gemsmith 7.6.0 → 7.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -1
- data/README.md +1 -0
- data/lib/gemsmith/aids/gem_spec.rb +2 -2
- data/lib/gemsmith/aids/spec.rb +1 -0
- data/lib/gemsmith/cli.rb +4 -3
- data/lib/gemsmith/cli_helpers.rb +9 -8
- data/lib/gemsmith/configuration.rb +6 -2
- data/lib/gemsmith/errors/requirement_conversion.rb +9 -0
- data/lib/gemsmith/errors/requirement_operator.rb +9 -0
- data/lib/gemsmith/gem/requirement.rb +47 -0
- data/lib/gemsmith/identity.rb +1 -1
- data/lib/gemsmith/skeletons/rake_skeleton.rb +1 -1
- data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +6 -9
- data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/cli.rb.tt +3 -3
- data/lib/gemsmith/templates/%gem_name%/spec/support/extensions/pry.rb.tt +0 -3
- metadata +26 -51
- 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: 34971a7bf833e06948419177cf190d1f1418a05a
|
4
|
+
data.tar.gz: 03252013fd1be9ef11fde87968f293f61c52f867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c4bcc823e16f4301cbfa7ace9ad5d40b1157ae59aaf3dee8b7f692dc84720d921f46f91fdc75f541e104e1b11b6493efecf5382d692e047ce83280225252d2e
|
7
|
+
data.tar.gz: 166745da9434736b4a8f0a7a7300297c37bd212501dbdfa37aff2f916730c8f0ca7c685fd1460d8b3bb7028d47b9aa1d95970c28c762663680b9f56c49731887
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
@.P#=�ܔ��W?H�泒G���yl��uǤ���b%%��F�NmD����:~dH�G�O����J����4���)��:�f��sۆ����g�}V,ߛ�FR�j�0�����]�uÙ�),��4��Y�*^��ڙ��j�:��`�m�Z���<R��3S2�D9,��H�����f��
|
2
|
+
�j�g��X���Ig��hNP!n
|
3
|
+
��bہi�=��Q{vh!B4/3L���:� 7�rr��s]����s}%#
|
data/README.md
CHANGED
@@ -40,6 +40,7 @@ A command line interface for smithing new Ruby gems.
|
|
40
40
|
# Features
|
41
41
|
|
42
42
|
- Builds a gem skeleton with enhanced Bundler functionality.
|
43
|
+
- Uses [Versionaire](https://github.com/bkuhlmann/versionaire) for semantic versioning.
|
43
44
|
- Uses [Milestoner](https://github.com/bkuhlmann/milestoner) for consistent project/gem versioning.
|
44
45
|
- Uses [Tocer](https://github.com/bkuhlmann/tocer) for README table of contents generation.
|
45
46
|
- Supports [Thor](https://github.com/erikhuda/thor).
|
@@ -22,8 +22,8 @@ module Gemsmith
|
|
22
22
|
specification.find_by_name name, version
|
23
23
|
end
|
24
24
|
|
25
|
-
def self.find_all name
|
26
|
-
specification.find_all_by_name name
|
25
|
+
def self.find_all name, requirement: Gem::Requirement.new.to_s
|
26
|
+
specification.find_all_by_name name, requirement
|
27
27
|
end
|
28
28
|
|
29
29
|
def initialize file_path, shell: Open3
|
data/lib/gemsmith/aids/spec.rb
CHANGED
@@ -5,6 +5,7 @@ require "open3"
|
|
5
5
|
module Gemsmith
|
6
6
|
module Aids
|
7
7
|
# A convenience aid to the Gem::Specification object.
|
8
|
+
# DEPRECATED: Will be removed in the next major release. Use `GemSpec` instead.
|
8
9
|
class Spec
|
9
10
|
def initialize specification: ::Gem::Specification, shell: Open3
|
10
11
|
@specification = specification
|
data/lib/gemsmith/cli.rb
CHANGED
@@ -4,12 +4,14 @@ require "yaml"
|
|
4
4
|
require "thor"
|
5
5
|
require "thor/actions"
|
6
6
|
require "thor_plus/actions"
|
7
|
-
require "refinements/string_extensions"
|
8
7
|
require "gemsmith/aids/gem_spec"
|
9
8
|
require "gemsmith/aids/git"
|
10
9
|
require "gemsmith/aids/spec"
|
11
10
|
require "gemsmith/errors/base"
|
11
|
+
require "gemsmith/errors/requirement_conversion"
|
12
|
+
require "gemsmith/errors/requirement_operator"
|
12
13
|
require "gemsmith/errors/specification"
|
14
|
+
require "gemsmith/gem/requirement"
|
13
15
|
require "gemsmith/skeletons/base_skeleton"
|
14
16
|
require "gemsmith/skeletons/bundler_skeleton"
|
15
17
|
require "gemsmith/skeletons/cli_skeleton"
|
@@ -35,7 +37,6 @@ module Gemsmith
|
|
35
37
|
include Thor::Actions
|
36
38
|
include ThorPlus::Actions
|
37
39
|
include CLIHelpers
|
38
|
-
using Refinements::StringExtensions
|
39
40
|
|
40
41
|
package_name Gemsmith::Identity.version_label
|
41
42
|
|
@@ -164,7 +165,7 @@ module Gemsmith
|
|
164
165
|
attr_reader :configuration, :gem_spec
|
165
166
|
|
166
167
|
def setup_configuration name, options
|
167
|
-
@configuration = Configuration.new gem_name: name
|
168
|
+
@configuration = Configuration.new gem_name: name, gem_class: name
|
168
169
|
options.each { |key, value| configuration.public_send "create_#{key}=", value }
|
169
170
|
end
|
170
171
|
end
|
data/lib/gemsmith/cli_helpers.rb
CHANGED
@@ -31,10 +31,12 @@ module Gemsmith
|
|
31
31
|
gem_spec.find name, gems[answer.to_i - 1].version.version
|
32
32
|
else
|
33
33
|
error "Invalid option: #{answer}"
|
34
|
+
nil
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
38
|
def open_gem specification, method
|
39
|
+
return unless specification
|
38
40
|
spec = gem_spec.new specification.spec_file
|
39
41
|
spec.public_send method
|
40
42
|
end
|
@@ -42,14 +44,13 @@ module Gemsmith
|
|
42
44
|
def process_gem name, method
|
43
45
|
specs = gem_spec.find_all name
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
error("Unable to find gem: #{name}.") && ""
|
47
|
+
if specs.size == 1
|
48
|
+
open_gem specs.first, method
|
49
|
+
elsif specs.size > 1
|
50
|
+
print_gems specs
|
51
|
+
open_gem pick_gem(specs, name), method
|
52
|
+
else
|
53
|
+
error("Unable to find gem: #{name}.") and ""
|
53
54
|
end
|
54
55
|
end
|
55
56
|
end
|
@@ -1,8 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "refinements/string_extensions"
|
4
|
+
|
3
5
|
module Gemsmith
|
4
6
|
# Default configuration for gem with support for custom settings.
|
5
7
|
class Configuration
|
8
|
+
using Refinements::StringExtensions
|
9
|
+
|
6
10
|
attr_reader :gem_name, :gem_class, :file_path
|
7
11
|
attr_writer :gem_platform, :gem_home_url, :gem_license, :gem_private_key, :gem_public_key, :author_name,
|
8
12
|
:author_email, :author_url, :organization_name, :organization_email, :organization_url,
|
@@ -15,8 +19,8 @@ module Gemsmith
|
|
15
19
|
git: Aids::Git,
|
16
20
|
file_path: File.join(ENV["HOME"], Identity.file_name)
|
17
21
|
|
18
|
-
@gem_name = gem_name
|
19
|
-
@gem_class = gem_class
|
22
|
+
@gem_name = gem_name.snakecase
|
23
|
+
@gem_class = gem_class.camelcase
|
20
24
|
@file_path = file_path
|
21
25
|
@git = git
|
22
26
|
@settings = load_settings
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "versionaire"
|
2
|
+
|
3
|
+
module Gemsmith
|
4
|
+
module Gem
|
5
|
+
# Defines a gem requirement. This is a partial, cleaner implementation of the RubyGems `Gem::Requirement` object.
|
6
|
+
class Requirement
|
7
|
+
def self.operators
|
8
|
+
[">", ">=", "=", "!=", "<", "<=", "~>"]
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.version_segments version
|
12
|
+
String(version).split(Versionaire::Version.delimiter).map(&:to_i)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.for object
|
16
|
+
case object
|
17
|
+
when String
|
18
|
+
operator, version = object.split " "
|
19
|
+
new operator: operator, raw_version: version
|
20
|
+
else
|
21
|
+
fail Errors::RequirementConversion, %(Invalid string conversion. Use: "<operator> <version>".)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_reader :operator, :raw_version, :version_segments, :version
|
26
|
+
|
27
|
+
def initialize operator: ">=", raw_version: "0"
|
28
|
+
@operator = operator
|
29
|
+
@raw_version = raw_version
|
30
|
+
@version_segments = self.class.version_segments raw_version
|
31
|
+
@version = Versionaire::Version version_segments
|
32
|
+
validate!
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_s
|
36
|
+
"#{operator} #{version}"
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def validate!
|
42
|
+
return true if self.class.operators.include?(operator)
|
43
|
+
fail Errors::RequirementOperator, %(Invalid gem requirement operator. Use: #{self.class.operators.join ", "}.)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/gemsmith/identity.rb
CHANGED
@@ -30,7 +30,7 @@ module Gemsmith
|
|
30
30
|
|
31
31
|
def configure_rakefile
|
32
32
|
return if default_tasks.empty?
|
33
|
-
cli.append_to_file "%gem_name%/Rakefile", %(\ntask default: %w
|
33
|
+
cli.append_to_file "%gem_name%/Rakefile", %(\ntask default: %w[#{default_tasks.join(" ")}]\n)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["<%= config.dig(:author, :name) %>"]
|
9
9
|
spec.email = ["<%= config.dig(:author, :email) %>"]
|
10
10
|
spec.homepage = "<%= config.dig(:gem, :home_url) %>"
|
11
|
-
spec.summary = "
|
12
|
-
spec.description = "
|
11
|
+
spec.summary = ""
|
12
|
+
spec.description = ""
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
<%- if config.dig(:create, :security) -%>
|
@@ -21,21 +21,18 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
<%- if config.dig(:create, :cli) -%>
|
23
23
|
spec.add_dependency "thor", "~> 0.19"
|
24
|
-
spec.add_dependency "thor_plus", "~> 3.
|
24
|
+
spec.add_dependency "thor_plus", "~> 3.1"
|
25
25
|
<%- end -%>
|
26
26
|
<%- if config.dig(:create, :rails) -%>
|
27
27
|
spec.add_dependency "rails", "~> <%= config.dig(:versions, :rails) %>"
|
28
28
|
<%- end -%>
|
29
|
-
spec.add_development_dependency "bundler", "~> 1.
|
30
|
-
spec.add_development_dependency "rake", "~>
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
30
|
+
spec.add_development_dependency "rake", "~> 11.0"
|
31
31
|
spec.add_development_dependency "gemsmith", "~> <%= Gemsmith::Identity.version[/\d{1}\.\d{1}/] %>"
|
32
32
|
<%- if config.dig(:create, :pry) -%>
|
33
33
|
spec.add_development_dependency "pry"
|
34
34
|
spec.add_development_dependency "pry-byebug"
|
35
|
-
spec.add_development_dependency "pry-remote"
|
36
35
|
spec.add_development_dependency "pry-state"
|
37
|
-
spec.add_development_dependency "pry-rescue"
|
38
|
-
spec.add_development_dependency "pry-stack_explorer"
|
39
36
|
<%- end -%>
|
40
37
|
<%- if config.dig(:create, :rspec) -%>
|
41
38
|
spec.add_development_dependency "<%= config.dig(:create, :rails) ? "rspec-rails" : "rspec" %>", "~> 3.4"
|
@@ -47,7 +44,7 @@ Gem::Specification.new do |spec|
|
|
47
44
|
spec.add_development_dependency "terminal-notifier-guard"
|
48
45
|
<%- end -%>
|
49
46
|
<%- if config.dig(:create, :rubocop) -%>
|
50
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
47
|
+
spec.add_development_dependency "rubocop", "~> 0.40"
|
51
48
|
<%- end -%>
|
52
49
|
<%- if config.dig(:create, :code_climate) -%>
|
53
50
|
spec.add_development_dependency "codeclimate-test-reporter"
|
@@ -19,20 +19,20 @@ module <%= config.dig(:gem, :class) %>
|
|
19
19
|
<%- if config.dig(:create, :cli) -%>
|
20
20
|
|
21
21
|
desc "-e, [--edit]", "Edit gem settings in default editor."
|
22
|
-
map %w
|
22
|
+
map %w[-e --edit] => :edit
|
23
23
|
def edit
|
24
24
|
`#{editor} $HOME/#{<%= config.dig(:gem, :class) %>::Identity.file_name}`
|
25
25
|
end
|
26
26
|
<%- end -%>
|
27
27
|
|
28
28
|
desc "-v, [--version]", "Show gem version."
|
29
|
-
map %w
|
29
|
+
map %w[-v --version] => :version
|
30
30
|
def version
|
31
31
|
say <%= config.dig(:gem, :class) %>::Identity.version_label
|
32
32
|
end
|
33
33
|
|
34
34
|
desc "-h, [--help=HELP]", "Show this message or get help for a command."
|
35
|
-
map %w
|
35
|
+
map %w[-h --help] => :help
|
36
36
|
def help task = nil
|
37
37
|
say and super
|
38
38
|
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.7.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-05-15 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: thor
|
@@ -60,6 +60,20 @@ dependencies:
|
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '3.0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: versionaire
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.2'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.2'
|
63
77
|
- !ruby/object:Gem::Dependency
|
64
78
|
name: refinements
|
65
79
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,28 +122,28 @@ dependencies:
|
|
108
122
|
requirements:
|
109
123
|
- - "~>"
|
110
124
|
- !ruby/object:Gem::Version
|
111
|
-
version: '1.
|
125
|
+
version: '1.12'
|
112
126
|
type: :development
|
113
127
|
prerelease: false
|
114
128
|
version_requirements: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
130
|
- - "~>"
|
117
131
|
- !ruby/object:Gem::Version
|
118
|
-
version: '1.
|
132
|
+
version: '1.12'
|
119
133
|
- !ruby/object:Gem::Dependency
|
120
134
|
name: rake
|
121
135
|
requirement: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
137
|
- - "~>"
|
124
138
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
139
|
+
version: '11.0'
|
126
140
|
type: :development
|
127
141
|
prerelease: false
|
128
142
|
version_requirements: !ruby/object:Gem::Requirement
|
129
143
|
requirements:
|
130
144
|
- - "~>"
|
131
145
|
- !ruby/object:Gem::Version
|
132
|
-
version: '
|
146
|
+
version: '11.0'
|
133
147
|
- !ruby/object:Gem::Dependency
|
134
148
|
name: pry
|
135
149
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,20 +172,6 @@ dependencies:
|
|
158
172
|
- - ">="
|
159
173
|
- !ruby/object:Gem::Version
|
160
174
|
version: '0'
|
161
|
-
- !ruby/object:Gem::Dependency
|
162
|
-
name: pry-remote
|
163
|
-
requirement: !ruby/object:Gem::Requirement
|
164
|
-
requirements:
|
165
|
-
- - ">="
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
version: '0'
|
168
|
-
type: :development
|
169
|
-
prerelease: false
|
170
|
-
version_requirements: !ruby/object:Gem::Requirement
|
171
|
-
requirements:
|
172
|
-
- - ">="
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
version: '0'
|
175
175
|
- !ruby/object:Gem::Dependency
|
176
176
|
name: pry-state
|
177
177
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,34 +186,6 @@ dependencies:
|
|
186
186
|
- - ">="
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
|
-
- !ruby/object:Gem::Dependency
|
190
|
-
name: pry-rescue
|
191
|
-
requirement: !ruby/object:Gem::Requirement
|
192
|
-
requirements:
|
193
|
-
- - ">="
|
194
|
-
- !ruby/object:Gem::Version
|
195
|
-
version: '0'
|
196
|
-
type: :development
|
197
|
-
prerelease: false
|
198
|
-
version_requirements: !ruby/object:Gem::Requirement
|
199
|
-
requirements:
|
200
|
-
- - ">="
|
201
|
-
- !ruby/object:Gem::Version
|
202
|
-
version: '0'
|
203
|
-
- !ruby/object:Gem::Dependency
|
204
|
-
name: pry-stack_explorer
|
205
|
-
requirement: !ruby/object:Gem::Requirement
|
206
|
-
requirements:
|
207
|
-
- - ">="
|
208
|
-
- !ruby/object:Gem::Version
|
209
|
-
version: '0'
|
210
|
-
type: :development
|
211
|
-
prerelease: false
|
212
|
-
version_requirements: !ruby/object:Gem::Requirement
|
213
|
-
requirements:
|
214
|
-
- - ">="
|
215
|
-
- !ruby/object:Gem::Version
|
216
|
-
version: '0'
|
217
189
|
- !ruby/object:Gem::Dependency
|
218
190
|
name: bond
|
219
191
|
requirement: !ruby/object:Gem::Requirement
|
@@ -360,14 +332,14 @@ dependencies:
|
|
360
332
|
requirements:
|
361
333
|
- - "~>"
|
362
334
|
- !ruby/object:Gem::Version
|
363
|
-
version: '0.
|
335
|
+
version: '0.40'
|
364
336
|
type: :development
|
365
337
|
prerelease: false
|
366
338
|
version_requirements: !ruby/object:Gem::Requirement
|
367
339
|
requirements:
|
368
340
|
- - "~>"
|
369
341
|
- !ruby/object:Gem::Version
|
370
|
-
version: '0.
|
342
|
+
version: '0.40'
|
371
343
|
- !ruby/object:Gem::Dependency
|
372
344
|
name: codeclimate-test-reporter
|
373
345
|
requirement: !ruby/object:Gem::Requirement
|
@@ -406,7 +378,10 @@ files:
|
|
406
378
|
- lib/gemsmith/configuration.rb
|
407
379
|
- lib/gemsmith/credentials.rb
|
408
380
|
- lib/gemsmith/errors/base.rb
|
381
|
+
- lib/gemsmith/errors/requirement_conversion.rb
|
382
|
+
- lib/gemsmith/errors/requirement_operator.rb
|
409
383
|
- lib/gemsmith/errors/specification.rb
|
384
|
+
- lib/gemsmith/gem/requirement.rb
|
410
385
|
- lib/gemsmith/identity.rb
|
411
386
|
- lib/gemsmith/rake/build.rb
|
412
387
|
- lib/gemsmith/rake/release.rb
|
@@ -486,7 +461,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
486
461
|
version: '0'
|
487
462
|
requirements: []
|
488
463
|
rubyforge_project:
|
489
|
-
rubygems_version: 2.6.
|
464
|
+
rubygems_version: 2.6.4
|
490
465
|
signing_key:
|
491
466
|
specification_version: 4
|
492
467
|
summary: A command line interface for smithing new Ruby gems.
|
metadata.gz.sig
CHANGED
Binary file
|