slim 4.1.0 → 5.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.
@@ -95,13 +95,13 @@ renders as
95
95
  You can embed html code in the text which is not escaped.
96
96
 
97
97
  ~~~ slim
98
- | <a href="http://slim-lang.com">slim-lang.com</a>
98
+ | <a href="http://github.com/slim-template/slim">github.com/slim-template/slim</a>
99
99
  ~~~
100
100
 
101
101
  renders as
102
102
 
103
103
  ~~~ html
104
- <a href="http://slim-lang.com">slim-lang.com</a>
104
+ <a href="http://github.com/slim-template/slim">github.com/slim-template/slim</a>
105
105
  ~~~
106
106
 
107
107
  ### Text with trailing white space `'`
@@ -122,13 +122,13 @@ This is especially useful if you use tags behind a text block.
122
122
 
123
123
  ~~~ slim
124
124
  ' Link to
125
- a href="http://slim-lang.com" slim-lang.com
125
+ a href="http://github.com/slim-template/slim" github.com/slim-template/slim
126
126
  ~~~
127
127
 
128
128
  renders as
129
129
 
130
130
  ~~~ html
131
- Link to <a href="http://slim-lang.com">slim-lang.com</a>
131
+ Link to <a href="http://github.com/slim-template/slim">github.com/slim-template/slim</a>
132
132
  ~~~
133
133
 
134
134
  Multiple lines can be indented beneath the first text line.
@@ -186,13 +186,13 @@ lines
186
186
  HTML can be written directly.
187
187
 
188
188
  ~~~ slim
189
- <a href="http://slim-lang.com">slim-lang.com</a>
189
+ <a href="http://github.com/slim-template/slim">github.com/slim-template/slim</a>
190
190
  ~~~
191
191
 
192
192
  renders as
193
193
 
194
194
  ~~~ html
195
- <a href="http://slim-lang.com">slim-lang.com</a>
195
+ <a href="http://github.com/slim-template/slim">github.com/slim-template/slim</a>
196
196
  ~~~
197
197
 
198
198
  HTML tags allow nested blocks inside.
@@ -800,31 +800,31 @@ If a delimiter makes the syntax more readable for you, you can use the character
800
800
 
801
801
  ~~~ slim
802
802
  li
803
- a(href="http://slim-lang.com" class="important") Link
803
+ a(href="http://github.com/slim-template/slim" class="important") Link
804
804
  li
805
- a[href="http://slim-lang.com" class="important"] Link
805
+ a[href="http://github.com/slim-template/slim" class="important"] Link
806
806
  li
807
- a{href="http://slim-lang.com" class="important"} Link
807
+ a{href="http://github.com/slim-template/slim" class="important"} Link
808
808
  ~~~
809
809
 
810
810
  renders as
811
811
 
812
812
  ~~~ html
813
813
  <li>
814
- <a class="important" href="http://slim-lang.com">Link</a>
814
+ <a class="important" href="http://github.com/slim-template/slim">Link</a>
815
815
  </li>
816
816
  <li>
817
- <a class="important" href="http://slim-lang.com">Link</a>
817
+ <a class="important" href="http://github.com/slim-template/slim">Link</a>
818
818
  </li>
819
819
  <li>
820
- <a class="important" href="http://slim-lang.com">Link</a>
820
+ <a class="important" href="http://github.com/slim-template/slim">Link</a>
821
821
  </li>
822
822
  ~~~
823
823
 
824
824
  If you wrap the attributes, you can spread them across multiple lines:
825
825
 
826
826
  ~~~ slim
