cosm-rb 0.2.05 → 0.2.07

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ruby-1.8.7-p370
1
+ ruby-1.9.3-p194
@@ -3,10 +3,4 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
- - jruby-18mode
7
- - jruby-19mode
8
- matrix:
9
- allow_failures:
10
- - rvm: jruby-18mode
11
- - rvm: jruby-19mode
12
6
  env: COVERAGE=on
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency("multi_xml", ">=0.5.2")
22
22
  s.add_dependency("yajl-ruby", ">=1.1.0")
23
23
  s.add_dependency("nokogiri", ">=1.5.6")
24
- s.add_dependency("httparty", ">=0.8.3")
24
+ s.add_dependency("httparty", ">=0.10.0")
25
25
 
26
26
  if RUBY_VERSION.to_f < 1.9
27
27
  s.add_dependency("fastercsv", ">=1.5.x")
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_development_dependency("ruby-debug")
35
35
  s.add_development_dependency("rcov", ">=0.9.9")
36
36
  else
37
+ s.add_development_dependency("debugger")
37
38
  s.add_development_dependency("simplecov", ">=0.7.1")
38
39
  end
39
40
  end
@@ -28,6 +28,8 @@ module Cosm
28
28
 
29
29
  hash = Hash.new
30
30
 
31
+ raise InvalidCSVError, "Submitted CSV is empty." if rows.empty?
32
+
31
33
  if version == :v2
32
34
  hash["datastreams"] = extract_datastreams(rows)
33
35
  elsif version == :v1
@@ -1,3 +1,3 @@
1
1
  module Cosm #:nodoc:
2
- VERSION = '0.2.05'
2
+ VERSION = '0.2.07'
3
3
  end
@@ -49,6 +49,18 @@ describe "default feed csv parser" do
49
49
  }.to raise_error(Cosm::Parsers::CSV::InvalidCSVError)
50
50
  end
51
51
 
52
+ it "should raise an error if passed empty content as v2" do
53
+ expect {
54
+ Cosm::Feed.new("", :v2)
55
+ }.to raise_error(Cosm::Parsers::CSV::InvalidCSVError)
56
+ end
57
+
58
+ it "should raise an error if passed empty content as v1" do
59
+ expect {
60
+ Cosm::Feed.new("", :v1)
61
+ }.to raise_error(Cosm::Parsers::CSV::InvalidCSVError)
62
+ end
63
+
52
64
  it "should raise an error if passed some wild csv with more than max permitted three columns" do
53
65
  csv =<<-CSV
54
66
  Date-Time, System HOA,Jockey Pump HOA,VFD Pump HOA,Lag Pump HOA,Lag Pump 2 HOA,Power Monitor,Water Level Relay,High Discharge Pressure,Reset Function,Jockey Running,VFD Run,Lag Pump Run,VFD Fault,Filter In Auto,Filter In Hand,Differential Press 1,Filter 1 Running,High Limit Switch,Low Limit Switch,Lag Pump Running,VFD Run Output Auto,VFD Pump On,Lag Pump,Lag Pump 1 On,System Auto Mode,Fault,Lag Pump 2 Run,Jockey On,Jockey Pump Run,Lag Pump 2,Filter Forward,Filter Reverse,Filter Solenoid,Pressure,Flow,Unknown?,VFD Input,VFD Output,
metadata CHANGED
@@ -1,213 +1,191 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cosm-rb
3
- version: !ruby/object:Gem::Version
4
- hash: 29
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.07
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 5
10
- version: 0.2.05
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Paul Bellamy
14
9
  - Levent Ali
15
10
  - Sam Mulube
16
11
  autorequire:
17
12
  bindir: bin
18
13
  cert_chain: []
19
-
20
- date: 2013-01-11 00:00:00 +00:00
21
- default_executable:
22
- dependencies:
23
- - !ruby/object:Gem::Dependency
24
- requirement: &id001 !ruby/object:Gem::Requirement
14
+ date: 2013-01-28 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: multi_json
18
+ requirement: !ruby/object:Gem::Requirement
25
19
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 23
30
- segments:
31
- - 1
32
- - 3
33
- - 6
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
34
23
  version: 1.3.6
35
- version_requirements: *id001
36
- name: multi_json
37
- prerelease: false
38
24
  type: :runtime
