locomotivecms_steam 1.7.1 → 1.8.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54113c1f820748abcfc48e22803c588b09387b5889942ac838c4d2165b113de3
4
- data.tar.gz: 02706cbb6e9002ae7180dfd99106acab607e58cae7f68b0b7a9b43f877b49b0c
3
+ metadata.gz: bbac080500edff48f27330a294f5bfe6ca8429aa3ceb3b432050dbab884dabd7
4
+ data.tar.gz: 21abc53a533550a832797bf54431ded6a3fcb88493dd3266e5a943d80cf692ef
5
5
  SHA512:
6
- metadata.gz: 07231a9488c08e9f664b6ea326c9e09c86a7eca83567be52ee876c0fb5a87203db2eb5919d87207926f8fbd7185788644b622e73a4fb788f5dd1ae345e29c269
7
- data.tar.gz: 742faf6804b70f83d14491e99358f4f9e99c316442ca00434684ef17ba57fb2e36846f59f76bffb7921b8e276c863c79143e64926d253ac295e59c3012ae2c29
6
+ metadata.gz: 6c8164e4ccba652609c7238fc673ae349eea722cf908fc06829c937c920ba1e9eaa00fb54372abe71be01e51e247b2c363dcc23bf665461b613ca62556343cb5
7
+ data.tar.gz: 90b452804c38f418adf630de59103e0b6fc53d49f0a97493b91b0d328c4e650aa172ac436c556bebdfa22b02a43012156cfc838604ab3740f827a44fd5f1099e
data/Gemfile CHANGED
@@ -11,10 +11,10 @@ group :development do
11
11
 
12
12
  gem 'rake'
13
13
 
14
- gem 'puma', '~> 6.1.0'
15
- gem 'haml', '~> 5.2.0'
14
+ gem 'puma', '~> 6.4.0'
15
+ gem 'haml', '~> 6.2.3'
16
16
 
17
- gem 'rack', '~> 2.2.3.1'
17
+ gem 'rack', '~> 3.0'
18
18
  gem 'rack-mini-profiler', '~> 0.10.1'
19
19
  gem 'flamegraph'
20
20
  gem 'stackprof' # ruby 2.1+ only
@@ -22,7 +22,7 @@ group :development do
22
22
  end
23
23
 
24
24
  group :test do
25
- gem 'rspec', '~> 3.7.0'
25
+ gem 'rspec', '~> 3.12.0'
26
26
  gem 'json_spec', '~> 1.1.5'
27
27
  gem 'i18n-spec', '~> 0.6.0'
28
28
 
@@ -30,7 +30,7 @@ group :test do
30
30
 
31
31
  # gem 'pry-byebug', '~> 3.3.0'
32
32
 
33
- gem 'rack-test', '~> 0.8.2'
33
+ gem 'rack-test', '~> 2.1.0'
34
34
 
35
35
  gem 'coveralls', '~> 0.8.23', require: false
36
36
  end
data/Gemfile.lock CHANGED
@@ -1,46 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- locomotivecms_steam (1.7.1)
4
+ locomotivecms_steam (1.8.0.alpha1)
5
5
  RedCloth (~> 4.3.2)
6
6
  bcrypt (~> 3.1.11)
7
7
  chronic (~> 0.10.2)
8
8
  dragonfly (>= 1.2, < 1.5)
9
9
  duktape (~> 2.0.1.1)
10
- execjs (~> 2.8.1)
10
+ execjs (~> 2.9.1)
11
11
  httparty (~> 0.16.0)
12
12
  kramdown (~> 2.3.0)
13
13
  liquid (~> 4.0.4)
14
- locomotivecms_common (~> 0.5.0)
15
- mime-types (~> 3.3.0)
14
+ locomotivecms_common (~> 0.6.0.alpha1)
15
+ mime-types (~> 3.5.0)
16
16
  mimetype-fu (~> 0.1.2)
17
- moneta (~> 1.0.0)
17
+ moneta (~> 1.6.0)
18
18
  morphine (~> 0.1.1)
19
19
  multi_json (~> 1.15.0)
20
20
  nokogiri (~> 1.14.2)
21
21
  pony (~> 1.12)
22
22
  rack-cache (>= 1.7, < 2)
23
23
  rack-rewrite (~> 1.5.1)
24
+ rack-session (~> 2.0.0)
24
25
  rack_csrf (~> 2.6.0)
25
26
  sanitize (~> 6.0.1)
26
27
 
27
28
  GEM
28
29
  remote: https://rubygems.org/
29
30
  specs:
30
- RedCloth (4.3.2)
31
- activesupport (7.0.4.2)
31
+ RedCloth (4.3.4)
32
+ activesupport (7.1.3.2)
33
+ base64
34
+ bigdecimal
32
35
  concurrent-ruby (~> 1.0, >= 1.0.2)
36
+ connection_pool (>= 2.2.5)
37
+ drb
33
38
  i18n (>= 1.6, < 2)
34
39
  minitest (>= 5.1)
40
+ mutex_m
35
41
  tzinfo (~> 2.0)
36
- addressable (2.8.1)
42
+ addressable (2.8.6)
37
43
  public_suffix (>= 2.0.2, < 6.0)
38
44
  attr_extras (7.1.0)
