rabl-rails 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -2
- data/CHANGELOG.md +10 -0
- data/Gemfile +5 -9
- data/README.md +5 -3
- data/Rakefile +2 -2
- data/lib/rabl-rails.rb +21 -74
- data/lib/rabl-rails/compiler.rb +28 -38
- data/lib/rabl-rails/configuration.rb +48 -0
- data/lib/rabl-rails/handler.rb +3 -1
- data/lib/rabl-rails/helpers.rb +7 -0
- data/lib/rabl-rails/library.rb +43 -16
- data/lib/rabl-rails/nodes.rb +6 -0
- data/lib/rabl-rails/nodes/attribute.rb +17 -0
- data/lib/rabl-rails/nodes/child.rb +12 -0
- data/lib/rabl-rails/nodes/code.rb +19 -0
- data/lib/rabl-rails/nodes/condition.rb +14 -0
- data/lib/rabl-rails/nodes/glue.rb +25 -0
- data/lib/rabl-rails/nodes/node.rb +9 -0
- data/lib/rabl-rails/railtie.rb +0 -2
- data/lib/rabl-rails/renderer.rb +15 -13
- data/lib/rabl-rails/renderers/hash.rb +85 -0
- data/lib/rabl-rails/renderers/json.rb +9 -5
- data/lib/rabl-rails/renderers/plist.rb +6 -4
- data/lib/rabl-rails/renderers/xml.rb +6 -3
- data/lib/rabl-rails/responder.rb +1 -1
- data/lib/rabl-rails/template.rb +11 -5
- data/lib/rabl-rails/version.rb +1 -1
- data/lib/rabl-rails/visitors.rb +2 -0
- data/lib/rabl-rails/visitors/to_hash.rb +131 -0
- data/lib/rabl-rails/visitors/visitor.rb +17 -0
- data/rabl-rails.gemspec +3 -5
- data/test/helper.rb +75 -0
- data/test/renderers/test_hash_renderer.rb +90 -0
- data/test/renderers/test_json_renderer.rb +46 -0
- data/test/renderers/test_plist_renderer.rb +42 -0
- data/test/renderers/test_xml_renderer.rb +37 -0
- data/test/test_compiler.rb +283 -0
- data/test/test_configuration.rb +31 -0
- data/test/test_hash_visitor.rb +224 -0
- data/test/test_library.rb +85 -0
- data/test/{render_test.rb → test_render.rb} +18 -24
- metadata +99 -108
- data/lib/rabl-rails/condition.rb +0 -10
- data/lib/rabl-rails/renderers/base.rb +0 -171
- data/test/base_renderer_test.rb +0 -67
- data/test/cache_templates_test.rb +0 -35
- data/test/compiler_test.rb +0 -233
- data/test/deep_nesting_test.rb +0 -56
- data/test/keyword_test.rb +0 -47
- data/test/non_restful_response_test.rb +0 -35
- data/test/renderers/json_renderer_test.rb +0 -189
- data/test/renderers/plist_renderer_test.rb +0 -135
- data/test/renderers/xml_renderer_test.rb +0 -137
- data/test/test_helper.rb +0 -68
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestConfiguration < MINITEST_TEST_CLASS
|
4
|
+
describe 'Configuration' do
|
5
|
+
it 'has a zero score by default' do
|
6
|
+
config = RablRails::Configuration.new
|
7
|
+
assert_equal 0, config.result_flags
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'sets a bit per option' do
|
11
|
+
config = RablRails::Configuration.new
|
12
|
+
config.replace_nil_values_with_empty_strings = true
|
13
|
+
assert_equal 1, config.result_flags
|
14
|
+
|
15
|
+
config = RablRails::Configuration.new
|
16
|
+
config.replace_empty_string_values_with_nil = true
|
17
|
+
assert_equal 2, config.result_flags
|
18
|
+
|
19
|
+
config = RablRails::Configuration.new
|
20
|
+
config.exclude_nil_values = true
|
21
|
+
assert_equal 4, config.result_flags
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'allows mutiple bits to be set at the same time' do
|
25
|
+
config = RablRails::Configuration.new
|
26
|
+
config.replace_nil_values_with_empty_strings = true
|
27
|
+
config.replace_empty_string_values_with_nil = true
|
28
|
+
assert_equal 3, config.result_flags
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestHashVisitor < MINITEST_TEST_CLASS
|
4
|
+
describe 'hash visitor' do
|
5
|
+
def visitor_result
|
6
|
+
visitor = Visitors::ToHash.new(@context)
|
7
|
+
visitor.reset_for @resource
|
8
|
+
visitor.visit @nodes
|
9
|
+
visitor.result
|
10
|
+
end
|
11
|
+
|
12
|
+
before do
|
13
|
+
@context = Context.new
|
14
|
+
@resource = User.new(1, 'Marty')
|
15
|
+
@nodes = []
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'renders empty nodes list' do
|
19
|
+
assert_equal({}, visitor_result)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'renders attributes node' do
|
23
|
+
@nodes << RablRails::Nodes::Attribute.new(id: :id)
|
24
|
+
assert_equal({ id: 1 }, visitor_result)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'renders array of nodes' do
|
28
|
+
@nodes = [
|
29
|
+
RablRails::Nodes::Attribute.new(id: :id),
|
30
|
+
RablRails::Nodes::Attribute.new(name: :name)
|
31
|
+
]
|
32
|
+
assert_equal({ id: 1, name: 'Marty' }, visitor_result)
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'with a child node' do
|
36
|
+
Address = Struct.new(:city)
|
37
|
+
|
38
|
+
before do
|
39
|
+
@template = RablRails::CompiledTemplate.new
|
40
|
+
@template.add_node(RablRails::Nodes::Attribute.new(city: :city))
|
41
|
+
@nodes << RablRails::Nodes::Child.new(:address, @template)
|
42
|
+
@address = Address.new('Paris')
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'renders with resource association as data source' do
|
46
|
+
@template.data = :address
|
47
|
+
def @resource.address; end
|
48
|
+
@resource.stub :address, @address do
|
49
|
+
assert_equal({ address: { city: 'Paris' } }, visitor_result)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'renders with arbitrary data source' do
|
54
|
+
@template.data = :@address
|
55
|
+
@context.assigns['address'] = @address
|
56
|
+
assert_equal({ address: { city: 'Paris' } }, visitor_result)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'renders with local method as data source' do
|
60
|
+
@template.data = :address
|
61
|
+
def @context.address; end
|
62
|
+
@context.stub :address, @address do
|
63
|
+
assert_equal({ address: { city: 'Paris' } }, visitor_result)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'renders with a collection as data source' do
|
68
|
+
@template.data = :address
|
69
|
+
def @context.address; end
|
70
|
+
@context.stub :address, [@address, @address] do
|
71
|
+
assert_equal({ address: [
|
72
|
+
{ city: 'Paris' },
|
73
|
+
{ city: 'Paris' }
|
74
|
+
]}, visitor_result)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'renders if the source is nil' do
|
79
|
+
@template.data = :address
|
80
|
+
def @resource.address; end
|
81
|
+
@resource.stub :address, nil do
|
82
|
+
assert_equal({ address: nil }, visitor_result)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'renders glue nodes' do
|
88
|
+
template = RablRails::CompiledTemplate.new
|
89
|
+
template.add_node(RablRails::Nodes::Attribute.new(name: :name))
|
90
|
+
template.data = :@user
|
91
|
+
|
92
|
+
@nodes << RablRails::Nodes::Glue.new(template)
|
93
|
+
@context.assigns['user'] = @resource
|
94
|
+
assert_equal({ name: 'Marty'}, visitor_result)
|
95
|
+
end
|
96
|
+
|
97
|
+
describe 'with a code node' do
|
98
|
+
before do
|
99
|
+
@proc = ->(object) { object.name }
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'renders the evaluated proc' do
|
103
|
+
@nodes << RablRails::Nodes::Code.new(:name, @proc)
|
104
|
+
assert_equal({ name: 'Marty'}, visitor_result)
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'renders with a true condition' do
|
108
|
+
@nodes << RablRails::Nodes::Code.new(:name, @proc, ->(o) { true })
|
109
|
+
assert_equal({ name: 'Marty'}, visitor_result)
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'renders nothing with a false condition' do
|
113
|
+
@nodes << RablRails::Nodes::Code.new(:name, @proc, ->(o) { false })
|
114
|
+
assert_equal({}, visitor_result)
|
115
|
+
end
|
116
|
+
|
117
|
+
it 'renders method called from context' do
|
118
|
+
@proc = ->(object) { context_method }
|
119
|
+
def @context.context_method; end
|
120
|
+
|
121
|
+
@nodes = [RablRails::Nodes::Code.new(:name, @proc)]
|
122
|
+
@context.stub :context_method, 'Biff' do
|
123
|
+
assert_equal({ name: 'Biff'}, visitor_result)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
describe 'with a condition node' do
|
129
|
+
before do
|
130
|
+
@ns = [RablRails::Nodes::Attribute.new(name: :name)]
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'renders transparently if the condition is met' do
|
134
|
+
@nodes << RablRails::Nodes::Condition.new(->(o) { true }, @ns)
|
135
|
+
assert_equal({ name: 'Marty' }, visitor_result)
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'renders nothing if the condition is not met' do
|
139
|
+
@nodes << RablRails::Nodes::Condition.new(->(o) { false }, @ns)
|
140
|
+
assert_equal({}, visitor_result)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'renders a merge node' do
|
145
|
+
proc = ->(c) { { custom: c.name } }
|
146
|
+
@nodes << RablRails::Nodes::Code.new(nil, proc)
|
147
|
+
assert_equal({ custom: 'Marty' }, visitor_result)
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'raises an exception when trying to merge a non hash object' do
|
151
|
+
proc = ->(c) { c.name }
|
152
|
+
@nodes << RablRails::Nodes::Code.new(nil, proc)
|
153
|
+
assert_raises(RablRails::Renderer::PartialError) { visitor_result }
|
154
|
+
end
|
155
|
+
|
156
|
+
it 'renders partial defined in code node' do
|
157
|
+
template = RablRails::CompiledTemplate.new
|
158
|
+
template.add_node(RablRails::Nodes::Attribute.new(name: :name))
|
159
|
+
proc = ->(u) { partial('users/base', object: u) }
|
160
|
+
|
161
|
+
library = MiniTest::Mock.new
|
162
|
+
library.expect :compile_template_from_path, template, ['users/base', @context]
|
163
|
+
|
164
|
+
@nodes << RablRails::Nodes::Code.new(:user, proc)
|
165
|
+
RablRails::Library.stub :instance, library do
|
166
|
+
assert_equal({ user: { name: 'Marty' } }, visitor_result)
|
167
|
+
end
|
168
|
+
|
169
|
+
library.verify
|
170
|
+
end
|
171
|
+
|
172
|
+
it 'renders partial with empty target' do
|
173
|
+
proc = ->(u) { partial('users/base', object: []) }
|
174
|
+
@nodes << RablRails::Nodes::Code.new(:users, proc)
|
175
|
+
assert_equal({ users: [] }, visitor_result)
|
176
|
+
end
|
177
|
+
|
178
|
+
it 'raises an exception when calling a partial without a target' do
|
179
|
+
proc = ->(u) { partial('users/base') }
|
180
|
+
@nodes << RablRails::Nodes::Code.new(:user, proc)
|
181
|
+
assert_raises(RablRails::Renderer::PartialError) { visitor_result }
|
182
|
+
end
|
183
|
+
|
184
|
+
describe 'when hash options are set' do
|
185
|
+
before do
|
186
|
+
RablRails.reset_configuration
|
187
|
+
@nodes << RablRails::Nodes::Attribute.new(name: :name)
|
188
|
+
end
|
189
|
+
|
190
|
+
after { RablRails.reset_configuration }
|
191
|
+
|
192
|
+
it 'replaces nil values by strings' do
|
193
|
+
RablRails.configuration.replace_nil_values_with_empty_strings = true
|
194
|
+
@resource = User.new(1, nil)
|
195
|
+
|
196
|
+
assert_equal({ name: '' }, visitor_result)
|
197
|
+
end
|
198
|
+
|
199
|
+
it 'replaces empty string by nil' do
|
200
|
+
RablRails.configuration.replace_empty_string_values_with_nil = true
|
201
|
+
@resource = User.new(1, '')
|
202
|
+
|
203
|
+
assert_equal({ name: nil }, visitor_result)
|
204
|
+
end
|
205
|
+
|
206
|
+
it 'excludes nil values' do
|
207
|
+
RablRails.configuration.exclude_nil_values = true
|
208
|
+
@resource = User.new(1, nil)
|
209
|
+
@nodes << RablRails::Nodes::Attribute.new(id: :id)
|
210
|
+
|
211
|
+
assert_equal({ id: 1 }, visitor_result)
|
212
|
+
end
|
213
|
+
|
214
|
+
it 'excludes nil values and empty strings' do
|
215
|
+
RablRails.configuration.replace_empty_string_values_with_nil = true
|
216
|
+
RablRails.configuration.exclude_nil_values = true
|
217
|
+
@resource = User.new(nil, '')
|
218
|
+
@nodes << RablRails::Nodes::Attribute.new(id: :id)
|
219
|
+
|
220
|
+
assert_equal({}, visitor_result)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestLibrary < MINITEST_TEST_CLASS
|
4
|
+
RablRails::Library.send(:attr_reader, :cached_templates)
|
5
|
+
|
6
|
+
describe 'library' do
|
7
|
+
before do
|
8
|
+
@library = RablRails::Library.instance
|
9
|
+
@library.reset_cache!
|
10
|
+
@context = Context.new
|
11
|
+
@template = RablRails::CompiledTemplate.new
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#get_rendered_template' do
|
15
|
+
it 'compiles and renders template' do
|
16
|
+
renderer = MiniTest::Mock.new
|
17
|
+
renderer.expect :render, '{}', [@template, @context, nil]
|
18
|
+
|
19
|
+
result = @library.stub :compile_template_from_source, @template do
|
20
|
+
RablRails::Renderers.stub :const_get, renderer do
|
21
|
+
@library.get_rendered_template '', @context
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_equal '{}', result
|
26
|
+
assert renderer.verify
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'accepts format as string' do
|
30
|
+
result = @library.stub :compile_template_from_source, @template do
|
31
|
+
@context.stub :params, { format: 'xml' } do
|
32
|
+
RablRails::Renderers::XML.stub :render, '<xml>' do
|
33
|
+
@library.get_rendered_template '', @context
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
assert_equal '<xml>', result
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'accepts format as symbol' do
|
42
|
+
result = @library.stub :compile_template_from_source, @template do
|
43
|
+
@context.stub :params, { format: :plist } do
|
44
|
+
RablRails::Renderers::PLIST.stub :render, '<plist>' do
|
45
|
+
@library.get_rendered_template '', @context
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
assert_equal '<plist>', result
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#compile_template_from_source' do
|
55
|
+
it 'compiles a template' do
|
56
|
+
compiler = MiniTest::Mock.new
|
57
|
+
compiler.expect :compile_source, @template, ['attribute :id']
|
58
|
+
|
59
|
+
result = RablRails::Compiler.stub :new, compiler do
|
60
|
+
@library.compile_template_from_source('attribute :id', @context)
|
61
|
+
end
|
62
|
+
|
63
|
+
assert_equal @template, result
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'caches compiled template if option is set' do
|
67
|
+
@context.virtual_path = 'users/base'
|
68
|
+
template = with_configuration :cache_templates, true do
|
69
|
+
@library.compile_template_from_source("attribute :id", @context)
|
70
|
+
end
|
71
|
+
|
72
|
+
assert_equal(template, @library.cached_templates['users/base'])
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'compiles source without caching it if options is not set' do
|
76
|
+
@context.virtual_path = 'users/base'
|
77
|
+
template = with_configuration :cache_templates, false do
|
78
|
+
@library.compile_template_from_source("attribute :id", @context)
|
79
|
+
end
|
80
|
+
|
81
|
+
assert_empty @library.cached_templates
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -1,15 +1,16 @@
|
|
1
|
-
require '
|
1
|
+
require 'helper'
|
2
2
|
require 'pathname'
|
3
3
|
require 'tmpdir'
|
4
4
|
|
5
|
-
class
|
5
|
+
class TestRender < MINITEST_TEST_CLASS
|
6
|
+
@@tmp_path = Pathname.new(Dir.mktmpdir)
|
6
7
|
|
7
|
-
setup
|
8
|
+
def setup
|
8
9
|
@user = User.new(1, 'Marty')
|
9
|
-
@tmp_path =
|
10
|
+
@tmp_path = @@tmp_path
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
+
def test_object_as_option
|
13
14
|
File.open(@tmp_path + "nil.json.rabl", "w") do |f|
|
14
15
|
f.puts %q{
|
15
16
|
object :@user
|
@@ -19,7 +20,7 @@ class RenderTest < ActiveSupport::TestCase
|
|
19
20
|
assert_equal %q({"user":{"name":"Marty"}}), RablRails.render(nil, 'nil', locals: { object: @user }, view_path: @tmp_path)
|
20
21
|
end
|
21
22
|
|
22
|
-
|
23
|
+
def test_load_source_from_file
|
23
24
|
File.open(@tmp_path + "show.json.rabl", "w") do |f|
|
24
25
|
f.puts %q{
|
25
26
|
object :@user
|
@@ -29,11 +30,11 @@ class RenderTest < ActiveSupport::TestCase
|
|
29
30
|
assert_equal %q({"user":{"id":1,"name":"Marty"}}), RablRails.render(@user, 'show', view_path: @tmp_path)
|
30
31
|
end
|
31
32
|
|
32
|
-
|
33
|
+
def test_template_not_found
|
33
34
|
assert_raises(RablRails::Renderer::TemplateNotFound) { RablRails.render(@user, 'not_found') }
|
34
35
|
end
|
35
36
|
|
36
|
-
|
37
|
+
def test_with_locals_options
|
37
38
|
File.open(@tmp_path + "instance.json.rabl", "w") do |f|
|
38
39
|
f.puts %q{
|
39
40
|
object false
|
@@ -43,7 +44,7 @@ class RenderTest < ActiveSupport::TestCase
|
|
43
44
|
assert_equal %q({"username":"Marty"}), RablRails.render(nil, 'instance', view_path: @tmp_path, locals: { user: @user })
|
44
45
|
end
|
45
46
|
|
46
|
-
|
47
|
+
def test_extend_with_view_path
|
47
48
|
File.open(@tmp_path + "extend.json.rabl", "w") do |f|
|
48
49
|
f.puts %q{
|
49
50
|
object :@user
|
@@ -60,7 +61,7 @@ class RenderTest < ActiveSupport::TestCase
|
|
60
61
|
assert_equal %q({"user":{"extended_name":"Marty"}}), RablRails.render(@user, 'extend', view_path: @tmp_path)
|
61
62
|
end
|
62
63
|
|
63
|
-
|
64
|
+
def test_format_as_symbol_or_string
|
64
65
|
File.open(@tmp_path + "show.json.rabl", "w") do |f|
|
65
66
|
f.puts %q{
|
66
67
|
object :@user
|
@@ -73,20 +74,13 @@ class RenderTest < ActiveSupport::TestCase
|
|
73
74
|
assert_equal %q({"user":{"id":1,"name":"Marty"}}), RablRails.render(@user, 'show', view_path: @tmp_path, format: 'JSON')
|
74
75
|
end
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
attributes :id, :name
|
83
|
-
}
|
84
|
-
end
|
85
|
-
|
86
|
-
assert_equal %q({"user":{"id":1,"name":"Marty"}}), RablRails.render(@user, 'show', view_path: @tmp_path)
|
87
|
-
ensure
|
88
|
-
RablRails.allow_empty_format_in_template = false
|
77
|
+
def test_format_omitted
|
78
|
+
File.open(@tmp_path + "show.rabl", "w") do |f|
|
79
|
+
f.puts %q{
|
80
|
+
object :@user
|
81
|
+
attributes :id, :name
|
82
|
+
}
|
89
83
|
end
|
84
|
+
assert_equal %q({"user":{"id":1,"name":"Marty"}}), RablRails.render(@user, 'show', view_path: @tmp_path)
|
90
85
|
end
|
91
|
-
|
92
86
|
end
|
metadata
CHANGED
@@ -1,83 +1,71 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabl-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 3
|
8
|
-
- 4
|
9
|
-
version: 0.3.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Christopher Cocchi-Perrier
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2014-10-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: activesupport
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 3
|
29
|
-
- 1
|
30
|
-
version: "3.1"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.1'
|
31
22
|
type: :runtime
|
32
|
-
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: railties
|
35
23
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: railties
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '3.1'
|
44
38
|
type: :runtime
|
45
|
-
version_requirements: *id002
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: actionpack
|
48
39
|
prerelease: false
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.1'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: thread_safe
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.3.1
|
54
|
+
type: :runtime
|
61
55
|
prerelease: false
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
version: "0"
|
69
|
-
type: :development
|
70
|
-
version_requirements: *id004
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.3.1
|
71
62
|
description: Fast Rails 3+ templating system with JSON, XML and PList support
|
72
|
-
email:
|
63
|
+
email:
|
73
64
|
- cocchi.c@gmail.com
|
74
65
|
executables: []
|
75
|
-
|
76
66
|
extensions: []
|
77
|
-
|
78
67
|
extra_rdoc_files: []
|
79
|
-
|
80
|
-
files:
|
68
|
+
files:
|
81
69
|
- .gitignore
|
82
70
|
- .travis.yml
|
83
71
|
- CHANGELOG.md
|
@@ -87,70 +75,73 @@ files:
|
|
87
75
|
- Rakefile
|
88
76
|
- lib/rabl-rails.rb
|
89
77
|
- lib/rabl-rails/compiler.rb
|
90
|
-
- lib/rabl-rails/
|
78
|
+
- lib/rabl-rails/configuration.rb
|
91
79
|
- lib/rabl-rails/handler.rb
|
80
|
+
- lib/rabl-rails/helpers.rb
|
92
81
|
- lib/rabl-rails/library.rb
|
82
|
+
- lib/rabl-rails/nodes.rb
|
83
|
+
- lib/rabl-rails/nodes/attribute.rb
|
84
|
+
- lib/rabl-rails/nodes/child.rb
|
85
|
+
- lib/rabl-rails/nodes/code.rb
|
86
|
+
- lib/rabl-rails/nodes/condition.rb
|
87
|
+
- lib/rabl-rails/nodes/glue.rb
|
88
|
+
- lib/rabl-rails/nodes/node.rb
|
93
89
|
- lib/rabl-rails/railtie.rb
|
94
90
|
- lib/rabl-rails/renderer.rb
|
95
|
-
- lib/rabl-rails/renderers/
|
91
|
+
- lib/rabl-rails/renderers/hash.rb
|
96
92
|
- lib/rabl-rails/renderers/json.rb
|
97
93
|
- lib/rabl-rails/renderers/plist.rb
|
98
94
|
- lib/rabl-rails/renderers/xml.rb
|
99
95
|
- lib/rabl-rails/responder.rb
|
100
96
|
- lib/rabl-rails/template.rb
|
101
97
|
- lib/rabl-rails/version.rb
|
98
|
+
- lib/rabl-rails/visitors.rb
|
99
|
+
- lib/rabl-rails/visitors/to_hash.rb
|
100
|
+
- lib/rabl-rails/visitors/visitor.rb
|
102
101
|
- lib/tasks/rabl-rails.rake
|
103
102
|
- rabl-rails.gemspec
|
104
|
-
- test/
|
105
|
-
- test/
|
106
|
-
- test/
|
107
|
-
- test/
|
108
|
-
- test/
|
109
|
-
- test/
|
110
|
-
- test/
|
111
|
-
- test/
|
112
|
-
- test/
|
113
|
-
- test/
|
114
|
-
- test/test_helper.rb
|
115
|
-
has_rdoc: true
|
103
|
+
- test/helper.rb
|
104
|
+
- test/renderers/test_hash_renderer.rb
|
105
|
+
- test/renderers/test_json_renderer.rb
|
106
|
+
- test/renderers/test_plist_renderer.rb
|
107
|
+
- test/renderers/test_xml_renderer.rb
|
108
|
+
- test/test_compiler.rb
|
109
|
+
- test/test_configuration.rb
|
110
|
+
- test/test_hash_visitor.rb
|
111
|
+
- test/test_library.rb
|
112
|
+
- test/test_render.rb
|
116
113
|
homepage: https://github.com/ccocchi/rabl-rails
|
117
114
|
licenses: []
|
118
|
-
|
119
115
|
post_install_message:
|
120
116
|
rdoc_options: []
|
121
|
-
|
122
|
-
require_paths:
|
117
|
+
require_paths:
|
123
118
|
- lib
|
124
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
requirements:
|
133
|
-
- -
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
|
136
|
-
- 0
|
137
|
-
version: "0"
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
none: false
|
127
|
+
requirements:
|
128
|
+
- - ! '>='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
138
131
|
requirements: []
|
139
|
-
|
140
132
|
rubyforge_project:
|
141
|
-
rubygems_version: 1.
|
133
|
+
rubygems_version: 1.8.23
|
142
134
|
signing_key:
|
143
135
|
specification_version: 3
|
144
136
|
summary: Fast Rails 3+ templating system with JSON, XML and PList support
|
145
|
-
test_files:
|
146
|
-
- test/
|
147
|
-
- test/
|
148
|
-
- test/
|
149
|
-
- test/
|
150
|
-
- test/
|
151
|
-
- test/
|
152
|
-
- test/
|
153
|
-
- test/
|
154
|
-
- test/
|
155
|
-
- test/
|
156
|
-
- test/test_helper.rb
|
137
|
+
test_files:
|
138
|
+
- test/helper.rb
|
139
|
+
- test/renderers/test_hash_renderer.rb
|
140
|
+
- test/renderers/test_json_renderer.rb
|
141
|
+
- test/renderers/test_plist_renderer.rb
|
142
|
+
- test/renderers/test_xml_renderer.rb
|
143
|
+
- test/test_compiler.rb
|
144
|
+
- test/test_configuration.rb
|
145
|
+
- test/test_hash_visitor.rb
|
146
|
+
- test/test_library.rb
|
147
|
+
- test/test_render.rb
|