39
- - !ruby/object:Gem::Dependency
40
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
41
27
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 15
46
- segments:
47
- - 0
48
- - 5
49
- - 2
50
- version: 0.5.2
51
- version_requirements: *id002
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: 1.3.6
32
+ - !ruby/object:Gem::Dependency
52
33
  name: multi_xml
53
- prerelease: false
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: 0.5.2
54
40
  type: :runtime
55
- - !ruby/object:Gem::Dependency
56
- requirement: &id003 !ruby/object:Gem::Requirement
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
57
43
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 19
62
- segments:
63
- - 1
64
- - 1
65
- - 0
66
- version: 1.1.0
67
- version_requirements: *id003
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.5.2
48
+ - !ruby/object:Gem::Dependency
68
49
  name: yajl-ruby
69
- prerelease: false
50
+ requirement: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 1.1.0
70
56
  type: :runtime
71
- - !ruby/object:Gem::Dependency
72
- requirement: &id004 !ruby/object:Gem::Requirement
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
73
59
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 15
78
- segments:
79
- - 1
80
- - 5
81
- - 6
82
- version: 1.5.6
83
- version_requirements: *id004
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: 1.1.0
64
+ - !ruby/object:Gem::Dependency
84
65
  name: nokogiri
85
- prerelease: false
66
+ requirement: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: 1.5.6
86
72
  type: :runtime
87
- - !ruby/object:Gem::Dependency
88
- requirement: &id005 !ruby/object:Gem::Requirement
73
+ prerelease: false
74
+ version_requirements: !ruby/object:Gem::Requirement
89
75
  none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- hash: 57
94
- segments:
95
- - 0
96
- - 8
97
- - 3
98
- version: 0.8.3
99
- version_requirements: *id005
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: 1.5.6
80
+ - !ruby/object:Gem::Dependency
100
81
  name: httparty
101
- prerelease: false
102
- type: :runtime
103
- - !ruby/object:Gem::Dependency
104
- requirement: &id006 !ruby/object:Gem::Requirement
82
+ requirement: !ruby/object:Gem::Requirement
105
83
  none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- hash: 974768130
110
- segments:
111
- - 1
112
- - 5
113
- - x
114
- version: 1.5.x
115
- version_requirements: *id006
116
- name: fastercsv
117
- prerelease: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: 0.10.0
118
88
  type: :runtime
119
- - !ruby/object:Gem::Dependency
120
- requirement: &id007 !ruby/object:Gem::Requirement
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
121
91
  none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 17
126
- segments:
127
- - 1
128
- - 5
129
- - 9
130
- version: 1.5.9
131
- version_requirements: *id007
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: 0.10.0
96
+ - !ruby/object:Gem::Dependency
132
97
  name: ox
133
- prerelease: false
134
- type: :runtime
135
- - !ruby/object:Gem::Dependency
136
- requirement: &id008 !ruby/object:Gem::Requirement
98
+ requirement: !ruby/object:Gem::Requirement
137
99
  none: false
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- hash: 3
142
- segments:
143
- - 0
144
- version: "0"
145
- version_requirements: *id008
146
- name: ruby-debug
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: 1.5.9
104
+ type: :runtime
147
105
  prerelease: false
148
- type: :development
149
- - !ruby/object:Gem::Dependency
150
- requirement: &id009 !ruby/object:Gem::Requirement
106
+ version_requirements: !ruby/object:Gem::Requirement
151
107
  none: false
152
- requirements:
153
- - - ">="
154
- - !ruby/object:Gem::Version
155
- hash: 41
156
- segments:
157
- - 0
158
- - 9
159
- - 9
160
- version: 0.9.9
161
- version_requirements: *id009
162
- name: rcov
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: 1.5.9
112
+ - !ruby/object:Gem::Dependency
113
+ name: debugger
114
+ requirement: !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ! '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :development
163
121
  prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ - !ruby/object:Gem::Dependency
129
+ name: simplecov
130
+ requirement: !ruby/object:Gem::Requirement
131
+ none: false
132
+ requirements:
133
+ - - ! '>='
134
+ - !ruby/object:Gem::Version
135
+ version: 0.7.1
164
136
  type: :development
165
- - !ruby/object:Gem::Dependency
166
- requirement: &id010 !ruby/object:Gem::Requirement
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
167
139
  none: false
