Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 118 lines (96 sloc) 3.345 kb
34a3106 Added hoptoad_notifier
jyurek authored
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
bf486bb @jferris Addd a gemspec
jferris authored
4 require 'rake/gempackagetask'
7df97d7 @jferris Added a test for the installation process
jferris authored
5 require 'cucumber/rake/task'
34a3106 Added hoptoad_notifier
jyurek authored
6
7 desc 'Default: run unit tests.'
7df97d7 @jferris Added a test for the installation process
jferris authored
8 task :default => [:test, :cucumber]
34a3106 Added hoptoad_notifier
jyurek authored
9
e1e6a38 @mike-burns Change wording to refer to the gem instead of plugin, and start a lis…
mike-burns authored
10 desc 'Test the hoptoad_notifier gem.'
34a3106 Added hoptoad_notifier
jyurek authored
11 Rake::TestTask.new(:test) do |t|
12 t.libs << 'lib'
13 t.pattern = 'test/**/*_test.rb'
14 t.verbose = true
15 end
16
b1ece68 @qrush Vendoring ginger and adding rake ginger task
qrush authored
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
c4e26cb @qrush Starting YARD'ing up the plugin
qrush authored
24
25 begin
26 require 'yard'
27 YARD::Rake::YardocTask.new do |t|
df14a50 @qrush Removing INSTALL and making sure the testing and license file show up
qrush authored
28 t.files = ['lib/**/*.rb', 'TESTING.rdoc']
c4e26cb @qrush Starting YARD'ing up the plugin
qrush authored
29 end
30 rescue LoadError
31 end
bf486bb @jferris Addd a gemspec
jferris authored
32
7df97d7 @jferris Added a test for the installation process
jferris authored
33 GEM_ROOT = File.dirname(__FILE__).freeze
34 VERSION_FILE = File.join(GEM_ROOT, 'lib', 'hoptoad_notifier', 'version')
bf486bb @jferris Addd a gemspec
jferris authored
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',
2be23d7 @jferris Fixed capistrano recipes
jferris authored
44 'test/**/*.rb', 'rails/**/*.rb', 'tasks/**/*.rake']
bf486bb @jferris Addd a gemspec
jferris authored
45 s.require_path = 'lib'
46 s.test_files = Dir[*['test/**/*_test.rb']]
47
48 s.has_rdoc = true
49 s.extra_rdoc_files = ["README.rdoc"]
50 s.rdoc_options = ['--line-numbers', "--main", "README.rdoc"]
51
52 s.authors = ["thoughtbot, inc"]
53 s.email = %q{support@hoptoadapp.com}
54 s.homepage = "http://www.hoptoadapp.com"
55
56 s.platform = Gem::Platform::RUBY
57 end
58
59 Rake::GemPackageTask.new gemspec do |pkg|
60 pkg.need_tar = true
61 pkg.need_zip = true
62 end
63
64 desc "Clean files generated by rake tasks"
65 task :clobber => [:clobber_rdoc, :clobber_package]
66
67 desc "Generate a gemspec file"
68 task :gemspec do
69 File.open("#{gemspec.name}.gemspec", 'w') do |f|
70 f.write gemspec.to_ruby
71 end
72 end
73
7df97d7 @jferris Added a test for the installation process
jferris authored
74 LOCAL_GEM_ROOT = File.join(GEM_ROOT, 'tmp', 'local_gems').freeze
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris authored
75 RAILS_VERSIONS = IO.read('SUPPORTED_RAILS_VERSIONS').strip.split("\n")
76 LOCAL_GEMS = [['sham_rack', nil], ['capistrano', nil], ['sqlite3-ruby', nil]] +
77 RAILS_VERSIONS.collect { |version| ['rails', version] }
7df97d7 @jferris Added a test for the installation process
jferris authored
78
79 task :vendor_test_gems do
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris authored
80 LOCAL_GEMS.each do |gem_name, version|
81 gem_file_pattern = [gem_name, version || '*'].compact.join('-')
82 version_option = version ? "-v #{version}" : ''
83 pattern = File.join(LOCAL_GEM_ROOT, 'gems', "#{gem_file_pattern}")
7df97d7 @jferris Added a test for the installation process
jferris authored
84 existing = Dir.glob(pattern).first
85 unless existing
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris authored
86 command = "gem install -i #{LOCAL_GEM_ROOT} --no-ri --no-rdoc #{version_option} #{gem_name}"
87 puts "Vendoring #{gem_file_pattern}..."
7df97d7 @jferris Added a test for the installation process
jferris authored
88 unless system(command)
89 $stderr.puts "Command failed: #{command}"
90 end
91 end
92 end
93 end
94
95 Cucumber::Rake::Task.new(:cucumber) do |t|
96 t.fork = true
97 t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
98 end
99
100 task :cucumber => [:gemspec, :vendor_test_gems]
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris authored
101
102 OLD_RAILS_VERSIONS = RAILS_VERSIONS[0...-1]
103
104 namespace :cucumber do
105 namespace :rails do
106 OLD_RAILS_VERSIONS.each do |version|
107 desc "Test integration of the gem with Rails #{version}"
108 task version do
109 ENV['RAILS_VERSION'] = version
110 system("cucumber --format progress features/rails.feature")
111 end
112 end
113
114 desc "Test integration of the gem with all Rails versions"
115 task :all => [:cucumber, *OLD_RAILS_VERSIONS]
116 end
117 end
Something went wrong with that request. Please try again.