trop 0.6.19 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -25
- data/Rakefile +3 -4
- data/VERSION +1 -2
- data/lib/trop/gem_version.rb +104 -0
- data/lib/trop/version.rb +1 -1
- data/rakelib/gem_version.rake +14 -15
- metadata +67 -11
- data/lib/trop/gem_tasks.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9268ce6ded40e0a1527ed34e01569bac1b0874ccaf7a6ce4f4670751191dc2c
|
4
|
+
data.tar.gz: 37f623a7ea3c96309055b9c225a278366774faba0c7900b99a249db7fe31cc8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 232abbcda82bd01233bf116702c966e885ad5a85541268bd51a99d4458a664f19bb5d480616330f68b07af193112a200b14275bcd12db43c2a8defcfc7e2d372
|
7
|
+
data.tar.gz: 937480adab0e4f6db433a1152f179545697222b05ddf70c62d3728540ec1beb6b1e4cf3cee259ec71fd827fe21b4094dc351aa75f5af197702210d47a0321afe
|
data/Gemfile
CHANGED
@@ -1,34 +1,12 @@
|
|
1
1
|
#source 'https://rubygems.org'
|
2
2
|
source 'http://localhost:9292/'
|
3
3
|
|
4
|
+
gemspec
|
4
5
|
# Add dependencies required to use your gem here.
|
5
6
|
# Example:
|
6
|
-
|
7
|
-
gem "poise-service", "~> 1.5", require: false
|
7
|
+
|
8
8
|
# Add dependencies to develop your gem here.
|
9
9
|
# Include everything needed to run rake, tests, features, etc.
|
10
10
|
group :development do
|
11
|
-
gem 'minitest', '~> 5.11'
|
12
|
-
gem 'shoulda', '~> 3.6'
|
13
|
-
gem 'simplecov', '~> 0.16.1'
|
14
|
-
gem 'test-unit', '~> 3.3'
|
15
|
-
gem 'rake', '~> 12.3'
|
16
|
-
gem "factory_bot", "~> 5.0"
|
17
|
-
gem "minitest-reporters", "~> 1.3"
|
18
|
-
gem "bump", "~> 0.8.0"
|
19
|
-
gem "gem_version", "~> 0.0.6"
|
20
|
-
gem "bundler-geminabox", "1.0"
|
21
|
-
gem "git-version-bump", "~> 0.16.0"
|
22
|
-
gem "gem-release", "~> 2.0"
|
23
|
-
end
|
24
|
-
|
25
11
|
|
26
|
-
|
27
|
-
gem 'bundler', '~> 2.0.1'
|
28
|
-
gem 'sentry-raven'
|
29
|
-
gem 'colorize'
|
30
|
-
gem "faraday", "0.15.4"
|
31
|
-
|
32
|
-
|
33
|
-
gem "gem-release", "~> 2.0"
|
34
|
-
gem "nokogiri", "~> 1.10"
|
12
|
+
end
|
data/Rakefile
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
|
+
require 'bump'
|
3
4
|
require 'fileutils'
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
require 'git-version-bump/rake-tasks'
|
6
|
+
require "bundler/gem_tasks"
|
8
7
|
begin
|
9
8
|
Bundler.setup(:default, :development)
|
10
9
|
rescue Bundler::BundlerError => e
|
data/VERSION
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
0.16.0
|
1
|
+
0.7.0
|
@@ -0,0 +1,104 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'git'
|
3
|
+
require 'logger'
|
4
|
+
|
5
|
+
#load File.dirname(__FILE__) + '/../../rakelib/gem_version.rake'
|
6
|
+
|
7
|
+
module Trop::GemVersion
|
8
|
+
@@gem_version_file = 'next_gem_version'
|
9
|
+
@@default_commit_message = 'incremented gem version'
|
10
|
+
|
11
|
+
def self.gem_version_file=(str)
|
12
|
+
@@gem_version_file = str
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.next_version
|
16
|
+
init_version_file unless File.exist?(@@gem_version_file)
|
17
|
+
file = File.new(@@gem_version_file, 'r')
|
18
|
+
version = file.gets.chomp
|
19
|
+
raise "#{@@gem_version_file} file corrupt" unless self.version_format_valid?(version)
|
20
|
+
file.close
|
21
|
+
version
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.set_version(version)
|
25
|
+
raise "Invalid version format" unless self.version_format_valid?(version)
|
26
|
+
self.update_version(version)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.version_format_valid?(version)
|
30
|
+
(version && version =~ /^\d+\.\d+[\.\d+]+$/)
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.init_version_file
|
34
|
+
file = File.new(@@gem_version_file, 'w')
|
35
|
+
file.puts '0.0.1'
|
36
|
+
file.close
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.increment_and_push
|
40
|
+
self.update_version(self.increment_version)
|
41
|
+
self.rewrite_gemspec
|
42
|
+
self.commit_and_push
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.increment_version
|
46
|
+
version = self.next_version
|
47
|
+
components = version.split('.')
|
48
|
+
components.push((components.pop.to_i + 1).to_s)
|
49
|
+
new_version = components.join('.')
|
50
|
+
new_version
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.rewrite_gemspec
|
54
|
+
spec_path = FileUtils.getwd + '/' + Trop::GEMSPEC_NAME
|
55
|
+
spec_gem = Gem::Specification::load(spec_path)
|
56
|
+
spec_gem.version = Trop::GemVersion.next_version
|
57
|
+
File.open(spec_path, 'w') {|f| f.write spec_gem.to_ruby}
|
58
|
+
return spec_gem.version
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.check_lib_version_rb?
|
62
|
+
return false if (Trop::GemVersion::check_lib_version_rb.nil?)
|
63
|
+
true
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.check_lib_version_rb
|
67
|
+
content = Pathname.new(Trop::VERSION_FILE).read
|
68
|
+
version_ok = content.scan(/VERSION.*["']+\d+\.\d+[\.\d+]+["']+/)
|
69
|
+
version_ok
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.update_lib_version_rb
|
73
|
+
if self.check_lib_version_rb?
|
74
|
+
# update
|
75
|
+
|
76
|
+
return
|
77
|
+
end
|
78
|
+
|
79
|
+
puts "version out of sync"
|
80
|
+
assert false
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
def self.update_version(new_version)
|
85
|
+
# 1. next_version
|
86
|
+
file = File.new(@@gem_version_file, 'w')
|
87
|
+
file.print new_version
|
88
|
+
file.close
|
89
|
+
# 2. VERSION
|
90
|
+
file = File.new('VERSION', 'w')
|
91
|
+
file.print new_version
|
92
|
+
file.close
|
93
|
+
# 3.
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.commit_and_push(project_directory = nil, msg = nil, &block)
|
97
|
+
g = Git.open(project_directory || Dir.pwd, :log => Logger.new(STDOUT))
|
98
|
+
g.add(@@gem_version_file)
|
99
|
+
yield(g) if block_given?
|
100
|
+
g.commit(msg || @@default_commit_message)
|
101
|
+
g.push
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
data/lib/trop/version.rb
CHANGED
data/rakelib/gem_version.rake
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
1
|
require_relative '../lib/trop'
|
2
|
+
require_relative '../lib/trop/gem_version'
|
3
3
|
|
4
4
|
namespace :gem do
|
5
5
|
|
@@ -13,7 +13,6 @@ namespace :gem do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
task :next do
|
16
|
-
|
17
16
|
# self.dirty_tree?
|
18
17
|
# Are we in a dirty, dirty tree?
|
19
18
|
Trop::Sh::silent!
|
@@ -29,14 +28,14 @@ namespace :gem do
|
|
29
28
|
else
|
30
29
|
vers1 = vers2 = nil
|
31
30
|
Trop::Sh::silence_streams(STDOUT) {
|
32
|
-
vers1 = GemVersion.increment_version
|
33
|
-
vers2 =
|
34
|
-
GemVersion.commit_and_push {|g| g.add(Trop::VERSION_FILE) && g.add(Trop::GEMSPEC_NAME)}
|
31
|
+
vers1 = Trop::GemVersion.increment_version
|
32
|
+
vers2 = Trop::GemVersion.rewrite_gemspec
|
33
|
+
Trop::GemVersion.commit_and_push {|g| g.add(Trop::VERSION_FILE) && g.add(Trop::GEMSPEC_NAME)}
|
35
34
|
}
|
36
35
|
|
37
36
|
puts "incr. version build and push #{vers1} #{vers2}"
|
38
|
-
Trop::Sh::systemlocal('
|
39
|
-
Trop::Sh::systemlocal('rake
|
37
|
+
Trop::Sh::systemlocal('gem build trop.gemspec')
|
38
|
+
Trop::Sh::systemlocal('rake gembox')
|
40
39
|
end
|
41
40
|
end
|
42
41
|
|
@@ -46,27 +45,27 @@ namespace :gem do
|
|
46
45
|
FileUtils.cp(%w[LICENSE.txt README.md README.rakes.md TODO.md], 'public', verbose: true)
|
47
46
|
end
|
48
47
|
|
49
|
-
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
namespace :gem do
|
54
48
|
desc "Clean *.gem* files from project root"
|
55
49
|
task :clean do
|
56
50
|
FileUtils.rm_f Dir.glob('*.gem*')
|
57
51
|
end
|
58
52
|
|
53
|
+
desc "sync version files"
|
54
|
+
task :sync do
|
55
|
+
Trop::GemVersion::update_version(Trop::VERSION)
|
56
|
+
end
|
57
|
+
|
59
58
|
desc "Return and set next gem version"
|
60
59
|
task :version do
|
61
60
|
if (ENV.include?("set"))
|
62
61
|
version = ENV['set'].gsub(/'/, '')
|
63
|
-
unless GemVersion.version_format_valid?(version)
|
62
|
+
unless Trop::GemVersion.version_format_valid?(version)
|
64
63
|
raise "Version '#{version}' format invalid. Must only contain digits separated by decimal points."
|
65
64
|
end
|
66
|
-
GemVersion.set_version(version)
|
65
|
+
Trop::GemVersion.set_version(version)
|
67
66
|
puts "Next version set at '#{version}'"
|
68
67
|
else
|
69
|
-
puts GemVersion.next_version
|
68
|
+
puts Trop::GemVersion.next_version
|
70
69
|
end
|
71
70
|
end
|
72
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- werner
|
@@ -10,6 +10,62 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bump
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: git-version-bump
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.16.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.16.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.15.4
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.15.4
|
13
69
|
- !ruby/object:Gem::Dependency
|
14
70
|
name: dotenv
|
15
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,47 +151,47 @@ dependencies:
|
|
95
151
|
- !ruby/object:Gem::Version
|
96
152
|
version: '5.0'
|
97
153
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
154
|
+
name: git
|
99
155
|
requirement: !ruby/object:Gem::Requirement
|
100
156
|
requirements:
|
101
157
|
- - "~>"
|
102
158
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
159
|
+
version: '1.5'
|
104
160
|
type: :runtime
|
105
161
|
prerelease: false
|
106
162
|
version_requirements: !ruby/object:Gem::Requirement
|
107
163
|
requirements:
|
108
164
|
- - "~>"
|
109
165
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
166
|
+
version: '1.5'
|
111
167
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: minitest
|
168
|
+
name: minitest-reporters
|
113
169
|
requirement: !ruby/object:Gem::Requirement
|
114
170
|
requirements:
|
115
171
|
- - "~>"
|
116
172
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
173
|
+
version: '1.3'
|
118
174
|
type: :development
|
119
175
|
prerelease: false
|
120
176
|
version_requirements: !ruby/object:Gem::Requirement
|
121
177
|
requirements:
|
122
178
|
- - "~>"
|
123
179
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
180
|
+
version: '1.3'
|
125
181
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
182
|
+
name: minitest
|
127
183
|
requirement: !ruby/object:Gem::Requirement
|
128
184
|
requirements:
|
129
185
|
- - "~>"
|
130
186
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
187
|
+
version: '5.11'
|
132
188
|
type: :development
|
133
189
|
prerelease: false
|
134
190
|
version_requirements: !ruby/object:Gem::Requirement
|
135
191
|
requirements:
|
136
192
|
- - "~>"
|
137
193
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
194
|
+
version: '5.11'
|
139
195
|
- !ruby/object:Gem::Dependency
|
140
196
|
name: simplecov
|
141
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -216,7 +272,7 @@ files:
|
|
216
272
|
- lib/trop/core-ext.rb
|
217
273
|
- lib/trop/file_finder.rb
|
218
274
|
- lib/trop/filefind.rb
|
219
|
-
- lib/trop/
|
275
|
+
- lib/trop/gem_version.rb
|
220
276
|
- lib/trop/infogit.rb
|
221
277
|
- lib/trop/os.rb
|
222
278
|
- lib/trop/shell_deb_verb.rb
|
data/lib/trop/gem_tasks.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
require 'bundler/gem_tasks'
|
3
|
-
#require 'bundler-geminabox/gem_tasks'
|
4
|
-
require 'bundler/endpoint_specification'
|
5
|
-
require 'bump'
|
6
|
-
require 'gem_version'
|
7
|
-
require 'git-version-bump/rake-tasks'
|
8
|
-
#require 'gem/release'
|
9
|
-
|
10
|
-
module GemHelper
|
11
|
-
|
12
|
-
def self.rewrite_gemspec
|
13
|
-
spec_path = FileUtils.getwd + '/' + Trop::GEMSPEC_NAME
|
14
|
-
spec_gem = Gem::Specification::load(spec_path)
|
15
|
-
spec_gem.version = GemVersion.next_version
|
16
|
-
File.open(spec_path, 'w') {|f| f.write spec_gem.to_ruby }
|
17
|
-
unless Trop::Sh::silent?
|
18
|
-
File.open("gemspecx.gemspecx", 'w') {|f| f.write spec_gem.to_ruby }
|
19
|
-
end
|
20
|
-
|
21
|
-
return spec_gem.version
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.check_lib_version_rb
|
25
|
-
content = Pathname.new(Trop::VERSION_FILE).read
|
26
|
-
version_ok = content.scan(/VERSION.*["']+\d+\.\d+[\.\d+]+["']+/)
|
27
|
-
version_ok
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.check_lib_version_rb?
|
31
|
-
return false if ( GemHelper::check_lib_version_rb.nil? )
|
32
|
-
true
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.update_version
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|