hephaestus 0.0.2 → 0.1.1

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +12 -0
  4. data/README.md +6 -4
  5. data/bin/hephaestus +19 -6
  6. data/lib/hephaestus/app_builder.rb +7 -1
  7. data/lib/hephaestus/generators/base.rb +4 -0
  8. data/lib/hephaestus/generators/config_generator.rb +3 -3
  9. data/lib/hephaestus/generators/core_generator.rb +1 -2
  10. data/lib/hephaestus/generators/lib_generator.rb +5 -0
  11. data/lib/hephaestus/generators/sorbet_generator.rb +1 -0
  12. data/lib/hephaestus/version.rb +1 -1
  13. data/templates/.github/actions/setup/action.yml +1 -0
  14. data/templates/.github/workflows/automerge.yml +0 -1
  15. data/templates/.github/workflows/lint.yml +2 -0
  16. data/templates/.github/workflows/security.yml +2 -0
  17. data/templates/.vscode/settings.json +17 -17
  18. data/templates/app/lib/plug_app/middleware/tracing_attributes.rb +6 -1
  19. data/templates/config/initializers/environment.rb +1 -1
  20. data/templates/lib/plug_app/schemas/api/2023-03-06/components/schemas/yetto.json +167 -1
  21. data/templates/lib/plug_app/schemas/api/2023-03-06/openapi.json +3 -0
  22. data/templates/lib/plug_app/schemas/api/2023-03-06/paths/plug.json +4 -5
  23. data/templates/lib/plug_app/schemas/api/2023-03-06/paths/yetto/after_create_message.json +11 -1
  24. data/templates/lib/plug_app/schemas/api/2023-03-06/paths/yetto/after_create_plug_installation.json +10 -0
  25. data/templates/script/typecheck +2 -0
  26. data/templates/test/controllers/settings_controller_test.rb +1 -1
  27. data/templates/test/controllers/yetto_controller_test.rb +0 -1
  28. data/templates/test/support/api.rb +1 -1
  29. data/templates/test/support/rails.rb +6 -5
  30. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cfb5da6707ff5a508725681a93cee151823e06b0e25f385003241e8e67ba941
4
- data.tar.gz: d54d8a73305ab8c17a391cc6af11bf5af2d40307a456a762a0df134770a5e31c
3
+ metadata.gz: 91109351951b2ac1514f251751c9311dd55028f4fdcfa8e0140fc2c4efa014c9
4
+ data.tar.gz: 452d4065cdfb605092c41c5677e87b85fe4070c6b21d2c28d8cd4649cadbfbb4
5
5
  SHA512:
