locomotivecms_steam 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -2
- data/Gemfile +4 -2
- data/Gemfile.lock +58 -120
- data/Rakefile +2 -2
- data/lib/locomotive/steam/adapters/mongodb/command.rb +1 -1
- data/lib/locomotive/steam/initializers.rb +0 -1
- data/lib/locomotive/steam/liquid/tags/concerns/attributes.rb +11 -98
- data/lib/locomotive/steam/liquid/tags/concerns/path.rb +6 -25
- data/lib/locomotive/steam/liquid/tags/consume.rb +3 -3
- data/lib/locomotive/steam/liquid/tags/inherited_block.rb +4 -3
- data/lib/locomotive/steam/liquid/tags/with_scope.rb +25 -17
- data/lib/locomotive/steam/middlewares/sitemap.rb +2 -2
- data/lib/locomotive/steam/models/concerns/validation.rb +1 -1
- data/lib/locomotive/steam/server.rb +1 -5
- data/lib/locomotive/steam/version.rb +1 -1
- data/locomotivecms_steam.gemspec +8 -17
- data/spec/fixtures/default/public/javascripts/application.js +1 -0
- data/spec/integration/adapters/mongodb_spec.rb +1 -1
- data/spec/integration/server/assets_spec.rb +3 -13
- data/spec/support/helpers.rb +1 -1
- data/spec/unit/liquid/tags/paginate_spec.rb +1 -1
- data/spec/unit/liquid/tags/with_scope_spec.rb +1 -51
- data/spec/unit/middlewares/auth_spec.rb +1 -0
- data/spec/unit/middlewares/cache_spec.rb +4 -4
- data/spec/unit/middlewares/sitemap_spec.rb +2 -2
- metadata +24 -148
- data/lib/locomotive/steam/initializers/sprockets.rb +0 -69
- data/lib/locomotive/steam/middlewares/dynamic_assets.rb +0 -33
- data/spec/fixtures/default/public/javascripts/application.js.coffee +0 -2
- data/spec/unit/initializers/sprockets_spec.rb +0 -47
- data/spec/unit/middlewares/dynamic_assets_spec.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1d1190c7a803c31bd03c95eadc0778dae4018260d5f189e17504584ff214eb2
|
4
|
+
data.tar.gz: a31caf22fe539484172005e8ffd8429bc301b72d1e09b0b0d4d553ca6364a8c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fce3dfa770a46f8d6f7ae47db8c7045d4dece1acb550685955f0641bf09c82de9a2d9dc67309727d3fc7874b21b59c205d29f770c8f7c2f3ab5829c72ce769c
|
7
|
+
data.tar.gz: 34b654ec05743ce7da33454004a9828f94533d15f26691a25c254833f179f2ba84cc5f3dc9864485452d76f82b889ae6dd7f10ac6a90bda3951dd5f80b961604
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -9,7 +9,9 @@ group :development do
|
|
9
9
|
# gem 'duktape', github: 'judofyr/duktape.rb', ref: '20ef6a5'
|
10
10
|
# gem 'duktape', github: 'did/duktape.rb', branch: 'any-fixnum'
|
11
11
|
|
12
|
-
gem '
|
12
|
+
gem 'rake'
|
13
|
+
|
14
|
+
gem 'puma', '~> 6.1.0'
|
13
15
|
gem 'haml', '~> 5.2.0'
|
14
16
|
|
15
17
|
gem 'rack', '~> 2.2.3.1'
|
@@ -30,5 +32,5 @@ group :test do
|
|
30
32
|
|
31
33
|
gem 'rack-test', '~> 0.8.2'
|
32
34
|
|
33
|
-
gem 'coveralls', '~> 0.8.
|
35
|
+
gem 'coveralls', '~> 0.8.23', require: false
|
34
36
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,84 +1,46 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
locomotivecms_steam (1.
|
4
|
+
locomotivecms_steam (1.7.0)
|
5
5
|
RedCloth (~> 4.3.2)
|
6
|
-
autoprefixer-rails (~> 8.0.0)
|
7
6
|
bcrypt (~> 3.1.11)
|
8
7
|
chronic (~> 0.10.2)
|
9
|
-
coffee-script (~> 2.4.1)
|
10
|
-
compass (~> 1.0.3)
|
11
8
|
dragonfly (>= 1.2, < 1.5)
|
12
9
|
duktape (~> 2.0.1.1)
|
10
|
+
execjs (~> 2.8.1)
|
13
11
|
httparty (~> 0.16.0)
|
14
12
|
kramdown (~> 2.3.0)
|
15
|
-
liquid (~> 4.0.
|
16
|
-
locomotivecms_common (~> 0.
|
13
|
+
liquid (~> 4.0.4)
|
14
|
+
locomotivecms_common (~> 0.5.0)
|
17
15
|
mime-types (~> 3.3.0)
|
18
16
|
mimetype-fu (~> 0.1.2)
|
19
17
|
moneta (~> 1.0.0)
|
20
18
|
morphine (~> 0.1.1)
|
21
19
|
multi_json (~> 1.15.0)
|
22
|
-
nokogiri (
|
23
|
-
parser (~> 2.7)
|
20
|
+
nokogiri (~> 1.14.2)
|
24
21
|
pony (~> 1.12)
|
25
22
|
rack-cache (~> 1.7.0)
|
26
23
|
rack-rewrite (~> 1.5.1)
|
27
24
|
rack_csrf (~> 2.6.0)
|
28
|
-
sanitize (~>
|
29
|
-
sass (~> 3.4.25)
|
30
|
-
sprockets (~> 3.7.1)
|
31
|
-
uglifier (~> 4.1.3)
|
32
|
-
unparser (~> 0.4)
|
25
|
+
sanitize (~> 6.0.1)
|
33
26
|
|
34
27
|
GEM
|
35
28
|
remote: https://rubygems.org/
|
36
29
|
specs:
|
37
30
|
RedCloth (4.3.2)
|
38
|
-
|
39
|
-
activesupport (5.2.8.1)
|
31
|
+
activesupport (7.0.4.2)
|
40
32
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
41
|
-
i18n (>=
|
42
|
-
minitest (
|
43
|
-
tzinfo (~>
|
44
|
-
adamantium (0.2.0)
|
45
|
-
ice_nine (~> 0.11.0)
|
46
|
-
memoizable (~> 0.4.0)
|
33
|
+
i18n (>= 1.6, < 2)
|
34
|
+
minitest (>= 5.1)
|
35
|
+
tzinfo (~> 2.0)
|
47
36
|
addressable (2.8.1)
|
48
37
|
public_suffix (>= 2.0.2, < 6.0)
|
49
|
-
|
50
|
-
abstract_type (~> 0.0.7)
|
51
|
-
adamantium (~> 0.2)
|
52
|
-
equalizer (~> 0.0.11)
|
53
|
-
ast (2.4.2)
|
54
|
-
attr_extras (5.2.0)
|
55
|
-
autoprefixer-rails (8.0.0)
|
56
|
-
execjs
|
38
|
+
attr_extras (7.1.0)
|
57
39
|
bcrypt (3.1.18)
|
58
40
|
bson (4.15.0)
|
59
41
|
chronic (0.10.2)
|
60
|
-
chunky_png (1.4.0)
|
61
|
-
coffee-script (2.4.1)
|
62
|
-
coffee-script-source
|
63
|
-
execjs
|
64
|
-
coffee-script-source (1.12.2)
|
65
42
|
colorize (0.8.1)
|
66
|
-
|
67
|
-
chunky_png (~> 1.2)
|
68
|
-
compass-core (~> 1.0.2)
|
69
|
-
compass-import-once (~> 1.0.5)
|
70
|
-
rb-fsevent (>= 0.9.3)
|
71
|
-
rb-inotify (>= 0.9)
|
72
|
-
sass (>= 3.3.13, < 3.5)
|
73
|
-
compass-core (1.0.3)
|
74
|
-
multi_json (~> 1.0)
|
75
|
-
sass (>= 3.3.0, < 3.5)
|
76
|
-
compass-import-once (1.0.5)
|
77
|
-
sass (>= 3.2, < 3.5)
|
78
|
-
concord (0.1.6)
|
79
|
-
adamantium (~> 0.2.0)
|
80
|
-
equalizer (~> 0.0.9)
|
81
|
-
concurrent-ruby (1.1.10)
|
43
|
+
concurrent-ruby (1.2.2)
|
82
44
|
coveralls (0.8.23)
|
83
45
|
json (>= 1.8, < 3)
|
84
46
|
simplecov (~> 0.16.1)
|
@@ -86,6 +48,7 @@ GEM
|
|
86
48
|
thor (>= 0.19.4, < 2.0)
|
87
49
|
tins (~> 1.6)
|
88
50
|
crass (1.0.6)
|
51
|
+
date (3.3.3)
|
89
52
|
diff-lcs (1.5.0)
|
90
53
|
docile (1.4.0)
|
91
54
|
dragonfly (1.4.0)
|
@@ -93,9 +56,7 @@ GEM
|
|
93
56
|
multi_json (~> 1.0)
|
94
57
|
rack (>= 1.3)
|
95
58
|
duktape (2.0.1.1)
|
96
|
-
equalizer (0.0.11)
|
97
59
|
execjs (2.8.1)
|
98
|
-
ffi (1.15.5)
|
99
60
|
flamegraph (0.9.5)
|
100
61
|
haml (5.2.2)
|
101
62
|
temple (>= 0.8.0)
|
@@ -107,62 +68,59 @@ GEM
|
|
107
68
|
concurrent-ruby (~> 1.0)
|
108
69
|
i18n-spec (0.6.0)
|
109
70
|
iso
|
110
|
-
ice_nine (0.11.2)
|
111
71
|
iso (0.4.0)
|
112
72
|
i18n
|
113
|
-
json (2.6.
|
73
|
+
json (2.6.3)
|
114
74
|
json_spec (1.1.5)
|
115
75
|
multi_json (~> 1.0)
|
116
76
|
rspec (>= 2.0, < 4.0)
|
117
77
|
kramdown (2.3.2)
|
118
78
|
rexml
|
119
|
-
liquid (4.0.
|
120
|
-
locomotivecms_common (0.
|
121
|
-
activesupport (>= 5
|
122
|
-
attr_extras (~>
|
79
|
+
liquid (4.0.4)
|
80
|
+
locomotivecms_common (0.5.0)
|
81
|
+
activesupport (>= 5)
|
82
|
+
attr_extras (~> 7.1.0)
|
123
83
|
colorize
|
124
|
-
stringex (~> 2.8.
|
125
|
-
mail (2.
|
84
|
+
stringex (~> 2.8.5)
|
85
|
+
mail (2.8.1)
|
126
86
|
mini_mime (>= 0.1.1)
|
127
|
-
|
128
|
-
|
129
|
-
|
87
|
+
net-imap
|
88
|
+
net-pop
|
89
|
+
net-smtp
|
90
|
+
memory_profiler (1.0.1)
|
130
91
|
mime-types (3.3.1)
|
131
92
|
mime-types-data (~> 3.2015)
|
132
|
-
mime-types-data (3.
|
93
|
+
mime-types-data (3.2023.0218.1)
|
133
94
|
mimetype-fu (0.1.2)
|
134
95
|
mini_mime (1.1.2)
|
135
|
-
mini_portile2 (2.8.
|
136
|
-
minitest (5.
|
96
|
+
mini_portile2 (2.8.1)
|
97
|
+
minitest (5.17.0)
|
137
98
|
moneta (1.0.0)
|
138
|
-
mongo (2.
|
139
|
-
bson (>= 4.
|
99
|
+
mongo (2.18.2)
|
100
|
+
bson (>= 4.14.1, < 5.0.0)
|
140
101
|
morphine (0.1.1)
|
141
|
-
mprelude (0.1.0)
|
142
|
-
abstract_type (~> 0.0.7)
|
143
|
-
adamantium (~> 0.2.0)
|
144
|
-
concord (~> 0.1.5)
|
145
|
-
equalizer (~> 0.0.9)
|
146
|
-
ice_nine (~> 0.11.1)
|
147
|
-
procto (~> 0.0.2)
|
148
102
|
multi_json (1.15.0)
|
149
103
|
multi_xml (0.6.0)
|
104
|
+
net-imap (0.3.4)
|
105
|
+
date
|
106
|
+
net-protocol
|
107
|
+
net-pop (0.1.2)
|
108
|
+
net-protocol
|
109
|
+
net-protocol (0.2.1)
|
110
|
+
timeout
|
111
|
+
net-smtp (0.3.3)
|
112
|
+
net-protocol
|
150
113
|
nio4r (2.5.8)
|
151
|
-
nokogiri (1.
|
114
|
+
nokogiri (1.14.2)
|
152
115
|
mini_portile2 (~> 2.8.0)
|
153
116
|
racc (~> 1.4)
|
154
|
-
nokogumbo (2.0.5)
|
155
|
-
nokogiri (~> 1.8, >= 1.8.4)
|
156
117
|
origin (2.3.1)
|
157
|
-
parser (2.7.2.0)
|
158
|
-
ast (~> 2.4.1)
|
159
118
|
pony (1.13.1)
|
160
119
|
mail (>= 2.0)
|
161
|
-
|
162
|
-
|
163
|
-
puma (5.6.5)
|
120
|
+
public_suffix (5.0.1)
|
121
|
+
puma (6.1.0)
|
164
122
|
nio4r (~> 2.0)
|
165
|
-
racc (1.6.
|
123
|
+
racc (1.6.2)
|
166
124
|
rack (2.2.3.1)
|
167
125
|
rack-cache (1.7.2)
|
168
126
|
rack (>= 0.4)
|
@@ -174,9 +132,6 @@ GEM
|
|
174
132
|
rack_csrf (2.6.0)
|
175
133
|
rack (>= 1.1.0)
|
176
134
|
rake (13.0.6)
|
177
|
-
rb-fsevent (0.11.2)
|
178
|
-
rb-inotify (0.10.1)
|
179
|
-
ffi (~> 1.0)
|
180
135
|
rexml (3.2.5)
|
181
136
|
rspec (3.7.0)
|
182
137
|
rspec-core (~> 3.7.0)
|
@@ -191,68 +146,51 @@ GEM
|
|
191
146
|
diff-lcs (>= 1.2.0, < 2.0)
|
192
147
|
rspec-support (~> 3.7.0)
|
193
148
|
rspec-support (3.7.1)
|
194
|
-
sanitize (
|
149
|
+
sanitize (6.0.1)
|
195
150
|
crass (~> 1.0.2)
|
196
|
-
nokogiri (>= 1.
|
197
|
-
nokogumbo (~> 2.0)
|
198
|
-
sass (3.4.25)
|
151
|
+
nokogiri (>= 1.12.0)
|
199
152
|
simplecov (0.16.1)
|
200
153
|
docile (~> 1.1)
|
201
154
|
json (>= 1.8, < 3)
|
202
155
|
simplecov-html (~> 0.10.0)
|
203
156
|
simplecov-html (0.10.2)
|
204
|
-
|
205
|
-
concurrent-ruby (~> 1.0)
|
206
|
-
rack (> 1, < 3)
|
207
|
-
stackprof (0.2.21)
|
157
|
+
stackprof (0.2.23)
|
208
158
|
stringex (2.8.5)
|
209
159
|
sync (0.5.0)
|
210
|
-
temple (0.
|
160
|
+
temple (0.10.0)
|
211
161
|
term-ansicolor (1.7.1)
|
212
162
|
tins (~> 1.0)
|
213
163
|
thor (1.2.1)
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
tins (1.
|
164
|
+
tilt (2.1.0)
|
165
|
+
timecop (0.9.6)
|
166
|
+
timeout (0.3.2)
|
167
|
+
tins (1.32.1)
|
218
168
|
sync
|
219
|
-
tzinfo (
|
220
|
-
|
221
|
-
uglifier (4.1.20)
|
222
|
-
execjs (>= 0.3.0, < 3)
|
223
|
-
unparser (0.5.5)
|
224
|
-
abstract_type (~> 0.0.7)
|
225
|
-
adamantium (~> 0.2.0)
|
226
|
-
anima (~> 0.3.1)
|
227
|
-
concord (~> 0.1.5)
|
228
|
-
diff-lcs (~> 1.3)
|
229
|
-
equalizer (~> 0.0.9)
|
230
|
-
mprelude (~> 0.1.0)
|
231
|
-
parser (>= 2.6.5)
|
232
|
-
procto (~> 0.0.2)
|
169
|
+
tzinfo (2.0.6)
|
170
|
+
concurrent-ruby (~> 1.0)
|
233
171
|
|
234
172
|
PLATFORMS
|
235
173
|
ruby
|
236
|
-
x86_64-darwin-
|
174
|
+
x86_64-darwin-22
|
237
175
|
|
238
176
|
DEPENDENCIES
|
239
|
-
coveralls (~> 0.8.
|
177
|
+
coveralls (~> 0.8.23)
|
240
178
|
flamegraph
|
241
179
|
haml (~> 5.2.0)
|
242
180
|
i18n-spec (~> 0.6.0)
|
243
181
|
json_spec (~> 1.1.5)
|
244
182
|
locomotivecms_steam!
|
245
183
|
memory_profiler
|
246
|
-
mongo (~> 2.
|
184
|
+
mongo (~> 2.18.2)
|
247
185
|
origin (~> 2.3.1)
|
248
|
-
puma (~>
|
186
|
+
puma (~> 6.1.0)
|
249
187
|
rack (~> 2.2.3.1)
|
250
188
|
rack-mini-profiler (~> 0.10.1)
|
251
189
|
rack-test (~> 0.8.2)
|
252
|
-
rake
|
190
|
+
rake
|
253
191
|
rspec (~> 3.7.0)
|
254
192
|
stackprof
|
255
193
|
timecop (~> 0.9.1)
|
256
194
|
|
257
195
|
BUNDLED WITH
|
258
|
-
2.3.
|
196
|
+
2.3.10
|
data/Rakefile
CHANGED
@@ -27,8 +27,8 @@ namespace :mongodb do
|
|
27
27
|
`mv #{dump_path} #{db_path}`
|
28
28
|
end
|
29
29
|
|
30
|
-
`mongo
|
31
|
-
`mongorestore -d
|
30
|
+
`mongo steam_test_1_7_x --eval "db.dropDatabase()" #{host}`
|
31
|
+
`mongorestore -d steam_test_1_7_x #{db_path} #{host}`
|
32
32
|
|
33
33
|
puts "Done! Update now the spec/support/helpers.rb file by setting the new id of the site returned by the mongodb_site_id method"
|
34
34
|
end
|
@@ -23,7 +23,7 @@ module Locomotive::Steam
|
|
23
23
|
def update(entity)
|
24
24
|
entity.tap do
|
25
25
|
serialized_entity = @mapper.serialize(entity)
|
26
|
-
@collection.find(_id: entity._id).update_one(serialized_entity)
|
26
|
+
@collection.find(_id: entity._id).update_one('$set' => serialized_entity)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'parser/current'
|
2
|
-
require 'unparser'
|
3
|
-
|
4
1
|
module Locomotive
|
5
2
|
module Steam
|
6
3
|
module Liquid
|
@@ -13,52 +10,28 @@ module Locomotive
|
|
13
10
|
|
14
11
|
module Attributes
|
15
12
|
|
16
|
-
SyntaxWithoutComa = /^ *([a-zA-Z0-9_.]*:.*)$/
|
17
|
-
SyntaxWithComa = /^[a-zA-Z0-9 _"']*, *(.*)$/
|
18
|
-
|
19
13
|
attr_reader :attributes, :raw_attributes
|
20
14
|
|
21
15
|
private
|
22
16
|
|
23
17
|
def parse_attributes(markup, default = {})
|
24
|
-
@
|
25
|
-
|
26
|
-
if markup =~ SyntaxWithoutComa
|
27
|
-
attribute_markup = $1
|
28
|
-
elsif markup =~ SyntaxWithComa
|
29
|
-
attribute_markup = $1
|
30
|
-
end
|
31
|
-
unless attribute_markup.blank?
|
32
|
-
@raw_attributes.merge!(AttributeParser.parse(attribute_markup))
|
33
|
-
end
|
34
|
-
@raw_attributes
|
35
|
-
end
|
18
|
+
@attributes = default || {}
|
19
|
+
@raw_attributes = @attributes.dup
|
36
20
|
|
37
|
-
|
38
|
-
vals.map { value.is_a?(::Liquid::VariableLookup) ? context.evaluate(value) : value }
|
39
|
-
end
|
21
|
+
return if markup.blank?
|
40
22
|
|
41
|
-
|
42
|
-
|
43
|
-
end
|
23
|
+
markup.scan(tag_attributes_regexp) do |key, value|
|
24
|
+
_key = key.to_sym
|
44
25
|
|
45
|
-
|
46
|
-
|
47
|
-
raw_attributes.each do |key, value|
|
48
|
-
hash[evaluate_value(context, key, lax: lax)] = evaluate_value(context, value, lax: lax)
|
49
|
-
end
|
26
|
+
@attributes[_key] = block_given? ? yield(value) : ::Liquid::Expression.parse(value)
|
27
|
+
@raw_attributes[_key] = @attributes[_key]
|
50
28
|
end
|
51
29
|
end
|
52
30
|
|
53
|
-
def
|
54
|
-
|
55
|
-
when ::Liquid::VariableLookup
|
31
|
+
def evaluate_attributes(context, lax: false)
|
32
|
+
@attributes = @raw_attributes.transform_values do |value|
|
56
33
|
_value = context.evaluate(value)
|
57
34
|
lax && _value.nil? ? value&.name : _value
|
58
|
-
when Array then value.map { |_value| evaluate_value(context, _value) }
|
59
|
-
when Hash then value.transform_values { |_value| evaluate_value(context, _value) }
|
60
|
-
else
|
61
|
-
value
|
62
35
|
end
|
63
36
|
end
|
64
37
|
|
@@ -66,70 +39,10 @@ module Locomotive
|
|
66
39
|
::Liquid::TagAttributes
|
67
40
|
end
|
68
41
|
|
69
|
-
class AttributeParser
|
70
|
-
class << self
|
71
|
-
def parse(markup)
|
72
|
-
handle_hash(Parser::CurrentRuby.parse("{#{markup}}"), )
|
73
|
-
end
|
74
|
-
|
75
|
-
def handle(node)
|
76
|
-
handler = "handle_#{node.type}"
|
77
|
-
unless respond_to?(handler)
|
78
|
-
raise ::Liquid::SyntaxError.new(
|
79
|
-
"Fail to parse attributes. Unknown expression type: #{node.type.inspect}")
|
80
|
-
end
|
81
|
-
public_send handler, node
|
82
|
-
end
|
83
|
-
|
84
|
-
def handle_hash(node)
|
85
|
-
res = {}
|
86
|
-
node.children.each do | n |
|
87
|
-
res[handle(n.children[0])] = handle(n.children[1])
|
88
|
-
end
|
89
|
-
res
|
90
|
-
end
|
91
|
-
|
92
|
-
def handle_sym(node)
|
93
|
-
node.children[0]
|
94
|
-
end
|
95
|
-
|
96
|
-
def handle_int(node)
|
97
|
-
node.children[0]
|
98
|
-
end
|
99
|
-
|
100
|
-
def handle_str(node)
|
101
|
-
node.children[0]
|
102
|
-
end
|
103
|
-
|
104
|
-
def handle_regexp(node)
|
105
|
-
Unparser.unparse(node)
|
106
|
-
end
|
107
|
-
|
108
|
-
def handle_send(node)
|
109
|
-
::Liquid::Expression.parse(Unparser.unparse(node))
|
110
|
-
end
|
111
|
-
|
112
|
-
def handle_true(node)
|
113
|
-
true
|
114
|
-
end
|
115
|
-
|
116
|
-
def handle_false(node)
|
117
|
-
false
|
118
|
-
end
|
119
|
-
|
120
|
-
def handle_float(node)
|
121
|
-
node.children[0]
|
122
|
-
end
|
123
|
-
|
124
|
-
def handle_array(node)
|
125
|
-
node.children.map{|n| handle(n)}
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
42
|
end
|
43
|
+
|
131
44
|
end
|
132
45
|
end
|
133
46
|
end
|
134
47
|
end
|
135
|
-
end
|
48
|
+
end
|
@@ -7,7 +7,7 @@ module Locomotive
|
|
7
7
|
|
8
8
|
Syntax = /(#{::Liquid::QuotedFragment}+)(\s*,.+)?/o
|
9
9
|
|
10
|
-
attr_reader :handle
|
10
|
+
attr_reader :handle
|
11
11
|
|
12
12
|
def initialize(tag_name, markup, options)
|
13
13
|
super
|
@@ -15,13 +15,6 @@ module Locomotive
|
|
15
15
|
if markup =~ Syntax
|
16
16
|
@handle, _attributes = $1, $2
|
17
17
|
|
18
|
-
# this is a hack for sites which don't follow the new syntax.
|
19
|
-
# We need this hack because the value pass by with can contain "-"
|
20
|
-
# for example : "link_to another_song, with: a-song-template"
|
21
|
-
# This will be evaluated as multiple variable by the ruby AST parser
|
22
|
-
# So we need to convert it to "link_to another_song, with: 'a-song-template'"
|
23
|
-
parse_compatible_attributes(_attributes)
|
24
|
-
|
25
18
|
parse_attributes(_attributes)
|
26
19
|
else
|
27
20
|
self.wrong_syntax!
|
@@ -29,14 +22,14 @@ module Locomotive
|
|
29
22
|
end
|
30
23
|
|
31
24
|
def render_path(context, &block)
|
32
|
-
evaluate_attributes(context)
|
25
|
+
evaluate_attributes(context, lax: true)
|
33
26
|
|
34
27
|
set_vars_from_context(context)
|
35
28
|
|
36
29
|
handle = @context[@handle] || @handle
|
37
30
|
|
38
31
|
# is external url?
|
39
|
-
if handle
|
32
|
+
if handle =~ Locomotive::Steam::IsHTTP
|
40
33
|
handle
|
41
34
|
elsif page = self.retrieve_page_drop_from_handle(handle) # return a drop or model?
|
42
35
|
# make sure we've got the page/content entry (if templatized)
|
@@ -53,18 +46,6 @@ module Locomotive
|
|
53
46
|
|
54
47
|
protected
|
55
48
|
|
56
|
-
def parse_compatible_attributes(_attributes)
|
57
|
-
if _attributes
|
58
|
-
_compatible_attributes = _attributes.dup
|
59
|
-
%w(with locale).each do |name|
|
60
|
-
_compatible_attributes.gsub!(/#{name}: ([\w-]+)/, name + ': "\1"')
|
61
|
-
end
|
62
|
-
@compatible_attributes = parse_attributes(_compatible_attributes)
|
63
|
-
else
|
64
|
-
@compatible_attributes = {}
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
49
|
def services
|
69
50
|
@context.registers[:services]
|
70
51
|
end
|
@@ -105,11 +86,11 @@ module Locomotive
|
|
105
86
|
end
|
106
87
|
|
107
88
|
def locale
|
108
|
-
attributes[:locale] ||
|
89
|
+
attributes[:locale] || @locale
|
109
90
|
end
|
110
91
|
|
111
92
|
def template_slug
|
112
|
-
attributes[:with]
|
93
|
+
attributes[:with]
|
113
94
|
end
|
114
95
|
|
115
96
|
def set_vars_from_context(context)
|
@@ -123,4 +104,4 @@ module Locomotive
|
|
123
104
|
end
|
124
105
|
end
|
125
106
|
end
|
126
|
-
end
|
107
|
+
end
|
@@ -25,9 +25,9 @@ module Locomotive
|
|
25
25
|
super
|
26
26
|
|
27
27
|
if markup =~ Syntax
|
28
|
-
@variable_name, @url_expr,
|
28
|
+
@variable_name, @url_expr, attributes = $1.to_s, ::Liquid::Expression.parse($2), $3
|
29
29
|
|
30
|
-
parse_attributes(
|
30
|
+
parse_attributes(attributes)
|
31
31
|
else
|
32
32
|
raise ::Liquid::SyntaxError.new("Syntax Error in 'consume' - Valid syntax: consume <var> from \"<url>\" [username: value, password: value]")
|
33
33
|
end
|
@@ -99,4 +99,4 @@ module Locomotive
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
end
|
102
|
-
end
|
102
|
+
end
|
@@ -72,7 +72,7 @@ module Locomotive
|
|
72
72
|
page: parse_context[:page],
|
73
73
|
name: name,
|
74
74
|
found_super: self.contains_super?(nodelist)
|
75
|
-
}.merge(
|
75
|
+
}.merge(attributes))
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -85,7 +85,8 @@ module Locomotive
|
|
85
85
|
|
86
86
|
# the block drop is in charge of rendering "{{ block.super }}"
|
87
87
|
context['block'] = Drops::InheritedBlock.new(block)
|
88
|
-
|
88
|
+
|
89
|
+
anchor_html = if live_editing?(context) && (attributes[:anchor] || attributes[:anchor].nil?)
|
89
90
|
%{<span class="locomotive-block-anchor" data-element-id="#{name}" style="visibility: hidden"></span>}
|
90
91
|
else
|
91
92
|
''
|
@@ -154,4 +155,4 @@ module Locomotive
|
|
154
155
|
end
|
155
156
|
end
|
156
157
|
end
|
157
|
-
end
|
158
|
+
end
|