gemsmith 7.5.0 → 7.6.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: b37d50dad74a5bfb96b4cccbe1acb2c9be2535f8
4
- data.tar.gz: 7348735afdb627d3fa112fa28c81b5a33864e986
3
+ metadata.gz: cd7fab7a9abe6523ebd810fd7f322076d7b5001c
4
+ data.tar.gz: 3fe24c73f469a6b228d2dbbd3523a33fafde2e06
5
5
  SHA512:
6
- metadata.gz: 5d85c62093136a1cd68961f51419a0a5ba757ae75646d0c619f666b1aad304dacf6bfab58fb7e35dac72d84d8ff840ccf68c318db31eec9fee5c786710f3a2b1
7
- data.tar.gz: 2d5958aee433222d02cbc9e3a060dcdfd1c5d2a0ea2f4e165112ac7afcc2b63eb9aef64703d28b989a94c4736c7087e4e13286f08107deee9ce5485a01fac781
6
+ metadata.gz: ac8a9dca013e5237cd25ee35e4179e42f7f2d7394c7bb7a73631feb56646822c7a14c3044bcd7f7c129053b7dfe8f2399681c147b572c6efa6ed62c124c4c77c
7
+ data.tar.gz: 8e5803a9915109e2927156b0ea3a773994a2865379981804f24ccdcfd16e10b82ae09f664fd2030e2be9a8c793f12846e9a80854dace0eae8865add9e98c8469
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -144,12 +144,12 @@ necessary.
144
144
  From the command line, type: `gemsmith --help`
145
145
 
146
146
  gemsmith -c, [--create=CREATE] # Create new gem. DEPRECATED (use --generate).
147
- gemsmith -e, [--edit] # Edit Gemsmith settings in default editor.
147
+ gemsmith -e, [--edit] # Edit gem settings in default editor.
148
148
  gemsmith -g, [--generate=GENERATE] # Generate new gem.
149
149
  gemsmith -h, [--help=HELP] # Show this message or get help for a command.
150
150
  gemsmith -o, [--open=OPEN] # Open a gem in default editor.
151
151
  gemsmith -r, [--read=READ] # Open a gem in default browser.
152
- gemsmith -v, [--version] # Show Gemsmith version.
152
+ gemsmith -v, [--version] # Show gem version.
153
153
 
154
154
  For more gem creation options, type: `gemsmith --help --generate`
155
155
 
data/lib/gemsmith/cli.rb CHANGED
@@ -4,7 +4,7 @@ require "yaml"
4
4
  require "thor"
5
5
  require "thor/actions"
6
6
  require "thor_plus/actions"
7
- require "gemsmith/aids/gem"
7
+ require "refinements/string_extensions"
8
8
  require "gemsmith/aids/gem_spec"
9
9
  require "gemsmith/aids/git"
10
10
  require "gemsmith/aids/spec"
@@ -35,6 +35,7 @@ module Gemsmith
35
35
  include Thor::Actions
36
36
  include ThorPlus::Actions
37
37
  include CLIHelpers
38
+ using Refinements::StringExtensions
38
39
 
39
40
  package_name Gemsmith::Identity.version_label
40
41
 
@@ -70,7 +71,7 @@ module Gemsmith
70
71
  end
71
72
 
72
73
  desc "-g, [--generate=GENERATE]", "Generate new gem."
73
- map %w(-g --generate) => :generate
74
+ map %w[-g --generate] => :generate
74
75
  method_option :cli, aliases: "-c", desc: "Add CLI support.", type: :boolean, default: false
75
76
  method_option :rails, aliases: "-r", desc: "Add Rails support.", type: :boolean, default: false
76
77
  method_option :security, aliases: "-S", desc: "Add security support.", type: :boolean, default: true
@@ -95,7 +96,7 @@ module Gemsmith
95
96
  end
96
97
 
97
98
  desc "-c, [--create=CREATE]", "Create new gem. DEPRECATED (use --generate)."
98
- map %w(-c --create) => :create
99
+ map %w[-c --create] => :create
99
100
  method_option :cli, aliases: "-c", desc: "Add CLI support.", type: :boolean, default: false
