representative_view 1.2.0 → 1.2.1

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.
data/Gemfile CHANGED
@@ -7,6 +7,8 @@ if ENV["ACTIONPACK_VERSION"]
7
7
  gem "actionpack", ENV["ACTIONPACK_VERSION"]
8
8
  end
9
9
 
10
+ gem "nokogiri", ">= 1.5.0"
11
+
10
12
  group :test do
11
13
  gem "rake", "~> 0.8.7"
12
14
  gem "rspec", "~> 2.5.0"
@@ -6,7 +6,7 @@ Representative View
6
6
  Installing it
7
7
  -------------
8
8
 
9
- Simply add the '`representative_view`' gem to your `Gemfile`
9
+ Simply add the '`representative_view`' gem to your `Gemfile`
10
10
 
11
11
  gem "representative_view"
12
12
 
@@ -18,14 +18,14 @@ Using it
18
18
  In your controller, declare that you can provide both XML and JSON, e.g.
19
19
 
20
20
  class BooksController < ApplicationController
21
-
21
+
22
22
  def index
23
23
  respond_to do |format|
24
24
  format.xml
25
25
  format.json
26
26
  end
27
27
  end
28
-
28
+
29
29
  end
30
30
 
31
31
  Next, create a template with the suffix "`.rep`" (to select the Representative View template handler) and use the Representative DSL to generate elements and lists, e.g.
@@ -7,8 +7,6 @@ module RepresentativeView
7
7
  include ActionView::TemplateHandlers::Compilable
8
8
 
9
9
  def compile(template)
10
- require 'representative/json'
11
- require 'representative/nokogiri'
12
10
  <<-RUBY
13
11
  representative_view(#{template.format.inspect} || template_format) do |r|
14
12
  #{template.source}
@@ -5,8 +5,6 @@ module RepresentativeView
5
5
  class ActionPack3Handler
6
6
 
7
7
  def self.call(template)
8
- require 'representative/json'
9
- require 'representative/nokogiri'
10
8
  <<-RUBY
11
9
  representative_view(formats.first) do |r|
12
10
  #{template.source}
@@ -1,3 +1,3 @@
1
1
  module RepresentativeView
2
- VERSION = "1.2.0".freeze
2
+ VERSION = "1.2.1".freeze
3
3
  end
@@ -1,4 +1,6 @@
1
1
  require 'action_view'
2
+ require 'representative/json'
3
+ require 'representative/nokogiri'
2
4
 
3
5
  module RepresentativeView
4
6
 
@@ -15,7 +15,7 @@ describe "a Representative template" do
15
15
 
16
16
  it "can generate XML" do
17
17
  render("books", :xml, :books => Books.all).should == undent(<<-XML)
18
- <?xml version="1.0"?>
18
+ <?xml version="1.0" encoding="utf-8"?>
19
19
  <books type="array">
20
20
  <book>
21
21
  <title>Sailing for old dogs</title>
@@ -33,7 +33,7 @@ describe "a Representative template" do
33
33
  it "can generate XML dialects" do
34
34
  Mime::Type.register "application/vnd.books+xml", :book_xml
35
35
  render("books", :book_xml, :books => Books.all).should == undent(<<-XML)
36
- <?xml version="1.0"?>
36
+ <?xml version="1.0" encoding="utf-8"?>
37
37
  <books type="array">
38
38
  <book>
39
39
  <title>Sailing for old dogs</title>
@@ -142,7 +142,7 @@ describe "a Representative template" do
142
142
  <h2>XML REPRESENTATION</h2>
143
143
 
144
144
  <pre>
145
- &lt;?xml version=&quot;1.0&quot;?&gt;
145
+ &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
146
146
  &lt;books type=&quot;array&quot;&gt;
147
147
  &lt;book&gt;
148
148
  &lt;title&gt;Sailing for old dogs&lt;/title&gt;
@@ -184,7 +184,7 @@ describe "a Representative template" do
184
184
  RepresentativeView.xml_options = {:naming_strategy => :upcase}
185
185
 
186
186
  render("books", :xml, :books => Books.all).should == undent(<<-XML)
187
- <?xml version="1.0"?>
187
+ <?xml version="1.0" encoding="utf-8"?>
188
188
  <BOOKS TYPE="array">
189
189
  <BOOK>
190
190
  <TITLE>Sailing for old dogs</TITLE>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: representative_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-06 00:00:00.000000000Z
12
+ date: 2012-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: representative
16
- requirement: &70240665487840 !ruby/object:Gem::Requirement
16
+ requirement: &70357628933980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70240665487840
24
+ version_requirements: *70357628933980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: actionpack
27
- requirement: &70240665487140 !ruby/object:Gem::Requirement
27
+ requirement: &70357628933460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>'
@@ -35,7 +35,7 @@ dependencies:
35
35
  version: 4.0.0
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *70240665487140
38
+ version_requirements: *70357628933460
39
39
  description:
40
40
  email: mdub@dogbiscuit.org
41
41
  executables: []
@@ -69,18 +69,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
69
  - - ! '>='
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
- segments:
73
- - 0
74
- hash: 2640363158941591145
75
72
  required_rubygems_version: !ruby/object:Gem::Requirement
76
73
  none: false
77
74
  requirements:
78
75
  - - ! '>='
79
76
  - !ruby/object:Gem::Version
80
77
  version: '0'
81
- segments:
82
- - 0
83
- hash: 2640363158941591145
84
78
  requirements: []
85
79
  rubyforge_project:
86
80
  rubygems_version: 1.8.10