bake-bundler 0.3.1 → 0.3.5

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: 5ab993f300ada8749f24d6558c8afb4934759163e2a0a5986a6cdc82171b40bc
4
- data.tar.gz: a61b6f265fc5ab05c573b7049b7945e23bf401e9489b024b15f4cc285246067a
3
+ metadata.gz: c5baf096d4dee1e613671cf08e7d36d029b0fae5c0f1e5e8c5cb6af91648da6b
4
+ data.tar.gz: 870c5dd6c866f85da86a796f88bcd0bf5b43f37b046e2d193b3a0c3b1c37e9a2
5
5
  SHA512:
6
- metadata.gz: c935d63ef9a48636ed6b81469287fceb7939c7ac60809f0d86e7283a16a4a94cce3f8e8844f783bb9f0c6590c10747b15d67e5003a63660f2a21d097a57dddeb
7
- data.tar.gz: cebd57b16c8bf72d69a29067fc2cc379f52db5666cb18e87921ed673dbe2ffea76c382bacfee7c923ec9c7d1563e7c1c4d75248c3de326fe9975a09e012a36b3
6
+ metadata.gz: 50d8ee9e276a27bed07a2da8339526be9a43dfc4694cc6f03f6b9b65fbb01650dbfeb63631773f0e4d37c1d8e88ec68843dfbcc52ba8daa8c65039a35957a80d
7
+ data.tar.gz: 966e51c9681440a32fecc87468a63074442bd817b9dc8344b04e759b62be1659738ec04e8f468d3d79bf040ea53f3b0229d92302f00421bbe1cbce813e771f39
data/bake/bundler.rb CHANGED
@@ -13,10 +13,17 @@ attr :helper
13
13
  # Build the gem into the pkg directory.
14
14
  def build
15
15
  @built_gem_path ||= @helper.build_gem
16
+
17
+ gemspec = @helper.gemspec
18
+
19
+ $stdout.puts "Your gem contains the following files:"
20
+ pp gemspec.files
21
+
22
+ return @built_gem_path
16
23
  end
17
24
 
18
25
  # Build and install the gem into system gems.
19
- # @param local [Boolean] only use locally available caches.
26
+ # @parameter local [Boolean] only use locally available caches.
20
27
  def install(local: false)
21
28
  path = self.build
22
29
 