827
- a(href="http://slim-lang.com"
827
+ a(href="http://github.com/slim-template/slim"
828
828
 
829
829
  class="important") Link
830
830
  ~~~
@@ -832,7 +832,7 @@ a(href="http://slim-lang.com"
832
832
  renders as
833
833
 
834
834
  ~~~ html
835
- <a class="important" href="http://slim-lang.com">Link</a>
835
+ <a class="important" href="http://github.com/slim-template/slim">Link</a>
836
836
  ~~~
837
837
 
838
838
  ~~~ slim
@@ -872,19 +872,19 @@ renders as
872
872
  You can use single or double quotes for simple text attributes.
873
873
 
874
874
  ~~~ slim
875
- a href="http://slim-lang.com" title='Slim Homepage' Goto the Slim homepage
875
+ a href="http://github.com/slim-template/slim" title='Slim Homepage' Goto the Slim homepage
876
876
  ~~~
877
877
 
878
878
  renders as
879
879
 
880
880
  ~~~ html
881
- <a href="http://slim-lang.com" title="Slim Homepage">Goto the Slim homepage</a>
881
+ <a href="http://github.com/slim-template/slim" title="Slim Homepage">Goto the Slim homepage</a>
882
882
  ~~~
883
883
 
884
884
  You can use text interpolation in the quoted attributes:
885
885
 
886
886
  ~~~ slim
887
- - url='slim-lang.com'
887
+ - url='github.com/slim-template/slim'
888
888
  a href="http://#{url}" Goto the #{url}
889
889
  a href="{"test"}" Test of quoted text in braces
890
890
  ~~~
@@ -892,7 +892,7 @@ a href="{"test"}" Test of quoted text in braces
892
892
  renders as
893
893
 
894
894
  ~~~ html
895
- <a href="http://slim-lang.com">Goto the slim-lang.com</a><a href="{&quot;test&quot;}">Test of quoted text in braces</a>
895
+ <a href="http://github.com/slim-template/slim">Goto the github.com/slim-template/slim</a><a href="{&quot;test&quot;}">Test of quoted text in braces</a>
896
896
  ~~~
897
897
 
898
898
  The attribute value will be escaped by default. Use == if you want to disable escaping in the attribute.
@@ -1040,13 +1040,13 @@ You can configure attributes to be merged if multiple are given (See option `:me
1040
1040
  this is done for class attributes with the white space as delimiter.
1041
1041
 
1042
1042
  ~~~ slim
1043
- a.menu class="highlight" href="http://slim-lang.com/" Slim-lang.com
1043
+ a.menu class="highlight" href="http://github.com/slim-template/slim/" github.com/slim-template/slim
1044
1044
  ~~~
1045
1045
 
1046
1046
  renders as
1047
1047
 
1048
1048
  ~~~ html
1049
- <a class="menu highlight" href="http://slim-lang.com/">Slim-lang.com</a>
1049
+ <a class="menu highlight" href="http://github.com/slim-template/slim/">github.com/slim-template/slim</a>
1050
1050
  ~~~
1051
1051
 
1052
1052
  You can also use an `Array` as attribute value and the array elements will be merged using the delimiter.
@@ -1074,7 +1074,7 @@ with the :tag key.
1074
1074
  ~~~ slim
1075
1075
  ruby:
1076
1076
  def self.a_unless_current
1077
- @page_current ? {tag: 'span'} : {tag: 'a', href: 'http://slim-lang.com/'}
1077
+ @page_current ? {tag: 'span'} : {tag: 'a', href: 'http://github.com/slim-template/slim/'}
1078
1078
  end
1079
1079
  - @page_current = true
1080
1080
  *a_unless_current Link
@@ -1085,7 +1085,7 @@ ruby:
1085
1085
  renders as
1086
1086
 
1087
1087
  ~~~ html
1088
- <span>Link</span><a href="http://slim-lang.com/">Link</a>
1088
+ <span>Link</span><a href="http://github.com/slim-template/slim/">Link</a>
1089
1089
  ~~~
1090
1090
 
1091
1091
  ### Shortcuts
data/test/literate/run.rb CHANGED
@@ -65,9 +65,9 @@ class LiterateTest < Temple::Engine
65
65
  @in_testcase = false
66
66
  result = " html = #{code.inspect}\n"
67
67
  if @opts.empty?
68
- result << " render(slim).must_equal html\nend\n"
68
+ result << " _(render(slim)).must_equal html\nend\n"
69
69
  else
70
- result << " options = #{@opts.inspect}\n render(slim, options).must_equal html\nend\n"
70
+ result << " options = #{@opts.inspect}\n _(render(slim, options)).must_equal html\nend\n"
71
71
  end
72
72
  end
73
73
 
@@ -6,9 +6,7 @@ require 'action_view/railtie'
6
6
  #require 'active_record/railtie'
7
7
  #require 'action_mailer/railtie'
8
8
  require 'sprockets/railtie'
9
-
10
9
  require 'slim'
11
- require 'slim-rails/register_engine'
12
10
 
13
11
  module Dummy
14
12
  class Application < Rails::Application
@@ -42,20 +40,5 @@ module Dummy
42
40
 
43
41
  # Configure sensitive parameters which will be filtered from the log file.
44
42
  config.filter_parameters += [:password]
45
-
46
- # From slim-rails fix for "ActionView::Template::Error: Unknown line indicator"
47
- # https://github.com/slim-template/slim-rails/blob/991589ea5648e5e896781e68912bc51beaf4102a/lib/slim-rails/register_engine.rb
48
- if config.respond_to?(:assets)
49
- config.assets.configure do |env|
50
- if env.respond_to?(:register_transformer) && Sprockets::VERSION.to_i > 3
51
- env.register_mime_type 'text/slim', extensions: ['.slim', '.slim.html']
52
- env.register_transformer 'text/slim', 'text/html', Slim::Rails::RegisterEngine::Transformer
53
- elsif env.respond_to?(:register_engine)
54
- args = ['.slim', Slim::Template]
55
- args << { silence_deprecation: true } if Sprockets::VERSION.start_with?('3')
56
- env.register_engine(*args)
57
- end
58
- end
59
- end
60
43
  end
61
44
  end
@@ -46,18 +46,12 @@ class TestSlim < ActionDispatch::IntegrationTest
46
46
  assert_html "<h1>Hello Slim!</h1><p>With a partial!</p>"
47
47
  end
48
48
 
49
- if RUBY_ENGINE == 'jruby' && RUBY_ENGINE < '2.2.0'
50
- puts 'Streaming test disabled for JRuby < 9000.',
51
- 'See https://github.com/jruby/jruby/issues/1243',
52
- 'and https://github.com/jruby/jruby/issues/1789'
53
- else
54
- puts 'Streaming test enabled.'
55
- test "streaming" do
56
- get "/slim/streaming"
57
- output = "2f\r\n<!DOCTYPE html><html><head><title>Dummy</title>\r\nd\r\n</head><body>\r\n17\r\nHeading set from a view\r\n15\r\n<div class=\"content\">\r\n53\r\n<p>Page content</p><h1><p>Hello Streaming!</p></h1><h2><p>Hello Streaming!</p></h2>\r\n14\r\n</div></body></html>\r\n0\r\n\r\n"
58
- assert_equal output, @response.body
59
- end
60
- end
49
+ # TODO Reenable streaming test
50
+ # test "streaming" do
51
+ # get "/slim/streaming"
52
+ # output = "2f\r\n<!DOCTYPE html><html><head><title>Dummy</title>\r\nd\r\n</head><body>\r\n17\r\nHeading set from a view\r\n15\r\n<div class=\"content\">\r\n53\r\n<p>Page content</p><h1><p>Hello Streaming!</p></h1><h2><p>Hello Streaming!</p></h2>\r\n14\r\n</div></body></html>\r\n0\r\n\r\n"
53
+ # assert_equal output, @response.body
54
+ # end
61
55
 
62
56
  test "render integers" do
63
57
  get "/slim/integers"
@@ -8,8 +8,6 @@ if ENV['COVERAGE']
8
8
  end
9
9
 
10
10
  ENV['APP_ENV'] = 'test'
11
- Encoding.default_external = "UTF-8" if defined? Encoding
12
-
13
11
  RUBY_ENGINE = 'ruby' unless defined? RUBY_ENGINE
14
12
 
15
13
  require 'rack'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slim
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Mendler
@@ -10,28 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-05-07 00:00:00.000000000 Z
13
+ date: 2023-01-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: temple
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: 0.7.6
22
- - - "<"
19
+ - - "~>"
23
20
  - !ruby/object:Gem::Version
24
- version: '0.9'
21
+ version: 0.10.0
25
22
  type: :runtime
26
23
  prerelease: false
27
24
  version_requirements: !ruby/object:Gem::Requirement
28
25
  requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: 0.7.6
32
- - - "<"
26
+ - - "~>"
33
27
  - !ruby/object:Gem::Version
34
- version: '0.9'
28
+ version: 0.10.0
35
29
  - !ruby/object:Gem::Dependency
36
30
  name: tilt
37
31
  requirement: !ruby/object:Gem::Requirement
@@ -63,8 +57,8 @@ executables:
63
57
  extensions: []
64
58
  extra_rdoc_files: []
65
59
  files:
60
+ - ".github/workflows/test.yml"
66
61
  - ".gitignore"
67
- - ".travis.yml"
68
62
  - ".yardopts"
69
63
  - CHANGES
70
64
  - Gemfile
@@ -106,6 +100,7 @@ files:
106
100
  - lib/slim/logic_less/context.rb
107
101
  - lib/slim/logic_less/filter.rb
108
102
  - lib/slim/parser.rb
103
+ - lib/slim/railtie.rb
109
104
  - lib/slim/smart.rb
110
105
  - lib/slim/smart/escaper.rb
111
106
  - lib/slim/smart/filter.rb
@@ -177,7 +172,6 @@ files:
177
172
  - test/rails/config/initializers/backtrace_silencers.rb
178
173
  - test/rails/config/initializers/inflections.rb
179
174
  - test/rails/config/initializers/mime_types.rb
180
- - test/rails/config/initializers/secret_token.rb
181
175
  - test/rails/config/initializers/session_store.rb
182
176
  - test/rails/config/locales/en.yml
183
177
  - test/rails/config/routes.rb
@@ -195,7 +189,7 @@ files:
195
189
  - test/sinatra/views/layout2.slim
196
190
  - test/smart/test_smart_text.rb
197
191
  - test/translator/test_translator.rb
198
- homepage: http://slim-lang.com/
192
+ homepage: http://github.com/slim-template/slim/
199
193
  licenses:
200
194
  - MIT
201
195
  metadata: {}
@@ -207,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
201
  requirements:
208
202
  - - ">="
209
203
  - !ruby/object:Gem::Version
210
- version: 2.0.0
204
+ version: 2.5.0
211
205
  required_rubygems_version: !ruby/object:Gem::Requirement
212
206
  requirements:
213
207
  - - ">="
214
208
  - !ruby/object:Gem::Version
215
209
  version: '0'
216
210
  requirements: []
217
- rubygems_version: 3.1.2
211
+ rubygems_version: 3.2.5
218
212
  signing_key:
219
213
  specification_version: 4
220
214
  summary: Slim is a template language.
data/.travis.yml DELETED
@@ -1,38 +0,0 @@
1
- # https://www.ruby-lang.org/en/downloads/releases/
2
- language: ruby
3
- rvm:
4
- - 2.6.1
5
- - 2.5.3
6
- - 2.4.5
7
- - jruby-9.2.6.0
8
- - jruby-9.1.17.0
9
-
10
- # Recommend sudo required when using trusty dist
11
- # https://docs.travis-ci.com/user/reference/trusty/
12
- sudo: required
13
- dist: trusty
14
-
15
- script: "bundle exec rake $TASK"
16
-
17
- after_success:
18
- - bundle exec codeclimate-test-reporter
19
-
20
- env:
21
- global:
22
- - secure: "a7sD9iwPJJn3Fj+mn62GAmy/PEguh3elrilsp1KS+WfDiCiIKD8Q5KG2Jv67DGcQAGI3dPWeh7+ZhZ/W7nEipwWUBmSvGYVeoF63y8j6mNRLeekqspj94l47hXyFePj9bCadY1b1/xY4lE1pMEU8eA8AOUHUqCSuH+Kk/MuvyLM="
23
- matrix:
24
- - "TASK=test:core_and_plugins"
25
- - "TASK=test:rails RAILS=6.0.0.beta2"
26
- - "TASK=test:rails RAILS=5.2.2"
27
- - "TASK=test:rails RAILS=5.2.1.1"
28
- - "TASK=test:rails RAILS=5.2.1"
29
- - "TASK=test:sinatra SINATRA=2.0.5"
30
- - "TASK=test:sinatra SINATRA=2.0.4"
31
- - "TASK=test:sinatra SINATRA=2.0.3"
32
-
33
- matrix:
34
- exclude:
35
- - rvm: 2.4.5
36
- env: "TASK=test:rails RAILS=6.0.0.beta2"
37
- - rvm: jruby-9.1.17.0
38
- env: "TASK=test:rails RAILS=6.0.0.beta2"
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = Dummy::Application.config.secret_key_base = '123a9119fb14a410f485f9390286b33f2743b9d348246cf3e4434522078f77c202d7a1fb7e42666dd0844bcb10d0ff3d8b4ee087796269d4c574837948512dbf'