foobara-command-generator 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2404c881758c41df5445bb64e53be2ed40295a85df5e2adb6c06d87ea39613f4
4
- data.tar.gz: 76a557b58e9a04f7c20f8e7e6414580f75c0a743a03f60f8247882c0e0a6267a
3
+ metadata.gz: fd7a9da8eceb4b9faea8aff2945db3526d52169d42ad71b1d701d36373d1110e
4
+ data.tar.gz: 640789c6673de3266aaf79e308c3d85cc05f96c2c8119a9a50d20e30928cd6fe
5
5
  SHA512:
6
- metadata.gz: c704d332a365c16ff42f0cb64fa84cd51eb9ec5020cb9286750fe1442db87d21e214dd0456cd0f56c79a2ddaacdc5ab430106e1aa47b7264a0d3c1f19b76b873
7
- data.tar.gz: 1ba4bc03a8147f04b2e0c5d10e248a3650a7df507972570a931be49cef20db4e61e207db3f00b89feaddf51d7e06f277a949d0754d337891d8ecbf06279dee04
6
+ metadata.gz: 0f843529fb85add636474d61a9945e824eae00189f1ecf4e040e34c2be6477e55a0f2d522cd33f0a9323d39f1658cf06c53e0224698cd0604b692e6d37d12cc5
7
+ data.tar.gz: f2e8cbcf97dfb5fe28877fdd275cf20a6c9fe921be4f14cbc537b02112c83a5bdd3bafba1a6ffa0943561a4965c3618c875ff337e85f254fcbc193ce9ea1e618
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.3]
2
+
3
+ - Bump Ruby to 3.4.1
4
+
5
+ ## [0.0.2]
6
+
7
+ - Include templates in gem
8
+
1
9
  ## [0.0.1]
2
10
 
3
11
  - Add Apache-2.0 license
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-MIT.txt) for more info about licensing.
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.1
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: 2024-06-16 00:00:00.000000000 Z
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.2.2
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.4.10
84
- signing_key:
82
+ rubygems_version: 3.6.2
85
83
  specification_version: 4
86
84
  summary: Generates Foobara commands
87
85
  test_files: []