sun-sword 0.0.7 → 0.0.8

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: cacb6bceddaa9fb6ba8f8c3945e7155e4a2b14b69e6a186515f7a422f4ff6958
4
- data.tar.gz: 182bfdb83177b9d43275af6e81b2a41f7b2dcdd0d6755b91f35067f5cb50d6a4
3
+ metadata.gz: 57ff7c155c265ffc5fc09eeaf83bb95117fd84784be22e3848800b02698a1361
4
+ data.tar.gz: f7b68f4db59ea7fe20e2ff23e4ac293d6abc1ccda395bd991141646b535672cd
5
5
  SHA512:
6
- metadata.gz: 9cd45b713edd8e23fa0dabba54d60f3e7fb5c50726190d3b4a514f48392589fa27e04d49576e9173485c6ec22e17990cbded89dc30f72ff0fca11ceeeb38ca48
7
- data.tar.gz: 2917fc97426c914670bbd48da1cb9547f55918a2fb991bc2cd11580e9aaa5dfd24295f8f704ebf6658353b2dc2dcdcd4ffb7426a89b18f514382d4fab70be894
6
+ metadata.gz: eecc700498bed3cecda88d6efb27314786c63e437f2cd25879ed1d9390bfd3d360eece0964f5e8c78b962042f9ab4a1043eacdedc58bc9b90ed136a6e3b70e38
7
+ data.tar.gz: 21ca6c2fa65a0a2dff3b67ae8027ca0b5ec4b64595281347cc1c0f113155d4a871fdb8cbcbd59f1e520d00d3ebd26fd4467f8b70459f72212a5350461ee0bbdb
@@ -41,8 +41,9 @@ module SunSword
41
41
  @variable_subject = model_name.split('::').last.underscore.downcase
42
42
  @scope_path = resource_name.pluralize.underscore.downcase
43
43
  @scope_class = @scope_path.camelize
44
+ @scope_subject = @scope_path.singularize
44
45
  @model_class = model_name.camelize.constantize
45
- @subject_class = resource_name.camelize
46
+ @subject_class = @variable_subject.camelize
46
47
  @fields = contract_fields
47
48
  @form_fields = @controllers.form_fields
48
49
 
@@ -10,7 +10,7 @@ class <%= [@route_scope_class, @scope_class].reject { |c| c.empty? }.join("::")
10
10
  result = use_case.new(contract).result
11
11
  Dry::Matcher::ResultMatcher.call(result) do |matcher|
12
12
  matcher.success do |response|
13
- @<%= @scope_path %> = response
13
+ @<%= @variable_subject.pluralize %> = response
14
14
  render '<%= @route_scope_path %>/<%= @scope_path %>/index'
15
15
  end
16
16
  matcher.failure do |errors|
@@ -50,7 +50,7 @@ class <%= [@route_scope_class, @scope_class].reject { |c| c.empty? }.join("::")
50
50
  result = use_case.new(contract).result
51
51
  Dry::Matcher::ResultMatcher.call(result) do |matcher|
52
52
  matcher.success do |response|
53
- redirect_to <%= [@route_scope_path, @variable_subject].reject { |c| c.empty? }.join("_") %>_url(id: response.id), success: '<%= @subject_class %> was successfully created.'
53
+ redirect_to <%= [@route_scope_path, @scope_path.singularize].reject { |c| c.empty? }.join("_") %>_url(id: response.id), success: '<%= @subject_class %> was successfully created.'
54
54
  end
55
55
  matcher.failure do |errors|
56
56
  @<%= @variable_subject %> = build_form_errors(<%= @variable_subject %>_params, <%= @model_class %>.new, errors)
@@ -66,7 +66,7 @@ class <%= [@route_scope_class, @scope_class].reject { |c| c.empty? }.join("::")
66
66
  result = use_case.new(contract).result
67
67
  Dry::Matcher::ResultMatcher.call(result) do |matcher|
68
68
  matcher.success do |response|
69
- redirect_to <%= [@route_scope_path, @variable_subject].reject { |c| c.empty? }.join("_") %>_url(id: response.id), success: '<%= @subject_class %> was successfully updated.'
69
+ redirect_to <%= [@route_scope_path, @scope_path.singularize].reject { |c| c.empty? }.join("_") %>_url(id: response.id), success: '<%= @subject_class %> was successfully updated.'
70
70
  end
