rake-release 1.0.0 → 1.3.0

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: 4f57c7ab816f8b5967fada02b402586a25a1a73ffb6fd0cd864133b56ad8afe6
4
- data.tar.gz: 1e8d380cdb33c8bb029f5be948aef86d41798638919641ec7f3272b005dbf4a9
3
+ metadata.gz: 74d0e88927d104dee76b0fcb1683b96c4a50ef4bc7e58b1727d5eb310db14172
4
+ data.tar.gz: a236636c5bd7f31410d90cddac05faa45a39e77bfbadd20c899662ca6e419908
5
5
  SHA512:
6
- metadata.gz: 9c04699feb9d665b3e8449b35be5ae126f70dc88cbfa8a87fba593fcef8adc33b19b24eda1f2b66faa68cd7a698f2916b5aa5ebabbae7b6f89454afe7bb76552
7
- data.tar.gz: 2803b6c8d933d1c366ff0c66aa3b635841066a66b1cd3717bc0d37d6790ecfb80d9d57fc097625b980c99d1585871a957c919b556ded46d5e2696c2f689ac417
6
+ metadata.gz: d912cd1681267ed905a41706afbce9179f579ee82e71135594dd821dbf4c09383f4df970be6119ed2deaf8bd5eb9cd7f1b43403a79e25b6810b6b3aeafa2c077
7
+ data.tar.gz: 0bca5a28a3594f6e0287601e504a5bea67cc2886250a0ff804926b9135be6293d510d88d8a972c2e872d5441c65a5ab580e212e14ff12f524ea39e8a21f6856f
@@ -0,0 +1,8 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ charset = utf-8
7
+ trim_trailing_whitespace = true
8
+ insert_final_newline = true
@@ -0,0 +1,68 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ TargetRubyVersion: 2.5
5
+
6
+
7
+ Layout/ArgumentAlignment:
8
+ EnforcedStyle: with_fixed_indentation
9
+
10
+ Layout/CaseIndentation:
11
+ EnforcedStyle: end
12
+ SupportedStyles:
13
+ - case
14
+ - end
15
+ IndentOneStep: true
16
+
17
+ Layout/LineLength:
18
+ Exclude:
19
+ - '*.gemspec'
20
+
21
+ Layout/SpaceInsideBlockBraces:
22
+ EnforcedStyle: space
23
+ EnforcedStyleForEmptyBraces: no_space
24
+ SpaceBeforeBlockParameters: false
25
+
26
+ Layout/SpaceInsideHashLiteralBraces:
27
+ EnforcedStyle: no_space
28
+
29
+
30
+ Metrics/AbcSize:
31
+ Enabled: false
32
+
33
+ Metrics/ClassLength:
34
+ Enabled: false
35
+
36
+ Metrics/CyclomaticComplexity:
37
+ Enabled: false
38
+
39
+ Metrics/MethodLength:
40
+ Enabled: false
41
+
42
+
43
+ Style/ClassAndModuleChildren:
44
+ Enabled: false
45
+
46
+ Style/Documentation:
47
+ Enabled: false
48
+
49
+ Style/IfUnlessModifier:
50
+ Enabled: false
51
+
52
+ Style/HashEachMethods:
53
+ Enabled: false
54
+
55
+ Style/HashTransformKeys:
56
+ Enabled: false
57
+
58
+ Style/HashTransformValues:
59
+ Enabled: false
60
+
61
+ Style/RaiseArgs:
62
+ EnforcedStyle: compact
63
+
64
+ Style/SignalException:
65
+ EnforcedStyle: only_raise
66
+
67
+ Style/TrivialAccessors:
68
+ AllowPredicates: true
data/Gemfile CHANGED
@@ -1,6 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in rake-release.gemspec
4
6
  gemspec
5
7
 
6
8
  gem 'rake'
9
+ gem 'rubocop', '~> 1.8.0'
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
 
