hanami-cli 2.0.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -0
- data/{.action_hero.yml → .repobot.yml} +1 -3
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +17 -0
- data/lib/hanami/cli/bundler.rb +5 -2
- data/lib/hanami/cli/commands/app/generate/action.rb +5 -2
- data/lib/hanami/cli/generators/gem/app/gitignore.erb +2 -0
- data/lib/hanami/cli/generators/gem/app.rb +1 -0
- data/lib/hanami/cli/naming.rb +25 -0
- data/lib/hanami/cli/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bcebd7bee28802b90462073bbc9def8c6f1c13b7fc032cc8f20859b082310a4
|
4
|
+
data.tar.gz: fd38025e1fa7a2b5c6650710e16076fefa8f8697a1b3bba3035eedaa9ce612b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdebf6ac07bfad66d9a7d37050ce6b91c7d29abc781c44807a0efdc8c7085db42ed7afcbf5b5b32f264213499e59d31754823a670eb43d71acee1be39dd0b5c2
|
7
|
+
data.tar.gz: 56a41e42c83896516b0b20d7aea8864743c9a96508fd520d226de683d59de612a85cd99e83f7ed50bf39cfa87564152afb903bbfdc6d4d8e48ed9eb1904705e1
|
data/.github/workflows/ci.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -8,6 +8,8 @@ Layout/LineLength:
|
|
8
8
|
Exclude:
|
9
9
|
- Gemfile
|
10
10
|
- 'spec/**/*.rb'
|
11
|
+
Lint/DuplicateBranch:
|
12
|
+
Enabled: false
|
11
13
|
Lint/EmptyFile:
|
12
14
|
Exclude:
|
13
15
|
- 'spec/fixtures/**/*.rb'
|
@@ -26,6 +28,8 @@ Style/CommentedKeyword:
|
|
26
28
|
Enabled: false
|
27
29
|
Style/EmptyHeredoc:
|
28
30
|
Enabled: false
|
31
|
+
Style/IdenticalConditionalBranches:
|
32
|
+
Enabled: false
|
29
33
|
Style/LambdaCall:
|
30
34
|
Enabled: false
|
31
35
|
Style/TrailingCommaInArguments:
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,23 @@
|
|
2
2
|
|
3
3
|
Hanami Command Line Interface
|
4
4
|
|
5
|
+
## v2.0.3 - 2023-02-01
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- [Luca Guidi] Generate a default `.gitignore` when using `hanami new`
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
- [dsisnero] Ensure to run automatically bundle gems when using `hanami new` on Windows
|
14
|
+
- [Luca Guidi] Ensure to generate the correct action identifier in routes when using `hanami generate action` with deeply nested action name
|
15
|
+
|
16
|
+
## v2.0.2 - 2022-12-25
|
17
|
+
|
18
|
+
### Added
|
19
|
+
|
20
|
+
- [Luca Guidi] Official support for Ruby 3.2
|
21
|
+
|
5
22
|
## v2.0.1 - 2022-12-06
|
6
23
|
|
7
24
|
### Fixed
|
data/lib/hanami/cli/bundler.rb
CHANGED
@@ -146,10 +146,13 @@ module Hanami
|
|
146
146
|
# @since 2.0.0
|
147
147
|
# @api private
|
148
148
|
def which(cmd)
|
149
|
+
exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
|
149
150
|
# Adapted from https://stackoverflow.com/a/5471032/498386
|
150
151
|
ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
|
151
|
-
|
152
|
-
|
152
|
+
exts.each do |ext|
|
153
|
+
exe = fs.join(path, "#{cmd}#{ext}")
|
154
|
+
return exe if fs.executable?(exe) && !fs.directory?(exe)
|
155
|
+
end
|
153
156
|
end
|
154
157
|
|
155
158
|
nil
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "dry/inflector"
|
4
4
|
require "dry/files"
|
5
5
|
require "shellwords"
|
6
|
+
require_relative "../../../naming"
|
6
7
|
require_relative "../../../errors"
|
7
8
|
|
8
9
|
module Hanami
|
@@ -48,7 +49,9 @@ module Hanami
|
|
48
49
|
# @since 2.0.0
|
49
50
|
# @api private
|
50
51
|
def initialize(fs: Hanami::CLI::Files.new, inflector: Dry::Inflector.new,
|
52
|
+
naming: Naming.new(inflector: inflector),
|
51
53
|
generator: Generators::App::Action.new(fs: fs, inflector: inflector), **)
|
54
|
+
@naming = naming
|
52
55
|
@generator = generator
|
53
56
|
super(fs: fs)
|
54
57
|
end
|
@@ -59,7 +62,7 @@ module Hanami
|
|
59
62
|
# @api private
|
60
63
|
def call(name:, url: nil, http: nil, format: DEFAULT_FORMAT, skip_view: DEFAULT_SKIP_VIEW, slice: nil, **)
|
61
64
|
slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
|
62
|
-
name =
|
65
|
+
name = naming.action_name(name)
|
63
66
|
*controller, action = name.split(ACTION_SEPARATOR)
|
64
67
|
|
65
68
|
if controller.empty?
|
@@ -73,7 +76,7 @@ module Hanami
|
|
73
76
|
|
74
77
|
private
|
75
78
|
|
76
|
-
attr_reader :generator
|
79
|
+
attr_reader :naming, :generator
|
77
80
|
end
|
78
81
|
end
|
79
82
|
end
|
@@ -34,6 +34,7 @@ module Hanami
|
|
34
34
|
attr_reader :inflector
|
35
35
|
|
36
36
|
def generate_app(app, context) # rubocop:disable Metrics/AbcSize
|
37
|
+
fs.write(".gitignore", t("gitignore.erb", context))
|
37
38
|
fs.write(".env", t("env.erb", context))
|
38
39
|
|
39
40
|
fs.write("README.md", t("readme.erb", context))
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shellwords"
|
4
|
+
|
5
|
+
module Hanami
|
6
|
+
module CLI
|
7
|
+
class Naming
|
8
|
+
def initialize(inflector:)
|
9
|
+
@inflector = inflector
|
10
|
+
end
|
11
|
+
|
12
|
+
def action_name(name)
|
13
|
+
inflector.underscore(escape(name)).gsub("/", ".")
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
attr_reader :inflector
|
19
|
+
|
20
|
+
def escape(name)
|
21
|
+
Shellwords.shellescape(name)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/hanami/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -168,10 +168,10 @@ executables:
|
|
168
168
|
extensions: []
|
169
169
|
extra_rdoc_files: []
|
170
170
|
files:
|
171
|
-
- ".action_hero.yml"
|
172
171
|
- ".github/FUNDING.yml"
|
173
172
|
- ".github/workflows/ci.yml"
|
174
173
|
- ".gitignore"
|
174
|
+
- ".repobot.yml"
|
175
175
|
- ".rspec"
|
176
176
|
- ".rubocop.yml"
|
177
177
|
- ".yardopts"
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- lib/hanami/cli/generators/gem/app/config_ru.erb
|
246
246
|
- lib/hanami/cli/generators/gem/app/env.erb
|
247
247
|
- lib/hanami/cli/generators/gem/app/gemfile.erb
|
248
|
+
- lib/hanami/cli/generators/gem/app/gitignore.erb
|
248
249
|
- lib/hanami/cli/generators/gem/app/keep.erb
|
249
250
|
- lib/hanami/cli/generators/gem/app/puma.erb
|
250
251
|
- lib/hanami/cli/generators/gem/app/rakefile.erb
|
@@ -255,6 +256,7 @@ files:
|
|
255
256
|
- lib/hanami/cli/generators/gem/app/validator.erb
|
256
257
|
- lib/hanami/cli/generators/version.rb
|
257
258
|
- lib/hanami/cli/middleware_stack_inspector.rb
|
259
|
+
- lib/hanami/cli/naming.rb
|
258
260
|
- lib/hanami/cli/rake_tasks.rb
|
259
261
|
- lib/hanami/cli/repl/core.rb
|
260
262
|
- lib/hanami/cli/repl/irb.rb
|
@@ -290,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
292
|
- !ruby/object:Gem::Version
|
291
293
|
version: '0'
|
292
294
|
requirements: []
|
293
|
-
rubygems_version: 3.
|
295
|
+
rubygems_version: 3.4.5
|
294
296
|
signing_key:
|
295
297
|
specification_version: 4
|
296
298
|
summary: Hanami CLI
|