Permalink
Browse files

Move gem specification to gemspec and remove gemspec rake task

  • Loading branch information...
1 parent 3e63d36 commit 27e858da3bc65cd50490a3933e2d85ce5ee67d87 @obrie obrie committed Aug 6, 2011
Showing with 23 additions and 58 deletions.
  1. +6 −32 Rakefile
  2. +3 −0 lib/table_helper/version.rb
  3. +14 −26 table_helper.gemspec
View
@@ -3,60 +3,34 @@ require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
-spec = Gem::Specification.new do |s|
- s.name = 'table_helper'
- s.version = '0.2.2'
- s.platform = Gem::Platform::RUBY
- s.summary = 'Adds a helper method for generating HTML tables from collections in Rails'
- s.description = s.summary
-
- s.files = FileList['{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.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 table_helper."
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 table_helper 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/)"'
t.verbose = true
end
end
rescue LoadError
end
-desc "Generate documentation for the #{spec.name} plugin."
+desc "Generate documentation for table_helper."
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = spec.name
- rdoc.template = '../rdoc_template.rb'
+ rdoc.title = 'table_helper'
rdoc.options << '--line-numbers' << '--inline-source' << '--main=README.rdoc'
rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG.rdoc', 'LICENSE', 'lib/**/*.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
@@ -0,0 +1,3 @@
+module TableHelper
+ VERSION = '0.2.2'
+end
View
@@ -1,29 +1,17 @@
-# -*- encoding: utf-8 -*-
+$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
+require 'table_helper/version'
Gem::Specification.new do |s|
- s.name = %q{table_helper}
- s.version = "0.2.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{Adds a helper method for generating HTML tables from collections in Rails}
- s.email = %q{aaron@pluginaweek.org}
- s.files = ["lib/table_helper", "lib/table_helper/row.rb", "lib/table_helper/cell.rb", "lib/table_helper/collection_table.rb", "lib/table_helper/footer.rb", "lib/table_helper/body_row.rb", "lib/table_helper/html_element.rb", "lib/table_helper/body.rb", "lib/table_helper/header.rb", "lib/table_helper.rb", "test/unit", "test/unit/row_test.rb", "test/unit/html_element_test.rb", "test/unit/row_builder_test.rb", "test/unit/header_test.rb", "test/unit/collection_table_test.rb", "test/unit/cell_test.rb", "test/unit/footer_test.rb", "test/unit/body_test.rb", "test/unit/body_row_test.rb", "test/app_root", "test/app_root/db", "test/app_root/db/migrate", "test/app_root/db/migrate/001_create_people.rb", "test/app_root/app", "test/app_root/app/models", "test/app_root/app/models/person.rb", "test/test_helper.rb", "test/helpers", "test/helpers/table_helper_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{Adds a helper method for generating HTML tables from collections in Rails}
- s.test_files = ["test/unit/row_test.rb", "test/unit/html_element_test.rb", "test/unit/row_builder_test.rb", "test/unit/header_test.rb", "test/unit/collection_table_test.rb", "test/unit/cell_test.rb", "test/unit/footer_test.rb", "test/unit/body_test.rb", "test/unit/body_row_test.rb", "test/helpers/table_helper_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
- else
- end
- else
- end
+ s.name = "table_helper"
+ s.version = TableHelper::VERSION
+ s.authors = ["Aaron Pfeifer"]
+ s.email = "aaron@pluginaweek.org"
+ s.homepage = "http://www.pluginaweek.org"
+ s.description = "Adds a helper method for generating HTML tables from collections in Rails"
+ s.summary = "HTML tables from collections in Rails"
+ 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 table_helper --main README.rdoc)
+ s.extra_rdoc_files = %w(README.rdoc CHANGELOG.rdoc LICENSE)
end

0 comments on commit 27e858d

Please sign in to comment.