trop 0.7.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9268ce6ded40e0a1527ed34e01569bac1b0874ccaf7a6ce4f4670751191dc2c
4
- data.tar.gz: 37f623a7ea3c96309055b9c225a278366774faba0c7900b99a249db7fe31cc8a
3
+ metadata.gz: d8a4aff04bf2e45be6a1b47fc939f02d3725149f9f73d6b3779ab3f4f4a6b8bd
4
+ data.tar.gz: 33105a3554b27407a465c37fb03ff1f29685206af0def7f01a9f20c0c1beff21
5
5
  SHA512:
6
- metadata.gz: 232abbcda82bd01233bf116702c966e885ad5a85541268bd51a99d4458a664f19bb5d480616330f68b07af193112a200b14275bcd12db43c2a8defcfc7e2d372
7
- data.tar.gz: 937480adab0e4f6db433a1152f179545697222b05ddf70c62d3728540ec1beb6b1e4cf3cee259ec71fd827fe21b4094dc351aa75f5af197702210d47a0321afe
6
+ metadata.gz: 64f1fa46f99ca2361a2afad361c099c86e4bbc16dd33c3cc7f179235dabe35e74ebd39dea9b79b3e5d9d02b519e43b17641299d7e646f7af57c106a6659f4471
7
+ data.tar.gz: d66bf235a374b54656671cd13fe89105a3cdd34eb987b89a4d192aae7d1be37722fa1d3250156fcb91552e5917335bc7324198ba49181efaf0a933df41fa14d0
data/Gemfile CHANGED
@@ -10,3 +10,5 @@ gemspec
10
10
  group :development do
11
11
 
12
12
  end
13
+
14
+ gem "yard", "~> 0.9.19"
data/Rakefile CHANGED
@@ -2,8 +2,13 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'bump'
4
4
  require 'fileutils'
5
- require 'git-version-bump/rake-tasks'
6
- require "bundler/gem_tasks"
5
+
6
+ require 'rubygems'
7
+ require 'bundler'
8
+ Bundler::GemHelper.install_tasks
9
+
10
+ require 'bump/tasks'
11
+
7
12
  begin
8
13
  Bundler.setup(:default, :development)
9
14
  rescue Bundler::BundlerError => e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.8.1
@@ -68,6 +68,25 @@ module Trop
68
68
  return files
69
69
  end
70
70
 
71
+ def collect_gem_tree(path)
72
+ files = []
73
+ if path.is_a? Array
74
+ path.each {|s| files += fffind(s) }
75
+ else
76
+ files += fffind(path)
77
+ end
78
+
79
+ out=[]
80
+ files.each do |f|
81
+ f = f.delete_prefix('/home/werner/rails/trop/')
82
+ next unless f.to_s.end_with?('.rb')
83
+
84
+ out << f
85
+ end
86
+
87
+
88
+ return out
89
+ end
71
90
  # @param spath to search in
72
91
  def collect_sorted_readme(spath)
73
92
  @readmes = []
@@ -147,6 +166,11 @@ module Trop
147
166
  finder.collect_dir_tree(path)
148
167
  end
149
168
 
169
+ def self.my_gemspec_fffind(*path)
170
+ finder = FileFinder.new
171
+ finder.collect_gem_tree(*path)
172
+ end
173
+
150
174
  end
151
175
  end
152
176
 
@@ -1,10 +1,15 @@
1
1
  require 'rubygems'
2
2
  require 'git'
3
3
  require 'logger'
4
+ require_relative 'version'
4
5
 
5
6
  #load File.dirname(__FILE__) + '/../../rakelib/gem_version.rake'
6
7
 
8
+
9
+
10
+
7
11
  module Trop::GemVersion
12
+ @@version = nil
8
13
  @@gem_version_file = 'next_gem_version'
9
14
  @@default_commit_message = 'incremented gem version'
10
15
 
@@ -40,64 +45,91 @@ module Trop::GemVersion
40
45
  self.update_version(self.increment_version)
41
46
  self.rewrite_gemspec
42
47
  self.commit_and_push
48
+ self.version
43
49
  end
44
50
 
45
51
  def self.increment_version
46
52
  version = self.next_version
47
53
  components = version.split('.')
48
54
  components.push((components.pop.to_i + 1).to_s)
49
- new_version = components.join('.')
50
- new_version
55
+ @@version = components.join('.')
56
+ ENV['VERSION'] = @@version
57
+ @@version
51
58
  end
52
59
 
53
60
  def self.rewrite_gemspec
54
- spec_path = FileUtils.getwd + '/' + Trop::GEMSPEC_NAME
61
+ spec_path = FileUtils.getwd + '/' + self.gemspec_name
55
62
  spec_gem = Gem::Specification::load(spec_path)
56
- spec_gem.version = Trop::GemVersion.next_version
63
+ spec_gem.version = @@version || self.next_version
64
+ spec_gem.files = spec_gem.files + Trop::FileFinder::my_gemspec_fffind([File.expand_path('./lib'),File.expand_path('rakelib')])
57
65
  File.open(spec_path, 'w') {|f| f.write spec_gem.to_ruby}
58
66
  return spec_gem.version
59
67
  end
60
68
 
61
69
  def self.check_lib_version_rb?
62
- return false if (Trop::GemVersion::check_lib_version_rb.nil?)
70
+ return false if (self.check_lib_version_rb.nil?)
63
71
  true
64
72
  end
65
73
 
66
74
  def self.check_lib_version_rb
67
- content = Pathname.new(Trop::VERSION_FILE).read
75
+ content = Pathname.new(self.version_file_rb).read
68
76
  version_ok = content.scan(/VERSION.*["']+\d+\.\d+[\.\d+]+["']+/)
69
77
  version_ok
70
78
  end
71
79
 
72
- def self.update_lib_version_rb
73
- if self.check_lib_version_rb?
74
- # update
75
-
80
+ def self.update_lib_version_rb(version)
81
+ unless self.check_lib_version_rb?
82
+ puts "version out of sync"
83
+ assert false
76
84
  return
77
85
  end
78
-
79
- puts "version out of sync"
80
- assert false
86
+ # update
87
+ content = Pathname.new(self.version_file_rb).read
88
+ File.open(self.version_file_rb + '.tmp', 'w') do |out|
89
+ content.each_line do |l|
90
+ ret = l.match(/VERSION.*["']+\d+\.\d+[\.\d+]+["']+/)
91
+ if ret
92
+ out.print " VERSION = '" + version + "'\n"
93
+ else
94
+ out.print (l)
95
+ end
96
+ end
97
+ end
98
+ # rename
99
+ FileUtils.cp( self.version_file_rb + '.tmp',self.version_file_rb, preserve: false)
81
100
  end
82
101
 
83
-
84
102
  def self.update_version(new_version)
103
+ # 0. ENV
104
+ @@version = new_version
105
+ ENV['VERSION'] = @@version
85
106
  # 1. next_version
86
107
  file = File.new(@@gem_version_file, 'w')
87
- file.print new_version
108
+ file.print new_version + "\n"
88
109
  file.close
89
110
  # 2. VERSION
90
111
  file = File.new('VERSION', 'w')
91
- file.print new_version
112
+ file.print new_version + "\n"
92
113
  file.close
93
114
  # 3.
115
+ self.update_lib_version_rb(@@version)
116
+ # 4. gemspec
117
+ self.rewrite_gemspec
118
+ ENV['VERSION'] = @@version
94
119
  end
95
120
 
96
121
  def self.commit_and_push(project_directory = nil, msg = nil, &block)
97
122
  g = Git.open(project_directory || Dir.pwd, :log => Logger.new(STDOUT))
98
123
  g.add(@@gem_version_file)
124
+ g.add(self.version_file_rb)
125
+ g.add(self.gemspec_name)
126
+ g.add('VERSION')
99
127
  yield(g) if block_given?
100
128
  g.commit(msg || @@default_commit_message)
129
+ v = @@version
130
+ system("git tag -f -a -m 'Version v#{v}' v#{v}")
131
+ system("git push > #{DEVNULL} 2>&1")
132
+ system("git push --tags > #{DEVNULL} 2>&1")
101
133
  g.push
102
134
  end
103
135
  end
data/lib/trop/version.rb CHANGED
@@ -1,6 +1,24 @@
1
1
  module Trop
2
- VERSION = '0.7.0'
2
+ VERSION = '0.8.1'
3
3
  VERSION_NAME = 'trop'
4
- GEMSPEC_NAME = VERSION_NAME + '.gemspec'
5
- VERSION_FILE = File.expand_path('version.rb', __dir__)
4
+ end
5
+
6
+ module Trop::GemVersion
7
+
8
+ def self.version_name
9
+ Trop::VERSION_NAME
10
+ end
11
+
12
+ def self.version
13
+ Trop::VERSION
14
+ end
15
+
16
+ def self.version_file_rb
17
+ File.expand_path('version.rb', __dir__)
18
+ end
19
+
20
+ def self.gemspec_name
21
+ Trop::VERSION_NAME + '.gemspec'
22
+ end
23
+
6
24
  end
data/lib/trop.rb ADDED
@@ -0,0 +1,10 @@
1
+ require_relative './trop/version'
2
+ require_relative './trop/core-ext'
3
+ require_relative './trop/os'
4
+ require_relative './trop/shell_deb_verb'
5
+ require_relative './trop/infogit'
6
+ require_relative './trop/gem_version'
7
+ require 'colorized_string'
8
+
9
+ require_relative './trop/filefind'
10
+ require_relative './trop/file_finder'
@@ -1,5 +1,5 @@
1
1
  require_relative '../lib/trop'
2
- require_relative '../lib/trop/gem_version'
2
+
3
3
 
4
4
  namespace :gem do
5
5
 
@@ -35,7 +35,7 @@ namespace :gem do
35
35
 
36
36
  puts "incr. version build and push #{vers1} #{vers2}"
37
37
  Trop::Sh::systemlocal('gem build trop.gemspec')
38
- Trop::Sh::systemlocal('rake gembox')
38
+ #Trop::Sh::systemlocal('rake gembox')
39
39
  end
40
40
  end
41
41
 
@@ -52,7 +52,7 @@ namespace :gem do
52
52
 
53
53
  desc "sync version files"
54
54
  task :sync do
55
- Trop::GemVersion::update_version(Trop::VERSION)
55
+ Trop::GemVersion::update_version(Trop::GemVersion::next_version)
56
56
  end
57
57
 
58
58
  desc "Return and set next gem version"
data/rakelib/raven.rake CHANGED
@@ -10,7 +10,7 @@ if ENV['CI'].nil?
10
10
  config.dsn = envtest
11
11
  config.release = Trop::InfoGit::GitProject.commit_id
12
12
  config.ssl_verification = false
13
- puts "Using dsn #{envtest}".yellow #if Shell.verbose?
13
+ puts "Using dsn #{envtest}".yellow if Trop::Sh::verbose?
14
14
  # puts "with comit-id: #{InfoGit::GitProject.commit_id}".yellow if Shell.verbose?
15
15
  end
16
16
  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.7.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - werner
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
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
41
  - !ruby/object:Gem::Dependency
56
42
  name: faraday
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -224,16 +210,16 @@ dependencies:
224
210
  name: git-up
225
211
  requirement: !ruby/object:Gem::Requirement
226
212
  requirements:
227
- - - ">="
213
+ - - "~>"
228
214
  - !ruby/object:Gem::Version
229
- version: '0'
215
+ version: '0.5'
230
216
  type: :development
231
217
  prerelease: false
232
218
  version_requirements: !ruby/object:Gem::Requirement
233
219
  requirements:
234
- - - ">="
220
+ - - "~>"
235
221
  - !ruby/object:Gem::Version
236
- version: '0'
222
+ version: '0.5'
237
223
  - !ruby/object:Gem::Dependency
238
224
  name: rake
239
225
  requirement: !ruby/object:Gem::Requirement
@@ -268,6 +254,7 @@ files:
268
254
  - VERSION
269
255
  - bin/setup
270
256
  - bin/update
257
+ - lib/trop.rb
271
258
  - lib/trop/config.bundler.tpl
272
259
  - lib/trop/core-ext.rb
273
260
  - lib/trop/file_finder.rb
@@ -301,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
288
  - !ruby/object:Gem::Version
302
289
  version: '0'
303
290
  requirements: []
304
- rubygems_version: 3.0.3
291
+ rubygems_version: 3.0.4
305
292
  signing_key:
306
293
  specification_version: 4
307
294
  summary: trop is troppuS