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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +42 -18
  3. data/lib/rworkflow/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a21aaa1eb7353e45eb10cf8498ed9c8ae9cebfc
4
- data.tar.gz: 05a018eb4b27041ed86515cb7db4e2c945708368
3
+ metadata.gz: 22961811d932301219dc5196b2fb08a94f70b644
4
+ data.tar.gz: 32791b0a336f8aeb4d3b38ccca801e87e488b8db
5
5
  SHA512:
6
- metadata.gz: f304c504e1f537f0430f94739997c858b23d2308844796d00b2bc40fb74be22cdbd0f018d6b004e60e05538e4c3283ba969ac5572ef967257e91c3cd4d5f611d
7
- data.tar.gz: d89cddce1e44a96ef6252ff43a528780b7f4c023ee9e83d93bf08d679448704341a61614dec068dc73a1d028279f9c94c44641078bdb40449611426c5b96164b
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:assert_version', 'cim:update_readme', 'cim:update_changelog', 'cim:commit_changes', 'cim:tag']
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 ">>> Repository is clean!"
47
+ if status.strip.empty?
48
+ puts '>>> Repository is clean!'
49
49
  else
50
- puts ">>> Please push your committed changes before releasing!"
51
- exit -1
50
+ puts '>>> Please push your committed changes before releasing!'
51
+ exit(-1)
52
52
  end
53
53
  else
54
- puts ">>> Please stash or commit your changes before releasing!"
55
- exit -1
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 'Fails if the current gem version is not greater than the last tag'
66
- task :assert_version do
67
- latest = `git describe --abbrev=0`.chomp.strip
68
- current = Rworkflow::VERSION
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 -1
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
- file.readline # skip first two lines
94
- file.readline
95
- while buffer = file.read(2048)
96
- changelog.write(buffer)
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
- message = STDOUT.print ">>> Please enter a tag message: "
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
@@ -1,3 +1,3 @@
1
1
  module Rworkflow
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.6.2'.freeze
3
3
  end
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.1
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: '3'
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: '3'
26
+ version: '4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement