Skip to content
This repository
Newer
Older
100644 118 lines (97 sloc) 3.389 kb
34a31064 » jyurek
2007-12-18 Added hoptoad_notifier
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
bf486bbb » jferris
2010-01-13 Addd a gemspec
4 require 'rake/gempackagetask'
7df97d79 » jferris
2010-01-13 Added a test for the installation process
5 require 'cucumber/rake/task'
34a31064 » jyurek
2007-12-18 Added hoptoad_notifier
6
7 desc 'Default: run unit tests.'
7df97d79 » jferris
2010-01-13 Added a test for the installation process
8 task :default => [:test, :cucumber]
34a31064 » jyurek
2007-12-18 Added hoptoad_notifier
9
e1e6a383 » mike-burns
2010-01-04 Change wording to refer to the gem instead of plugin, and start a lis…
10 desc 'Test the hoptoad_notifier gem.'
34a31064 » jyurek
2007-12-18 Added hoptoad_notifier
11 Rake::TestTask.new(:test) do |t|
12 t.libs << 'lib'
13 t.pattern = 'test/**/*_test.rb'
14 t.verbose = true
15 end
16
b1ece683 » qrush
2009-03-18 Vendoring ginger and adding rake ginger task
17 desc 'Run ginger tests'
18 task :ginger do
19 $LOAD_PATH << File.join(*%w[vendor ginger lib])
20 ARGV.clear
21 ARGV << 'test'
22 load File.join(*%w[vendor ginger bin ginger])
23 end
c4e26cbe » qrush
2009-08-20 Starting YARD'ing up the plugin
24
25 begin
26 require 'yard'
27 YARD::Rake::YardocTask.new do |t|
df14a504 » qrush
2009-08-21 Removing INSTALL and making sure the testing and license file show up
28 t.files = ['lib/**/*.rb', 'TESTING.rdoc']
c4e26cbe » qrush
2009-08-20 Starting YARD'ing up the plugin
29 end
30 rescue LoadError
31 end
bf486bbb » jferris
2010-01-13 Addd a gemspec
32
7df97d79 » jferris
2010-01-13 Added a test for the installation process
33 GEM_ROOT = File.dirname(__FILE__).freeze
34 VERSION_FILE = File.join(GEM_ROOT, 'lib', 'hoptoad_notifier', 'version')
bf486bbb » jferris
2010-01-13 Addd a gemspec
35
36 require VERSION_FILE
37
38 gemspec = Gem::Specification.new do |s|
39 s.name = %q{hoptoad_notifier}
40 s.version = HoptoadNotifier::VERSION
41 s.summary = %q{Send your application errors to our hosted service and reclaim your inbox.}
42
43 s.files = FileList['[A-Z]*', 'generators/**/*.*', 'lib/**/*.rb',
243db663 » jferris
2010-01-21 Include rescue.erb in the gem (bumped to 2.1.2)
44 'test/**/*.rb', 'rails/**/*.rb', 'script/*',
45 'lib/templates/*.erb']
bf486bbb » jferris
2010-01-13 Addd a gemspec
46 s.require_path = 'lib'
47 s.test_files = Dir[*['test/**/*_test.rb']]
48
49 s.has_rdoc = true
50 s.extra_rdoc_files = ["README.rdoc"]
51 s.rdoc_options = ['--line-numbers', "--main", "README.rdoc"]
52
53 s.authors = ["thoughtbot, inc"]
54 s.email = %q{support@hoptoadapp.com}
55 s.homepage = "http://www.hoptoadapp.com"
56
57 s.platform = Gem::Platform::RUBY
58 end
59
60 Rake::GemPackageTask.new gemspec do |pkg|
61 pkg.need_tar = true
62 pkg.need_zip = true
63 end
64
65 desc "Clean files generated by rake tasks"
66 task :clobber => [:clobber_rdoc, :clobber_package]
67
68 desc "Generate a gemspec file"
69 task :gemspec do
70 File.open("#{gemspec.name}.gemspec", 'w') do |f|
71 f.write gemspec.to_ruby
72 end
73 end
74
7df97d79 » jferris
2010-01-13 Added a test for the installation process
75 LOCAL_GEM_ROOT = File.join(GEM_ROOT, 'tmp', 'local_gems').freeze
1f878913 » jferris
2010-01-19 Added integration coverage and fixes for older versions of Rails
76 RAILS_VERSIONS = IO.read('SUPPORTED_RAILS_VERSIONS').strip.split("\n")
77 LOCAL_GEMS = [['sham_rack', nil], ['capistrano', nil], ['sqlite3-ruby', nil]] +
78 RAILS_VERSIONS.collect { |version| ['rails', version] }
7df97d79 » jferris
2010-01-13 Added a test for the installation process
79
80 task :vendor_test_gems do
1f878913 » jferris
2010-01-19 Added integration coverage and fixes for older versions of Rails
81 LOCAL_GEMS.each do |gem_name, version|
82 gem_file_pattern = [gem_name, version || '*'].compact.join('-')
83 version_option = version ? "-v #{version}" : ''
84 pattern = File.join(LOCAL_GEM_ROOT, 'gems', "#{gem_file_pattern}")
7df97d79 » jferris
2010-01-13 Added a test for the installation process
85 existing = Dir.glob(pattern).first
86 unless existing
1f878913 » jferris
2010-01-19 Added integration coverage and fixes for older versions of Rails
87 command = "gem install -i #{LOCAL_GEM_ROOT} --no-ri --no-rdoc #{version_option} #{gem_name}"
88 puts "Vendoring #{gem_file_pattern}..."
7df97d79 » jferris
2010-01-13 Added a test for the installation process
89 unless system(command)
90 $stderr.puts "Command failed: #{command}"
91 end
92 end
93 end
94 end
95
96 Cucumber::Rake::Task.new(:cucumber) do |t|
97 t.fork = true
98 t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
99 end
100
101 task :cucumber => [:gemspec, :vendor_test_gems]
1f878913 » jferris
2010-01-19 Added integration coverage and fixes for older versions of Rails
102
103 OLD_RAILS_VERSIONS = RAILS_VERSIONS[0...-1]
104
105 namespace :cucumber do
106 namespace :rails do
107 OLD_RAILS_VERSIONS.each do |version|
108 desc "Test integration of the gem with Rails #{version}"
109 task version do
110 ENV['RAILS_VERSION'] = version
111 system("cucumber --format progress features/rails.feature")
112 end
113 end
114
115 desc "Test integration of the gem with all Rails versions"
116 task :all => [:cucumber, *OLD_RAILS_VERSIONS]
117 end
118 end
Something went wrong with that request. Please try again.