representative 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  require "active_support/core_ext/array"
2
+ require "active_support/json"
2
3
  require "representative/base"
3
- require "multi_json"
4
4
 
5
5
  module Representative
6
6
 
@@ -10,7 +10,7 @@ module Representative
10
10
 
11
11
  def initialize(subject = nil, options = {})
12
12
  super(subject, options)
13
- @buffer = ""
13
+ @buffer = []
14
14
  @indent_level = 0
15
15
  @attribute_prefix = options[:attribute_prefix] || DEFAULT_ATTRIBUTE_PREFIX
16
16
  now_at :beginning_of_buffer
@@ -84,7 +84,8 @@ module Representative
84
84
  end
85
85
 
86
86
  def to_json
87
- @buffer + "\n"
87
+ @buffer << "\n"
88
+ @buffer.join
88
89
  end
89
90
 
90
91
  def to_s
@@ -98,7 +99,7 @@ module Representative
98
99
  end
99
100
 
100
101
  def encode(data)
101
- MultiJson.encode(data)
102
+ ActiveSupport::JSON.encode(data)
102
103
  end
103
104
 
104
105
  def indentation
@@ -108,7 +109,7 @@ module Representative
108
109
  def label(name)
109
110
  return false if @indent_level == 0
110
111
  new_item
111
- emit(encode(format_name(name)) + ": ")
112
+ emit(format_name(name).inspect + ": ")
112
113
  end
113
114
 
114
115
  def new_item
@@ -12,6 +12,7 @@ module Representative
12
12
  def initialize(subject = nil, options = {})
13
13
  super(subject, options)
14
14
  @doc = ::Nokogiri::XML::Document.new
15
+ @doc.encoding = 'utf-8'
15
16
  @current_element = @doc
16
17
  yield self if block_given?
17
18
  end
@@ -1,3 +1,3 @@
1
1
  module Representative
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "1.0.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: representative
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
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: 2011-10-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70320168544360 !ruby/object:Gem::Requirement
16
+ requirement: &70306840912340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70320168544360
24
+ version_requirements: *70306840912340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: i18n
27
- requirement: &70320168543740 !ruby/object:Gem::Requirement
27
+ requirement: &70306841362100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.4.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70320168543740
35
+ version_requirements: *70306841362100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: builder
38
- requirement: &70320168543160 !ruby/object:Gem::Requirement
38
+ requirement: &70306841799820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,21 +43,10 @@ dependencies:
43
43
  version: 2.1.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70320168543160
47
- - !ruby/object:Gem::Dependency
48
- name: multi_json
49
- requirement: &70320168542600 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: 1.0.0
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: *70320168542600
46
+ version_requirements: *70306841799820
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: nokogiri
60
- requirement: &70320168541940 !ruby/object:Gem::Requirement
49
+ requirement: &70306842178620 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
52
  - - ! '>='
@@ -65,10 +54,10 @@ dependencies:
65
54
  version: 1.4.2
66
55
  type: :runtime
67
56
  prerelease: false
68
- version_requirements: *70320168541940
57
+ version_requirements: *70306842178620
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: rake
71
- requirement: &70320168541280 !ruby/object:Gem::Requirement
60
+ requirement: &70306842185980 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ~>
@@ -76,10 +65,10 @@ dependencies:
76
65
  version: 0.8.7
77
66
  type: :development
78
67
  prerelease: false
79
- version_requirements: *70320168541280
68
+ version_requirements: *70306842185980
80
69
  - !ruby/object:Gem::Dependency
81
70
  name: rspec
82
- requirement: &70320168540320 !ruby/object:Gem::Requirement
71
+ requirement: &70306842545580 !ruby/object:Gem::Requirement
83
72
  none: false
84
73
  requirements:
85
74
  - - ~>
@@ -87,10 +76,10 @@ dependencies:
87
76
  version: 2.5.0
88
77
  type: :development
89
78
  prerelease: false
90
- version_requirements: *70320168540320
79
+ version_requirements: *70306842545580
91
80
  - !ruby/object:Gem::Dependency
92
81
  name: tilt
93
- requirement: &70320168539200 !ruby/object:Gem::Requirement
82
+ requirement: &70306843766040 !ruby/object:Gem::Requirement
94
83
  none: false
95
84
  requirements:
96
85
  - - ! '>='
@@ -98,10 +87,10 @@ dependencies:
98
87
  version: '0.9'
99
88
  type: :development
100
89
  prerelease: false
101
- version_requirements: *70320168539200
90
+ version_requirements: *70306843766040
102
91
  - !ruby/object:Gem::Dependency
103
92
  name: diff-lcs
104
- requirement: &70320168538300 !ruby/object:Gem::Requirement
93
+ requirement: &70306844090200 !ruby/object:Gem::Requirement
105
94
  none: false
106
95
  requirements:
107
96
  - - ! '>='
@@ -109,7 +98,7 @@ dependencies:
109
98
  version: '0'
110
99
  type: :development
111
100
  prerelease: false
112
- version_requirements: *70320168538300
101
+ version_requirements: *70306844090200
113
102
  description:
114
103
  email: mdub@dogbiscuit.org
115
104
  executables: []
@@ -150,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
139
  version: '0'
151
140
  segments:
152
141
  - 0
153
- hash: 3455823887133998267
142
+ hash: 1947364240128206184
154
143
  required_rubygems_version: !ruby/object:Gem::Requirement
155
144
  none: false
156
145
  requirements:
@@ -159,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
148
  version: '0'
160
149
  segments:
161
150
  - 0
162
- hash: 3455823887133998267
151
+ hash: 1947364240128206184
163
152
  requirements: []
164
153
  rubyforge_project:
165
154
  rubygems_version: 1.8.10