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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5de5b05b1753cdf48960fb5a7f8a98e63e42b95db21eda01d3f28a828d97b81f
4
- data.tar.gz: 8bb86b14f367b4874ca04d92bc81daab8566109ebeb86033bc6dacf3061000fb
3
+ metadata.gz: 20f2a11f56484a9763bbb712c8bbf2c09558d9ad098b886849ee87429e379a19
4
+ data.tar.gz: b5b9a13a2e084cd82fd09c9d4451c8cb2d59a4dd08198968eb8165d34a7dcfc0
5
5
  SHA512:
6
- metadata.gz: 45bbf5d2b75437f5b55f3df5c8a8041fb7cc1db11b8ce275277012c1aea3027587e114986cf9b0773fc0f72a0a5a26fbf8702dbd4fb4f2ae5375dfc9634d5841
7
- data.tar.gz: c9a4dcd50b189a79592ac6e50df049b8eb3ff33387644d0db2fc76672815197ae33d830025a2982c9f1064a97a2bae5ae2fcce6fddf30043e114ac3d8fa3eeac
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 = body.encode(Encoding::UTF_8, invalid: :replace, undef: :replace, replace: '')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '2.3.1.3'
4
+ VERSION = '2.3.1.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1.3
4
+ version: 2.3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme