tramway 2.3.1.3 → 2.3.1.4
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 +4 -4
- data/docs/AGENTS.md +10 -1
- data/lib/generators/tramway/install/install_generator.rb +13 -1
- data/lib/tramway/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20f2a11f56484a9763bbb712c8bbf2c09558d9ad098b886849ee87429e379a19
|
|
4
|
+
data.tar.gz: b5b9a13a2e084cd82fd09c9d4451c8cb2d59a4dd08198968eb8165d34a7dcfc0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0a2569b1767b5e8c7e65b88f03124c67e845ce2db8999574255e1353135770f06dfe932d3b4d3601ad9bd3bfd0573dc4f217b7e211c502a67414a0e757b3239
|
|
7
|
+
data.tar.gz: d6d354cef03905530fc1f959a5768e2682008b14a10a9b34d03a0065c7f07ed343eb3dac7e06c2a5d3a1136f3c149e8f81a62c360ace8c8a4bf7c5615b46b184
|
data/docs/AGENTS.md
CHANGED
|
@@ -103,6 +103,8 @@ Tramway.configure do |config|
|
|
|
103
103
|
end
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
If admin panel requested to be implemented from scratch, do the same with `namespace: :admin`
|
|
107
|
+
|
|
106
108
|
### Rule 2
|
|
107
109
|
Normalize input with `normalizes` (from Tramway) for attributes like email, phone, etc. Don't use `normalizes` in model unless it requested explicitly.
|
|
108
110
|
|
|
@@ -115,11 +117,18 @@ Use Tramway Navbar for navigation
|
|
|
115
117
|
### Rule 4
|
|
116
118
|
Use Tramway Flash for user notifications.
|
|
117
119
|
|
|
120
|
+
```
|
|
121
|
+
= tramway_flash text: flash[:notice], type: :hope
|
|
122
|
+
= tramway_flash text: 'Double check your data', type: :greed, class: 'mt-2', data: { turbo: 'false' }
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`type:` argument supports lantern colors.
|
|
126
|
+
|
|
118
127
|
### Rule 5
|
|
119
128
|
Use Tramway Table for tabular data display.
|
|
120
129
|
|
|
121
130
|
### Rule 6
|
|
122
|
-
Use Tramway Button for buttons.
|
|
131
|
+
Use Tramway Button for buttons. Always add a color of the button via `color:` or `type:` argument. `color:` argument support directs colors only: red, yellow, blue, etc. `type:` argument supports only lantern colors: will, hope, rage, etc.
|
|
123
132
|
|
|
124
133
|
### Rule 7
|
|
125
134
|
Use `tramway_form_for` instead `form_with`, `form_for`
|
|
@@ -71,7 +71,19 @@ module Tramway
|
|
|
71
71
|
response = Net::HTTP.get_response(uri)
|
|
72
72
|
body = response.body.to_s
|
|
73
73
|
body = body.dup.force_encoding(Encoding::UTF_8)
|
|
74
|
-
@agents_template_body =
|
|
74
|
+
@agents_template_body = sanitize_agents_template_body(
|
|
75
|
+
body.encode(Encoding::UTF_8, invalid: :replace, undef: :replace, replace: '')
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def sanitize_agents_template_body(content)
|
|
80
|
+
stripped_content = content.strip
|
|
81
|
+
section_pattern = /\A#{Regexp.escape(agents_section_start)}\s*\n?(.*?)\n?#{Regexp.escape(agents_section_end)}\s*\z/m # rubocop:disable Layout/LineLength
|
|
82
|
+
match = stripped_content.match(section_pattern)
|
|
83
|
+
|
|
84
|
+
return stripped_content unless match
|
|
85
|
+
|
|
86
|
+
match[1].to_s.strip
|
|
75
87
|
end
|
|
76
88
|
|
|
77
89
|
def agents_section_start
|
data/lib/tramway/version.rb
CHANGED