4
6
  require 'rake/release/task'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake/release/spec'
2
4
  require 'rake/release/task'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'forwardable'
2
4
  require 'uri'
3
5
 
@@ -6,18 +8,14 @@ module Rake
6
8
  class Spec
7
9
  extend Forwardable
8
10
 
9
- EMPTY_STR = ''.freeze
11
+ EMPTY_STR = ''
10
12
 
11
13
  delegate name: :@gemspec
12
14
  delegate version: :@gemspec
13
15
 
14
- attr_reader :base
15
- attr_reader :gemspec
16
- attr_reader :gemspec_path
16
+ attr_reader :base, :gemspec, :gemspec_path, :push_host
17
17
 
18
- attr_accessor :push_host
19
- attr_accessor :sign_tag
20
- attr_accessor :namespace
18
+ attr_accessor :sign_tag, :namespace, :version_tag
21
19
 
22
20
  def initialize(path = nil, namespace: nil, sign_tag: false)
23
21
  path = Task.pwd.join(path.to_s).expand_path
@@ -47,6 +45,7 @@ module Rake
47
45
 
48
46
  @sign_tag = sign_tag
49
47
  @namespace = namespace
48
+ @version_tag = "v#{version}"
50
49
 
51
50
  yield self if block_given?
52
51
  end
@@ -74,10 +73,6 @@ module Rake
74
73
  @pkg_file_path ||= pkg_path.join pkg_file_name
75
74
  end
76
75
 
77
- def version_tag
78
- "v#{version}"
79
- end
80
-
81
76
  class << self
82
77
  def load(*args, &block)
83
78
  new(*args, &block)
@@ -88,7 +83,7 @@ module Rake
88
83
  def scan(path = Task.pwd.join('*.gemspec'))
89
84
  Pathname
90
85
  .glob(path)
91
- .map { |m| Rake::Release::Spec.load(m) }
86
+ .map {|m| Rake::Release::Spec.load(m) }
92
87
  .reject(&:nil?)
93
88
  end
94
89
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/vendored_thor' unless defined?(Thor)
2
4
 
3
5
  require 'open3'
@@ -63,6 +65,7 @@ module Rake
63
65
 
64
66
  def guard_clean
65
67
  return if clean? && committed?
68
+
66
69
  raise 'There are files that need to be committed first.'
67
70
  end
68
71
 
@@ -72,7 +75,7 @@ module Rake
72
75
  return if out.split("\n").include? @spec.version_tag
73
76
 
74
77
  raise "Tag #{@spec.version_tag} does not point to current HEAD. " \
75
- 'Cannot release wrong code.'
78
+ 'Will no release wrong code.'
76
79
  end
77
80
 
78
81
  def build
@@ -82,7 +85,7 @@ module Rake
82
85
 
83
86
  @spec.pkg_path.mkpath
84
87
  FileUtils.mv @spec.pkg_file_name,
85
- @spec.pkg_path.join(@spec.pkg_file_name)
88
+ @spec.pkg_path.join(@spec.pkg_file_name)
86
89
 
87
90
  Task.ui.confirm \
88
91
  "#{@spec.name} #{@spec.version} built to #{@spec.pkg_path}."
@@ -101,7 +104,10 @@ module Rake
101
104
  cmd = %w[gem push]
102
105
  cmd << @spec.pkg_file_path << '--host' << @spec.push_host
103
106
 
104
- sh!(*cmd)
107
+ pid = ::Kernel.spawn(*cmd.flatten.map(&:to_s))
108
+ _, status = ::Process.wait2(pid)
109
+
110
+ ::Kernel.exit(1) unless status.success?
105
111
 
106
112
  Task.ui.confirm "Pushed #{@spec.pkg_file_name} to #{@spec.push_host}"
107
113
  end
@@ -173,10 +179,10 @@ module Rake
173
179
  out, ret = sh(*cmd, **kwargs, &block)
174
180
 
175
181
  if ret != 0
