rubysmith 1.2.0 → 1.3.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
  SHA256:
3
- metadata.gz: ca0d0b47912e86e319cbd81bd25af112fd467aeab79fcf408ab01ab1446f94b2
4
- data.tar.gz: c0e00e05dc16bf8976c497c48604ddb73c0b9bc6125b285bff89a137cd0b57fa
3
+ metadata.gz: 70dbc101555ee2f755af1202de17dd12c04bd5a427a483a3c2710bcedad4fdb5
4
+ data.tar.gz: 723ab4a9bee7cb81f5c46e5011704972922ec6c9d30e408b17935369a7034502
5
5
  SHA512:
6
- metadata.gz: bcb340f7987ff2b2c79f7c650c83c327e9e8e2dcf70bee01b529ce4a269bbb113b26b5df3f7df97eaeca86b8c953c1677be1501786711a1572a91ccc471553ed
7
- data.tar.gz: ed94f96e94d3cd4b72d3e60789a5a960fe537b61edb8ce23898a7406ca16db24ea762d0193e44121c91a4678e805c3a6b5381ca60da3715c30e7e037444a733f
6
+ metadata.gz: 4a735f251308fe224894d35cd6ec488fbb48296d2192371b1cefb7f0dfaaa2a4320cfeebcb91954c4ee6238ff35d3f962b9c5f59496d9c49a215bcbd6250c8bb
7
+ data.tar.gz: caa4eccf46c21ef081e46530ba780776895d9ee42b10fc87f2bcf43dd4e3ed5b99665a22f4eaf2490dafc44c22650ab67cd9507fa5af7c05202caa2d25bd2604
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -4,13 +4,6 @@
4
4
 
5
5
  = Rubysmith
6
6
 
