-
Notifications
You must be signed in to change notification settings - Fork 115
/
Rakefile
50 lines (46 loc) · 1.34 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require 'rake'
begin
require 'rspec/core'
require 'rspec/core/rake_task'
rescue MissingSourceFile
module RSpec
module Core
class RakeTask
def initialize(name)
task name do
# if rspec-rails is a configured gem, this will output helpful material and exit ...
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
# ... otherwise, do this:
raise <<-MSG
#{"*" * 80}
* You are trying to run an rspec rake task defined in
* #{__FILE__},
* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
#{"*" * 80}
MSG
end
end
end
end
end
end
task :default => :spec
task :stats => "spec:statsetup"
desc "Run RSpec code examples"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = "./spec/**/*_spec.rb"
end
namespace :gem do
desc "Release to rubygems"
task :release do
require File.expand_path('lib/truncate_html/version', File.dirname(__FILE__))
version = TruncateHtml::VERSION
message = "Bump to version #{version}"
system "git tag -a -m '#{message}' v#{version}"
system "git push origin master"
system "git push origin $(git tag | tail -1)"
system "gem build truncate_html.gemspec"
system "gem push truncate_html-#{version}.gem"
system "rm truncate_html-#{version}.gem"
end
end