@@ -18,8 +18,8 @@ VERSION_PATTERN = /VERSION = ['"](?<value>\d+\.\d+\.\d+)(?<pre>.*?)['"]/
18
18
 
19
19
  # Scans the files listed in the gemspec for a file named `version.rb`. Extracts the VERSION constant and updates it according to the version bump. Commits the changes to git using the specified message.
20
20
  #
21
- # @param bump [Array(Integer | Nil)] the version bump to apply before publishing.
22
- # @param message [String] the git commit message to use.
21
+ # @parameter bump [Array(Integer | Nil)] the version bump to apply before publishing, e.g. `0,1,0` to increment minor version number.
22
+ # @parameter message [String] the git commit message to use.
23
23
  def increment(bump, message: "Bump version.")
24
24
  release = context.lookup('bundler:release')
25
25
  helper = release.instance.helper
@@ -70,9 +70,43 @@ def release(*arguments, **options)
70
70
  release = context.lookup('bundler:release')
71
71
  helper = release.instance.helper
72
72
 
73
- helper.guard_clean
73
+ changes = readlines("git", "status", "--porcelain")
74
74
 
75
- increment(*arguments, **options)
76
-
77
- release.call
75
+ if changes.any?
76
+ puts "Uncommitted modifications detected:"
77
+ changes.each do |change|
78
+ puts change
79
+ end
80
+ else
81
+ last_commit = readlines("git", "log", "-1", "--oneline").first
82
+
83
+ unless last_commit =~ /version bump|bump version/i
84
+ increment(*arguments, **options)
85
+ end
86
+
87
+ release.call
88
+ end
89
+ end
90
+
91
+ def shell(*arguments)
92
+ IO.pipe do |input, output|
93
+ pid = Process.spawn(*arguments, out: output)
94
+ output.close
95
+
96
+ begin
97
+ yield input
98
+ ensure
99
+ pid, status = Process.wait2(pid)
100
+
101
+ unless status.success?
102
+ raise "Failed to execute #{arguments} -> #{status}"
103
+ end
104
+ end
105
+ end
106
+ end
107
+
108
+ def readlines(*arguments)
109
+ shell(*arguments) do |output|
110
+ return output.readlines
111
+ end
78
112
  end
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Bake
24
24
  module Bundler
25
- VERSION = "0.3.1"
25
+ VERSION = "0.3.5"
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bake-bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-10 00:00:00.000000000 Z
11
+ date: 2021-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bake
@@ -38,27 +38,23 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description:
41
+ description:
42
42
  email:
43
- - samuel.williams@oriontransfer.co.nz
44
43
  executables: []
45
44
  extensions: []
46
45
  extra_rdoc_files: []
47
46
  files:
48
- - ".gitignore"
49
- - ".rspec"
50
- - Gemfile
51
- - README.md
52
- - bake-bundler.gemspec
53
47
  - bake/bundler.rb
54
48
  - bake/bundler/release.rb
55
49
  - lib/bake/bundler.rb
56
50
  - lib/bake/bundler/helper.rb
57
51
  - lib/bake/bundler/version.rb
58
52
  homepage: https://github.com/ioquatix/bake-bundler
59
- licenses: []
60
- metadata: {}
61
- post_install_message:
53
+ licenses:
54
+ - MIT
55
+ metadata:
56
+ funding_uri: https://github.com/sponsors/ioquatix/
57
+ post_install_message:
62
58
  rdoc_options: []
63
59
  require_paths:
64
60
  - lib
@@ -73,8 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
69
  - !ruby/object:Gem::Version
74
70
  version: '0'
75
71
  requirements: []
76
- rubygems_version: 3.1.2
77
- signing_key:
72
+ rubygems_version: 3.2.15
73
+ signing_key:
78
74
  specification_version: 4
79
75
  summary: Provides recipes for bundler.
80
76
  test_files: []
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
- Gemfile.lock
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in bake-bundler.gemspec
4
- gemspec
data/README.md DELETED
@@ -1,65 +0,0 @@
1
- # Bake::Bundler
2
-
3
- Provides bake tasks for releasing gems using bundler.
4
-
5
- ## Installation
6
-
7
- ```
8
- bundle add bake-bundler
9
- ```
10
-
11
- ## Usage
12
-
13
- ### Build
14
-
15
- ```
16
- bake bundler:build
17
- ```
18
-
19
- ### Install
20
-
21
- ```
22
- bake bundler:install
23
- ```
24
-
25
- ### Release
26
-
27
- ```
28
- bake bundler:release
29
- ```
30
-
31
- ## Contributing
32
-
33
- 1. Fork it
34
- 2. Create your feature branch (`git checkout -b my-new-feature`)
35
- 3. Commit your changes (`git commit -am 'Add some feature'`)
36
- 4. Push to the branch (`git push origin my-new-feature`)
37
- 5. Create new Pull Request
38
-
39
- ## See Also
40
-
41
- - [Bake](https://github.com/ioquatix/bake) — The bake task execution tool.
42
-
43
- ## License
44
-
45
- Released under the MIT license.
46
-
47
- Copyright, 2020, by [Samuel G. D. Williams](http://www.codeotaku.com).
48
-
49
- Permission is hereby granted, free of charge, to any person obtaining a copy
50
- of this software and associated documentation files (the "Software"), to deal
51
- in the Software without restriction, including without limitation the rights
52
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
- copies of the Software, and to permit persons to whom the Software is
54
- furnished to do so, subject to the following conditions:
55
-
56
- The above copyright notice and this permission notice shall be included in
57
- all copies or substantial portions of the Software.
58
-
59
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
65
- THE SOFTWARE.
data/bake-bundler.gemspec DELETED
@@ -1,24 +0,0 @@
1
- require_relative 'lib/bake/bundler/version'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "bake-bundler"
5
- spec.version = Bake::Bundler::VERSION
6
- spec.authors = ["Samuel Williams"]
7
- spec.email = ["samuel.williams@oriontransfer.co.nz"]
8
-
9
- spec.summary = "Provides recipes for bundler."
10
- spec.homepage = "https://github.com/ioquatix/bake-bundler"
11
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
12
-
13
- # Specify which files should be added to the gem when it is released.
14
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
15
- spec.files = Dir.chdir(__dir__) do
16
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- end
18
-
19
- spec.add_dependency "bake", "~> 0.9"
20
- spec.add_dependency "rspec"
21
-
22
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
- spec.require_paths = ["lib"]
24
- end