7
- [link=http://badge.fury.io/rb/rubysmith]
8
- image::https://badge.fury.io/rb/rubysmith.svg[Gem Version]
9
- [link=https://www.alchemists.io/projects/code_quality]
10
- image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
11
- [link=https://circleci.com/gh/bkuhlmann/rubysmith]
12
- image::https://circleci.com/gh/bkuhlmann/rubysmith.svg?style=svg[Circle CI Status]
13
-
14
7
  Rubysmith is a command line interface for smithing Ruby projects.
15
8
 
16
9
  This gem is useful in situations in which you need something more sophisticated than a
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/strings"
3
4
  require "refinements/structs"
4
5
 
5
6
  module Rubysmith
6
7
  module Builders
7
8
  # Builds project skeleton core structure and minimum file support.
8
9
  class Core
10
+ using Refinements::Strings
9
11
  using Refinements::Structs
10
12
 
11
13
  def self.call(...) = new(...).call
@@ -21,18 +23,17 @@ module Rubysmith
21
23
  .replace(" require", "require")
22
24
  .replace(/ (?=(Zeit|loader|end))/, "")
23
25
  .replace("\n \n", "\n\n")
24
- .insert_before("module #{module_name}", "#{module_indent}# Main namespace.\n")
26
+ .insert_before("module #{module_name}", "#{indentation}# Main namespace.\n")
27
+ .replace("end\n end", " end\n end")
25
28
 
26
29
  configuration
27
30
  end
28
31
 
29
32
  private
30
33
 
31
- def module_indent = project_class.include?("::") ? " " : ""
34
+ def indentation = "".indent configuration.project_levels
32
35
 
33
- def module_name = project_class.split("::").last
34
-
35
- def project_class = configuration.project_class
36
+ def module_name = configuration.project_class.split("::").last
36
37
 
37
38
  attr_reader :configuration, :builder
38
39
  end
@@ -20,7 +20,7 @@ module Rubysmith
20
20
  end
21
21
 
22
22
  def call arguments = []
23
- client.banner = "Rubysmith - #{specification.summary}"
23
+ client.banner = specification.labeled_summary
24
24
  client.separator "\nUSAGE:\n"
25
25
  collate
26
26
  client.parse arguments
@@ -33,7 +33,7 @@ module Rubysmith
33
33
  in action_config: Symbol => action then config action
34
34
  in action_build: true then build configuration
35
35
  in action_publish: true then publish configuration
36
- in action_version: true then logger.info { "Rubysmith #{specification.version}" }
36
+ in action_version: true then logger.info { specification.labeled_version }
37
37
  else usage
38
38
  end
39
39
  end
@@ -111,14 +111,16 @@ module Rubysmith
111
111
 
112
112
  def license_label_version = [license_label, license_version].compress.join("-")
113
113
 
114
- def project_label = project_name.titleize
115
-
116
114
  def project_class = project_name.camelcase
117
115
 
118
- def project_root = target_root.join(project_name)
116
+ def project_label = project_name.titleize
117
+
118
+ def project_levels = project_class.split("::").size - 1
119
119
 
120
120
  def project_path = project_name.snakecase
121
121
 
122
+ def project_root = target_root.join(project_name)
123
+
122
124
  def computed_project_url_community = format_url(__method__)
123
125
 
124
126
  def computed_project_url_conduct = format_url(__method__)
@@ -3,16 +3,15 @@
3
3
  require "dry-container"
4
4
  require "logger"
5
5
  require "pastel"
6
+ require "spek"
6
7
 
7
8
  module Rubysmith
8
9
  # Provides a global gem container for injection into other objects.
9
10
  module Container
10
11
  extend Dry::Container::Mixin
11
12
 
12
- SPEC_PATH = "#{__dir__}/../../rubysmith.gemspec".freeze
13
-
14
13
  register(:configuration) { Configuration::Loader.call }
15
- register(:specification) { Gem::Specification.load SPEC_PATH }
14
+ register(:specification) { Spek::Loader.call "#{__dir__}/../../rubysmith.gemspec" }
16
15
  register(:colorizer) { Pastel.new enabled: $stdout.tty? }
17
16
  register(:kernel) { Kernel }
18
17
 
@@ -8,10 +8,10 @@ module Rubysmith
8
8
  class Namespace
9
9
  using Refinements::Strings
10
10
 
11
- def initialize namespace
11
+ def initialize namespace, delimiter: "::"
12
12
  @namespace = namespace
13
- @modules = namespace.split "::"
14
- @depth = namespace.scan("::").length
13
+ @modules = namespace.split delimiter
14
+ @depth = namespace.scan(delimiter).length
15
15
  end
16
16
 
17
17
  def call(content = nil) = "#{prefix}#{body content}#{suffix}"
@@ -1,8 +1,8 @@
1
1
  <% if configuration.build_zeitwerk %>
2
2
  require "zeitwerk"
3
- <% if configuration.project_path.include? "/" %>
3
+ <% if configuration.project_levels.positive? %>
4
4
  Zeitwerk::Loader.new.then do |loader|
5
- loader.push_dir "#{__dir__}/.."
5
+ loader.push_dir "#{__dir__}<%= Array.new(configuration.project_levels, "/..").join %>"
6
6
  loader.setup
7
7
  end
8
8
  <% else %>
data/rubysmith.gemspec CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "rubysmith"
5
- spec.version = "1.2.0"
6
- spec.platform = Gem::Platform::RUBY
5
+ spec.version = "1.3.0"
7
6
  spec.authors = ["Brooke Kuhlmann"]
8
7
  spec.email = ["brooke@alchemists.io"]
9
8
  spec.homepage = "https://github.com/bkuhlmann/rubysmith"
@@ -30,7 +29,8 @@ Gem::Specification.new do |spec|
30
29
  spec.add_dependency "pragmater", "~> 10.0"
31
30
  spec.add_dependency "refinements", "~> 9.1"
32
31
  spec.add_dependency "rubocop", "~> 1.25"
33
- spec.add_dependency "runcom", "~> 8.0"
32
+ spec.add_dependency "runcom", "~> 8.2"
33
+ spec.add_dependency "spek", "~> 0.0"
34
34
  spec.add_dependency "tocer", "~> 13.0"
35
35
  spec.add_dependency "zeitwerk", "~> 2.5"
36
36
 
@@ -38,5 +38,4 @@ Gem::Specification.new do |spec|
38
38
  spec.executables << "rubysmith"
39
39
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
40
40
  spec.files = Dir.glob ["*.gemspec", "lib/**/*"], File::FNM_DOTMATCH
41
- spec.require_paths = ["lib"]
42
41
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
29
  W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2022-01-23 00:00:00.000000000 Z
31
+ date: 2022-02-06 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dry-container
@@ -134,14 +134,28 @@ dependencies:
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '8.0'
137
+ version: '8.2'
138
138
  type: :runtime
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '8.0'
144
+ version: '8.2'
145
+ - !ruby/object:Gem::Dependency
146
+ name: spek
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.0'
152
+ type: :runtime
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '0.0'
145
159
  - !ruby/object:Gem::Dependency
146
160
  name: tocer
147
161
  requirement: !ruby/object:Gem::Requirement
@@ -283,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
297
  - !ruby/object:Gem::Version
284
298
  version: '0'
285
299
  requirements: []
286
- rubygems_version: 3.3.5
300
+ rubygems_version: 3.3.6
287
301
  signing_key:
288
302
  specification_version: 4
289
303
  summary: A command line interface for smithing Ruby projects.
metadata.gz.sig CHANGED
Binary file