71
71
  matcher.failure do |errors|
72
72
  @<%= @variable_subject %> = build_form_errors(<%= @variable_subject %>_params, <%= @model_class %>.find(params[:id]), errors)
@@ -1 +1 @@
1
- <a data-remote="true" id="<%= [@route_scope_path, @scope_path].reject { |c| c.empty? }.join("_")%>" href="<%%=<%= [@route_scope_path, @scope_path].reject { |c| c.empty? }.join("_")%>_path %>#<%= [@route_scope_path, @scope_path].reject { |c| c.empty? }.join("_")%>" class="<%%= ['<%= [@route_scope_path, @scope_path].reject { |c| c.empty? }.join("_")%>_index'].include?("#{controller_name}_#{action_name}") ? "class-menu-active-link" : "class-menu-link" %>"><%= @variable_subject.titleize%></a>
1
+ <a data-remote="true" id="<%= [@route_scope_path, @scope_subject].reject { |c| c.empty? }.join("_")%>" href="<%%=<%= [@route_scope_path, @scope_path].reject { |c| c.empty? }.join("_")%>_path %>#<%= [@route_scope_path, @scope_path].reject { |c| c.empty? }.join("_")%>" class="<%%= ['<%= [@route_scope_path, @scope_path].reject { |c| c.empty? }.join("_")%>_index'].include?("#{controller_name}_#{action_name}") ? "class-menu-active-link" : "class-menu-link" %>"><%= @variable_subject.titleize%></a>
@@ -26,7 +26,7 @@
26
26
  </tr>
27
27
  </thead>
28
28
  <tbody class="divide-y bg-white">
29
- <%% @<%= @scope_path %>.response.each do |<%= @variable_subject %>| %>
29
+ <%% @<%= @variable_subject.pluralize %>.response.each do |<%= @variable_subject %>| %>
30
30
  <tr>
31
31
  <%@controllers.list_fields.each do |field| -%>
32
32
  <td class="class-td">
@@ -38,7 +38,7 @@
38
38
  </td>
39
39
  <%end-%>
40
40
  <td class="class-td text-center">
41
- <%%= render "components/link_action", key: "<%= [@route_scope_path, @variable_subject].reject { |c| c.empty? }.join("_") %>", value: <%= @variable_subject %>, actions: [:show, :edit, :destroy] %>
41
+ <%%= render "components/link_action", key: "<%= [@route_scope_path, @scope_subject].reject { |c| c.empty? }.join("_") %>", value: <%= @variable_subject %>, actions: [:show, :edit, :destroy] %>
42
42
  </td>
43
43
  </tr>
44
44
  <%% end %>
@@ -6,7 +6,7 @@
6
6
  <p class="mt-1 max-w-2xl text-sm leading-6 text-gray-500">Details info from <%= @subject_class %> .</p>
7
7
  </div>
8
8
  <div class="mt-4 sm:ml-16 sm:mt-0 sm:flex-none">
9
- <%%= render "components/link_action", key: "<%= [@route_scope_path, @variable_subject].reject { |c| c.empty? }.join("_") %>", value: @<%= @variable_subject %>, actions: [:edit, :destroy] %>
9
+ <%%= render "components/link_action", key: "<%= [@route_scope_path, @scope_subject].reject { |c| c.empty? }.join("_") %>", value: @<%= @variable_subject %>, actions: [:edit, :destroy] %>
10
10
  </div>
11
11
  </div>
12
12
  <div class="border-t border-gray-100">
@@ -20,7 +20,7 @@
20
20
  <div class="container px-5 py-2 mx-auto">
21
21
  <div class="flex flex-wrap -m-1 md:-m-2">
22
22
  <div class="flex flex-wrap w-1/1">
23
- <%%= [@<%=@variable_subject%>.<%=col%>].flatten.each do |asset| %>
23
+ <%% [@<%=@variable_subject%>.<%=col%>].flatten.each do |asset| %>
24
24
  <div class="w-1/3 p-1 md:p-2">
25
25
  <img alt="<%=col.titleize%>" class="block object-cover object-center w-100 rounded-lg" src="<%%= asset %>">
26
26
  </div>
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SunSword
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  public_constant :VERSION
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sun-sword
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - kotarominami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-23 00:00:00.000000000 Z
11
+ date: 2024-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler