Skip to content

Commit

Permalink
WIP: Move gemspec out of Rake task, general reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Jun 8, 2011
1 parent dc65415 commit c2e8be4
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 58 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ tags
.yardoc
doc
pkg

Gemfile.lock
.bundle

*.rbc
11 changes: 2 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
51 changes: 6 additions & 45 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -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']] +
Expand Down Expand Up @@ -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}"
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion features/support/terminal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions hoptoad_notifier.gemspec
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit c2e8be4

Please sign in to comment.