foobara-command-generator 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/templates/spec/command_spec.rb.erb +16 -0
- data/templates/src/command.rb.erb +38 -0
- metadata +6 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd7a9da8eceb4b9faea8aff2945db3526d52169d42ad71b1d701d36373d1110e
|
4
|
+
data.tar.gz: 640789c6673de3266aaf79e308c3d85cc05f96c2c8119a9a50d20e30928cd6fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f843529fb85add636474d61a9945e824eae00189f1ecf4e040e34c2be6477e55a0f2d522cd33f0a9323d39f1658cf06c53e0224698cd0604b692e6d37d12cc5
|
7
|
+
data.tar.gz: f2e8cbcf97dfb5fe28877fdd275cf20a6c9fe921be4f14cbc537b02112c83a5bdd3bafba1a6ffa0943561a4965c3618c875ff337e85f254fcbc193ce9ea1e618
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -48,4 +48,4 @@ at https://github.com/[USERNAME]/foobara-command-generator.
|
|
48
48
|
## License
|
49
49
|
|
50
50
|
This project is licensed under your choice of the Apache-2.0 license or the MIT license.
|
51
|
-
See [LICENSE.txt](LICENSE
|
51
|
+
See [LICENSE.txt](LICENSE.txt) for more info about licensing.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
RSpec.describe <%= full_module_name %> do
|
2
|
+
let(:command) { described_class.new(inputs) }
|
3
|
+
let(:outcome) { command.run }
|
4
|
+
let(:result) { outcome.result }
|
5
|
+
let(:errors) { outcome.errors }
|
6
|
+
let(:errors_hash) { outcome.errors_hash }
|
7
|
+
|
8
|
+
let(:inputs) do
|
9
|
+
{ foo: "bar" }
|
10
|
+
end
|
11
|
+
|
12
|
+
it "is successful" do
|
13
|
+
expect(outcome).to be_success
|
14
|
+
expect(result).to eq("bar")
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<% module_path[..-2].each do |part| %>
|
2
|
+
module <%= part %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
class <%= module_path.last %> < Foobara::Command
|
6
|
+
# class SomeError < RuntimeError
|
7
|
+
# class << self
|
8
|
+
# def context_type_declaration
|
9
|
+
# { foo: :string }
|
10
|
+
# end
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
|
14
|
+
# possible_error SomeError
|
15
|
+
|
16
|
+
inputs do
|
17
|
+
foo :string, default: "bar"
|
18
|
+
end
|
19
|
+
|
20
|
+
result :string
|
21
|
+
|
22
|
+
# depends_on SomeOtherCommand
|
23
|
+
|
24
|
+
def execute
|
25
|
+
do_something
|
26
|
+
end
|
27
|
+
|
28
|
+
# def validate
|
29
|
+
# add_runtime_error SomeError.new(message: "kaboom", context: {foo: :bar})
|
30
|
+
# end
|
31
|
+
|
32
|
+
def do_something
|
33
|
+
foo
|
34
|
+
end
|
35
|
+
|
36
|
+
<% module_path.size.times do %>
|
37
|
+
end
|
38
|
+
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-command-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-06 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: foobara
|
@@ -38,7 +37,6 @@ dependencies:
|
|
38
37
|
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '0'
|
41
|
-
description:
|
42
40
|
email:
|
43
41
|
- azimux@gmail.com
|
44
42
|
executables: []
|
@@ -56,6 +54,8 @@ files:
|
|
56
54
|
- src/command_spec_generator.rb
|
57
55
|
- src/generate_command.rb
|
58
56
|
- src/write_command_to_disk.rb
|
57
|
+
- templates/spec/command_spec.rb.erb
|
58
|
+
- templates/src/command.rb.erb
|
59
59
|
homepage: https://github.com/foobara/generators-command-generator
|
60
60
|
licenses:
|
61
61
|
- Apache-2.0
|
@@ -65,7 +65,6 @@ metadata:
|
|
65
65
|
source_code_uri: https://github.com/foobara/generators-command-generator
|
66
66
|
changelog_uri: https://github.com/foobara/generators-command-generator/blob/main/CHANGELOG.md
|
67
67
|
rubygems_mfa_required: 'true'
|
68
|
-
post_install_message:
|
69
68
|
rdoc_options: []
|
70
69
|
require_paths:
|
71
70
|
- lib
|
@@ -73,15 +72,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
72
|
requirements:
|
74
73
|
- - ">="
|
75
74
|
- !ruby/object:Gem::Version
|
76
|
-
version: 3.
|
75
|
+
version: 3.4.0
|
77
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
77
|
requirements:
|
79
78
|
- - ">="
|
80
79
|
- !ruby/object:Gem::Version
|
81
80
|
version: '0'
|
82
81
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
84
|
-
signing_key:
|
82
|
+
rubygems_version: 3.6.2
|
85
83
|
specification_version: 4
|
86
84
|
summary: Generates Foobara commands
|
87
85
|
test_files: []
|