100
101
  method_option :rails, aliases: "-r", desc: "Add Rails support.", type: :boolean, default: false
101
102
  method_option :security, aliases: "-S", desc: "Add security support.", type: :boolean, default: true
@@ -121,14 +122,14 @@ module Gemsmith
121
122
  end
122
123
 
123
124
  desc "-o, [--open=OPEN]", "Open a gem in default editor."
124
- map %w(-o --open) => :open
125
+ map %w[-o --open] => :open
125
126
  def open name
126
127
  result = process_gem name, "open_gem"
127
128
  info("Opening: #{result}") unless result.nil? || result.empty?
128
129
  end
129
130
 
130
131
  desc "-r, [--read=READ]", "Open a gem in default browser."
131
- map %w(-r --read) => :read
132
+ map %w[-r --read] => :read
132
133
  def read name
133
134
  result = process_gem name, "open_homepage"
134
135
 
@@ -139,23 +140,23 @@ module Gemsmith
139
140
  end
140
141
  end
141
142
 
142
- desc "-e, [--edit]", "Edit #{Gemsmith::Identity.label} settings in default editor."
143
- map %w(-e --edit) => :edit
143
+ desc "-e, [--edit]", "Edit gem settings in default editor."
144
+ map %w[-e --edit] => :edit
144
145
  def edit
145
146
  info "Editing: #{configuration.file_path}..."
146
147
  `#{gem_spec.editor} #{configuration.file_path}`
147
148
  end
148
149
 
149
- desc "-v, [--version]", "Show #{Gemsmith::Identity.label} version."
150
- map %w(-v --version) => :version
150
+ desc "-v, [--version]", "Show gem version."
151
+ map %w[-v --version] => :version
151
152
  def version
152
153
  say Gemsmith::Identity.version_label
153
154
  end
154
155
 
155
156
  desc "-h, [--help=HELP]", "Show this message or get help for a command."
156
- map %w(-h --help) => :help
157
+ map %w[-h --help] => :help
157
158
  def help task = nil
158
- say && super
159
+ say and super
159
160
  end
160
161
 
161
162
  private
@@ -163,8 +164,7 @@ module Gemsmith
163
164
  attr_reader :configuration, :gem_spec
164
165
 
165
166
  def setup_configuration name, options
166
- gem = Aids::Gem.new name
167
- @configuration = Configuration.new gem_name: gem.name, gem_class: gem.klass
167
+ @configuration = Configuration.new gem_name: name.snakecase, gem_class: name.camelcase
168
168
  options.each { |key, value| configuration.public_send "create_#{key}=", value }
169
169
  end
170
170
  end
@@ -12,7 +12,7 @@ module Gemsmith
12
12
  end
13
13
 
14
14
  def self.version
15
- "7.5.0"
15
+ "7.6.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -7,6 +7,8 @@ AllCops:
7
7
  Rails:
8
8
  Enabled: true
9
9
  <%- end -%>
10
+ Style/AndOr:
11
+ EnforcedStyle: conditionals
10
12
  Style/CaseIndentation:
11
13
  IndentOneStep: true
12
14
  Style/MethodDefParentheses:
@@ -15,6 +17,10 @@ Style/NumericLiterals:
15
17
  Enabled: false
16
18
  Style/PercentLiteralDelimiters:
17
19
  PreferredDelimiters:
20
+ "%w": "[]"
21
+ "%W": "[]"
22
+ "%i": "[]"
23
+ "%I": "[]"
18
24
  "%r": "()"
19
25
  Style/SignalException:
20
26
  EnforcedStyle: semantic
@@ -18,14 +18,14 @@ module <%= config.dig(:gem, :class) %>
18
18
  end
19
19
  <%- if config.dig(:create, :cli) -%>
20
20
 
21
- desc "-e, [--edit]", "Edit #{<%= config.dig(:gem, :class) %>::Identity.label} settings in default editor."
21
+ desc "-e, [--edit]", "Edit gem settings in default editor."
22
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
- desc "-v, [--version]", "Show #{<%= config.dig(:gem, :class) %>::Identity.label} version."
28
+ desc "-v, [--version]", "Show gem version."
29
29
  map %w(-v --version) => :version
