green_monkey 0.2.2 → 0.3.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/.gitignore +2 -1
- data/.travis.yml +13 -9
- data/Gemfile +1 -1
- data/Gemfile.lock +115 -99
- data/{Gemfile.rails-4.1 → Gemfile.rails-4.2} +1 -1
- data/{Gemfile.rails-3.2 → Gemfile.rails-5} +1 -1
- data/{Gemfile.rails-3.0 → Gemfile.rails-5.1} +1 -1
- data/README.md +1 -1
- data/green_monkey.gemspec +1 -1
- data/lib/green_monkey/ext/action_view.rb +36 -10
- data/lib/green_monkey/ext/haml.rb +8 -4
- data/lib/green_monkey/ext/view_helper.rb +5 -1
- data/spec/action_view_spec.rb +2 -2
- data/spec/spec_helper.rb +11 -3
- metadata +6 -9
- data/Gemfile.haml-edge +0 -5
- data/Gemfile.rails-3.1 +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0686362a0baec8b14b634d22298877bbb8b63666'
|
|
4
|
+
data.tar.gz: 383b6a17e8472a5b35322abb8033dbcd67d5638d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50e16fb4529936568fba250d98f5586c4aa7084dd0ad314a4dbbff85a145991894b2557c35695c00bc1a9937059339c95d02632b7c930883f5a8e63d45ce4a5e
|
|
7
|
+
data.tar.gz: 7c8add2f508a3307f36ce4451b1539b7b29da6d1345720fa5708e16614b5e53c9c8c4ff43adda7b5942be9674c9d380dba5fe8bd371246f8e803563e4ba562ef
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
language: ruby
|
|
2
|
+
|
|
3
|
+
script: rake
|
|
4
|
+
|
|
5
|
+
install: bundle install --jobs=3 --retry=5
|
|
6
|
+
|
|
2
7
|
rvm:
|
|
3
|
-
-
|
|
4
|
-
- 2.
|
|
5
|
-
- 2.1
|
|
8
|
+
- 2.2.7
|
|
9
|
+
- 2.3.4
|
|
10
|
+
- 2.4.1
|
|
11
|
+
|
|
6
12
|
gemfile:
|
|
7
|
-
- Gemfile.rails-
|
|
8
|
-
- Gemfile.rails-
|
|
9
|
-
- Gemfile.rails-
|
|
10
|
-
- Gemfile.rails-4.1
|
|
11
|
-
- Gemfile.haml-edge
|
|
13
|
+
- Gemfile.rails-4.2
|
|
14
|
+
- Gemfile.rails-5.0
|
|
15
|
+
- Gemfile.rails-5.1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
green_monkey (0.
|
|
4
|
+
green_monkey (0.3.0)
|
|
5
5
|
chronic_duration
|
|
6
6
|
haml (>= 3.1.0)
|
|
7
7
|
mida_vocabulary (>= 0.2.2)
|
|
@@ -9,125 +9,138 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
|
|
13
|
-
actionpack (=
|
|
14
|
-
|
|
12
|
+
actioncable (5.1.0)
|
|
13
|
+
actionpack (= 5.1.0)
|
|
14
|
+
nio4r (~> 2.0)
|
|
15
|
+
websocket-driver (~> 0.6.1)
|
|
16
|
+
actionmailer (5.1.0)
|
|
17
|
+
actionpack (= 5.1.0)
|
|
18
|
+
actionview (= 5.1.0)
|
|
19
|
+
activejob (= 5.1.0)
|
|
15
20
|
mail (~> 2.5, >= 2.5.4)
|
|
16
|
-
rails-dom-testing (~>
|
|
17
|
-
actionpack (
|
|
18
|
-
actionview (=
|
|
19
|
-
activesupport (=
|
|
20
|
-
rack (~>
|
|
21
|
-
rack-test (~> 0.6.
|
|
22
|
-
rails-
|
|
23
|
-
rails-
|
|
24
|
-
actionview (
|
|
25
|
-
activesupport (=
|
|
21
|
+
rails-dom-testing (~> 2.0)
|
|
22
|
+
actionpack (5.1.0)
|
|
23
|
+
actionview (= 5.1.0)
|
|
24
|
+
activesupport (= 5.1.0)
|
|
25
|
+
rack (~> 2.0)
|
|
26
|
+
rack-test (~> 0.6.3)
|
|
27
|
+
rails-dom-testing (~> 2.0)
|
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
29
|
+
actionview (5.1.0)
|
|
30
|
+
activesupport (= 5.1.0)
|
|
26
31
|
builder (~> 3.1)
|
|
27
|
-
|
|
28
|
-
rails-
|
|
29
|
-
rails-
|
|
30
|
-
activejob (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
activerecord (
|
|
36
|
-
activemodel (=
|
|
37
|
-
activesupport (=
|
|
38
|
-
arel (
|
|
39
|
-
activesupport (
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
erubi (~> 1.4)
|
|
33
|
+
rails-dom-testing (~> 2.0)
|
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
|
35
|
+
activejob (5.1.0)
|
|
36
|
+
activesupport (= 5.1.0)
|
|
37
|
+
globalid (>= 0.3.6)
|
|
38
|
+
activemodel (5.1.0)
|
|
39
|
+
activesupport (= 5.1.0)
|
|
40
|
+
activerecord (5.1.0)
|
|
41
|
+
activemodel (= 5.1.0)
|
|
42
|
+
activesupport (= 5.1.0)
|
|
43
|
+
arel (~> 8.0)
|
|
44
|
+
activesupport (5.1.0)
|
|
45
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
46
|
+
i18n (~> 0.7)
|
|
42
47
|
minitest (~> 5.1)
|
|
43
|
-
thread_safe (~> 0.1)
|
|
44
48
|
tzinfo (~> 1.1)
|
|
45
|
-
arel (
|
|
49
|
+
arel (8.0.0)
|
|
46
50
|
blankslate (3.1.3)
|
|
47
|
-
builder (3.2.
|
|
51
|
+
builder (3.2.3)
|
|
48
52
|
chronic_duration (0.10.6)
|
|
49
53
|
numerizer (~> 0.1.1)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
concurrent-ruby (1.0.5)
|
|
55
|
+
diff-lcs (1.3)
|
|
56
|
+
erubi (1.6.0)
|
|
57
|
+
globalid (0.4.0)
|
|
58
|
+
activesupport (>= 4.2.0)
|
|
59
|
+
haml (5.0.1)
|
|
60
|
+
temple (>= 0.8.0)
|
|
55
61
|
tilt
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
mail (2.6.
|
|
60
|
-
mime-types (>= 1.16, <
|
|
62
|
+
i18n (0.8.1)
|
|
63
|
+
loofah (2.0.3)
|
|
64
|
+
nokogiri (>= 1.5.9)
|
|
65
|
+
mail (2.6.5)
|
|
66
|
+
mime-types (>= 1.16, < 4)
|
|
67
|
+
method_source (0.8.2)
|
|
61
68
|
mida_vocabulary (0.2.2)
|
|
62
69
|
blankslate (~> 3.1)
|
|
63
|
-
mime-types (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
mime-types (3.1)
|
|
71
|
+
mime-types-data (~> 3.2015)
|
|
72
|
+
mime-types-data (3.2016.0521)
|
|
73
|
+
mini_portile2 (2.1.0)
|
|
74
|
+
minitest (5.10.1)
|
|
75
|
+
nio4r (2.0.0)
|
|
76
|
+
nokogiri (1.7.1)
|
|
77
|
+
mini_portile2 (~> 2.1.0)
|
|
69
78
|
numerizer (0.1.1)
|
|
70
|
-
rack (
|
|
71
|
-
rack-test (0.6.
|
|
79
|
+
rack (2.0.1)
|
|
80
|
+
rack-test (0.6.3)
|
|
72
81
|
rack (>= 1.0)
|
|
73
|
-
rails (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
rails (5.1.0)
|
|
83
|
+
actioncable (= 5.1.0)
|
|
84
|
+
actionmailer (= 5.1.0)
|
|
85
|
+
actionpack (= 5.1.0)
|
|
86
|
+
actionview (= 5.1.0)
|
|
87
|
+
activejob (= 5.1.0)
|
|
88
|
+
activemodel (= 5.1.0)
|
|
89
|
+
activerecord (= 5.1.0)
|
|
90
|
+
activesupport (= 5.1.0)
|
|
81
91
|
bundler (>= 1.3.0, < 2.0)
|
|
82
|
-
railties (=
|
|
83
|
-
sprockets-rails (
|
|
84
|
-
rails-
|
|
85
|
-
activesupport (>= 4.2.0.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
railties (= 5.1.0)
|
|
93
|
+
sprockets-rails (>= 2.0.0)
|
|
94
|
+
rails-dom-testing (2.0.2)
|
|
95
|
+
activesupport (>= 4.2.0, < 6.0)
|
|
96
|
+
nokogiri (~> 1.6)
|
|
97
|
+
rails-html-sanitizer (1.0.3)
|
|
98
|
+
loofah (~> 2.0)
|
|
99
|
+
railties (5.1.0)
|
|
100
|
+
actionpack (= 5.1.0)
|
|
101
|
+
activesupport (= 5.1.0)
|
|
102
|
+
method_source
|
|
93
103
|
rake (>= 0.8.7)
|
|
94
104
|
thor (>= 0.18.1, < 2.0)
|
|
95
|
-
rake (
|
|
96
|
-
rspec (3.
|
|
97
|
-
rspec-core (~> 3.
|
|
98
|
-
rspec-expectations (~> 3.
|
|
99
|
-
rspec-mocks (~> 3.
|
|
100
|
-
rspec-core (3.
|
|
101
|
-
rspec-support (~> 3.
|
|
102
|
-
rspec-expectations (3.
|
|
105
|
+
rake (12.0.0)
|
|
106
|
+
rspec (3.5.0)
|
|
107
|
+
rspec-core (~> 3.5.0)
|
|
108
|
+
rspec-expectations (~> 3.5.0)
|
|
109
|
+
rspec-mocks (~> 3.5.0)
|
|
110
|
+
rspec-core (3.5.4)
|
|
111
|
+
rspec-support (~> 3.5.0)
|
|
112
|
+
rspec-expectations (3.5.0)
|
|
103
113
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
104
|
-
rspec-support (~> 3.
|
|
105
|
-
rspec-mocks (3.
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
rspec-support (~> 3.5.0)
|
|
115
|
+
rspec-mocks (3.5.0)
|
|
116
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
117
|
+
rspec-support (~> 3.5.0)
|
|
118
|
+
rspec-rails (3.5.2)
|
|
108
119
|
actionpack (>= 3.0)
|
|
109
120
|
activesupport (>= 3.0)
|
|
110
121
|
railties (>= 3.0)
|
|
111
|
-
rspec-core (~> 3.
|
|
112
|
-
rspec-expectations (~> 3.
|
|
113
|
-
rspec-mocks (~> 3.
|
|
114
|
-
rspec-support (~> 3.
|
|
115
|
-
rspec-support (3.
|
|
116
|
-
sprockets (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
tilt (~> 1.1, != 1.3.0)
|
|
121
|
-
sprockets-rails (3.0.0.beta1)
|
|
122
|
+
rspec-core (~> 3.5.0)
|
|
123
|
+
rspec-expectations (~> 3.5.0)
|
|
124
|
+
rspec-mocks (~> 3.5.0)
|
|
125
|
+
rspec-support (~> 3.5.0)
|
|
126
|
+
rspec-support (3.5.0)
|
|
127
|
+
sprockets (3.7.1)
|
|
128
|
+
concurrent-ruby (~> 1.0)
|
|
129
|
+
rack (> 1, < 3)
|
|
130
|
+
sprockets-rails (3.2.0)
|
|
122
131
|
actionpack (>= 4.0)
|
|
123
132
|
activesupport (>= 4.0)
|
|
124
|
-
sprockets (
|
|
125
|
-
sqlite3 (1.3.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
sprockets (>= 3.0.0)
|
|
134
|
+
sqlite3 (1.3.13)
|
|
135
|
+
temple (0.8.0)
|
|
136
|
+
thor (0.19.4)
|
|
137
|
+
thread_safe (0.3.6)
|
|
138
|
+
tilt (2.0.7)
|
|
139
|
+
tzinfo (1.2.3)
|
|
130
140
|
thread_safe (~> 0.1)
|
|
141
|
+
websocket-driver (0.6.5)
|
|
142
|
+
websocket-extensions (>= 0.1.0)
|
|
143
|
+
websocket-extensions (0.1.2)
|
|
131
144
|
|
|
132
145
|
PLATFORMS
|
|
133
146
|
ruby
|
|
@@ -136,7 +149,10 @@ DEPENDENCIES
|
|
|
136
149
|
bundler (>= 1.0.0)
|
|
137
150
|
green_monkey!
|
|
138
151
|
nokogiri
|
|
139
|
-
rails (=
|
|
152
|
+
rails (= 5.1.0)
|
|
140
153
|
rspec (>= 2.9.0)
|
|
141
154
|
rspec-rails
|
|
142
155
|
sqlite3
|
|
156
|
+
|
|
157
|
+
BUNDLED WITH
|
|
158
|
+
1.14.6
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## About
|
|
4
4
|
|
|
5
|
-
This Gem allows you to make html-layout with microdata properties easier. It works with ruby
|
|
5
|
+
This Gem allows you to make html-layout with microdata properties easier. It works with ruby 2.2+, rails 4, rails 5, haml 5+.
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
data/green_monkey.gemspec
CHANGED
|
@@ -1,24 +1,50 @@
|
|
|
1
1
|
# Add support for "itemscope" html attributes
|
|
2
2
|
|
|
3
|
+
#module GreenMonkeyActionViewExt
|
|
4
|
+
#end
|
|
5
|
+
|
|
6
|
+
# For rails < 5
|
|
3
7
|
module ActionView::Helpers::TagHelper
|
|
4
8
|
# Rails by default does not behave with itemscope as boolean attribute
|
|
5
9
|
# and renders it as itemscope="true"
|
|
6
10
|
|
|
7
11
|
# this changes make it render as itemscope="itemscope"
|
|
8
|
-
BOOLEAN_ATTRIBUTES.
|
|
12
|
+
unless BOOLEAN_ATTRIBUTES.include?("itemscope")
|
|
13
|
+
BOOLEAN_ATTRIBUTES.merge(['itemscope', :itemscope])
|
|
14
|
+
end
|
|
9
15
|
|
|
10
|
-
|
|
16
|
+
if private_instance_methods.include?(:tag_options)
|
|
17
|
+
private
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
# this hack replaces itemscope="itemscope" => itemscope
|
|
20
|
+
# to make it follow standarts (http://www.w3.org/TR/microdata/#typed-items)
|
|
21
|
+
alias_method :tag_options_before_green_monkey, :tag_options
|
|
22
|
+
def tag_options(options, escape = true)
|
|
23
|
+
str = tag_options_before_green_monkey(options, escape)
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
if options['itemscope'] || options[:itemscope]
|
|
26
|
+
str = (str + '').sub(/itemscope=('|")itemscope('|")/, 'itemscope').html_safe
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
str
|
|
20
30
|
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
# For rails 5+
|
|
35
|
+
if defined?(ActionView::Helpers::TagHelper::TagBuilder)
|
|
36
|
+
class ActionView::Helpers::TagHelper::TagBuilder
|
|
37
|
+
# this hack replaces itemscope="itemscope" => itemscope
|
|
38
|
+
# to make it follow standarts (http://www.w3.org/TR/microdata/#typed-items)
|
|
39
|
+
alias_method :tag_options_before_green_monkey, :tag_options
|
|
40
|
+
def tag_options(options, escape = true)
|
|
41
|
+
str = tag_options_before_green_monkey(options, escape)
|
|
42
|
+
|
|
43
|
+
if options['itemscope'] || options[:itemscope]
|
|
44
|
+
str = (str + '').sub(/itemscope=('|")itemscope('|")/, 'itemscope').html_safe
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
str
|
|
48
|
+
end
|
|
23
49
|
end
|
|
24
50
|
end
|
|
@@ -3,7 +3,7 @@ require "haml"
|
|
|
3
3
|
# this hack looks at active-record object's :html_schema_type field and adds itemscope, itemid and itemtype to element
|
|
4
4
|
# example:
|
|
5
5
|
#
|
|
6
|
-
# %article[post]
|
|
6
|
+
# %article[post]
|
|
7
7
|
# => <article class="post" itemscope itemtype="http://schema.org/BlogPosting" itemid="1">
|
|
8
8
|
#
|
|
9
9
|
# %section[Mida(:Blog)]
|
|
@@ -25,7 +25,11 @@ class Haml::Buffer
|
|
|
25
25
|
options = {}
|
|
26
26
|
ref.each do |obj|
|
|
27
27
|
next if obj == "local-variable"
|
|
28
|
-
self.class.merge_attrs
|
|
28
|
+
if self.class.respond_to?(:merge_attrs)
|
|
29
|
+
self.class.merge_attrs(options, process_object_ref(obj))
|
|
30
|
+
else
|
|
31
|
+
Haml::AttributeBuilder.merge_attributes!(options, process_object_ref(obj))
|
|
32
|
+
end
|
|
29
33
|
end
|
|
30
34
|
options
|
|
31
35
|
end
|
|
@@ -49,7 +53,7 @@ class Haml::Buffer
|
|
|
49
53
|
# my hack for microdata attributes
|
|
50
54
|
if obj.respond_to?(:html_schema_type)
|
|
51
55
|
options['itemscope'] = true
|
|
52
|
-
options['itemid'] = obj.id
|
|
56
|
+
options['itemid'] = obj.has_attribute?(:slug) ? obj.slug : obj.id
|
|
53
57
|
|
|
54
58
|
if obj.html_schema_type.kind_of?(Mida::Vocabulary)
|
|
55
59
|
options['itemtype'] = obj.html_schema_type.itemtype.source
|
|
@@ -63,4 +67,4 @@ class Haml::Buffer
|
|
|
63
67
|
end
|
|
64
68
|
end
|
|
65
69
|
|
|
66
|
-
end
|
|
70
|
+
end
|
|
@@ -106,7 +106,11 @@ module GreenMonkey
|
|
|
106
106
|
options.merge!(itemtype: object)
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
-
tag_options(
|
|
109
|
+
if respond_to?(:tag_options) || private_methods.include?(:tag_options)
|
|
110
|
+
send(:tag_options, options)
|
|
111
|
+
else
|
|
112
|
+
tag_builder.tag_options(options)
|
|
113
|
+
end
|
|
110
114
|
end
|
|
111
115
|
|
|
112
116
|
def breadcrumb_link_to(title, path, options = {})
|
data/spec/action_view_spec.rb
CHANGED
|
@@ -7,7 +7,7 @@ describe "ActionView hacks" do
|
|
|
7
7
|
include TestInlineRenderer
|
|
8
8
|
|
|
9
9
|
it "should works with stylesheet_link_tag" do
|
|
10
|
-
str = render_haml "= stylesheet_link_tag 'application'"
|
|
10
|
+
str = render_haml "= stylesheet_link_tag 'application', skip_pipeline: true"
|
|
11
11
|
|
|
12
12
|
str.should =~ %r{link.+href="/stylesheets/application.css.*"}
|
|
13
13
|
end
|
|
@@ -36,7 +36,7 @@ describe "ActionView hacks" do
|
|
|
36
36
|
str = render_haml('= breadcrumb_link_to("Home", "/")').strip
|
|
37
37
|
str.index('http://data-vocabulary.org/Breadcrumb').should_not == nil
|
|
38
38
|
str.should == '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">' +
|
|
39
|
-
'<a
|
|
39
|
+
'<a itemprop="url" href="/"><span itemprop="title">Home</span></a>' +
|
|
40
40
|
'</span>'
|
|
41
41
|
end
|
|
42
42
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
|
1
|
+
#ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
|
2
2
|
ENV['RAILS_ENV'] ||= 'development'
|
|
3
3
|
|
|
4
4
|
require 'bundler/setup'
|
|
@@ -6,6 +6,7 @@ require 'bundler/setup'
|
|
|
6
6
|
require 'rails/all'
|
|
7
7
|
require 'rails/generators'
|
|
8
8
|
require 'rails/generators/test_case'
|
|
9
|
+
require 'haml'
|
|
9
10
|
|
|
10
11
|
require "green_monkey"
|
|
11
12
|
|
|
@@ -18,6 +19,9 @@ module TestApp
|
|
|
18
19
|
end
|
|
19
20
|
end
|
|
20
21
|
|
|
22
|
+
class ApplicationController < ActionController::Base
|
|
23
|
+
end
|
|
24
|
+
|
|
21
25
|
Rails.application = TestApp::Application
|
|
22
26
|
|
|
23
27
|
module Rails
|
|
@@ -59,9 +63,13 @@ end
|
|
|
59
63
|
|
|
60
64
|
module TestInlineRenderer
|
|
61
65
|
def render_file(file, options = {})
|
|
62
|
-
|
|
66
|
+
if ApplicationController.respond_to?(:render)
|
|
67
|
+
ApplicationController.render(file: file, locals: options)
|
|
68
|
+
else
|
|
69
|
+
ActionController::Base.new.render_to_string(file: file, locals: options, handlers: [:haml])
|
|
70
|
+
end
|
|
63
71
|
end
|
|
64
|
-
|
|
72
|
+
|
|
65
73
|
def render_haml(template, options = {})
|
|
66
74
|
$t += 1
|
|
67
75
|
file = File.expand_path(File.dirname(__FILE__) + "/../tmp/#{$t}.haml")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: green_monkey
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pavel Evstigneev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-05-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: haml
|
|
@@ -134,12 +134,10 @@ files:
|
|
|
134
134
|
- ".rspec"
|
|
135
135
|
- ".travis.yml"
|
|
136
136
|
- Gemfile
|
|
137
|
-
- Gemfile.haml-edge
|
|
138
137
|
- Gemfile.lock
|
|
139
|
-
- Gemfile.rails-
|
|
140
|
-
- Gemfile.rails-
|
|
141
|
-
- Gemfile.rails-
|
|
142
|
-
- Gemfile.rails-4.1
|
|
138
|
+
- Gemfile.rails-4.2
|
|
139
|
+
- Gemfile.rails-5
|
|
140
|
+
- Gemfile.rails-5.1
|
|
143
141
|
- README.md
|
|
144
142
|
- Rakefile
|
|
145
143
|
- green_monkey.gemspec
|
|
@@ -186,9 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
186
184
|
version: 1.2.0
|
|
187
185
|
requirements: []
|
|
188
186
|
rubyforge_project:
|
|
189
|
-
rubygems_version: 2.
|
|
187
|
+
rubygems_version: 2.6.8
|
|
190
188
|
signing_key:
|
|
191
189
|
specification_version: 4
|
|
192
190
|
summary: Rails and Haml microdata toolkit
|
|
193
191
|
test_files: []
|
|
194
|
-
has_rdoc:
|
data/Gemfile.haml-edge
DELETED
data/Gemfile.rails-3.1
DELETED