slim-rails 3.6.3 → 4.0.0
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/CHANGELOG.md +21 -0
- data/README.md +2 -2
- data/lib/generators/slim/authentication/authentication_generator.rb +21 -0
- data/lib/generators/slim/authentication/templates/passwords/edit.html.slim +10 -0
- data/lib/generators/slim/authentication/templates/passwords/new.html.slim +8 -0
- data/lib/generators/slim/authentication/templates/sessions/new.html.slim +12 -0
- data/lib/slim-rails/version.rb +1 -1
- data/lib/slim-rails.rb +21 -0
- metadata +10 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af27b2590d96b6394a46f392188b8853e2f6099ea5e5c386a16f14106ce7631b
|
|
4
|
+
data.tar.gz: 1ef0c42346ad933e803a4eefb9bb23b37f267180f99cd2acba90753d20588c11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 17ddd58b1d67e04dc05787e4a4b89d3fcbaea1619320353a920ce4d9190eee8a3fbf95871bfe5f891a5f66634d8f0721ee7bda6073b825230956bb1df01679bc
|
|
7
|
+
data.tar.gz: dd051090b0259003607c0876df5d1fffb02230d7393391ba4ecc11ebf6870b5b51ced80d46c2cb721c6125acdbf78c9e58570866f5a8e392a9f0ed8580478112
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## 4.0.0 (December 11, 2025)
|
|
2
|
+
|
|
3
|
+
- Add support for Rails Annotations and CodeStatistics ([#206])
|
|
4
|
+
- Drop support for Ruby 2.7 and Rails older than 7 ([205])
|
|
5
|
+
- Add Rails 8.1 to CI Matrix ([#204])
|
|
6
|
+
|
|
7
|
+
## 3.7.0 (December 29, 2024)
|
|
8
|
+
|
|
9
|
+
- Support Rails 8.0 authentication generator ([#201])
|
|
10
|
+
- Update CI matrix for Rails 7.2 / 8.0 and Ruby 3.3 / 3.4 ([#197], [#200])
|
|
11
|
+
|
|
12
|
+
## 3.6.3 (October 24, 2023)
|
|
13
|
+
|
|
14
|
+
- Fix ActionView::SyntaxErrorInTemplate when scaffolding with namespace ([#193])
|
|
15
|
+
- Update CI matrix for Rails 7.1 ([#194])
|
|
16
|
+
|
|
17
|
+
## 3.6.2 (March 9, 2023)
|
|
18
|
+
|
|
19
|
+
- Update gemspec to be compatible with slim 5.1 ([#191])
|
|
20
|
+
- README: Separate out details from main things ([#190])
|
|
21
|
+
|
|
1
22
|
## 3.6.1 (February 14, 2023)
|
|
2
23
|
|
|
3
24
|
- Fix to avoid depending on the failed Slim 5.0.0 release ([#188])
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# slim-rails [](http://rubygems.org/gems/slim-rails) [](https://github.com/slim-template/slim-rails/actions/workflows/main.yml)
|
|
1
|
+
# slim-rails [](http://rubygems.org/gems/slim-rails) [](https://github.com/slim-template/slim-rails/actions/workflows/main.yml)
|
|
2
2
|
|
|
3
3
|
slim-rails provides Slim generators for Rails:
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ Every time you generate a controller or scaffold, you'll get Slim templates.
|
|
|
20
20
|
|
|
21
21
|
If you have existing `.erb` templates, check out our guide [How to convert your `.erb` templates to `.slim`](https://github.com/slim-template/slim/wiki/Template-Converters-ERB-to-SLIM) on how to achieve this.
|
|
22
22
|
|
|
23
|
-
This gem is [tested with Ruby on Rails
|
|
23
|
+
This gem is [tested with Ruby on Rails 7.0+](/.github/workflows/main.yml).
|
|
24
24
|
|
|
25
25
|
## History
|
|
26
26
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require "rails/generators/erb/authentication/authentication_generator"
|
|
2
|
+
|
|
3
|
+
module Slim
|
|
4
|
+
module Generators
|
|
5
|
+
class AuthenticationGenerator < Erb::Generators::AuthenticationGenerator
|
|
6
|
+
source_root File.expand_path(File.join("..", "templates"), __FILE__)
|
|
7
|
+
|
|
8
|
+
def create_files
|
|
9
|
+
template "sessions/new.html.slim", "app/views/sessions/new.html.slim"
|
|
10
|
+
template "passwords/new.html.slim", "app/views/passwords/new.html.slim"
|
|
11
|
+
template "passwords/edit.html.slim", "app/views/passwords/edit.html.slim"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
protected
|
|
15
|
+
|
|
16
|
+
def handler
|
|
17
|
+
:slim
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
h1 Update your password
|
|
2
|
+
|
|
3
|
+
= tag.div(flash[:alert], style: "color:red") if flash[:alert]
|
|
4
|
+
|
|
5
|
+
= form_with url: password_path(params[:token]), method: :put do |form|
|
|
6
|
+
= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72
|
|
7
|
+
br
|
|
8
|
+
= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72
|
|
9
|
+
br
|
|
10
|
+
= form.submit "Save"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
h1 Forgot your password?
|
|
2
|
+
|
|
3
|
+
= tag.div(flash[:alert], style: "color:red") if flash[:alert]
|
|
4
|
+
|
|
5
|
+
= form_with url: passwords_path do |form|
|
|
6
|
+
= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address]
|
|
7
|
+
br
|
|
8
|
+
= form.submit "Email reset instructions"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
= tag.div(flash[:alert], style: "color:red") if flash[:alert]
|
|
2
|
+
= tag.div(flash[:notice], style: "color:green") if flash[:notice]
|
|
3
|
+
|
|
4
|
+
= form_with url: session_path do |form|
|
|
5
|
+
= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address]
|
|
6
|
+
br
|
|
7
|
+
= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72
|
|
8
|
+
br
|
|
9
|
+
= form.submit "Sign in"
|
|
10
|
+
br
|
|
11
|
+
|
|
12
|
+
= link_to "Forgot password?", new_password_path
|
data/lib/slim-rails/version.rb
CHANGED
data/lib/slim-rails.rb
CHANGED
|
@@ -33,6 +33,27 @@ module Slim
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
if ::Rails::VERSION::MAJOR >= 8 && ::Rails::VERSION::MINOR >= 2
|
|
38
|
+
initializer "slim_rails.configure_code_statistics" do
|
|
39
|
+
require "rails/code_statistics"
|
|
40
|
+
|
|
41
|
+
::Rails::CodeStatistics.register_extension("slim")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
initializer "slim_rails.configure_source_annotation" do
|
|
46
|
+
annotation_class = if ::Rails::VERSION::MAJOR >= 6
|
|
47
|
+
require "rails/source_annotation_extractor"
|
|
48
|
+
::Rails::SourceAnnotationExtractor::Annotation
|
|
49
|
+
else
|
|
50
|
+
::SourceAnnotationExtractor::Annotation
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
annotation_class.register_extensions("slim") do |tag|
|
|
54
|
+
/\s*\/\s*(#{tag}):?\s*(.*)$/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
36
57
|
end
|
|
37
58
|
end
|
|
38
59
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slim-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Leonardo Almeida
|
|
8
8
|
- Janusz Mordarski
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: actionpack
|
|
@@ -65,32 +64,18 @@ dependencies:
|
|
|
65
64
|
- - "<"
|
|
66
65
|
- !ruby/object:Gem::Version
|
|
67
66
|
version: '6.0'
|
|
68
|
-
- !ruby/object:Gem::Dependency
|
|
69
|
-
name: sprockets-rails
|
|
70
|
-
requirement: !ruby/object:Gem::Requirement
|
|
71
|
-
requirements:
|
|
72
|
-
- - ">="
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: '0'
|
|
75
|
-
type: :development
|
|
76
|
-
prerelease: false
|
|
77
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
-
requirements:
|
|
79
|
-
- - ">="
|
|
80
|
-
- !ruby/object:Gem::Version
|
|
81
|
-
version: '0'
|
|
82
67
|
- !ruby/object:Gem::Dependency
|
|
83
68
|
name: slim_lint
|
|
84
69
|
requirement: !ruby/object:Gem::Requirement
|
|
85
70
|
requirements:
|
|
86
|
-
- - "
|
|
71
|
+
- - ">="
|
|
87
72
|
- !ruby/object:Gem::Version
|
|
88
73
|
version: 0.24.0
|
|
89
74
|
type: :development
|
|
90
75
|
prerelease: false
|
|
91
76
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
77
|
requirements:
|
|
93
|
-
- - "
|
|
78
|
+
- - ">="
|
|
94
79
|
- !ruby/object:Gem::Version
|
|
95
80
|
version: 0.24.0
|
|
96
81
|
- !ruby/object:Gem::Dependency
|
|
@@ -188,6 +173,10 @@ files:
|
|
|
188
173
|
- CHANGELOG.md
|
|
189
174
|
- LICENSE
|
|
190
175
|
- README.md
|
|
176
|
+
- lib/generators/slim/authentication/authentication_generator.rb
|
|
177
|
+
- lib/generators/slim/authentication/templates/passwords/edit.html.slim
|
|
178
|
+
- lib/generators/slim/authentication/templates/passwords/new.html.slim
|
|
179
|
+
- lib/generators/slim/authentication/templates/sessions/new.html.slim
|
|
191
180
|
- lib/generators/slim/controller/controller_generator.rb
|
|
192
181
|
- lib/generators/slim/controller/templates/view.html.slim
|
|
193
182
|
- lib/generators/slim/mailer/mailer_generator.rb
|
|
@@ -214,7 +203,6 @@ homepage: https://github.com/slim-template/slim-rails
|
|
|
214
203
|
licenses:
|
|
215
204
|
- MIT
|
|
216
205
|
metadata: {}
|
|
217
|
-
post_install_message:
|
|
218
206
|
rdoc_options: []
|
|
219
207
|
require_paths:
|
|
220
208
|
- lib
|
|
@@ -222,15 +210,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
222
210
|
requirements:
|
|
223
211
|
- - ">="
|
|
224
212
|
- !ruby/object:Gem::Version
|
|
225
|
-
version:
|
|
213
|
+
version: 3.0.0
|
|
226
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
215
|
requirements:
|
|
228
216
|
- - ">="
|
|
229
217
|
- !ruby/object:Gem::Version
|
|
230
218
|
version: '0'
|
|
231
219
|
requirements: []
|
|
232
|
-
rubygems_version: 3.
|
|
233
|
-
signing_key:
|
|
220
|
+
rubygems_version: 3.7.2
|
|
234
221
|
specification_version: 4
|
|
235
222
|
summary: Slim templates generator for Rails
|
|
236
223
|
test_files: []
|