domotics-arduino 0.0.07 → 0.0.08
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +15 -14
- data/lib/domotics/arduino/version.rb +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -14,20 +14,21 @@ MAJOR = 0
|
|
14
14
|
|
15
15
|
desc "Commit patch and release gem"
|
16
16
|
task :patch do
|
17
|
+
update { |sv,i| i == PATCH ? sv.succ : sv }
|
18
|
+
end
|
19
|
+
|
20
|
+
def update
|
21
|
+
# Update version
|
22
|
+
File.open "lib/domotics/arduino/version.rb", "r+" do |f|
|
23
|
+
up = f.read.sub(/\d+.\d+.\d+/){ |ver| ver.split('.').map.with_index{ |sv, i| yield sv,i }.join('.') }
|
24
|
+
f.seek 0
|
25
|
+
f.write up
|
26
|
+
end
|
17
27
|
# add new files to repo
|
18
28
|
%x(git add --all .)
|
19
|
-
# commit
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
f.seek 0
|
25
|
-
#f.write up
|
26
|
-
end
|
27
|
-
# release
|
28
|
-
Rake::Task[:release].reenable
|
29
|
-
Rake::Task[:release].invoke
|
30
|
-
else
|
31
|
-
puts "No changes"
|
32
|
-
end
|
29
|
+
# commit
|
30
|
+
%x(git commit -a --reuse-message=HEAD) =~ /nothing to commit/
|
31
|
+
# release
|
32
|
+
Rake::Task[:release].reenable
|
33
|
+
Rake::Task[:release].invoke
|
33
34
|
end
|