39
- bcrypt (3.1.18)
45
+ base64 (0.2.0)
46
+ bcrypt (3.1.20)
47
+ bigdecimal (3.1.7)
40
48
  bson (4.15.0)
41
49
  chronic (0.10.2)
42
- colorize (0.8.1)
43
- concurrent-ruby (1.2.2)
50
+ colorize (1.1.0)
51
+ concurrent-ruby (1.2.3)
52
+ connection_pool (2.4.1)
44
53
  coveralls (0.8.23)
45
54
  json (>= 1.8, < 3)
46
55
  simplecov (~> 0.16.1)
@@ -48,36 +57,38 @@ GEM
48
57
  thor (>= 0.19.4, < 2.0)
49
58
  tins (~> 1.6)
50
59
  crass (1.0.6)
51
- date (3.3.3)
52
- diff-lcs (1.5.0)
60
+ date (3.3.4)
61
+ diff-lcs (1.5.1)
53
62
  docile (1.4.0)
54
63
  dragonfly (1.4.0)
55
64
  addressable (~> 2.3)
56
65
  multi_json (~> 1.0)
57
66
  rack (>= 1.3)
67
+ drb (2.2.1)
58
68
  duktape (2.0.1.1)
59
- execjs (2.8.1)
69
+ execjs (2.9.1)
60
70
  flamegraph (0.9.5)
61
- haml (5.2.2)
62
- temple (>= 0.8.0)
71
+ haml (6.2.5)
72
+ temple (>= 0.8.2)
73
+ thor
63
74
  tilt
64
75
  httparty (0.16.4)
65
76
  mime-types (~> 3.0)
66
77
  multi_xml (>= 0.5.2)
67
- i18n (1.12.0)
78
+ i18n (1.14.4)
68
79
  concurrent-ruby (~> 1.0)
69
80
  i18n-spec (0.6.0)
70
81
  iso
71
82
  iso (0.4.0)
72
83
  i18n
73
- json (2.6.3)
84
+ json (2.7.1)
74
85
  json_spec (1.1.5)
75
86
  multi_json (~> 1.0)
76
87
  rspec (>= 2.0, < 4.0)
77
88
  kramdown (2.3.2)
78
89
  rexml
79
90
  liquid (4.0.4)
80
- locomotivecms_common (0.5.0)
91
+ locomotivecms_common (0.6.0.alpha1)
81
92
  activesupport (>= 5)
82
93
  attr_extras (~> 7.1.0)
83
94
  colorize
@@ -88,67 +99,70 @@ GEM
88
99
  net-pop
89
100
  net-smtp
90
101
  memory_profiler (1.0.1)
91
- mime-types (3.3.1)
102
+ mime-types (3.5.2)
92
103
  mime-types-data (~> 3.2015)
93
- mime-types-data (3.2023.0218.1)
104
+ mime-types-data (3.2024.0305)
94
105
  mimetype-fu (0.1.2)
95
- mini_mime (1.1.2)
96
- mini_portile2 (2.8.1)
97
- minitest (5.17.0)
98
- moneta (1.0.0)
99
- mongo (2.18.2)
106
+ mini_mime (1.1.5)
107
+ mini_portile2 (2.8.5)
108
+ minitest (5.22.3)
109
+ moneta (1.6.0)
110
+ mongo (2.18.3)
100
111
  bson (>= 4.14.1, < 5.0.0)
101
112
  morphine (0.1.1)
102
113
  multi_json (1.15.0)
103
114
  multi_xml (0.6.0)
104
- net-imap (0.3.4)
115
+ mutex_m (0.2.0)
116
+ net-imap (0.4.10)
105
117
  date
106
118
  net-protocol
107
119
  net-pop (0.1.2)
108
120
  net-protocol
109
- net-protocol (0.2.1)
121
+ net-protocol (0.2.2)
110
122
  timeout
111
- net-smtp (0.3.3)
123
+ net-smtp (0.4.0.1)
112
124
  net-protocol
113
- nio4r (2.5.8)
114
- nokogiri (1.14.2)
125
+ nio4r (2.7.0)
126
+ nokogiri (1.14.5)
115
127
  mini_portile2 (~> 2.8.0)
116
128
  racc (~> 1.4)
117
- nokogiri (1.14.2-x86_64-darwin)
129
+ nokogiri (1.14.5-x86_64-darwin)
118
130
  racc (~> 1.4)
119
131
  origin (2.3.1)
120
132
  pony (1.13.1)
121
133
  mail (>= 2.0)
122
- public_suffix (5.0.1)
123
- puma (6.1.0)
134
+ public_suffix (5.0.4)
135
+ puma (6.4.2)
124
136
  nio4r (~> 2.0)
125
- racc (1.6.2)
126
- rack (2.2.3.1)
127
- rack-cache (1.13.0)
137
+ racc (1.7.3)
138
+ rack (3.0.9.1)
139
+ rack-cache (1.16.0)
128
140
  rack (>= 0.4)
129
141
  rack-mini-profiler (0.10.7)
130
142
  rack (>= 1.2.0)
131
143
  rack-rewrite (1.5.1)
132
- rack-test (0.8.3)
133
- rack (>= 1.0, < 3)
144
+ rack-session (2.0.0)
145
+ rack (>= 3.0.0)
146
+ rack-test (2.1.0)
147
+ rack (>= 1.3)
134
148
  rack_csrf (2.6.0)