168
- requirements:
169
- - - "="
170
- - !ruby/object:Gem::Version
171
- hash: 49
172
- segments:
173
- - 0
174
- - 8
175
- - 7
176
- version: 0.8.7
177
- version_requirements: *id010
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: 0.7.1
144
+ - !ruby/object:Gem::Dependency
178
145
  name: rake
179
- prerelease: false
146
+ requirement: !ruby/object:Gem::Requirement
147
+ none: false
148
+ requirements:
149
+ - - '='
150
+ - !ruby/object:Gem::Version
151
+ version: 0.8.7
180
152
  type: :development
181
- - !ruby/object:Gem::Dependency
182
- requirement: &id011 !ruby/object:Gem::Requirement
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
183
155
  none: false
184
- requirements:
185
- - - "="
186
- - !ruby/object:Gem::Version
187
- hash: 23
188
- segments:
189
- - 2
190
- - 6
191
- - 0
192
- version: 2.6.0
193
- version_requirements: *id011
156
+ requirements:
157
+ - - '='
158
+ - !ruby/object:Gem::Version
159
+ version: 0.8.7
160
+ - !ruby/object:Gem::Dependency
194
161
  name: rspec
195
- prerelease: false
162
+ requirement: !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - '='
166
+ - !ruby/object:Gem::Version
167
+ version: 2.6.0
196
168
  type: :development
197
- description: A library for communicating with the Cosm REST API, parsing and rendering Cosm feed formats
198
- email:
169
+ prerelease: false
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - '='
174
+ - !ruby/object:Gem::Version
175
+ version: 2.6.0
176
+ description: A library for communicating with the Cosm REST API, parsing and rendering
177
+ Cosm feed formats
178
+ email:
199
179
  - paul.a.bellamy@gmail.com
200
180
  - lebreeze@gmail.com
201
181
  - sam@pachube.com
202
182
  executables: []
203
-
204
183
  extensions: []
205
-
206
- extra_rdoc_files:
184
+ extra_rdoc_files:
207
185
  - README.md
208
186
  - CHANGELOG.md
209
187
  - MIT-LICENSE
210
- files:
188
+ files:
211
189
  - .gitignore
212
190
  - .rbenv-version
213
191
  - .rspec
@@ -330,40 +308,37 @@ files:
330
308
  - spec/support/key_helper.rb
331
309
  - spec/support/search_result_helper.rb
332
310
  - spec/support/trigger_helper.rb
333
- has_rdoc: true
334
311
  homepage: http://github.com/cosm/cosm-rb
335
312
  licenses: []
336
-
337
313
  post_install_message:
338
- rdoc_options:
314
+ rdoc_options:
339
315
  - --main
340
316
  - README
341
- require_paths:
317
+ require_paths:
342
318
  - lib
343
- required_ruby_version: !ruby/object:Gem::Requirement
319
+ required_ruby_version: !ruby/object:Gem::Requirement
344
320
  none: false
345
- requirements:
346
- - - ">="
347
- - !ruby/object:Gem::Version
348
- hash: 3
349
- segments:
321
+ requirements:
322
+ - - ! '>='
323
+ - !ruby/object:Gem::Version
324
+ version: '0'
325
+ segments:
350
326
  - 0
351
- version: "0"
352
- required_rubygems_version: !ruby/object:Gem::Requirement
327
+ hash: -1496334543805275150
328
+ required_rubygems_version: !ruby/object:Gem::Requirement
353
329
  none: false
354
- requirements:
355
- - - ">="
356
- - !ruby/object:Gem::Version
357
- hash: 3
358
- segments:
330
+ requirements:
331
+ - - ! '>='
332
+ - !ruby/object:Gem::Version
333
+ version: '0'
334
+ segments:
359
335
  - 0
360
- version: "0"
336
+ hash: -1496334543805275150
361
337
  requirements: []
362
-
363
338
  rubyforge_project:
364
- rubygems_version: 1.6.2
339
+ rubygems_version: 1.8.23
365
340
  signing_key:
366
341
  specification_version: 3
367
- summary: A library for communicating with the Cosm REST API, parsing and rendering Cosm feed formats
342
+ summary: A library for communicating with the Cosm REST API, parsing and rendering
343
+ Cosm feed formats
368
344
  test_files: []
369
-