gemsmith 7.3.0 → 7.4.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +15 -40
- data/lib/gemsmith/aids/gem_spec.rb +81 -0
- data/lib/gemsmith/authenticators/basic.rb +28 -0
- data/lib/gemsmith/authenticators/ruby_gems.rb +39 -0
- data/lib/gemsmith/cli.rb +8 -5
- data/lib/gemsmith/cli_helpers.rb +9 -4
- data/lib/gemsmith/credentials.rb +75 -0
- data/lib/gemsmith/errors/base.rb +9 -0
- data/lib/gemsmith/errors/specification.rb +9 -0
- data/lib/gemsmith/identity.rb +1 -1
- data/lib/gemsmith/rake/release.rb +24 -52
- data/lib/gemsmith/rake/tasks.rb +7 -3
- metadata +8 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15a788991bc084549c98a462eed3c3f5c38cdca
|
4
|
+
data.tar.gz: 9738979e1f90e3f9e32a1e43da1a5ab1122bcab2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e44ec634d3ed7706e7b2b3a807d57bbf36631b9e8d818e4e3f2fc02b8166bf13b401dad37de89dd7bfb933da86d929c02c9813890549d31ace84987ba3b9c9c1
|
7
|
+
data.tar.gz: c983d010a5878a9a28082c66e61eb51a3ee0d235a224b612b5a5d7d629f0a6e0c1aa42c774c0e98eb8e6e0c3b3c6cabdae50f5ef3d14c04af2ce99c8f95a47b2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -26,8 +26,7 @@ A command line interface for smithing new Ruby gems.
|
|
26
26
|
- [Gem Certificates](#gem-certificates)
|
27
27
|
- [Private Gem Servers](#private-gem-servers)
|
28
28
|
- [Gem Specification Metadata](#gem-specification-metadata)
|
29
|
-
- [
|
30
|
-
- [Generating Credentials](#generating-credentials)
|
29
|
+
- [Gem Credentials](#gem-credentials)
|
31
30
|
- [Promotion](#promotion)
|
32
31
|
- [Versioning](#versioning)
|
33
32
|
- [Code of Conduct](#code-of-conduct)
|
@@ -43,7 +42,6 @@ A command line interface for smithing new Ruby gems.
|
|
43
42
|
- Builds a gem skeleton with enhanced Bundler functionality.
|
44
43
|
- Uses [Milestoner](https://github.com/bkuhlmann/milestoner) for consistent project/gem versioning.
|
45
44
|
- Uses [Tocer](https://github.com/bkuhlmann/tocer) for README table of contents generation.
|
46
|
-
- Uses common settings and a structured layout for building new gems.
|
47
45
|
- Supports [Thor](https://github.com/erikhuda/thor).
|
48
46
|
- Supports [Ruby on Rails](http://rubyonrails.org).
|
49
47
|
- Supports [Pry](http://pryrepl.org).
|
@@ -55,10 +53,12 @@ A command line interface for smithing new Ruby gems.
|
|
55
53
|
- Supports [Gemnasium](https://gemnasium.com).
|
56
54
|
- Supports [Travis CI](https://travis-ci.org).
|
57
55
|
- Supports [Patreon](https://www.patreon.com).
|
58
|
-
-
|
56
|
+
- Supports common settings and a structured layout for building new gems.
|
57
|
+
- Supports publishing to public or private gem servers.
|
58
|
+
- Provides commonly needed [README](README.md), [CHANGELOG](CHANGELOG.md), [CONTRIBUTING](CONTRIBUTING.md),
|
59
59
|
[CODE OF CONDUCT](CODE_OF_CONDUCT.md), [LICENSE](LICENSE.md), etc. documentation.
|
60
|
-
- Provides the ability to
|
61
|
-
- Provides the ability to
|
60
|
+
- Provides the ability to view source code of any gem within your favorite editor.
|
61
|
+
- Provides the ability to view the documentation of any gem within your default browser.
|
62
62
|
|
63
63
|
# Screencasts
|
64
64
|
|
@@ -295,46 +295,21 @@ following:
|
|
295
295
|
credentials are not used within your gemspec.
|
296
296
|
- `allowed_push_host`: Provides the URL of the private gem server to push your gem to.
|
297
297
|
|
298
|
-
##
|
298
|
+
## Gem Credentials
|
299
299
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
The "example_key" *must* be a symbol (hence the double colons) due to RubyGems requirements.
|
307
|
-
|
308
|
-
## Generating Credentials
|
309
|
-
|
310
|
-
RubyGems uses an `Authorization` HTTP header when pushing a gem to a remote server. This can be an API key, HTTP Basic
|
311
|
-
Auth, etc. When pushing a gem to RubyGems, you'll want to use the API key associated with your account. If that is the
|
312
|
-
case, you're credentials would contain the following:
|
300
|
+
With your gem specification metadata established, you are ready to publish your gem to a public or private server. If
|
301
|
+
this is your first time publishing a gem and no gem credentials have been configured, you'll be prompted for them. This
|
302
|
+
gem will ask you for your login and password during gem publish. Gem credentials will are stored in the
|
303
|
+
`~/.gem/credentials` file as defined by RubyGems. *This will only happen once.* Afterwards, future gem publishing will
|
304
|
+
your stored credentials instead. Multiple credentials can be stored in the `~/.gem/credentials` file. Example:
|
313
305
|
|
314
306
|
---
|
315
307
|
:rubygems_api_key: 2a0b460650e67d9b85a60e183defa376
|
316
|
-
|
317
|
-
For a server that might use HTTP Basic auth, you can generate the key value by launching IRB and running the following:
|
318
|
-
|
319
|
-
require "net/http"
|
320
|
-
Net::HTTP::Get.new("http://gems.example.com").basic_auth "user", "password"
|
321
|
-
|
322
|
-
The URL is arbitrary but the user and password should be your account credentials. The output, from running the code
|
323
|
-
above, should look like the following:
|
324
|
-
|
325
|
-
["Basic dXNlcjpwYXNzd29yZA=="]
|
326
|
-
|
327
|
-
You can then add this value to your credentials file like so:
|
328
|
-
|
329
|
-
---
|
330
308
|
:example_key: "Basic dXNlcjpwYXNzd29yZA=="
|
331
309
|
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
---
|
336
|
-
:rubygems_api_key: 2a0b460650e67d9b85a60e183defa376
|
337
|
-
:example_key: "Basic dXNlcjpwYXNzd29yZA=="
|
310
|
+
Should you need delete a credential (due to a bad login/password for example), you can open the `~/.gem/credentials` in
|
311
|
+
your default editor and remove the line(s) you don't need. Upon next publish of your gem, this gem will prompt you for
|
312
|
+
new credentials.
|
338
313
|
|
339
314
|
# Promotion
|
340
315
|
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "open3"
|
4
|
+
|
5
|
+
module Gemsmith
|
6
|
+
module Aids
|
7
|
+
# A Gem::Specification with additional enhancements.
|
8
|
+
class GemSpec
|
9
|
+
def self.specification
|
10
|
+
::Gem::Specification
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.default_gem_host
|
14
|
+
::Gem::DEFAULT_HOST
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.editor
|
18
|
+
ENV.fetch "EDITOR"
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.find name, version
|
22
|
+
specification.find_by_name name, version
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.find_all name
|
26
|
+
specification.find_all_by_name name
|
27
|
+
end
|
28
|
+
|
29
|
+
def initialize file_path, shell: Open3
|
30
|
+
@file_path = file_path
|
31
|
+
@shell = shell
|
32
|
+
@spec = self.class.specification.load file_path
|
33
|
+
validate
|
34
|
+
end
|
35
|
+
|
36
|
+
def homepage_url
|
37
|
+
String spec.homepage
|
38
|
+
end
|
39
|
+
|
40
|
+
def allowed_push_key
|
41
|
+
spec.metadata.fetch("allowed_push_key") { "rubygems_api_key" }
|
42
|
+
end
|
43
|
+
|
44
|
+
def allowed_push_host
|
45
|
+
spec.metadata.fetch("allowed_push_host") { self.class.default_gem_host }
|
46
|
+
end
|
47
|
+
|
48
|
+
def open_gem
|
49
|
+
shell.capture2 self.class.editor, spec.full_gem_path
|
50
|
+
String spec.full_gem_path
|
51
|
+
end
|
52
|
+
|
53
|
+
def open_homepage
|
54
|
+
shell.capture2 "open", homepage_url
|
55
|
+
homepage_url
|
56
|
+
end
|
57
|
+
|
58
|
+
def version_number
|
59
|
+
spec.version.version
|
60
|
+
end
|
61
|
+
|
62
|
+
def version_label
|
63
|
+
"v#{version_number}"
|
64
|
+
end
|
65
|
+
|
66
|
+
def package_file_name
|
67
|
+
"#{spec.name}-#{version_number}.gem"
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
attr_reader :file_path, :spec, :shell
|
73
|
+
|
74
|
+
def validate
|
75
|
+
unless spec.is_a?(self.class.specification)
|
76
|
+
fail(Errors::Specification, %(Unknown gem specification: "#{file_path}".))
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "net/http"
|
4
|
+
|
5
|
+
module Gemsmith
|
6
|
+
module Authenticators
|
7
|
+
# An authenticator for retrieving HTTP Basic authorization.
|
8
|
+
class Basic
|
9
|
+
def self.url
|
10
|
+
""
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize login, password, encrypter: Net::HTTP::Get.new("https://ignore.example.com")
|
14
|
+
@login = login
|
15
|
+
@password = password
|
16
|
+
@encrypter = encrypter
|
17
|
+
end
|
18
|
+
|
19
|
+
def authorization
|
20
|
+
encrypter.basic_auth(login, password).first
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
attr_reader :login, :password, :encrypter
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "net/http"
|
4
|
+
require "uri"
|
5
|
+
|
6
|
+
module Gemsmith
|
7
|
+
module Authenticators
|
8
|
+
# An authenticator for retrieving RubyGems authorization.
|
9
|
+
class RubyGems
|
10
|
+
def self.url
|
11
|
+
"https://rubygems.org/api/v1/api_key"
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize login, password
|
15
|
+
@login = login
|
16
|
+
@password = password
|
17
|
+
@uri = URI.parse self.class.url
|
18
|
+
configure_client
|
19
|
+
end
|
20
|
+
|
21
|
+
def authorization
|
22
|
+
request = Net::HTTP::Get.new uri.request_uri
|
23
|
+
request.basic_auth login, password
|
24
|
+
response = client.request request
|
25
|
+
String response.body
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
attr_reader :login, :password, :uri, :client
|
31
|
+
|
32
|
+
def configure_client
|
33
|
+
@client = Net::HTTP.new uri.host, uri.port
|
34
|
+
@client.use_ssl = true
|
35
|
+
@client.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/gemsmith/cli.rb
CHANGED
@@ -5,8 +5,11 @@ require "thor"
|
|
5
5
|
require "thor/actions"
|
6
6
|
require "thor_plus/actions"
|
7
7
|
require "gemsmith/aids/gem"
|
8
|
+
require "gemsmith/aids/gem_spec"
|
8
9
|
require "gemsmith/aids/git"
|
9
10
|
require "gemsmith/aids/spec"
|
11
|
+
require "gemsmith/errors/base"
|
12
|
+
require "gemsmith/errors/specification"
|
10
13
|
require "gemsmith/skeletons/base_skeleton"
|
11
14
|
require "gemsmith/skeletons/bundler_skeleton"
|
12
15
|
require "gemsmith/skeletons/cli_skeleton"
|
@@ -62,7 +65,7 @@ module Gemsmith
|
|
62
65
|
def initialize args = [], options = {}, config = {}
|
63
66
|
super args, options, config
|
64
67
|
@configuration = Configuration.new
|
65
|
-
@
|
68
|
+
@gem_spec = Aids::GemSpec
|
66
69
|
end
|
67
70
|
|
68
71
|
desc "-c, [--create=CREATE]", "Create new gem."
|
@@ -93,14 +96,14 @@ module Gemsmith
|
|
93
96
|
desc "-o, [--open=OPEN]", "Open a gem in default editor."
|
94
97
|
map %w(-o --open) => :open
|
95
98
|
def open name
|
96
|
-
result = process_gem name, "
|
99
|
+
result = process_gem name, "open_gem"
|
97
100
|
info("Opening: #{result}") unless result.nil? || result.empty?
|
98
101
|
end
|
99
102
|
|
100
103
|
desc "-r, [--read=READ]", "Open a gem in default browser."
|
101
104
|
map %w(-r --read) => :read
|
102
105
|
def read name
|
103
|
-
result = process_gem name, "
|
106
|
+
result = process_gem name, "open_homepage"
|
104
107
|
|
105
108
|
if result.nil? || result.empty?
|
106
109
|
error "Gem home page is not defined."
|
@@ -113,7 +116,7 @@ module Gemsmith
|
|
113
116
|
map %w(-e --edit) => :edit
|
114
117
|
def edit
|
115
118
|
info "Editing: #{configuration.file_path}..."
|
116
|
-
`#{
|
119
|
+
`#{gem_spec.editor} #{configuration.file_path}`
|
117
120
|
end
|
118
121
|
|
119
122
|
desc "-v, [--version]", "Show #{Gemsmith::Identity.label} version."
|
@@ -130,7 +133,7 @@ module Gemsmith
|
|
130
133
|
|
131
134
|
private
|
132
135
|
|
133
|
-
attr_reader :configuration, :
|
136
|
+
attr_reader :configuration, :gem_spec
|
134
137
|
|
135
138
|
def setup_configuration name, options
|
136
139
|
gem = Aids::Gem.new name
|
data/lib/gemsmith/cli_helpers.rb
CHANGED
@@ -28,21 +28,26 @@ module Gemsmith
|
|
28
28
|
return if answer == "q"
|
29
29
|
|
30
30
|
if (1..gems.size).cover?(answer.to_i)
|
31
|
-
|
31
|
+
gem_spec.find name, gems[answer.to_i - 1].version.version
|
32
32
|
else
|
33
33
|
error "Invalid option: #{answer}"
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
def open_gem specification, method
|
38
|
+
spec = gem_spec.new specification.spec_file
|
39
|
+
spec.public_send method
|
40
|
+
end
|
41
|
+
|
37
42
|
def process_gem name, method
|
38
|
-
specs =
|
43
|
+
specs = gem_spec.find_all name
|
39
44
|
|
40
45
|
case
|
41
46
|
when specs.size == 1
|
42
|
-
|
47
|
+
open_gem specs.first, method
|
43
48
|
when specs.size > 1
|
44
49
|
print_gems specs
|
45
|
-
|
50
|
+
open_gem pick_gem(specs, name), method
|
46
51
|
else
|
47
52
|
error("Unable to find gem: #{name}.") && ""
|
48
53
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaml"
|
4
|
+
require "fileutils"
|
5
|
+
require "gemsmith/authenticators/ruby_gems"
|
6
|
+
require "gemsmith/authenticators/basic"
|
7
|
+
|
8
|
+
module Gemsmith
|
9
|
+
# Configures gem credentials for RubyGems and/or alternative servers.
|
10
|
+
class Credentials
|
11
|
+
attr_reader :key, :url
|
12
|
+
|
13
|
+
def self.default_key
|
14
|
+
:rubygems_api_key
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.default_url
|
18
|
+
"https://rubygems.org"
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.file_path
|
22
|
+
File.join ENV.fetch("HOME"), ".gem", "credentials"
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.authenticators
|
26
|
+
[Authenticators::RubyGems, Authenticators::Basic]
|
27
|
+
end
|
28
|
+
|
29
|
+
def initialize key: self.class.default_key, url: self.class.default_url, shell: Bundler::UI::Shell.new
|
30
|
+
@key = key
|
31
|
+
@url = url
|
32
|
+
@shell = shell
|
33
|
+
@credentials = load_credentials
|
34
|
+
end
|
35
|
+
|
36
|
+
def authenticator
|
37
|
+
selected = self.class.authenticators.detect { |auth| auth.url.include? url }
|
38
|
+
selected ? selected : Authenticators::Basic
|
39
|
+
end
|
40
|
+
|
41
|
+
def value
|
42
|
+
String credentials[key]
|
43
|
+
end
|
44
|
+
|
45
|
+
def valid?
|
46
|
+
credentials? && !String(credentials[key]).empty?
|
47
|
+
end
|
48
|
+
|
49
|
+
def create
|
50
|
+
return if valid?
|
51
|
+
|
52
|
+
login = shell.ask %(What is your "#{url}" login?)
|
53
|
+
password = shell.ask %(What is your "#{url}" password?)
|
54
|
+
new_credentials = credentials.merge key => authenticator.new(login, password).authorization
|
55
|
+
|
56
|
+
FileUtils.mkdir_p File.dirname self.class.file_path
|
57
|
+
File.open(self.class.file_path, "w") { |file| file << YAML.dump(new_credentials) }
|
58
|
+
FileUtils.chmod(0600, self.class.file_path)
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
attr_reader :credentials, :shell
|
64
|
+
|
65
|
+
def credentials?
|
66
|
+
File.exist? self.class.file_path
|
67
|
+
end
|
68
|
+
|
69
|
+
def load_credentials
|
70
|
+
Hash YAML.load_file(self.class.file_path)
|
71
|
+
rescue
|
72
|
+
{}
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
data/lib/gemsmith/identity.rb
CHANGED
@@ -1,64 +1,40 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "milestoner"
|
4
|
+
require "gemsmith/credentials"
|
4
5
|
|
5
6
|
module Gemsmith
|
6
7
|
module Rake
|
7
8
|
# Provides gem release functionality. Meant to be wrapped in Rake tasks.
|
8
|
-
# rubocop:disable Metrics/MethodLength
|
9
|
-
# rubocop:disable Metrics/ParameterLists
|
10
9
|
class Release
|
11
|
-
def self.
|
12
|
-
|
10
|
+
def self.gem_spec_path
|
11
|
+
String Dir["#{Dir.pwd}/*.gemspec"].first
|
13
12
|
end
|
14
13
|
|
15
|
-
def initialize
|
16
|
-
|
17
|
-
bundler: Bundler,
|
14
|
+
def initialize gem_spec: Gemsmith::Aids::GemSpec.new(self.class.gem_spec_path),
|
15
|
+
credentials: Gemsmith::Credentials,
|
18
16
|
publisher: Milestoner::Publisher.new,
|
19
17
|
shell: Bundler::UI::Shell.new,
|
20
18
|
kernel: Kernel
|
21
19
|
|
22
|
-
@
|
23
|
-
@
|
20
|
+
@gem_spec = gem_spec
|
21
|
+
@credentials = credentials
|
24
22
|
@publisher = publisher
|
25
23
|
@shell = shell
|
26
24
|
@kernel = kernel
|
27
|
-
@gem_spec = bundler.load_gemspec gem_spec_path.to_s
|
28
|
-
rescue Errno::ENOENT
|
29
|
-
@shell.error "Invalid gemspec file path: #{@gem_spec_path}."
|
30
|
-
end
|
31
|
-
|
32
|
-
def version_number
|
33
|
-
gem_spec.version.version
|
34
|
-
end
|
35
|
-
|
36
|
-
def version_label
|
37
|
-
"v#{version_number}"
|
38
|
-
end
|
39
|
-
|
40
|
-
def gem_file_name
|
41
|
-
"#{gem_spec.name}-#{version_number}.gem"
|
42
|
-
end
|
43
|
-
|
44
|
-
def allowed_push_key
|
45
|
-
gem_spec.metadata.fetch("allowed_push_key") { "rubygems_api_key" }
|
46
|
-
end
|
47
|
-
|
48
|
-
def allowed_push_host
|
49
|
-
gem_spec.metadata.fetch("allowed_push_host") { self.class.default_gem_host }
|
50
25
|
end
|
51
26
|
|
52
27
|
def push
|
53
|
-
|
28
|
+
creds = credentials.new key: gem_spec.allowed_push_key.to_sym, url: gem_spec.allowed_push_host
|
29
|
+
creds.create
|
54
30
|
|
55
|
-
|
56
|
-
|
57
|
-
|
31
|
+
options = %(--key "#{translate_key creds.key}" --host "#{gem_spec.allowed_push_host}")
|
32
|
+
status = kernel.system %(gem push "pkg/#{gem_spec.package_file_name}" #{options})
|
33
|
+
process_push status
|
58
34
|
end
|
59
35
|
|
60
36
|
def publish sign: true
|
61
|
-
publisher.publish version_number, sign: sign
|
37
|
+
publisher.publish gem_spec.version_number, sign: sign
|
62
38
|
push
|
63
39
|
rescue Milestoner::Errors::Base => error
|
64
40
|
shell.error error.message
|
@@ -66,25 +42,21 @@ module Gemsmith
|
|
66
42
|
|
67
43
|
private
|
68
44
|
|
69
|
-
attr_reader :
|
70
|
-
|
71
|
-
def gem_credentials?
|
72
|
-
return true if File.exist?(gem_config.credentials_path)
|
73
|
-
shell.error "Unable to load gem credentials: #{gem_config.credentials_path}."
|
74
|
-
false
|
75
|
-
end
|
45
|
+
attr_reader :gem_spec, :credentials, :publisher, :shell, :kernel
|
76
46
|
|
77
|
-
def
|
78
|
-
|
79
|
-
allowed_push_key.to_sym
|
47
|
+
def translate_key key
|
48
|
+
key == credentials.default_key ? :rubygems : key
|
80
49
|
end
|
81
50
|
|
82
|
-
def
|
83
|
-
|
84
|
-
|
51
|
+
def process_push status
|
52
|
+
if status
|
53
|
+
shell.confirm "Pushed #{gem_spec.package_file_name} to #{gem_spec.allowed_push_host}."
|
54
|
+
else
|
55
|
+
shell.error "Failed pushing #{gem_spec.package_file_name} to #{gem_spec.allowed_push_host}. " \
|
56
|
+
"Check gemspec and gem credential settings."
|
57
|
+
end
|
85
58
|
|
86
|
-
|
87
|
-
false
|
59
|
+
status
|
88
60
|
end
|
89
61
|
end
|
90
62
|
end
|
data/lib/gemsmith/rake/tasks.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
|
+
require "gemsmith/aids/gem_spec"
|
5
|
+
require "gemsmith/errors/base"
|
6
|
+
require "gemsmith/errors/specification"
|
4
7
|
require "gemsmith/rake/build"
|
5
8
|
require "gemsmith/rake/release"
|
6
9
|
|
@@ -15,6 +18,7 @@ module Gemsmith
|
|
15
18
|
end
|
16
19
|
|
17
20
|
def initialize
|
21
|
+
@gem_spec = Gemsmith::Aids::GemSpec.new Dir.glob("#{Dir.pwd}/*.gemspec").first
|
18
22
|
@build = Gemsmith::Rake::Build.new
|
19
23
|
@release = Gemsmith::Rake::Release.new
|
20
24
|
end
|
@@ -37,12 +41,12 @@ module Gemsmith
|
|
37
41
|
build.validate
|
38
42
|
end
|
39
43
|
|
40
|
-
desc "Build, tag #{
|
44
|
+
desc "Build, tag #{gem_spec.version_label} (unsigned), and push #{gem_spec.package_file_name} to RubyGems"
|
41
45
|
task release: :build do
|
42
46
|
release.publish sign: false
|
43
47
|
end
|
44
48
|
|
45
|
-
desc "Build, tag #{
|
49
|
+
desc "Build, tag #{gem_spec.version_label} (signed), and push #{gem_spec.package_file_name} to RubyGems"
|
46
50
|
task publish: :build do
|
47
51
|
release.publish
|
48
52
|
end
|
@@ -50,7 +54,7 @@ module Gemsmith
|
|
50
54
|
|
51
55
|
private
|
52
56
|
|
53
|
-
attr_reader :build, :release
|
57
|
+
attr_reader :gem_spec, :build, :release
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemsmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
aSif+qBc6oHD7EQWPF5cZkzkIURuwNwPBngZGxIKaMAgRhjGFXzUMAaq++r59cS9
|
31
31
|
xTfQ4k6fglKEgpnLAXiKdo2c8Ym+X4rIKFfedQ==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2016-
|
33
|
+
date: 2016-03-14 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: thor
|
@@ -327,11 +327,17 @@ files:
|
|
327
327
|
- bin/gemsmith
|
328
328
|
- lib/gemsmith.rb
|
329
329
|
- lib/gemsmith/aids/gem.rb
|
330
|
+
- lib/gemsmith/aids/gem_spec.rb
|
330
331
|
- lib/gemsmith/aids/git.rb
|
331
332
|
- lib/gemsmith/aids/spec.rb
|
333
|
+
- lib/gemsmith/authenticators/basic.rb
|
334
|
+
- lib/gemsmith/authenticators/ruby_gems.rb
|
332
335
|
- lib/gemsmith/cli.rb
|
333
336
|
- lib/gemsmith/cli_helpers.rb
|
334
337
|
- lib/gemsmith/configuration.rb
|
338
|
+
- lib/gemsmith/credentials.rb
|
339
|
+
- lib/gemsmith/errors/base.rb
|
340
|
+
- lib/gemsmith/errors/specification.rb
|
335
341
|
- lib/gemsmith/identity.rb
|
336
342
|
- lib/gemsmith/rake/build.rb
|
337
343
|
- lib/gemsmith/rake/release.rb
|
metadata.gz.sig
CHANGED
Binary file
|