rworkflow 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +42 -18
- data/lib/rworkflow/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22961811d932301219dc5196b2fb08a94f70b644
|
4
|
+
data.tar.gz: 32791b0a336f8aeb4d3b38ccca801e87e488b8db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e55d2d88e77d25f6fe7f617c836aeeea618ca4c3b40eeee5d879c61590a961a5cc3b99caa1ddc1a6c170179d0584000797913bb6d71e7e0846994893f4bb4ad9
|
7
|
+
data.tar.gz: e8ca260c885feb78bda7d0465c7377fee6371ee69114dab442931ab156418122299346aa4b3c32eb92c4bd185b947bdb68d843a81641e377153dccd0d143efe5
|
data/Rakefile
CHANGED
@@ -30,7 +30,7 @@ task default: :test
|
|
30
30
|
namespace :cim do
|
31
31
|
desc 'Tags, updates README, and CHANGELOG and pushes to Github. Requires ruby-git'
|
32
32
|
task :release do
|
33
|
-
tasks = ['cim:assert_clean_repo', 'cim:git_fetch', 'cim:
|
33
|
+
tasks = ['cim:assert_clean_repo', 'cim:git_fetch', 'cim:set_new_version', 'cim:update_readme', 'cim:update_changelog', 'cim:commit_changes', 'cim:tag']
|
34
34
|
begin
|
35
35
|
tasks.each { |task| Rake::Task[task].invoke }
|
36
36
|
`git push && git push origin '#{Rworkflow::VERSION}'`
|
@@ -42,17 +42,17 @@ namespace :cim do
|
|
42
42
|
desc 'Fails if the current repository is not clean'
|
43
43
|
task :assert_clean_repo do
|
44
44
|
status = `git status -s`.chomp.strip
|
45
|
-
if status.empty?
|
45
|
+
if status.strip.empty?
|
46
46
|
status = `git log origin/master..HEAD`.chomp.strip # check if we have unpushed commits
|
47
|
-
if status.empty?
|
48
|
-
puts
|
47
|
+
if status.strip.empty?
|
48
|
+
puts '>>> Repository is clean!'
|
49
49
|
else
|
50
|
-
puts
|
51
|
-
exit
|
50
|
+
puts '>>> Please push your committed changes before releasing!'
|
51
|
+
exit(-1)
|
52
52
|
end
|
53
53
|
else
|
54
|
-
puts
|
55
|
-
exit
|
54
|
+
puts '>>> Please stash or commit your changes before releasing!'
|
55
|
+
exit(-1)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -62,14 +62,35 @@ namespace :cim do
|
|
62
62
|
`git fetch --tags`
|
63
63
|
end
|
64
64
|
|
65
|
-
desc '
|
66
|
-
task :
|
67
|
-
|
68
|
-
|
65
|
+
desc 'Requests the new version number'
|
66
|
+
task :set_new_version do
|
67
|
+
STDOUT.print(">>> New version number (current: #{Rworkflow::VERSION}; leave blank if already updated): ")
|
68
|
+
input = STDIN.gets.strip.tr("'", "\'")
|
69
|
+
|
70
|
+
current = if input.empty?
|
71
|
+
Rworkflow::VERSION
|
72
|
+
else
|
73
|
+
unless input =~ /[0-9]+\.[0-9]+\.[0-9]+/
|
74
|
+
puts '>>> Please use semantic versioning!'
|
75
|
+
exit(-1)
|
76
|
+
end
|
69
77
|
|
78
|
+
input
|
79
|
+
end
|
80
|
+
|
81
|
+
latest = `git describe --abbrev=0`.chomp.strip
|
70
82
|
unless Gem::Version.new(current) > Gem::Version.new(latest)
|
71
83
|
puts ">>> Latest tagged version is #{latest}; make sure gem version (#{current}) is greater!"
|
72
|
-
exit
|
84
|
+
exit(-1)
|
85
|
+
end
|
86
|
+
|
87
|
+
if !input.empty?
|
88
|
+
`sed -i -u "s@VERSION = '#{Rworkflow::VERSION}'@VERSION = '#{input}'@" #{File.expand_path('../lib/rworkflow/version.rb', __FILE__)}`
|
89
|
+
$VERBOSE = nil
|
90
|
+
Rworkflow.const_set('VERSION', input)
|
91
|
+
$VERBOSE = false
|
92
|
+
|
93
|
+
`bundle check` # force updating version
|
73
94
|
end
|
74
95
|
end
|
75
96
|
|
@@ -90,10 +111,13 @@ namespace :cim do
|
|
90
111
|
changelog = File.open('.CHANGELOG.md', 'w')
|
91
112
|
changelog.write("# Changelog\n\n###{Rworkflow::VERSION}\n\n#{log}\n\n")
|
92
113
|
File.open('CHANGELOG.md', 'r') do |file|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
114
|
+
begin
|
115
|
+
file.readline # skip first two lines
|
116
|
+
file.readline
|
117
|
+
while buffer = file.read(2048)
|
118
|
+
changelog.write(buffer)
|
119
|
+
end
|
120
|
+
rescue => error
|
97
121
|
end
|
98
122
|
end
|
99
123
|
|
@@ -110,7 +134,7 @@ namespace :cim do
|
|
110
134
|
desc 'Creates and pushes the tag to git'
|
111
135
|
task :tag do
|
112
136
|
puts '>>> Tagging'
|
113
|
-
|
137
|
+
STDOUT.print('>>> Please enter a tag message: ')
|
114
138
|
input = STDIN.gets.strip.tr("'", "\'")
|
115
139
|
`git tag -a '#{Rworkflow::VERSION}' -m '#{input}'`
|
116
140
|
end
|
data/lib/rworkflow/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rworkflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- barcoo
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|