176
- raise <<-EOS.gsub(/^\s*\.?/, '')
182
+ raise <<~ERROR
177
183
  Running `#{cmd}` failed, exit code: #{ret}
178
- .#{out.gsub(/\n/, "\n ")}
179
- EOS
184
+ #{out.strip.gsub(/\n/, "\n ")}
185
+ ERROR
180
186
  end
181
187
 
182
188
  [out, ret]
@@ -197,20 +203,18 @@ module Rake
197
203
  end
198
204
 
199
205
  class << self
200
- def load_all(dir = pwd)
206
+ def load_all(dir = pwd, &block)
201
207
  specs = Spec.scan dir.join('**/*.gemspec')
202
208
 
203
- if specs.size > 1
204
- specs.each { |spec| spec.namespace = spec.name }
205
- end
209
+ specs.each {|spec| spec.namespace = spec.name } if specs.size > 1
206
210
 
207
- specs.each(&Proc.new) if block_given?
211
+ specs.each(&block) if block
208
212
 
209
- if specs.uniq { |s| s.namespace.to_s.strip }.size != specs.size
213
+ if specs.uniq {|s| s.namespace.to_s.strip }.size != specs.size
210
214
  raise 'Non distinct release task namespaces'
211
215
  end
212
216
 
213
- specs.each { |spec| Task.new spec }
217
+ specs.each {|spec| Task.new spec }
214
218
  end
215
219
 
216
220
  def pwd
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Gem::Specification.new do |spec|
2
4
  spec.name = 'rake-release'
3
- spec.version = '1.0.0'
5
+ spec.version = '1.3.0'
4
6
  spec.authors = ['Jan Graichen']
5
7
  spec.email = ['jgraichen@altimos.de']
6
8
  spec.licenses = ['MIT']
@@ -9,11 +11,13 @@ Gem::Specification.new do |spec|
9
11
  spec.description = 'Configurable fork of bundlers release tasks.'
10
12
  spec.homepage = 'https://github.com/jgraichen/rake-release'
11
13
 
12
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
13
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
15
+ spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
14
16
  spec.require_paths = %w[lib]
15
17
 
16
- spec.add_dependency 'bundler', '~> 1.11'
18
+ spec.required_ruby_version = '>= 2.5'
19
+
20
+ spec.add_dependency 'bundler', '>= 1.11', '< 3'
17
21
 
18
- spec.add_development_dependency 'bundler', '~> 1.11'
22
+ spec.add_development_dependency 'bundler', '>= 1.11', '< 3'
19
23
  end
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'rake/release'
metadata CHANGED
@@ -1,43 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-20 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.11'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.11'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
39
  version: '1.11'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '3'
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
39
48
  - !ruby/object:Gem::Version
40
49
  version: '1.11'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '3'
41
53
  description: Configurable fork of bundlers release tasks.
42
54
  email:
43
55
  - jgraichen@altimos.de
@@ -45,7 +57,9 @@ executables: []
45
57
  extensions: []
46
58
  extra_rdoc_files: []
47
59
  files:
60
+ - ".editorconfig"
48
61
  - ".gitignore"
62
+ - ".rubocop.yml"
49
63
  - Gemfile
50
64
  - LICENSE
51
65
  - README.md
@@ -68,15 +82,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
82
  requirements:
69
83
  - - ">="
70
84
  - !ruby/object:Gem::Version
71
- version: '0'
85
+ version: '2.5'
72
86
  required_rubygems_version: !ruby/object:Gem::Requirement
73
87
  requirements:
74
88
  - - ">="
75
89
  - !ruby/object:Gem::Version
76
90
  version: '0'
77
91
  requirements: []
78
- rubyforge_project:
79
- rubygems_version: 2.7.3
92
+ rubygems_version: 3.2.4
80
93
  signing_key:
81
94
  specification_version: 4
82
95
  summary: Configurable fork of bundlers release tasks.