dryml 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/dryml.gemspec +1 -1
- data/lib/dryml/helper.rb +5 -1
- data/lib/dryml/template_environment.rb +9 -5
- data/test/dryml.rdoctest +1 -0
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aeab80979d40c10f1851ed6397c5efc0b317e81
|
4
|
+
data.tar.gz: 0ad7025a6fdaa6acec287a9f2d5e177ca865f86b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f7a2c5848da1614100fe5edd9d30dc052992e55d20a6920b40811870cc6862ece16c977c16c06d3a779512453f06301c9ac30ff754d465e714dead666848b33
|
7
|
+
data.tar.gz: 01d40482a3d61bb88999ea35eeebb9a74c8bc432874b570eb5de8b17360a1315e495c8c516e85044c211163f64ccdfd81f51b517b5940c6d7942fe290a149cee
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.2
|
data/dryml.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
|
14
14
|
s.add_runtime_dependency('actionpack', ["~> 4.0.2"])
|
15
15
|
s.add_runtime_dependency('hobo_support', ["= #{version}"])
|
16
|
-
s.add_development_dependency('rubydoctest', [">= 1.1.3"])
|
16
|
+
# s.add_development_dependency('rubydoctest', [">= 1.1.3"])
|
17
17
|
s.add_development_dependency('cucumber', '~> 1.1.0')
|
18
18
|
s.add_development_dependency('aruba', '~> 0.4.6')
|
19
19
|
|
data/lib/dryml/helper.rb
CHANGED
@@ -20,14 +20,16 @@ module Dryml::Helper
|
|
20
20
|
# TODO: Calls to respond_to? in here can cause the full collection hiding behind a scoped collection to get loaded
|
21
21
|
res = []
|
22
22
|
empty = true
|
23
|
-
scope.new_scope(:repeat_collection => enum, :even_odd => 'odd', :repeat_item => nil) do
|
23
|
+
scope.new_scope(:repeat_collection => enum, :even_odd => 'odd', :repeat_item => nil, :index => 0) do
|
24
24
|
if !enum.respond_to?(:to_a) && enum.respond_to?(:each_pair)
|
25
25
|
enum.each_pair do |key, value|
|
26
26
|
scope.repeat_item = value
|
27
27
|
empty = false;
|
28
28
|
self.this_key = key;
|
29
29
|
new_object_context(value) { res << yield }
|
30
|
+
# The lines below are only used to prepare for the next element of the collection
|
30
31
|
scope.even_odd = scope.even_odd == "even" ? "odd" : "even"
|
32
|
+
scope.index += 1
|
31
33
|
end
|
32
34
|
else
|
33
35
|
index = 0
|
@@ -39,8 +41,10 @@ module Dryml::Helper
|
|
39
41
|
else
|
40
42
|
new_object_context(e) { res << yield }
|
41
43
|
end
|
44
|
+
# The lines below are only used to prepare for the next element of the collection
|
42
45
|
scope.even_odd = scope.even_odd == "even" ? "odd" : "even"
|
43
46
|
index += 1
|
47
|
+
scope.index += 1
|
44
48
|
end
|
45
49
|
end
|
46
50
|
Dryml.last_if = !empty
|
@@ -44,11 +44,12 @@ module Dryml
|
|
44
44
|
instance_variable_set(iv, view.instance_variable_get(iv))
|
45
45
|
end
|
46
46
|
|
47
|
-
#
|
48
|
-
self.
|
49
|
-
self.
|
50
|
-
self.
|
51
|
-
self.
|
47
|
+
# Copy some class attributes needed for Sprockets to work correctly
|
48
|
+
self.extend ::Sprockets::Rails::Helper
|
49
|
+
self.assets_prefix = view.try(:assets_prefix)
|
50
|
+
self.assets_environment = view.try(:assets_environment)
|
51
|
+
self.assets_manifest = view.try(:assets_manifest)
|
52
|
+
self.digest_assets = view.try(:digest_assets)
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
@@ -641,6 +642,9 @@ module Dryml
|
|
641
642
|
@view ? @view.session : {}
|
642
643
|
end
|
643
644
|
|
645
|
+
def config
|
646
|
+
@view ? @view.config : {}
|
647
|
+
end
|
644
648
|
|
645
649
|
def method_missing(name, *args, &b)
|
646
650
|
if @view
|
data/test/dryml.rdoctest
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
>> require 'active_support'
|
4
4
|
>> require 'action_view'
|
5
5
|
>> require 'action_controller'
|
6
|
+
>> require 'sprockets/railtie'
|
6
7
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../hobo_support/lib')
|
7
8
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../dryml/lib')
|
8
9
|
>> require 'hobo_support'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dryml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Locke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -30,28 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.1.
|
33
|
+
version: 2.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.1.
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubydoctest
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.1.3
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.1.3
|
40
|
+
version: 2.1.2
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: cucumber
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|