Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move gem specification to gemspec and remove gemspec rake task

  • Loading branch information...
commit b15f6843125441cd0a2b3923519d4e29b75a1fe2 1 parent 3fecb08
@obrie obrie authored
Showing with 25 additions and 62 deletions.
  1. +6 −33 Rakefile
  2. +16 −29 has_addresses.gemspec
  3. +3 −0  lib/has_addresses/version.rb
View
39 Rakefile
@@ -3,42 +3,23 @@ require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
-spec = Gem::Specification.new do |s|
- s.name = 'has_addresses'
- s.version = '0.5.2'
- s.platform = Gem::Platform::RUBY
- s.summary = 'Demonstrates a reference implementation for handling countries, regions, and addresses in ActiveRecord'
- s.description = s.summary
-
- s.files = FileList['{app,generators,lib,test}/**/*'] + %w(CHANGELOG.rdoc init.rb LICENSE Rakefile README.rdoc) - FileList['test/app_root/{log,log/*,script,script/*}']
- s.require_path = 'lib'
- s.has_rdoc = true
- s.test_files = Dir['test/**/*_test.rb']
- s.add_dependency 'enumerate_by', '>= 0.4.1'
-
- s.author = 'Aaron Pfeifer'
- s.email = 'aaron@pluginaweek.org'
- s.homepage = 'http://www.pluginaweek.org'
- s.rubyforge_project = 'pluginaweek'
-end
-
desc 'Default: run all tests.'
task :default => :test
-desc "Test the #{spec.name} plugin."
+desc "Test has_addresses."
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
- t.test_files = spec.test_files
+ t.test_files = Dir['test/**/*_test.rb']
t.verbose = true
end
begin
require 'rcov/rcovtask'
namespace :test do
- desc "Test the #{spec.name} plugin with Rcov."
+ desc "Test has_addresses with Rcov."
Rcov::RcovTask.new(:rcov) do |t|
t.libs << 'lib'
- t.test_files = spec.test_files
+ t.test_files = Dir['test/**/*_test.rb']
t.rcov_opts << '--exclude="^(?!lib/|app/)"'
t.verbose = true
end
@@ -46,18 +27,10 @@ begin
rescue LoadError
end
-desc "Generate documentation for the #{spec.name} plugin."
+desc "Generate documentation for has_addresses."
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = spec.name
- rdoc.template = '../rdoc_template.rb'
+ rdoc.title = 'has_addresses'
rdoc.options << '--line-numbers' << '--inline-source' << '--main=README.rdoc'
rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG.rdoc', 'LICENSE', 'lib/**/*.rb', 'app/**/*.rb')
end
-
-desc 'Generate a gemspec file.'
-task :gemspec do
- File.open("#{spec.name}.gemspec", 'w') do |f|
- f.write spec.to_ruby
- end
-end
View
45 has_addresses.gemspec
@@ -1,32 +1,19 @@
-# -*- encoding: utf-8 -*-
+$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
+require 'has_addresses/version'
Gem::Specification.new do |s|
- s.name = %q{has_addresses}
- s.version = "0.5.2"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Aaron Pfeifer"]
- s.date = %q{2010-03-07}
- s.description = %q{Demonstrates a reference implementation for handling countries, regions, and addresses in ActiveRecord}
- s.email = %q{aaron@pluginaweek.org}
- s.files = ["app/models", "app/models/address.rb", "app/models/country.rb", "app/models/region.rb", "generators/has_addresses", "generators/has_addresses/has_addresses_generator.rb", "generators/has_addresses/USAGE", "generators/has_addresses/templates", "generators/has_addresses/templates/001_create_countries.rb", "generators/has_addresses/templates/003_create_addresses.rb", "generators/has_addresses/templates/002_create_regions.rb", "lib/has_addresses.rb", "test/unit", "test/unit/region_test.rb", "test/unit/country_test.rb", "test/unit/address_test.rb", "test/app_root", "test/app_root/db", "test/app_root/db/migrate", "test/app_root/db/migrate/001_create_companies.rb", "test/app_root/db/migrate/002_migrate_has_addresses_to_version_3.rb", "test/app_root/app", "test/app_root/app/models", "test/app_root/app/models/company.rb", "test/app_root/config", "test/app_root/config/environment.rb", "test/test_helper.rb", "test/factory.rb", "test/functional", "test/functional/has_addresses_test.rb", "CHANGELOG.rdoc", "init.rb", "LICENSE", "Rakefile", "README.rdoc"]
- s.homepage = %q{http://www.pluginaweek.org}
- s.require_paths = ["lib"]
- s.rubyforge_project = %q{pluginaweek}
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Demonstrates a reference implementation for handling countries, regions, and addresses in ActiveRecord}
- s.test_files = ["test/unit/region_test.rb", "test/unit/country_test.rb", "test/unit/address_test.rb", "test/functional/has_addresses_test.rb"]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<enumerate_by>, [">= 0.4.1"])
- else
- s.add_dependency(%q<enumerate_by>, [">= 0.4.1"])
- end
- else
- s.add_dependency(%q<enumerate_by>, [">= 0.4.1"])
- end
+ s.name = "has_addresses"
+ s.version = HasAddresses::VERSION
+ s.authors = ["Aaron Pfeifer"]
+ s.email = "aaron@pluginaweek.org"
+ s.homepage = "http://www.pluginaweek.org"
+ s.description = "Demonstrates a reference implementation for handling countries, regions, and addresses in ActiveRecord"
+ s.summary = "Countries, regions, and addresses in ActiveRecord"
+ s.require_paths = ["lib"]
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- test/*`.split("\n")
+ s.rdoc_options = %w(--line-numbers --inline-source --title has_addresses --main README.rdoc)
+ s.extra_rdoc_files = %w(README.rdoc CHANGELOG.rdoc LICENSE)
+
+ s.add_dependency("enumerate_by", ">= 0.4.1")
end
View
3  lib/has_addresses/version.rb
@@ -0,0 +1,3 @@
+module HasAddresses
+ VERSION = '0.5.2'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.