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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd7fab7a9abe6523ebd810fd7f322076d7b5001c
4
- data.tar.gz: 3fe24c73f469a6b228d2dbbd3523a33fafde2e06
3
+ metadata.gz: 34971a7bf833e06948419177cf190d1f1418a05a
4
+ data.tar.gz: 03252013fd1be9ef11fde87968f293f61c52f867
5
5
  SHA512:
6
- metadata.gz: ac8a9dca013e5237cd25ee35e4179e42f7f2d7394c7bb7a73631feb56646822c7a14c3044bcd7f7c129053b7dfe8f2399681c147b572c6efa6ed62c124c4c77c
7
- data.tar.gz: 8e5803a9915109e2927156b0ea3a773994a2865379981804f24ccdcfd16e10b82ae09f664fd2030e2be9a8c793f12846e9a80854dace0eae8865add9e98c8469
6
+ metadata.gz: 7c4bcc823e16f4301cbfa7ace9ad5d40b1157ae59aaf3dee8b7f692dc84720d921f46f91fdc75f541e104e1b11b6493efecf5382d692e047ce83280225252d2e
7
+ data.tar.gz: 166745da9434736b4a8f0a7a7300297c37bd212501dbdfa37aff2f916730c8f0ca7c685fd1460d8b3bb7028d47b9aa1d95970c28c762663680b9f56c49731887
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,3 @@
1
- -A �񬰕����VB�O� ���ӷ+D{ m���I*�~�#�^+��$��Obc[v�.C�N��/�z�mԓ d��4�����?cU燂��č�o}J��N���yD��~:���V����|�Z2Gne�>�����
1
+ @.P#=�ܔ��W?H�泒G���yl��uǤ���b%%��FNmD����:~dHG�O����J����4���)��:�f��sۆ����g}V,ߛ�FR�j0�����]uÙ�),��4��Y�*^��ڙ��j�:��`�m�Z���<R�� 3S2D9,��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
@@ -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
@@ -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.snakecase, gem_class: name.camelcase
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
@@ -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
- case
46
- when specs.size == 1
47
- open_gem specs.first, method
48
- when specs.size > 1
49
- print_gems specs
50
- open_gem pick_gem(specs, name), method
51
- else
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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gemsmith
4
+ module Errors
5
+ # Thrown when attempting to convert (cast) a primitive to a gem requirement.
6
+ class RequirementConversion < Base
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gemsmith
4
+ module Errors
5
+ # Error class for gem requirement operator errors.
6
+ class RequirementOperator < Base
7
+ end
8
+ end
9
+ end
@@ -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
@@ -12,7 +12,7 @@ module Gemsmith
12
12
  end
13
13
 
14
14
  def self.version
15
- "7.6.0"
15
+ "7.7.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -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(#{default_tasks.join(" ")})\n)
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 = "TODO: Add gem summary here."
12
- spec.description = "TODO: Add gem description here."
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.0"
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.11"
30
- spec.add_development_dependency "rake", "~> 10.0"
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.37"
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(-e --edit) => :edit
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(-v --version) => :version
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(-h --help) => :help
35
+ map %w[-h --help] => :help
36
36
  def help task = nil
37
37
  say and super
38
38
  end
@@ -2,7 +2,4 @@
2
2
 
3
3
  require "pry"
4
4
  require "pry-byebug"
5
- require "pry-remote"
6
5
  require "pry-state"
7
- require "pry-rescue"
8
- require "pry-stack_explorer"
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.6.0
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-04-24 00:00:00.000000000 Z
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.11'
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.11'
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: '10.0'
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: '10.0'
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.39'
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.39'
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.3
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