Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 98 lines (79 sloc) 2.589 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 list o...
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',
7df97d7 @jferris Added a test for the installation process
jferris authored
44 'test/**/*.rb', 'rails/**/*.rb', 'recipes/**/*.rb',
bf486bb @jferris Addd a gemspec
jferris authored
45 'tasks/**/*.rake']
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
7df97d7 @jferris Added a test for the installation process
jferris authored
75 LOCAL_GEM_ROOT = File.join(GEM_ROOT, 'tmp', 'local_gems').freeze
76 LOCAL_GEMS = %w(rails sham_rack)
77
78 task :vendor_test_gems do
79 LOCAL_GEMS.each do |gem_name|
80 pattern = File.join(LOCAL_GEM_ROOT, 'gems', "#{gem_name}-*")
81 existing = Dir.glob(pattern).first
82 unless existing
83 command = "gem install -i #{LOCAL_GEM_ROOT} --no-ri --no-rdoc #{gem_name}"
84 puts "Vendoring #{gem_name}..."
85 unless system(command)
86 $stderr.puts "Command failed: #{command}"
87 end
88 end
89 end
90 end
91
92 Cucumber::Rake::Task.new(:cucumber) do |t|
93 t.fork = true
94 t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
95 end
96
97 task :cucumber => [:gemspec, :vendor_test_gems]
Something went wrong with that request. Please try again.