6
- metadata.gz: 42d578ae51c94944fc1cf155618180d321852eff0a3d2db61d342039217cbe6c69c146aa289144094b5332c11236aad919e0aa92de93a6180aa573d15b8d1068
7
- data.tar.gz: db73d6d9d19f13dfc22156231052c8bb87f5f5925a31a934e2e9e0ee71a39e0af2704072fb545d0b3aa44a2ea6b002ac8daf92a85801bc6817793a63b609ffd4
6
+ metadata.gz: 31f32e5f396ae5b519bde7f6c30b7b796ae26f0db150e6ed1717eb2aaf153079f1755b0d8da36312bb3e5c151f2c7534fbfcf81c8d9efcf11e6f7769b2a5f2cd
7
+ data.tar.gz: d1b3456db78f30e7d62c20731cd1fcb3925bc39e1e8653fff9a2bfa693b8b38db0a6c48fffc1df86d8417a50098a4f195570f63387f412ba22b4b88855d29507
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.2.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.1.1](https://github.com/yettoapp/hephaestus/tree/v0.1.1) (2023-03-15)
4
+
5
+ [Full Changelog](https://github.com/yettoapp/hephaestus/compare/v0.1.0...v0.1.1)
6
+
7
+ ## [v0.1.0](https://github.com/yettoapp/hephaestus/tree/v0.1.0) (2023-03-15)
8
+
9
+ [Full Changelog](https://github.com/yettoapp/hephaestus/compare/v0.0.2...v0.1.0)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Various updates [\#2](https://github.com/yettoapp/hephaestus/pull/2) ([gjtorikian](https://github.com/gjtorikian))
14
+
3
15
  ## [v0.0.2](https://github.com/yettoapp/hephaestus/tree/v0.0.2) (2023-03-01)
4
16
 
5
17
  [Full Changelog](https://github.com/yettoapp/hephaestus/compare/v0.0.1...v0.0.2)
data/README.md CHANGED
@@ -1,17 +1,19 @@
1
1
  # Hephaestus
2
2
 
3
- A plug template for Yetto.
3
+ A plug template for Yetto. Use this to quickly spin up new plugs with a set of defaults.
4
4
 
5
5
  ## Usage
6
6
 
7
7
  ```
8
- rails new plug-app --api -m hephaestus/template.rb
8
+ gem install hephaestus
9
+
10
+ hephaestus plug-app
9
11
  ```
10
12
 
11
- If you're working on updating this locally, you'll also probably want:
13
+ If you're working on updating this locally, you may also probably want:
12
14
 
13
15
  ```
14
- rm -rf plug-app && DEBUG=1 rails new plug-app --api -m hephaestus/template.rb
16
+ rm -rf plug-app && DEBUG=1 hephaestus/bin/hephaestus plug-app
15
17
  ```
16
18
 
17
19
  ## Acknowledgements
data/bin/hephaestus CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require 'pathname'
2
+ # frozen_string_literal: true
3
3
 
4
- source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
4
+ require "pathname"
5
+
6
+ source_path = (Pathname.new(__FILE__).dirname + "../lib").expand_path
5
7
  $LOAD_PATH << source_path
6
8
 
7
9
  activate_rails_version = ->(rails_version) do
@@ -10,7 +12,7 @@ activate_rails_version = ->(rails_version) do
10
12
  $LOAD_PATH.unshift(rails_path)
11
13
  end
12
14
 
13
- if str = ARGV.first
15
+ if (str = ARGV.first)
14
16
  str = str.b[/\A_(.*)_\z/, 1]
15
17
 
16
18
  if str && Gem::Version.correct?(str)
@@ -20,7 +22,7 @@ if str = ARGV.first
20
22
  begin
21
23
  activate_rails_version.call(rails_version)
22
24
  rescue Gem::GemNotFoundException
23
- abort "Hephaestus error: Unable to find Rails version #{rails_version}"
25
+ abort("Hephaestus error: Unable to find Rails version #{rails_version}")
24
26
  end
25
27
  else
26
28
  require "hephaestus/version"
@@ -38,13 +40,24 @@ if ARGV.empty?
38
40
  puts
39
41
  puts "See --help for more info"
40
42
  exit 0
41
- elsif ["-v", "--version"].include? ARGV[0]
43
+ elsif ["-v", "--version"].include?(ARGV[0])
42
44
  puts Hephaestus::VERSION
43
45
  exit 0
44
46
  end
45
47
 
48
+ path = ARGV.first
49
+ if File.exist?(path)
50
+ puts "The directory #{path} already exists."
51
+ exit 1
52
+ end
53
+
54
+ unless path.start_with?("plug-")
55
+ puts "The directory name must start with 'plug-'"
56
+ exit 1
57
+ end
58
+
46
59
  templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
47
- Hephaestus::AppGenerator.source_root templates_root
60
+ Hephaestus::AppGenerator.source_root(templates_root)
48
61
  Hephaestus::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
49
62
 
50
63
  ARGV.push("--minimal")
@@ -6,6 +6,7 @@ require "forwardable"
6
6
  module Hephaestus
7
7
  class AppBuilder < ::Rails::AppBuilder
8
8
  include Hephaestus::Actions
9
+
9
10
  extend Forwardable
10
11
 
11
12
  def readme
@@ -138,7 +139,8 @@ module Hephaestus
138
139
  end
139
140
 
140
141
  def replace_generic_variables
141
- replace_in_files(destination_root, "${APP}", app_name.titlecase)
142
+ replace_in_files(destination_root, "${APP}", short_appname.capitalize)
143
+ replace_in_files(destination_root, "${app}", short_appname.downcase)
142
144
  replace_in_files(destination_root, "PlugApp", app_name.underscore.camelcase)
143
145
  replace_in_files(destination_root, "plug-app", app_name.dasherize)
144
146
  replace_in_files(destination_root, "PLUG_APP", app_name.underscore.upcase)
@@ -147,6 +149,10 @@ module Hephaestus
147
149
 
148
150
  private
149
151
 
152
+ def short_appname
153
+ app_name.split("_").last
154
+ end
155
+
150
156
  def root_path
151
157
  @root_path ||= Pathname(__dir__).join("..", "..").expand_path
152
158
  end
@@ -37,6 +37,10 @@ module Hephaestus
37
37
  Rails.app_class.module_parent_name.demodulize.underscore.dasherize
38
38
  end
39
39
 
40
+ def short_appname
41
+ app_name.sub(/plug-/i, "")
42
+ end
43
+
40
44
  def empty_directory_with_keep_file(destination)
41
45
  empty_directory(destination, {})
42
46
  keep_file(destination)
@@ -35,10 +35,10 @@ module Hephaestus
35
35
 
36
36
  Rails.root.glob("app/lib/#{app_name.underscore}/middleware/*.{rb}").each { |file| require_relative file }
37
37
 
38
- config.middleware.insert(0, PlugEmail::Middleware::TracingAttributes)
39
- config.middleware.insert(0, PlugEmail::Middleware::MalformedRequest)
38
+ config.middleware.insert(0, PlugApp::Middleware::TracingAttributes)
39
+ config.middleware.insert(0, PlugApp::Middleware::MalformedRequest)
40
40
 
41
- config.middleware.use(PlugEmail::Middleware::OpenapiValidation)
41
+ config.middleware.use(PlugApp::Middleware::OpenapiValidation)
42
42
 
43
43
  GIT_SHA = %x(git rev-parse HEAD).chomp
44
44
  CONFIG
@@ -23,9 +23,8 @@ module Hephaestus
23
23
  end
24
24
 
25
25
  def libs
26
- bare_app_name = app_name.split("-").last
27
26
  copy_file("app/lib/body_parameter/yetto_parameters.rb", "app/lib/body_parameter/yetto_parameters.rb")
28
- copy_file("app/lib/constants/app.rb", "app/lib/constants/#{bare_app_name}.rb")
27
+ copy_file("app/lib/constants/app.rb", "app/lib/constants/#{app_name}.rb")
29
28
  copy_file("app/lib/headers/yetto.rb", "app/lib/headers/yetto.rb")
30
29
  copy_file("app/lib/path_parameter/yetto_parameters.rb", "app/lib/path_parameter/yetto_parameters.rb")
31
30
  directory("app/lib/plug_app", "app/lib/#{app_name.underscore}")
@@ -12,5 +12,10 @@ module Hephaestus
12
12
  def lib_tasks
13
13
  directory("lib/tasks", "lib/tasks")
14
14
  end
15
+
16
+ def plug_schema
17
+ copy_file("lib/plug_app/schemas/api/2023-03-06/paths/plug.json", "lib/#{app_name.underscore}/schemas/api/2023-03-06/paths/#{short_appname.underscore}.json")
18
+ remove_file("lib/#{app_name.underscore}/schemas/api/2023-03-06/paths/plug.json") # cleanup
19
+ end
15
20
  end
16
21
  end
@@ -9,6 +9,7 @@ module Hephaestus
9
9
  copy_file("sorbet/custom.rbi", "sorbet/custom.rbi")
10
10
  Bundler.with_unbundled_env do
11
11
  run("bundle exec tapioca init")
12
+ run("bundle exec tapioca require")
12
13
  run("script/typecheck --update")
13
14
  end
14
15
  end
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.0.2"
5
+ VERSION = "0.1.1"
6
6
  RAILS_VERSION = "~> 7.0.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
@@ -7,3 +7,4 @@ runs:
7
7
  - uses: ruby/setup-ruby@v1
8
8
  with:
9
9
  bundler-cache: true
10
+ rubygems: latest
@@ -22,7 +22,6 @@ jobs:
22
22
  # in test.yml due to a limitation in GitHub Actions
23
23
  # (services can only be defined per job)
24
24
  services:
25
- postgres:
26
25
  redis:
27
26
  # Docker Hub image name
28
27
  image: redis:6.2-alpine
@@ -16,6 +16,7 @@ jobs:
16
16
  - uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  bundler-cache: true
19
+ rubygems: latest
19
20
 
20
21
  - name: Rubocop
21
22
  run: bundle exec rake rubocop
@@ -29,6 +30,7 @@ jobs:
29
30
  - uses: ruby/setup-ruby@v1
30
31
  with:
31
32
  bundler-cache: true
33
+ rubygems: latest
32
34
 
33
35
  - name: Sorbet
34
36
  id: sorbet_tc
@@ -15,6 +15,7 @@ jobs:
15
15
  - uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  bundler-cache: true
18
+ rubygems: latest
18
19
 
19
20
  # Patch-level verification for bundler.
20
21
  - name: Run bundle-audit
@@ -29,6 +30,7 @@ jobs:
29
30
  - uses: ruby/setup-ruby@v1
30
31
  with:
31
32
  bundler-cache: true
33
+ rubygems: latest
32
34
 
33
35
  - name: brakeman report
34
36
  run: |
@@ -21,7 +21,6 @@
21
21
  "codeActions": true,
22
22
  "onTypeFormatting": true
23
23
  },
24
- "peacock.color": "#A700A0",
25
24
  "[javascript]": {
26
25
  "editor.codeActionsOnSave": {
27
26
  "source.fixAll.eslint": true
@@ -30,23 +29,24 @@
30
29
  "[ruby]": {
31
30
  "editor.defaultFormatter": "Shopify.ruby-lsp",
32
31
  },
32
+ "peacock.color": "#26FF9A",
33
33
  "workbench.colorCustomizations": {
34
- "activityBar.activeBackground": "#26FF9A",
35
- "activityBar.background": "#26FF9A",
36
- "activityBar.foreground": "#181818",
37
- "activityBar.inactiveForeground": "#18181899",
38
- "activityBarBadge.background": "#b7bf00",
34
+ "activityBar.activeBackground": "#59ffb2",
35
+ "activityBar.background": "#59ffb2",
36
+ "activityBar.foreground": "#15202b",
37
+ "activityBar.inactiveForeground": "#15202b99",
38
+ "activityBarBadge.background": "#c480ff",
39
39
  "activityBarBadge.foreground": "#15202b",
40
- "commandCenter.border": "#18181899",
41
- "sash.hoverBorder": "#26FF9A",
42
- "statusBar.background": "#59FFB4",
43
- "statusBar.foreground": "#181818",
44
- "statusBarItem.hoverBackground": "#26FF9A",
45
- "statusBarItem.remoteBackground": "#59FFB4",
46
- "statusBarItem.remoteForeground": "#181818",
47
- "titleBar.activeBackground": "#59FFB4",
48
- "titleBar.activeForeground": "#181818",
49
- "titleBar.inactiveBackground": "#59FFB499",
50
- "titleBar.inactiveForeground": "#18181899"
40
+ "commandCenter.border": "#15202b99",
41
+ "sash.hoverBorder": "#59ffb2",
42
+ "statusBar.background": "#26ff9a",
43
+ "statusBar.foreground": "#15202b",
44
+ "statusBarItem.hoverBackground": "#00f281",
45
+ "statusBarItem.remoteBackground": "#26ff9a",
46
+ "statusBarItem.remoteForeground": "#15202b",
47
+ "titleBar.activeBackground": "#26ff9a",
48
+ "titleBar.activeForeground": "#15202b",
49
+ "titleBar.inactiveBackground": "#26ff9a99",
50
+ "titleBar.inactiveForeground": "#15202b99"
51
51
  }
52
52
  }
@@ -13,6 +13,7 @@ module PlugApp
13
13
  attr_reader :app
14
14
 
15
15
  HTTP_REQUEST_BODY = "http.request.body"
16
+ PLUG_APP_PATH_PREFIX = "/${app}/"
16
17
 
17
18
  sig { params(app: T.untyped).void }
18
19
  def initialize(app)
@@ -35,7 +36,11 @@ module PlugApp
35
36
 
36
37
  def filtered_params(request)
37
38
  params = request.params
38
- @filterer.filter(params).to_json
39
+ if request.path.starts_with?(PLUG_APP_PATH_PREFIX)
40
+ {}
41
+ else
42
+ @filterer.filter(params)
43
+ end.to_json
39
44
  end
40
45
  end
41
46
  end
@@ -1,7 +1,7 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
- PLUG_APP_URL = ENV.fetch("PLUG_APP_URL", "yetto.email")
4
+ PLUG_APP_URL = ENV.fetch("PLUG_APP_URL", "")
5
5
 
6
6
  YETTO_URL = if Rails.env.production?
7
7
  "yetto.app"
@@ -1 +1,167 @@
1
- {}
1
+ {
2
+ "Create${APP}Message": {
3
+ "type": "object",
4
+ "required": [
5
+ "plug_installation",
6
+ "message",
7
+ "inbox"
8
+ ],
9
+ "properties": {
10
+ "plug_installation": {
11
+ "type": "object",
12
+ "required": [
13
+ "id",
14
+ "settings"
15
+ ],
16
+ "properties": {
17
+ "id": {
18
+ "type": "string",
19
+ "pattern": "^(?:pli)_[A-Z0-9]{26}$"
20
+ },
21
+ "settings": {
22
+ "type": "object",
23
+ "required": [],
24
+ "properties": {}
25
+ }
26
+ }
27
+ },
28
+ "inbox": {
29
+ "type": "object",
30
+ "required": [
31
+ "id",
32
+ "organization"
33
+ ],
34
+ "properties": {
35
+ "id": {
36
+ "type": "string",
37
+ "pattern": "^(?:ibx)_[A-Z0-9]{26}$"
38
+ },
39
+ "organization": {
40
+ "type": "object",
41
+ "required": [
42
+ "id",
43
+ "status"
44
+ ],
45
+ "properties": {
46
+ "id": {
47
+ "type": "string",
48
+ "pattern": "^(?:org)_[A-Z0-9]{26}$"
49
+ },
50
+ "status": {
51
+ "type": "string"
52
+ }
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "message": {
58
+ "type": "object",
59
+ "required": [
60
+ "id",
61
+ "conversation",
62
+ "text_content",
63
+ "metadata"
64
+ ],
65
+ "properties": {
66
+ "id": {
67
+ "type": "string",
68
+ "pattern": "^(?:msg)_[A-Z0-9]{26}$"
69
+ },
70
+ "text_content": {
71
+ "type": "string"
72
+ },
73
+ "metadata": {
74
+ "type": "object"
75
+ },
76
+ "conversation": {
77
+ "type": "object",
78
+ "required": [
79
+ "id",
80
+ "title",
81
+ "metadata"
82
+ ],
83
+ "properties": {
84
+ "id": {
85
+ "type": "string",
86
+ "pattern": "^(?:cnv)_[A-Z0-9]{26}$"
87
+ },
88
+ "title": {
89
+ "type": "string"
90
+ },
91
+ "metadata": {
92
+ "type": "object"
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ },
99
+ "additionalProperties": false
100
+ },
101
+ "Create${APP}": {
102
+ "type": "object",
103
+ "required": [
104
+ "plug_installation",
105
+ "organization",
106
+ "plug",
107
+ "inbox"
108
+ ],
109
+ "properties": {
110
+ "plug_installation": {
111
+ "type": "object",
112
+ "required": [
113
+ "id",
114
+ "settings"
115
+ ],
116
+ "properties": {
117
+ "id": {
118
+ "type": "string",
119
+ "pattern": "^(?:pli)_[A-Z0-9]{26}$"
120
+ },
121
+ "settings": {
122
+ "type": "object",
123
+ "required": [],
124
+ "properties": {}
125
+ }
126
+ }
127
+ },
128
+ "organization": {
129
+ "type": "object",
130
+ "required": [
131
+ "id"
132
+ ],
133
+ "properties": {
134
+ "id": {
135
+ "type": "string",
136
+ "pattern": "^(?:org)_[A-Z0-9]{26}$"
137
+ }
138
+ }
139
+ },
140
+ "plug": {
141
+ "type": "object",
142
+ "required": [
143
+ "id"
144
+ ],
145
+ "properties": {
146
+ "id": {
147
+ "type": "string",
148
+ "pattern": "^(?:plg)_[A-Z0-9]{26}$"
149
+ }
150
+ }
151
+ },
152
+ "inbox": {
153
+ "type": "object",
154
+ "required": [
155
+ "id"
156
+ ],
157
+ "properties": {
158
+ "id": {
159
+ "type": "string",
160
+ "pattern": "^(?:ibx)_[A-Z0-9]{26}$"
161
+ }
162
+ }
163
+ }
164
+ },
165
+ "additionalProperties": false
166
+ }
167
+ }
@@ -22,6 +22,9 @@
22
22
  },
23
23
  "/api/2023-03-06/after_create/message": {
24
24
  "$ref": "paths/yetto/after_create_message.json"
25
+ },
26
+ "/${app}/2023-03-06/{plugInstallationId}": {
27
+ "$ref": "paths/${app}.json"
25
28
  }
26
29
  }
27
30
  }
@@ -23,11 +23,10 @@
23
23
  "message": {
24
24
  "text_content": "Hello _World_",
25
25
  "is_public": true,
26
- "metadata": {
27
- "author": {
28
- "name": "John Doe"
29
- }
30
- }
26
+ "author": {
27
+ "name": "John Doe"
28
+ },
29
+ "metadata": {}
31
30
  },
32
31
  "creator": {
33
32
  "id": "usr_1234567890"
@@ -4,7 +4,17 @@
4
4
  "Yetto"
5
5
  ],
6
6
  "description": "After a message is created in Yetto, this delivers it.",
7
- "operationId": "Create a new email",
7
+ "operationId": "Create a new ${APP}",
8
+ "requestBody": {
9
+ "required": true,
10
+ "content": {
11
+ "application/json": {
12
+ "schema": {
13
+ "$ref": "../../components/schemas/yetto.json#/Create${APP}Message"
14
+ }
15
+ }
16
+ }
17
+ },
8
18
  "responses": {
9
19
  "204": {
10
20
  "description": "No Content",
@@ -5,6 +5,16 @@
5
5
  ],
6
6
  "description": "After a plug installation is created, this executes",
7
7
  "operationId": "Post a thing",
8
+ "requestBody": {
9
+ "required": true,
10
+ "content": {
11
+ "application/json": {
12
+ "schema": {
13
+ "$ref": "../../components/schemas/yetto.json#/Create${APP}"
14
+ }
15
+ }
16
+ }
17
+ },
8
18
  "responses": {
9
19
  "204": {
10
20
  "description": "No Content",
@@ -25,6 +25,8 @@ while [ "$1" != "" ]; do
25
25
  bin/tapioca todo
26
26
  ;;
27
27
  -v | --verify)
28
+ echo "Verify Sorbet types..."
29
+ bin/bundle exec srb tc
28
30
  echo "Verify gem RBIs are up-to-date ..."
29
31
  bin/tapioca gem --verify
30
32
  echo "Verify duplicates in shims ..."
@@ -22,6 +22,6 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest
22
22
  settings = settings_json["settings"]
23
23
 
24
24
  assert_equal "2023-03-06", settings_json["version"]
25
- assert_equal 3, settings.length
25
+ assert_equal 2, settings.length
26
26
  end
27
27
  end
@@ -14,7 +14,6 @@ class YettoControllerTest < ActionDispatch::IntegrationTest
14
14
  plug_installation: {
15
15
  id: @plug_installation_id,
16
16
  settings: {
17
- from_name: "it me",
18
17
  from_email: "new@from.company",
19
18
  reply_to_email: "new@from.company",
20
19
  },
@@ -60,7 +60,7 @@ module API
60
60
  end
61
61
 
62
62
  def prepend_plug_path(version, path)
63
- "/plug/#{version}#{path}"
63
+ "/${app}/#{version}#{path}"
64
64
  end
65
65
 
66
66
  def prepend_api_path(version, path)
@@ -26,12 +26,13 @@ module ActiveSupport
26
26
 
27
27
  def assert_expected_args(expected_args)
28
28
  lambda do |job_args_arr|
29
- expected_args.each do |expected_arg|
30
- key = expected_arg.first
31
- value = expected_arg.second
32
- expected_value = job_args_arr.first[key]
29
+ job_args_arr.first.each do |actual_args|
30
+ actual_key = actual_args.first
31
+ actual_value = actual_args.second
33
32
 
34
- assert_equal(expected_value, value)
33
+ expected_value = expected_args[actual_key]
34
+
35
+ assert_equal(expected_value, actual_value)
35
36
  end
36
37
  end
37
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hephaestus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-01 00:00:00.000000000 Z
11
+ date: 2023-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -215,14 +215,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
215
  requirements:
216
216
  - - ">="
217
217
  - !ruby/object:Gem::Version
218
- version: 3.1.1
218
+ version: 3.2.1
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  requirements:
221
221
  - - ">="
222
222
  - !ruby/object:Gem::Version
223
223
  version: 3.4.7
224
224
  requirements: []
225
- rubygems_version: 3.3.7
225
+ rubygems_version: 3.4.8
226
226
  signing_key:
227
227
  specification_version: 4
228
228
  summary: Generate a Rails app that can be used to create plugs for Yetto.