135
149
  rack (>= 1.1.0)
136
- rake (13.0.6)
137
- rexml (3.2.5)
138
- rspec (3.7.0)
139
- rspec-core (~> 3.7.0)
140
- rspec-expectations (~> 3.7.0)
141
- rspec-mocks (~> 3.7.0)
142
- rspec-core (3.7.1)
143
- rspec-support (~> 3.7.0)
144
- rspec-expectations (3.7.0)
150
+ rake (13.1.0)
151
+ rexml (3.2.6)
152
+ rspec (3.12.0)
153
+ rspec-core (~> 3.12.0)
154
+ rspec-expectations (~> 3.12.0)
155
+ rspec-mocks (~> 3.12.0)
156
+ rspec-core (3.12.3)
157
+ rspec-support (~> 3.12.0)
158
+ rspec-expectations (3.12.4)
145
159
  diff-lcs (>= 1.2.0, < 2.0)
146
- rspec-support (~> 3.7.0)
147
- rspec-mocks (3.7.0)
160
+ rspec-support (~> 3.12.0)
161
+ rspec-mocks (3.12.7)
148
162
  diff-lcs (>= 1.2.0, < 2.0)
149
- rspec-support (~> 3.7.0)
150
- rspec-support (3.7.1)
151
- sanitize (6.0.1)
163
+ rspec-support (~> 3.12.0)
164
+ rspec-support (3.12.2)
165
+ sanitize (6.0.2)
152
166
  crass (~> 1.0.2)
153
167
  nokogiri (>= 1.12.0)
154
168
  simplecov (0.16.1)
@@ -156,16 +170,16 @@ GEM
156
170
  json (>= 1.8, < 3)
157
171
  simplecov-html (~> 0.10.0)
158
172
  simplecov-html (0.10.2)
159
- stackprof (0.2.23)
160
- stringex (2.8.5)
173
+ stackprof (0.2.26)
174
+ stringex (2.8.6)
161
175
  sync (0.5.0)
162
- temple (0.10.0)
163
- term-ansicolor (1.7.1)
176
+ temple (0.10.3)
177
+ term-ansicolor (1.7.2)
164
178
  tins (~> 1.0)
165
- thor (1.2.1)
166
- tilt (2.1.0)
167
- timecop (0.9.6)
168
- timeout (0.3.2)
179
+ thor (1.3.1)
180
+ tilt (2.3.0)
181
+ timecop (0.9.8)
182
+ timeout (0.4.1)
169
183
  tins (1.32.1)
170
184
  sync
171
185
  tzinfo (2.0.6)
@@ -178,19 +192,19 @@ PLATFORMS
178
192
  DEPENDENCIES
179
193
  coveralls (~> 0.8.23)
180
194
  flamegraph
181
- haml (~> 5.2.0)
195
+ haml (~> 6.2.3)
182
196
  i18n-spec (~> 0.6.0)
183
197
  json_spec (~> 1.1.5)
184
198
  locomotivecms_steam!
185
199
  memory_profiler
186
200
  mongo (~> 2.18.2)
187
201
  origin (~> 2.3.1)
188
- puma (~> 6.1.0)
189
- rack (~> 2.2.3.1)
202
+ puma (~> 6.4.0)
203
+ rack (~> 3.0)
190
204
  rack-mini-profiler (~> 0.10.1)
191
- rack-test (~> 0.8.2)
205
+ rack-test (~> 2.1.0)
192
206
  rake
193
- rspec (~> 3.7.0)
207
+ rspec (~> 3.12.0)
194
208
  stackprof
195
209
  timecop (~> 0.9.1)
196
210
 
data/bin/steam.rb CHANGED
@@ -74,7 +74,6 @@ Locomotive::Steam.configure do |config|
74
74
  config.serve_assets = options[:asset_path].present?
75
75
  config.asset_path = options[:asset_path]
76
76
  config.asset_host = options[:asset_host]
77
- config.minify_assets = false
78
77
  config.log_file = options[:log_file]
79
78
  end
80
79
 
@@ -63,15 +63,7 @@ module Locomotive
63
63
  # default: nil
64
64
  #
65
65
  attr_accessor :asset_path
66
-
67
- # If java is installed and if this option is enabled,
68
- # then Uglifier and Sass are used to minify the javascript and the css.
69
- #
70
- # default: false
71
- #
72
- attr_accessor :minify_assets
73
- def minify_assets; @minify_assets.nil? ? false : @minify_assets; end
74
-
66
+
75
67
  # Dragonfly needs it to generate the protective SHA.
76
68
  #
77
69
  # default: 'please change it'
@@ -36,7 +36,7 @@ module Locomotive
36
36
 
37
37
  def render_haml(source, template_path)
38
38
  begin
39
- Haml::Engine.new(source, escape_attrs: false).render
39
+ Haml::Template.new(escape_attrs: false) { source }.render
40
40
  rescue Haml::SyntaxError => e
41
41
  raise Steam::RenderError.new(e, template_path, source)
42
42
  end
@@ -39,7 +39,7 @@ module Locomotive::Steam
39
39
  code, headers, _ = response = fetch_cached_response(key)
40
40
 
41
41
  unless CACHEABLE_RESPONSE_CODES.include?(code.to_i)