30
30
  def version
31
31
  say <%= config.dig(:gem, :class) %>::Identity.version_label
@@ -34,7 +34,7 @@ module <%= config.dig(:gem, :class) %>
34
34
  desc "-h, [--help=HELP]", "Show this message or get help for a command."
35
35
  map %w(-h --help) => :help
36
36
  def help task = nil
37
- say && super
37
+ say and super
38
38
  end
39
39
  end
40
40
  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.5.0
4
+ version: 7.6.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-04 00:00:00.000000000 Z
33
+ date: 2016-04-24 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: thor
@@ -60,34 +60,48 @@ dependencies:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
62
  version: '3.0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: refinements
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '2.2'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '2.2'
63
77
  - !ruby/object:Gem::Dependency
64
78
  name: tocer
65
79
  requirement: !ruby/object:Gem::Requirement
66
80
  requirements:
67
81
  - - "~>"
68
82
  - !ruby/object:Gem::Version
69
- version: '2.0'
83
+ version: '2.2'
70
84
  type: :runtime
71
85
  prerelease: false
72
86
  version_requirements: !ruby/object:Gem::Requirement
73
87
  requirements:
74
88
  - - "~>"
75
89
  - !ruby/object:Gem::Version
76
- version: '2.0'
90
+ version: '2.2'
77
91
  - !ruby/object:Gem::Dependency
78
92
  name: milestoner
79
93
  requirement: !ruby/object:Gem::Requirement
80
94
  requirements:
81
95
  - - "~>"
82
96
  - !ruby/object:Gem::Version
83
- version: '2.0'
97
+ version: '3.0'
84
98
  type: :runtime
85
99
  prerelease: false
86
100
  version_requirements: !ruby/object:Gem::Requirement
87
101
  requirements:
88
102
  - - "~>"
89
103
  - !ruby/object:Gem::Version
90
- version: '2.0'
104
+ version: '3.0'
91
105
  - !ruby/object:Gem::Dependency
92
106
  name: bundler
93
107
  requirement: !ruby/object:Gem::Requirement
@@ -346,14 +360,14 @@ dependencies:
346
360
  requirements:
347
361
  - - "~>"
348
362
  - !ruby/object:Gem::Version
349
- version: '0.37'
363
+ version: '0.39'
350
364
  type: :development
351
365
  prerelease: false
352
366
  version_requirements: !ruby/object:Gem::Requirement
353
367
  requirements:
354
368
  - - "~>"
355
369
  - !ruby/object:Gem::Version
356
- version: '0.37'
370
+ version: '0.39'
357
371
  - !ruby/object:Gem::Dependency
358
372
  name: codeclimate-test-reporter
359
373
  requirement: !ruby/object:Gem::Requirement
@@ -382,7 +396,6 @@ files:
382
396
  - README.md
383
397
  - bin/gemsmith
384
398
  - lib/gemsmith.rb
385
- - lib/gemsmith/aids/gem.rb
386
399
  - lib/gemsmith/aids/gem_spec.rb
387
400
  - lib/gemsmith/aids/git.rb
388
401
  - lib/gemsmith/aids/spec.rb
@@ -473,7 +486,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
486
  version: '0'
474
487
  requirements: []
475
488
  rubyforge_project:
476
- rubygems_version: 2.6.2
489
+ rubygems_version: 2.6.3
477
490
  signing_key:
478
491
  specification_version: 4
479
492
  summary: A command line interface for smithing new Ruby gems.
metadata.gz.sig CHANGED
Binary file
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gemsmith
4
- module Aids
5
- # Parses a raw string into a valid gem and/or class name which can be used to construct gem skeletons
6
- # and related Ruby objects.
7
- class Gem
8
- def initialize string = "unknown", util: Thor::Util
9
- @string = string
10
- @util = util
11
- end
12
-
13
- def name
14
- @name ||= util.snake_case(string).tr(" ", "_").tr "-", "_"
15
- end
16
-
17
- def klass
18
- @klass ||= util.camel_case name
19
- end
20
-
21
- private
22
-
23
- attr_reader :string, :util
24
- end
25
- end
26
- end