Skip to content
Browse files

WIP: Move gemspec out of Rake task, general reorganization

  • Loading branch information...
1 parent dc65415 commit c2e8be491bb54ddb27411fb380e75cb087f3d960 @joshuaclayton joshuaclayton committed Jun 8, 2011
Showing with 46 additions and 58 deletions.
  1. +2 −0 .gitignore
  2. +2 −9 Gemfile
  3. +6 −45 Rakefile
  4. +0 −1 features/support/terminal.rb
  5. +33 −0 hoptoad_notifier.gemspec
  6. +3 −3 test/helper.rb
View
2 .gitignore
@@ -11,6 +11,8 @@ tags
.yardoc
doc
pkg
+
Gemfile.lock
+.bundle
*.rbc
View
11 Gemfile
@@ -1,10 +1,3 @@
source "http://rubygems.org"
-gem "fakeweb", "~> 1.3.0"
-gem "cucumber", "~> 0.10.6"
-gem "activesupport", "~> 2.3.8"
-gem "activerecord", "~> 2.3.8"
-gem "actionpack", "~> 2.3.8"
-gem "nokogiri", "~> 1.4.3.1"
-gem "shoulda", "~> 2.11.3"
-gem 'bourne', '>= 1.0'
-gem "sham_rack", "~> 1.3.0"
+
+gemspec
View
51 Rakefile
@@ -19,6 +19,9 @@ Rake::TestTask.new(:test) do |t|
t.verbose = true
end
+task :gemspec do
+end
+
namespace :changeling do
desc "Bumps the version by a minor or patch version, depending on what was passed in."
task :bump, :part do |t, args|
@@ -104,53 +107,11 @@ begin
rescue LoadError
end
-GEM_ROOT = File.dirname(__FILE__).freeze
-VERSION_FILE = File.join(GEM_ROOT, 'lib', 'hoptoad_notifier', 'version')
-
-require VERSION_FILE
-
-gemspec = Gem::Specification.new do |s|
- s.name = %q{hoptoad_notifier}
- s.version = HoptoadNotifier::VERSION
- s.summary = %q{Send your application errors to our hosted service and reclaim your inbox.}
-
- s.files = FileList['[A-Z]*', 'generators/**/*.*', 'lib/**/*.rb',
- 'test/**/*.rb', 'rails/**/*.rb', 'script/*',
- 'lib/templates/*.erb']
- s.require_path = 'lib'
- s.test_files = Dir[*['test/**/*_test.rb']]
-
- s.add_runtime_dependency("builder")
- s.add_runtime_dependency("activesupport")
- s.add_development_dependency("activerecord")
- s.add_development_dependency("actionpack")
- s.add_development_dependency("bourne")
- s.add_development_dependency("nokogiri", '= 1.4.3.1')
- s.add_development_dependency("shoulda")
- s.add_development_dependency("rspec", '~> 2.6.0')
-
- s.authors = ["thoughtbot, inc"]
- s.email = %q{support@hoptoadapp.com}
- s.homepage = "http://www.hoptoadapp.com"
-
- s.platform = Gem::Platform::RUBY
-end
-
-Rake::GemPackageTask.new gemspec do |pkg|
- pkg.need_tar = true
- pkg.need_zip = true
-end
+GEM_ROOT = File.dirname(__FILE__).freeze
desc "Clean files generated by rake tasks"
task :clobber => [:clobber_rdoc, :clobber_package]
-desc "Generate a gemspec file"
-task :gemspec do
- File.open("#{gemspec.name}.gemspec", 'w') do |f|
- f.write gemspec.to_ruby
- end
-end
-
LOCAL_GEM_ROOT = File.join(GEM_ROOT, 'tmp', 'local_gems').freeze
RAILS_VERSIONS = IO.read('SUPPORTED_RAILS_VERSIONS').strip.split("\n")
LOCAL_GEMS = [['sham_rack', nil], ['capistrano', nil], ['sqlite3-ruby', nil], ['sinatra', nil], ['rake', '0.8.7']] +
@@ -185,7 +146,7 @@ Cucumber::Rake::Task.new(:cucumber) do |t|
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
end
-task :cucumber => [:gemspec, :vendor_test_gems]
+task :cucumber => [:vendor_test_gems]
def run_rails_cucumbr_task(version, additional_cucumber_args)
puts "Testing Rails #{version}"
@@ -200,7 +161,7 @@ def define_rails_cucumber_tasks(additional_cucumber_args = '')
namespace :rails do
RAILS_VERSIONS.each do |version|
desc "Test integration of the gem with Rails #{version}"
- task version => [:gemspec, :vendor_test_gems] do
+ task version => [:vendor_test_gems] do
exit 1 unless run_rails_cucumbr_task(version, additional_cucumber_args)
end
end
View
1 features/support/terminal.rb
@@ -63,7 +63,6 @@ def echo(string)
def build_and_install_gem(gemspec)
pkg_dir = File.join(TEMP_DIR, 'pkg')
FileUtils.mkdir_p(pkg_dir)
- `rake gemspec`
output = `gem build #{gemspec} 2>&1`
gem_file = Dir.glob("*.gem").first
unless gem_file
View
33 hoptoad_notifier.gemspec
@@ -0,0 +1,33 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "hoptoad_notifier/version"
+
+Gem::Specification.new do |s|
+ s.name = %q{hoptoad_notifier}
+ s.version = HoptoadNotifier::VERSION
+ s.summary = %q{Send your application errors to our hosted service and reclaim your inbox.}
+
+ s.require_paths = ["lib"]
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+
+ s.add_runtime_dependency("builder")
+ s.add_runtime_dependency("activesupport")
+
+ s.add_development_dependency("actionpack", "~> 2.3.8")
+ s.add_development_dependency("activerecord", "~> 2.3.8")
+ s.add_development_dependency("activesupport", "~> 2.3.8")
+ s.add_development_dependency("bourne", ">= 1.0")
+ s.add_development_dependency("cucumber", "~> 0.10.6")
+ s.add_development_dependency("fakeweb", "~> 1.3.0")
+ s.add_development_dependency("nokogiri", "~> 1.4.3.1")
+ s.add_development_dependency("rspec", "~> 2.6.0")
+ s.add_development_dependency("sham_rack", "~> 1.3.0")
+ s.add_development_dependency("shoulda", "~> 2.11.3")
+
+ s.authors = ["thoughtbot, inc"]
+ s.email = %q{support@hoptoadapp.com}
+ s.homepage = "http://www.hoptoadapp.com"
+
+ s.platform = Gem::Platform::RUBY
+end
View
6 test/helper.rb
@@ -4,15 +4,15 @@
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
require 'thread'
-require 'shoulda'
-require 'mocha'
+require "bundler/setup"
+require 'shoulda'
+require 'mocha'
require 'action_controller'
require 'action_controller/test_process'
require 'active_record'
-require 'active_record/base'
require 'active_support'
require 'nokogiri'
require 'rack'

0 comments on commit c2e8be4

Please sign in to comment.
Something went wrong with that request. Please try again.