42
- env['steam.cache_control'] = headers['Cache-Control'] = NO_CACHE_CONTROL
42
+ env['steam.cache_control'] = headers['cache-control'] = NO_CACHE_CONTROL
43
43
  env['steam.cache_vary'] = headers['Vary'] = nil
44
44
  end
45
45
 
@@ -8,7 +8,7 @@ module Locomotive::Steam
8
8
  HTML_MIME_TYPES = [nil, 'text/html', 'application/x-www-form-urlencoded', 'multipart/form-data'].freeze
9
9
 
10
10
  CACHE_HEADERS = {
11
- 'steam.cache_control' => 'Cache-Control',
11
+ 'steam.cache_control' => 'cache-control',
12
12
  'steam.cache_vary' => 'Vary',
13
13
  'steam.cache_etag' => 'ETag',
14
14
  'steam.cache_last_modified' => 'Last-Modified'
@@ -25,7 +25,7 @@ module Locomotive::Steam
25
25
  end
26
26
 
27
27
  def render_response(content, code = 200, type = nil)
28
- base_headers = { 'Content-Type' => type || HTML_CONTENT_TYPE }
28
+ base_headers = { 'content-type' => type || HTML_CONTENT_TYPE }
29
29
 
30
30
  CACHE_HEADERS.each do |key, http_name|
31
31
  base_headers[http_name] = env[key] if env[key]
@@ -34,7 +34,7 @@ module Locomotive::Steam
34
34
  _headers = env['steam.headers'] || {}
35
35
  inject_cookies(_headers)
36
36
 
37
- @next_response = [code, base_headers.merge(_headers), [content]]
37
+ @next_response = [code, base_headers.merge(_headers), [content].compact]
38
38
  end
39
39
 
40
40
  def redirect_to(location, type = 301)
@@ -42,7 +42,7 @@ module Locomotive::Steam
42
42
 
43
43
  self.debug_log "Redirected to #{_location}".blue
44
44
 
45
- headers = { 'Content-Type' => HTML_CONTENT_TYPE, 'Location' => _location }
45
+ headers = { 'content-type' => HTML_CONTENT_TYPE, 'location' => _location }
46
46
  inject_cookies(headers)
47
47
 
48
48
  @next_response = [type, headers, []]
@@ -10,7 +10,7 @@ module Locomotive::Steam
10
10
  def call(env)
11
11
  if env['PATH_INFO'] == '/favicon.ico'
12
12
  # Default and empty Favicon rendered
13
- [200, { 'Content-Type' => 'image/vnd.microsoft.icon' }, ['']]
13
+ [200, { 'content-type' => 'image/vnd.microsoft.icon' }, ['']]
14
14
  else
15
15
  app.call(env)
16
16
  end
@@ -37,8 +37,8 @@ module Locomotive::Steam
37
37
  # TODO: not implemented yet
38
38
  end
39
39
 
40
- def method_missing(name, *args, &block)
41
- @repository.send(name, *args, &block)
40
+ def method_missing(name, *args, **kwargs, &block)
41
+ @repository.send(name, *args, **kwargs, &block)
42
42
  end
43
43
 
44
44
  def respond_to_missing?(name, include_private = false)
@@ -64,9 +64,10 @@ module Locomotive::Steam
64
64
  end
65
65
 
66
66
  def deserialize(attributes)
67
- build_localized_attributes(attributes)
68
- build_associations(attributes)
69
- attributes
67
+ enhanced_attributes = attributes.with_indifferent_access
68
+ build_localized_attributes(enhanced_attributes)
69
+ build_associations(enhanced_attributes)
70
+ enhanced_attributes
70
71
  end
71
72
 
72
73
  def serialize(entity)
@@ -3,6 +3,6 @@
3
3
  # 1.0.0.alpha < 1.0.0.alpha1 < 1.0.0.beta < 1.0.0.beta2 < 1.0.0.beta11 < 1.0.0.rc1 < 1.0.0
4
4
  module Locomotive
5
5
  module Steam
6
- VERSION = '1.7.1'
6
+ VERSION = '1.8.0.alpha1'
7
7
  end
8
8
  end
@@ -29,20 +29,21 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency 'rack-rewrite', '~> 1.5.1'
31
31
  spec.add_dependency 'rack-cache', '>= 1.7', '< 2'
32
+ spec.add_dependency 'rack-session', '~> 2.0.0'
32
33
  spec.add_dependency 'rack_csrf', '~> 2.6.0'
33
34
  spec.add_dependency 'dragonfly', '>= 1.2', '< 1.5'
34
- spec.add_dependency 'moneta', '~> 1.0.0'
35
+ spec.add_dependency 'moneta', '~> 1.6.0'
35
36
 
36
- spec.add_dependency 'execjs', '~> 2.8.1'
37
+ spec.add_dependency 'execjs', '~> 2.9.1'
37
38
 
38
39
  spec.add_dependency 'kramdown', '~> 2.3.0'
39
40
  spec.add_dependency 'RedCloth', '~> 4.3.2'
40
41
  spec.add_dependency 'mimetype-fu', '~> 0.1.2'
41
- spec.add_dependency 'mime-types', '~> 3.3.0'
42
+ spec.add_dependency 'mime-types', '~> 3.5.0'
42
43
  spec.add_dependency 'duktape', '~> 2.0.1.1'
43
44
  spec.add_dependency 'pony', '~> 1.12'
44
45
 
45
- spec.add_dependency 'locomotivecms_common', '~> 0.5.0'
46
+ spec.add_dependency 'locomotivecms_common', '~> 0.6.0.alpha1'
46
47
 
47
- spec.required_ruby_version = ['>= 2.7', '< 3.2']
48
+ spec.required_ruby_version = ['>= 3.0']
48
49
  end
@@ -37,21 +37,21 @@ describe Locomotive::Steam::Liquid::Filters::Translate do
37
37
  describe 'legacy syntax' do
38
38
 
39
39
  let(:source) { "{{ 'welcome_message' | translate: 'fr', 'locomotive.default' }}" }
40
- it { expect(translator).to receive(:translate).with('welcome_message', 'locale' => 'fr', 'scope' => 'locomotive.default'); subject }
40
+ it { expect(translator).to receive(:translate).with('welcome_message', { 'locale' => 'fr', 'scope' => 'locomotive.default' }); subject }
41
41
 
42
42
  end
43
43
 
44
44
  describe 'new syntax' do
45
45
 
46
46
  let(:source) { "{{ 'welcome_message' | translate: locale: 'fr', scope: 'locomotive.default' }}" }
47
- it { expect(translator).to receive(:translate).with('welcome_message', 'locale' => 'fr', 'scope' => 'locomotive.default'); subject }
47
+ it { expect(translator).to receive(:translate).with('welcome_message', { 'locale' => 'fr', 'scope' => 'locomotive.default' }); subject }
48
48
 
49
49
  end
50
50
 
51
51
  describe 'shortcut alias' do
52
52
 
53
53
  let(:source) { "{{ 'welcome_message' | t: 'fr', 'locomotive.default' }}" }
54
- it { expect(translator).to receive(:translate).with('welcome_message', 'locale' => 'fr', 'scope' => 'locomotive.default'); subject }
54
+ it { expect(translator).to receive(:translate).with('welcome_message', { 'locale' => 'fr', 'scope' => 'locomotive.default' }); subject }
55
55
 
56
56
  end
57
57
 
@@ -36,7 +36,6 @@ module Spec
36
36
  # config.adapter = { name: :'mongoDB', database: 'steam_test', hosts: ['127.0.0.1'] }
37
37
  config.asset_path = File.expand_path(File.join(default_fixture_site_path, 'public'))
38
38
  config.serve_assets = true
39
- config.minify_assets = true
40
39
  config.log_file = ENV['STEAM_VERBOSE'] ? nil : File.join(default_fixture_site_path, 'log/steam.log')
41
40
  end
42
41
 
@@ -42,14 +42,14 @@ describe Locomotive::Steam::Liquid::Drops::ContentEntryCollection do
42
42
 
43
43
  describe '#first' do
44
44
  before do
45
- expect(services.repositories.content_entry).to receive(:all).with('visible' => true).and_return(['a', 'b'])
45
+ expect(services.repositories.content_entry).to receive(:all).with({ 'visible' => true }).and_return(['a', 'b'])
46
46
  end
47
47
  it { expect(drop.first).to eq('a') }
48
48
  end
49
49
 
50
50
  describe '#count' do
51
51
  before do
52
- expect(services.repositories.content_entry).to receive(:count).with('visible' => true).and_return(2)
52
+ expect(services.repositories.content_entry).to receive(:count).with({ 'visible' => true }).and_return(2)
53
53
  end
54
54
  it { expect(drop.count).to eq 2 }
55
55
  end
@@ -57,7 +57,7 @@ describe Locomotive::Steam::Liquid::Drops::ContentEntryCollection do
57
57
  describe 'only applied to the first content type' do
58
58
 
59
59
  it 'sets the content type in the context' do
60
- expect(services.repositories.content_entry).to receive(:all).with('visible' => true).and_return(['a', 'b'])
60
+ expect(services.repositories.content_entry).to receive(:all).with({ 'visible' => true }).and_return(['a', 'b'])
61
61
  expect(context['with_scope_content_type']).to eq nil
62
62
  drop.first
63
63
  expect(context['with_scope_content_type']).to eq 'articles'
@@ -111,7 +111,7 @@ describe Locomotive::Steam::Liquid::Tags::Consume do
111
111
  let(:source) { %{{% consume blog from "#{url}" timeout: 5.0 %}{{ blog.title }}{% endconsume %}} }
112
112
 
113
113
  it 'should pass the timeout option to httparty' do
114
- expect(services.external_api).to receive(:consume).with(url, timeout: 5.0).and_return(response)
114
+ expect(services.external_api).to receive(:consume).with(url, { timeout: 5.0 }).and_return(response)
115
115
  subject
116
116
  end
117
117
 
@@ -55,11 +55,11 @@ describe Locomotive::Steam::Middlewares::Cache do
55
55
 
56
56
  let(:response) { nil }
57
57
 
58
- before { expect(cache).to receive(:read).with('40ba2b3cfde6e2f8539c9ffa02fab139').and_return(response) }
58
+ before { expect(cache).to receive(:read).with('7f3fe1e49370f63970331ec3194d4590').and_return(response) }
59
59
 
60
60
  context 'the cache is empty' do
61
61
 
62
- before { expect(cache).to receive(:write).with('40ba2b3cfde6e2f8539c9ffa02fab139', Marshal.dump([200, {}, ["Hello world!"]])) }
62
+ before { expect(cache).to receive(:write).with('7f3fe1e49370f63970331ec3194d4590', Marshal.dump([200, {}, ["Hello world!"]])) }
63
63
 
64
64
  it 'tells the CDN to cache the page and also cache it internally' do
65
65
  is_expected.to eq ['max-age=0, s-maxage=3600, public, must-revalidate', 'Accept-Language']
@@ -69,7 +69,7 @@ describe Locomotive::Steam::Middlewares::Cache do
69
69
 
70
70
  subject { send_request[:env]['steam.cache_etag'] }
71
71
 
72
- it { is_expected.to eq '40ba2b3cfde6e2f8539c9ffa02fab139' }
72
+ it { is_expected.to eq '7f3fe1e49370f63970331ec3194d4590' }
73
73
 
74
74
  end
75
75
 
@@ -104,11 +104,11 @@ describe Locomotive::Steam::Middlewares::Cache do
104
104
 
105
105
  context 'based on the ETag' do
106
106
 
107
- let(:etag) { '40ba2b3cfde6e2f8539c9ffa02fab139' }
107
+ let(:etag) { '7f3fe1e49370f63970331ec3194d4590' }
108
108
 
109
109
  it 'returns a 304 (Not modified) without no cache headers' do
110
110
  expect(subject.first).to eq 304
111
- expect(subject.last['Cache-Control']).to eq nil
111
+ expect(subject.last['cache-control']).to eq nil
112
112
  end
113
113
 
114
114
  end
@@ -119,7 +119,7 @@ describe Locomotive::Steam::Middlewares::Cache do
119
119
 
120
120
  it 'returns a 304 (Not modified) without no cache headers' do
121
121
  expect(subject.first).to eq 304
122
- expect(subject.last['Cache-Control']).to eq nil
122
+ expect(subject.last['cache-control']).to eq nil
123
123
  end
124
124
 
125
125
  end
@@ -22,7 +22,7 @@ describe Locomotive::Steam::Middlewares::EncodedLinkRedirection do
22
22
  env['steam.services'] = services
23
23
  env['locomotive.path'] = locomotive_path
24
24
  code, env = middleware.call(env)
25
- [code, env['Location']]
25
+ [code, env['location']]
26
26
  end
27
27
 
28
28
  describe 'no redirections' do
@@ -38,7 +38,7 @@ describe Locomotive::Steam::Middlewares::Concerns::Helpers do
38
38
 
39
39
  describe '#redirect_to' do
40
40
 
41
- subject { instance.redirect_to(location)[1]['Location'] }
41
+ subject { instance.redirect_to(location)[1]['location'] }
42
42
 
43
43
  context 'mounted_on is not blank' do
44
44
 
@@ -54,7 +54,7 @@ describe Locomotive::Steam::Middlewares::ImpersonatedEntry do
54
54
 
55
55
  subject do
56
56
  code, env, body = call
57
- [code, env['steam.impersonating_authenticated_entry'], env['Location']]
57
+ [code, env['steam.impersonating_authenticated_entry'], env['location']]
58
58
  end
59
59
 
60
60
  before do
@@ -20,7 +20,7 @@ describe Locomotive::Steam::Middlewares::LocaleRedirection do
20
20
  env['steam.request'] = Rack::Request.new(env)
21
21
  env['steam.path'] = env['steam.request'].path_info.gsub(/\A#{mounted_on}/, '').gsub(/\A\/#{locale}/, '')
22
22
  code, env = middleware.call(env)
23
- [code, env['Location']]
23
+ [code, env['location']]
24
24
  end
25
25
 
26
26
  describe 'prefix_default_locale is false' do
@@ -17,7 +17,7 @@ describe Locomotive::Steam::Middlewares::Redirection do
17
17
  env['steam.request'] = Rack::Request.new(env)
18
18
  env['locomotive.path'] = locomotive_path
19
19
  code, env = middleware.call(env)
20
- [code, env['Location']]
20
+ [code, env['location']]
21
21
  end
22
22
 
23
23
  describe 'no redirection exception raised' do
@@ -46,7 +46,7 @@ describe Locomotive::Steam::Middlewares::Section do
46
46
  it 'renders the HTML code related to the section' do
47
47
  is_expected.to eq [
48
48
  200,
49
- { "Content-Type" => "text/html" },
49
+ { "content-type" => "text/html" },
50
50
  [%(<div id="locomotive-section-header" class="locomotive-section" data-locomotive-section-type="header"><span id="header-section"></span>Here some </div>)]
51
51
  ]
52
52
  end
@@ -62,7 +62,7 @@ describe Locomotive::Steam::Middlewares::Section do
62
62
  it 'renders the HTML code related to the section' do
63
63
  is_expected.to eq [
64
64
  200,
65
- { "Content-Type" => "text/html" },
65
+ { "content-type" => "text/html" },
66
66
  [%(<div id="locomotive-section-dropzone-42" class="locomotive-section" data-locomotive-section-type="header"><span id="dropzone-42-section"></span>Here some modified HTML</div>)]
67
67
  ]
68
68
  end
@@ -23,7 +23,7 @@ describe Locomotive::Steam::Middlewares::Site do
23
23
  env['steam.is_default_host'] = is_default_host
24
24
  env['steam.live_editing'] = live_editing
25
25
  code, env = middleware.call(env)
26
- [code, env['Location']]
26
+ [code, env['location']]
27
27
  end
28
28
 
29
29
  describe 'no site' do
@@ -26,7 +26,7 @@ describe Locomotive::Steam::Middlewares::Sitemap do
26
26
  describe 'no pages' do
27
27
 
28
28
  it 'renders a blank sitemap' do
29
- is_expected.to eq [200, { "Content-Type"=>"application/xml" }, ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">\n\n</urlset>\n"]]
29
+ is_expected.to eq [200, { "content-type"=>"application/xml" }, ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">\n\n</urlset>\n"]]
30
30
  end
