domotics-arduino 0.0.09 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -3
- data/lib/domotics/arduino/version.rb +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -13,11 +13,16 @@ MINOR = 1
|
|
13
13
|
MAJOR = 0
|
14
14
|
|
15
15
|
desc "Commit patch and release gem"
|
16
|
-
task :patch do
|
16
|
+
task :patch, :commit_message do |t, args|
|
17
|
+
update(args[:commit_message]){ |sv,i| i == PATCH ? sv.succ : sv }
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Commit minor update and release gem"
|
21
|
+
task :minor do
|
17
22
|
update { |sv,i| i == PATCH ? sv.succ : sv }
|
18
23
|
end
|
19
24
|
|
20
|
-
def update
|
25
|
+
def update(msg)
|
21
26
|
# Update version
|
22
27
|
File.open "lib/domotics/arduino/version.rb", "r+" do |f|
|
23
28
|
up = f.read.sub(/\d+.\d+.\d+/){ |ver| ver.split('.').map.with_index{ |sv, i| yield sv,i }.join('.') }
|
@@ -27,7 +32,9 @@ def update
|
|
27
32
|
# add new files to repo
|
28
33
|
%x(git add --all .)
|
29
34
|
# commit
|
30
|
-
%x(git commit -a
|
35
|
+
if msg then %x(git commit -a -m "#{msg}")
|
36
|
+
else %x(git commit -a --reuse-message=HEAD)
|
37
|
+
end
|
31
38
|
# release
|
32
39
|
Rake::Task[:release].reenable
|
33
40
|
Rake::Task[:release].invoke
|