hanamismith 0.27.0 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/hanamismith.gemspec +1 -1
- data/lib/hanamismith/builders/slices/health.rb +59 -7
- data/lib/hanamismith/builders/slices/home.rb +18 -5
- data/lib/hanamismith/templates/%project_name%/config/slices/health.rb.erb +6 -0
- data/lib/hanamismith/templates/%project_name%/config/slices/home.rb.erb +6 -0
- data/lib/hanamismith/templates/%project_name%/package.json.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/slices/health/action.rb.erb +7 -0
- data/lib/hanamismith/templates/%project_name%/slices/health/actions/show.rb.erb +3 -7
- data/lib/hanamismith/templates/%project_name%/slices/health/templates/layouts/app.html.erb.erb +29 -0
- data/lib/hanamismith/templates/%project_name%/slices/health/templates/show.html.erb.erb +4 -0
- data/lib/hanamismith/templates/%project_name%/slices/health/view.rb.erb +7 -0
- data/lib/hanamismith/templates/%project_name%/slices/health/views/context.rb.erb +10 -0
- data/lib/hanamismith/templates/%project_name%/slices/health/views/show.rb.erb +8 -0
- data/lib/hanamismith/templates/%project_name%/slices/home/views/context.rb.erb +10 -0
- data/lib/hanamismith/templates/%project_name%/spec/slices/health/actions/show_spec.rb.erb +3 -4
- data.tar.gz.sig +0 -0
- metadata +12 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 303ac313b793f2daf1c8d4f10c7c535cc84252ef3e7ad4ac5f4186164a42a49d
|
4
|
+
data.tar.gz: 7f03c6a382cbc6288c7251c8e0884e2930d395e5bd36027927d2bed0c679ebe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29cf9ef5b980523ef755006094cf74b00cfb5f134cad28b1ba9cde99b1ab286710264e241d33cf8aea3f997312ad579dc14ee41ac79c3518faaf785034585a72
|
7
|
+
data.tar.gz: 0cc2ad8c022aea8271e01d4aeef3c9eec10d09ebf463d9a83a6d11dd7826349a4d7a06b50e974502dd5384918475a79ad76c1ec3b8af703fd5ef0fd3b971faff
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/hanamismith.gemspec
CHANGED
@@ -17,7 +17,7 @@ module Hanamismith
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def call
|
20
|
-
|
20
|
+
private_methods.grep(/\Aadd_/).sort.each { |method| __send__ method }
|
21
21
|
configuration
|
22
22
|
end
|
23
23
|
|
@@ -25,13 +25,65 @@ module Hanamismith
|
|
25
25
|
|
26
26
|
attr_reader :configuration, :builder
|
27
27
|
|
28
|
+
def add_configuration
|
29
|
+
path = "%project_name%/config/slices/health.rb.erb"
|
30
|
+
builder.call(configuration.merge(template_path: path)).render
|
31
|
+
end
|
32
|
+
|
28
33
|
def add_action
|
29
|
-
%
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
path = "%project_name%/slices/health/action.rb.erb"
|
35
|
+
builder.call(configuration.merge(template_path: path)).render
|
36
|
+
end
|
37
|
+
|
38
|
+
def add_view
|
39
|
+
path = "%project_name%/slices/health/view.rb.erb"
|
40
|
+
builder.call(configuration.merge(template_path: path)).render
|
41
|
+
end
|
42
|
+
|
43
|
+
def add_layout
|
44
|
+
path = "%project_name%/slices/health/templates/layouts/app.html.erb.erb"
|
45
|
+
builder.call(configuration.merge(template_path: path))
|
46
|
+
.render
|
47
|
+
.replace("<!-- title -->", "<%= content_for :title %>")
|
48
|
+
.replace("<!-- favicon -->", favicon)
|
49
|
+
.replace("<!-- yield -->", "<%= yield %>")
|
50
|
+
end
|
51
|
+
|
52
|
+
def favicon
|
53
|
+
%(<%= favicon_tag "icon.svg", title: "#{configuration.project_label}: Icon", rel: ) +
|
54
|
+
%(:icon, type: "image/svg+xml" %>)
|
55
|
+
end
|
56
|
+
|
57
|
+
def add_show_template
|
58
|
+
path = "%project_name%/slices/health/templates/show.html.erb.erb"
|
59
|
+
|
60
|
+
builder.call(configuration.merge(template_path: path))
|
61
|
+
.render
|
62
|
+
.replace(
|
63
|
+
"<!-- title -->",
|
64
|
+
%(<% content_for :title, "Health | #{configuration.project_label}" %>)
|
65
|
+
)
|
66
|
+
.replace("<!-- color -->", %(<%= color %>))
|
67
|
+
end
|
68
|
+
|
69
|
+
def add_context
|
70
|
+
path = "%project_name%/slices/health/views/context.rb.erb"
|
71
|
+
builder.call(configuration.merge(template_path: path)).render
|
72
|
+
end
|
73
|
+
|
74
|
+
def add_show_view
|
75
|
+
path = "%project_name%/slices/health/views/show.rb.erb"
|
76
|
+
builder.call(configuration.merge(template_path: path)).render
|
77
|
+
end
|
78
|
+
|
79
|
+
def add_show_action
|
80
|
+
path = "%project_name%/slices/health/actions/show.rb.erb"
|
81
|
+
builder.call(configuration.merge(template_path: path)).render
|
82
|
+
end
|
83
|
+
|
84
|
+
def add_show_action_spec
|
85
|
+
path = "%project_name%/spec/slices/health/actions/show_spec.rb.erb"
|
86
|
+
builder.call(configuration.merge(template_path: path)).render
|
35
87
|
end
|
36
88
|
end
|
37
89
|
end
|
@@ -25,6 +25,11 @@ module Hanamismith
|
|
25
25
|
|
26
26
|
attr_reader :configuration, :builder
|
27
27
|
|
28
|
+
def add_configuration
|
29
|
+
path = "%project_name%/config/slices/home.rb.erb"
|
30
|
+
builder.call(configuration.merge(template_path: path)).render
|
31
|
+
end
|
32
|
+
|
28
33
|
def add_action
|
29
34
|
path = "%project_name%/slices/home/action.rb.erb"
|
30
35
|
builder.call(configuration.merge(template_path: path)).render
|
@@ -52,17 +57,25 @@ module Hanamismith
|
|
52
57
|
end
|
53
58
|
|
54
59
|
def favicon
|
55
|
-
%(<%= favicon_tag "icon.svg"
|
56
|
-
%(:
|
60
|
+
%(<%= favicon_tag app_assets["icon.svg"],\n) +
|
61
|
+
%( title: "#{configuration.project_label}: Icon",\n) +
|
62
|
+
%( rel: :icon,\n) +
|
63
|
+
%( type: "image/svg+xml" %>)
|
57
64
|
end
|
58
65
|
|
59
66
|
def manifest
|
60
|
-
%(<%= tag.link title: "#{configuration.project_label}: Manifest"
|
61
|
-
%(:
|
67
|
+
%(<%= tag.link title: "#{configuration.project_label}: Manifest",\n) +
|
68
|
+
%( rel: :manifest,\n) +
|
69
|
+
%( href: app_assets["manifest.webmanifest"] %>)
|
62
70
|
end
|
63
71
|
|
64
72
|
def stylesheet
|
65
|
-
%(<%= stylesheet_tag "
|
73
|
+
%(<%= stylesheet_tag "app", title: "#{configuration.project_label}: Stylesheet" %>)
|
74
|
+
end
|
75
|
+
|
76
|
+
def add_context
|
77
|
+
path = "%project_name%/slices/home/views/context.rb.erb"
|
78
|
+
builder.call(configuration.merge(template_path: path)).render
|
66
79
|
end
|
67
80
|
|
68
81
|
def add_show_template
|
@@ -1,18 +1,14 @@
|
|
1
1
|
module Health
|
2
2
|
module Actions
|
3
3
|
# The show action.
|
4
|
-
class Show <
|
5
|
-
using <%= configuration.project_namespaced_class %>::Refines::Actions::Response
|
6
|
-
|
4
|
+
class Show < Health::Action
|
7
5
|
handle_exception Exception => :down
|
8
6
|
|
9
|
-
def handle(*, response) = response.
|
7
|
+
def handle(*, response) = response.render view, color: :green
|
10
8
|
|
11
9
|
private
|
12
10
|
|
13
|
-
def down(*, response, _exception) = response.
|
14
|
-
|
15
|
-
def body(color) = %(<html><body style="background-color: #{color}"></body></html>)
|
11
|
+
def down(*, response, _exception) = response.render view, color: :red, status: 503
|
16
12
|
end
|
17
13
|
end
|
18
14
|
end
|
data/lib/hanamismith/templates/%project_name%/slices/health/templates/layouts/app.html.erb.erb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
6
|
+
|
7
|
+
<title><!-- title --></title>
|
8
|
+
|
9
|
+
<meta charset="utf-8">
|
10
|
+
<meta name="description" content="A Hanamismith skeleton application.">
|
11
|
+
<meta name="author" content="Hanamismith">
|
12
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
13
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
14
|
+
|
15
|
+
<link title="<%= configuration.project_label %>: Favorite Icon"
|
16
|
+
rel="icon"
|
17
|
+
href="https://alchemists.io/images/projects/hanamismith/icons/favicon.ico"
|
18
|
+
sizes="32x32">
|
19
|
+
<!-- favicon -->
|
20
|
+
<link title="<%= configuration.project_label %>: Apple Icon"
|
21
|
+
rel="apple-touch-icon"
|
22
|
+
href="https://alchemists.io/images/projects/hanamismith/icons/apple.png"
|
23
|
+
type="image/png">
|
24
|
+
</head>
|
25
|
+
|
26
|
+
<body>
|
27
|
+
<!-- yield -->
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -4,10 +4,9 @@ RSpec.describe Health::Actions::Show do
|
|
4
4
|
subject(:action) { described_class.new }
|
5
5
|
|
6
6
|
describe "#call" do
|
7
|
-
it "answers
|
8
|
-
expect(action.call({})).to
|
9
|
-
|
10
|
-
status: 200
|
7
|
+
it "answers green background" do
|
8
|
+
expect(action.call({}).body.first).to include(
|
9
|
+
%(<main style="background-color: green; height: 100vh;">\n</main>)
|
11
10
|
)
|
12
11
|
end
|
13
12
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanamismith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-
|
38
|
+
date: 2024-02-17 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -295,12 +295,20 @@ files:
|
|
295
295
|
- lib/hanamismith/templates/%project_name%/config/puma.rb.erb
|
296
296
|
- lib/hanamismith/templates/%project_name%/config/routes.rb.erb
|
297
297
|
- lib/hanamismith/templates/%project_name%/config/settings.rb.erb
|
298
|
+
- lib/hanamismith/templates/%project_name%/config/slices/health.rb.erb
|
299
|
+
- lib/hanamismith/templates/%project_name%/config/slices/home.rb.erb
|
298
300
|
- lib/hanamismith/templates/%project_name%/env.development.erb
|
299
301
|
- lib/hanamismith/templates/%project_name%/env.test.erb
|
300
302
|
- lib/hanamismith/templates/%project_name%/lib/%project_path%/refines/actions/response.rb.erb
|
301
303
|
- lib/hanamismith/templates/%project_name%/lib/%project_path%/types.rb.erb
|
302
304
|
- lib/hanamismith/templates/%project_name%/package.json.erb
|
305
|
+
- lib/hanamismith/templates/%project_name%/slices/health/action.rb.erb
|
303
306
|
- lib/hanamismith/templates/%project_name%/slices/health/actions/show.rb.erb
|
307
|
+
- lib/hanamismith/templates/%project_name%/slices/health/templates/layouts/app.html.erb.erb
|
308
|
+
- lib/hanamismith/templates/%project_name%/slices/health/templates/show.html.erb.erb
|
309
|
+
- lib/hanamismith/templates/%project_name%/slices/health/view.rb.erb
|
310
|
+
- lib/hanamismith/templates/%project_name%/slices/health/views/context.rb.erb
|
311
|
+
- lib/hanamismith/templates/%project_name%/slices/health/views/show.rb.erb
|
304
312
|
- lib/hanamismith/templates/%project_name%/slices/home/action.rb.erb
|
305
313
|
- lib/hanamismith/templates/%project_name%/slices/home/actions/show.rb.erb
|
306
314
|
- lib/hanamismith/templates/%project_name%/slices/home/assets/css/app.css.erb
|
@@ -309,6 +317,7 @@ files:
|
|
309
317
|
- lib/hanamismith/templates/%project_name%/slices/home/templates/layouts/app.html.erb.erb
|
310
318
|
- lib/hanamismith/templates/%project_name%/slices/home/templates/show.html.erb.erb
|
311
319
|
- lib/hanamismith/templates/%project_name%/slices/home/view.rb.erb
|
320
|
+
- lib/hanamismith/templates/%project_name%/slices/home/views/context.rb.erb
|
312
321
|
- lib/hanamismith/templates/%project_name%/slices/home/views/show.rb.erb
|
313
322
|
- lib/hanamismith/templates/%project_name%/spec/hanami_helper.rb.erb
|
314
323
|
- lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
|
@@ -342,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
342
351
|
- !ruby/object:Gem::Version
|
343
352
|
version: '0'
|
344
353
|
requirements: []
|
345
|
-
rubygems_version: 3.5.
|
354
|
+
rubygems_version: 3.5.6
|
346
355
|
signing_key:
|
347
356
|
specification_version: 4
|
348
357
|
summary: A command line interface for smithing Hanami projects.
|
metadata.gz.sig
CHANGED
Binary file
|