31
31
 
32
32
  end
@@ -36,7 +36,7 @@ describe Locomotive::Steam::Middlewares::Sitemap do
36
36
  let(:pages) { [instance_double('Page', index?: false, not_found?: false, layout?: true)] }
37
37
 
38
38
  it 'renders a blank sitemap' do
39
- is_expected.to eq [200, { "Content-Type"=>"application/xml" }, ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">\n\n</urlset>\n"]]
39
+ is_expected.to eq [200, { "content-type"=>"application/xml" }, ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">\n\n</urlset>\n"]]
40
40
  end
41
41
 
42
42
  end
@@ -18,7 +18,7 @@ describe Locomotive::Steam::Middlewares::UrlRedirection do
18
18
  env['steam.request'] = Rack::Request.new(env)
19
19
  env['locomotive.path'] = locomotive_path
20
20
  code, env = middleware.call(env)
21
- [code, env['Location']]
21
+ [code, env['location']]
22
22
  end
23
23
 
24
24
  describe 'no redirections' do
@@ -21,7 +21,7 @@ describe Locomotive::Steam::EmailService do
21
21
  subject { service.send_email(options, context) }
22
22
 
23
23
  it 'sends the email over Pony' do
24
- expect(Pony).to receive(:mail).with(
24
+ expect(Pony).to receive(:mail).with({
25
25
  to: 'john@doe.net',
26
26
  from: 'me@locomotivecms.com',
27
27
  subject: 'Hello world',
@@ -32,7 +32,7 @@ describe Locomotive::Steam::EmailService do
32
32
  user_name: 'user',
33
33
  password: 'password'
34
34
  }
35
- )
35
+ })
36
36
  subject
