forked from seosgithub/BooJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
executable file
·36 lines (29 loc) · 821 Bytes
/
Copy pathRakefile
File metadata and controls
executable file
·36 lines (29 loc) · 821 Bytes
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
require 'rspec/core/rake_task'
require "bundler/gem_tasks"
# Default directory to look in is `/specs`
# Run with `rake spec`
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
#Upgrade version of gem
def upgrade_version
versionf = './lib/boojs/version.rb'
require versionf
#Upgrade version '0.0.1' => '0.0.2'
version = BooJS::VERSION
new_version = version.split(".")
new_version[2] = new_version[2].to_i + 1
new_version = new_version.join(".")
sreg = "s/#{version}/#{new_version}/"
puts `sed #{sreg} #{versionf} > tmp; cp tmp #{versionf}`
return new_version
end
task :push do
version = upgrade_version
`git add .`
`git commit -a -m 'gem #{version}'`
`git push`
`git tag #{version}`
`git push origin #{version}`
`gem build boojs.gemspec`
`gem push boojs-#{version}.gem`
end