37
37
  end
38
38
 
@@ -61,7 +61,7 @@ describe Locomotive::Steam::EmailService do
61
61
  let(:options) { { to: 'john@doe.net', from: 'me@locomotivecms.com', subject: 'Hello world', page_handle: 'notification-email', smtp: smtp_options, html: true } }
62
62
 
63
63
  it 'sends the email over Pony' do
64
- expect(Pony).to receive(:mail).with(
64
+ expect(Pony).to receive(:mail).with({
65
65
  to: 'john@doe.net',
66
66
  from: 'me@locomotivecms.com',
67
67
  subject: 'Hello world',
@@ -72,7 +72,7 @@ describe Locomotive::Steam::EmailService do
72
72
  user_name: 'user',
73
73
  password: 'password'
74
74
  }
75
- )
75
+ })
76
76
  subject
77
77
  end
78
78
 
@@ -100,7 +100,7 @@ describe Locomotive::Steam::EmailService do
100
100
  end
101
101
 
102
102
  it 'sends the email over Pony' do
103
- expect(Pony).to receive(:mail).with(
103
+ expect(Pony).to receive(:mail).with({
104
104
  to: 'john@doe.net',
105
105
  from: 'me@locomotivecms.com',
106
106
  subject: 'Hello world',
@@ -112,7 +112,7 @@ describe Locomotive::Steam::EmailService do
112
112
  user_name: 'user',
113
113
  password: 'password'
114
114
  }
115
- )
115
+ })
116
116
  subject
117
117
  end
118
118
 
@@ -124,7 +124,7 @@ describe Locomotive::Steam::EmailService do
124
124
 
125
125
  it 'sends the email over Pony' do
126
126
  expect(Net::HTTP).to receive(:get).with(URI('http://acme.org/bar.txt')).and_return('Bar')
127
- expect(Pony).to receive(:mail).with(
127
+ expect(Pony).to receive(:mail).with({
128
128
  to: 'john@doe.net',
129
129
  from: 'me@locomotivecms.com',
130
130
  subject: 'Hello world',
@@ -136,7 +136,7 @@ describe Locomotive::Steam::EmailService do
136
136
  user_name: 'user',
137
137
  password: 'password'
138
138
  }
139
- )
139
+ })
140
140
  subject
141
141
  end
142
142
 
@@ -144,7 +144,7 @@ describe Locomotive::Steam::EmailService do
144
144
 
145
145
  it "doesn't send the email" do
146
146
  expect(Net::HTTP).to receive(:get).with(URI('http://acme.org/bar.txt')).and_raise('URL not responding')
147
- expect(Pony).to receive(:mail).with(
147
+ expect(Pony).to receive(:mail).with({
148
148
  to: 'john@doe.net',
149
149
  from: 'me@locomotivecms.com',
150
150
  subject: 'Hello world',
@@ -156,7 +156,7 @@ describe Locomotive::Steam::EmailService do
156
156
  user_name: 'user',
157
157
  password: 'password'
158
158
  }
159
- )
159
+ })
160
160
  subject
161
161
  end
162
162
 
@@ -169,7 +169,7 @@ describe Locomotive::Steam::EmailService do
169
169
  let(:attachments) { { 'bar.txt' => 'Bar' } }
170
170
 
171
171
  it 'sends the email over Pony' do
172
- expect(Pony).to receive(:mail).with(
172
+ expect(Pony).to receive(:mail).with({
173
173
  to: 'john@doe.net',
174
174
  from: 'me@locomotivecms.com',
175
175
  subject: 'Hello world',
@@ -181,7 +181,7 @@ describe Locomotive::Steam::EmailService do
181
181
  user_name: 'user',
182
182
  password: 'password'
183
183
  }
184
- )
184
+ })
185
185
  subject
186
186
  end
187
187
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms_steam
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.0.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-03-02 00:00:00.000000000 Z
14
+ date: 2024-03-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: mongo
@@ -187,6 +187,20 @@ dependencies:
187
187
  - - "<"
188
188
  - !ruby/object:Gem::Version
189
189
  version: '2'
190
+ - !ruby/object:Gem::Dependency
191
+ name: rack-session
192
+ requirement: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - "~>"
195
+ - !ruby/object:Gem::Version
196
+ version: 2.0.0
197
+ type: :runtime
198
+ prerelease: false
199
+ version_requirements: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - "~>"
202
+ - !ruby/object:Gem::Version
203
+ version: 2.0.0
190
204
  - !ruby/object:Gem::Dependency
191
205
  name: rack_csrf
192
206
  requirement: !ruby/object:Gem::Requirement
@@ -227,28 +241,28 @@ dependencies:
227
241
  requirements:
228
242
  - - "~>"
229
243
  - !ruby/object:Gem::Version
230
- version: 1.0.0
244
+ version: 1.6.0
231
245
  type: :runtime
232
246
  prerelease: false
233
247
  version_requirements: !ruby/object:Gem::Requirement
234
248
  requirements:
235
249
  - - "~>"
236
250
  - !ruby/object:Gem::Version
237
- version: 1.0.0
251
+ version: 1.6.0
238
252
  - !ruby/object:Gem::Dependency
239
253
  name: execjs
240
254
  requirement: !ruby/object:Gem::Requirement
241
255
  requirements:
242
256
  - - "~>"
243
257
  - !ruby/object:Gem::Version
244
- version: 2.8.1
258
+ version: 2.9.1
245
259
  type: :runtime
246
260
  prerelease: false
247
261
  version_requirements: !ruby/object:Gem::Requirement
248
262
  requirements:
249
263
  - - "~>"
250
264
  - !ruby/object:Gem::Version
251
- version: 2.8.1
265
+ version: 2.9.1
252
266
  - !ruby/object:Gem::Dependency
253
267
  name: kramdown
254
268
  requirement: !ruby/object:Gem::Requirement
@@ -297,14 +311,14 @@ dependencies:
297
311
  requirements:
298
312
  - - "~>"
299
313
  - !ruby/object:Gem::Version
300
- version: 3.3.0
314
+ version: 3.5.0
301
315
  type: :runtime
302
316
  prerelease: false
303
317
  version_requirements: !ruby/object:Gem::Requirement
304
318
  requirements:
305
319
  - - "~>"
306
320
  - !ruby/object:Gem::Version
307
- version: 3.3.0
321
+ version: 3.5.0
308
322
  - !ruby/object:Gem::Dependency
309
323
  name: duktape
310
324
  requirement: !ruby/object:Gem::Requirement
@@ -339,14 +353,14 @@ dependencies:
339
353
  requirements:
340
354
  - - "~>"
341
355
  - !ruby/object:Gem::Version
342
- version: 0.5.0
356
+ version: 0.6.0.alpha1
343
357
  type: :runtime
344
358
  prerelease: false
345
359
  version_requirements: !ruby/object:Gem::Requirement
346
360
  requirements:
347
361
  - - "~>"
348
362
  - !ruby/object:Gem::Version
349
- version: 0.5.0
363
+ version: 0.6.0.alpha1
350
364
  description: The LocomotiveCMS Steam is the rendering stack used by both Wagon and
351
365
  Engine
352
366
  email:
@@ -891,17 +905,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
891
905
  requirements:
892
906
  - - ">="
893
907
  - !ruby/object:Gem::Version
894
- version: '2.7'
895
- - - "<"
896
- - !ruby/object:Gem::Version
897
- version: '3.2'
908
+ version: '3.0'
898
909
  required_rubygems_version: !ruby/object:Gem::Requirement
899
910
  requirements:
900
911
  - - ">="
901
912
  - !ruby/object:Gem::Version
902
913
  version: '0'
903
914
  requirements: []
904
- rubygems_version: 3.3.3
915
+ rubygems_version: 3.5.4
905
916
  signing_key:
906
917
  specification_version: 4
907
918
  summary: The LocomotiveCMS Steam is the rendering stack used by both Wagon and Engine