xively-rb 0.2.09 → 0.2.10

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.
@@ -0,0 +1 @@
1
+ 1.9.3-p392
data/README.md CHANGED
@@ -1,6 +1,4 @@
1
- [![Build Status](https://secure.travis-ci.org/xively/xively-rb.png)](http://travis-ci.org/xively/xively-rb)
2
-
3
- ## Xively gem
1
+ ## xively-rb [![Gem Version](https://badge.fury.io/rb/xively-rb.png)](http://badge.fury.io/rb/xively-rb) [![Build Status](https://secure.travis-ci.org/xively/xively-rb.png)](http://travis-ci.org/xively/xively-rb) [![Code Climate](https://codeclimate.com/github/xively/xively-rb.png)](https://codeclimate.com/github/xively/xively-rb) [![Dependency Status](https://gemnasium.com/xively/xively-rb.png)](https://gemnasium.com/xively/xively-rb)
4
2
 
5
3
  Use this gem if you would like to convert between Xively data formats or represent Xively objects in Ruby.
6
4
  You can also interact with the Xively REST API using this gem.
@@ -25,6 +25,7 @@ require 'xively-rb/trigger'
25
25
  require 'xively-rb/key'
26
26
  require 'xively-rb/permission'
27
27
  require 'xively-rb/resource'
28
+ require 'xively-rb/version'
28
29
 
29
30
  require 'xively-rb/client'
30
31
 
@@ -29,7 +29,8 @@ module Xively
29
29
  hash["created"] = hash["created"]
30
30
  hash["status"] = hash["status"]
31
31
  hash["tags"] = join_tags(hash["tags"])
32
- hash["datastreams"] = hash["datastreams"].collect do |datastream|
32
+ raise InvalidJSONError, "\"datastreams\" must be an array" unless hash["datastreams"].nil? || hash["datastreams"].is_a?(Array)
33
+ hash["datastreams"] = [*hash["datastreams"]].collect do |datastream|
33
34
  unit_hash = {}
34
35
  if unit = datastream.delete('unit')
35
36
  unit_hash['unit_type'] = unit['type']
@@ -1,3 +1,3 @@
1
1
  module Xively #:nodoc:
2
- VERSION = '0.2.09'
2
+ VERSION = '0.2.10'
3
3
  end
@@ -40,6 +40,13 @@ describe "default feed json parser" do
40
40
  feed.datastreams[0].unit_symbol.should == ""
41
41
  feed.datastreams[0].tags.should == ""
42
42
  end
43
+
44
+ it "should throw an error if datastreams is not an array" do
45
+ json = "{\"version\":\"1.0.0\",\"datastreams\":\"foobar\"}"
46
+ expect {
47
+ Xively::Feed.new(json)
48
+ }.should raise_error(Xively::Parsers::JSON::InvalidJSONError, "\"datastreams\" must be an array")
49
+ end
43
50
  end
44
51
  end
45
52
 
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "http://github.com/xively/xively-rb"
12
12
  s.summary = "A library for communicating with the Xively REST API, parsing and rendering Xively feed formats"
13
13
  s.description = "A library for communicating with the Xively REST API, parsing and rendering Xively feed formats"
14
+ s.license = "BSD 3-Clause License"
14
15
 
15
16
  s.files = `git ls-files`.split("\n")
16
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xively-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.09
4
+ version: 0.2.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-05-14 00:00:00.000000000 Z
14
+ date: 2013-06-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json
@@ -124,8 +124,8 @@ extra_rdoc_files:
124
124
  - CONTRIBUTING.md
125
125
  files:
126
126
  - .gitignore
127
- - .rbenv-version
128
127
  - .rspec
128
+ - .ruby-version
129
129
  - .rvmrc
130
130
  - .travis.yml
131
131
  - CHANGELOG.md
@@ -247,7 +247,8 @@ files:
247
247
  - spec/xively-rb/trigger_spec.rb
248
248
  - xively-rb.gemspec
249
249
  homepage: http://github.com/xively/xively-rb
250
- licenses: []
250
+ licenses:
251
+ - BSD 3-Clause License
251
252
  post_install_message:
252
253
  rdoc_options:
253
254
  - --main
@@ -260,12 +261,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
260
261
  - - ! '>='
261
262
  - !ruby/object:Gem::Version
262
263
  version: '0'
264
+ segments:
265
+ - 0
266
+ hash: -4127591570389426511
263
267
  required_rubygems_version: !ruby/object:Gem::Requirement
264
268
  none: false
265
269
  requirements:
266
270
  - - ! '>='
267
271
  - !ruby/object:Gem::Version
268
272
  version: '0'
273
+ segments:
274
+ - 0
275
+ hash: -4127591570389426511
269
276
  requirements: []
270
277
  rubyforge_project:
271
278
  rubygems_version: 1.8.23
@@ -273,61 +280,4 @@ signing_key:
273
280
  specification_version: 3
274
281
  summary: A library for communicating with the Xively REST API, parsing and rendering
275
282
  Xively feed formats
276
- test_files:
277
- - spec/fixtures/models.rb
278
- - spec/spec_helper.rb
279
- - spec/support/contain_datapoint_eeml_matcher.rb
280
- - spec/support/contain_datastream_eeml_matcher.rb
281
- - spec/support/contain_feed_eeml_matcher.rb
282
- - spec/support/datapoint_helper.rb
283
- - spec/support/datastream_helper.rb
284
- - spec/support/describe_eeml_matcher.rb
285
- - spec/support/feed_helper.rb
286
- - spec/support/fully_represent_datapoint_matcher.rb
287
- - spec/support/fully_represent_datastream_matcher.rb
288
- - spec/support/fully_represent_feed_matcher.rb
289
- - spec/support/fully_represent_key_matcher.rb
290
- - spec/support/fully_represent_search_result_matcher.rb
291
- - spec/support/fully_represent_trigger_matcher.rb
292
- - spec/support/key_helper.rb
293
- - spec/support/search_result_helper.rb
294
- - spec/support/trigger_helper.rb
295
- - spec/xively-rb/array_extensions_spec.rb
296
- - spec/xively-rb/base/instance_methods_spec.rb
297
- - spec/xively-rb/base_spec.rb
298
- - spec/xively-rb/client_spec.rb
299
- - spec/xively-rb/datapoint_spec.rb
300
- - spec/xively-rb/datastream_spec.rb
301
- - spec/xively-rb/feed_spec.rb
302
- - spec/xively-rb/hash_extensions_spec.rb
303
- - spec/xively-rb/helpers_spec.rb
304
- - spec/xively-rb/key_spec.rb
305
- - spec/xively-rb/parsers/csv/datastream_defaults_spec.rb
306
- - spec/xively-rb/parsers/csv/feed_defaults_spec.rb
307
- - spec/xively-rb/parsers/json/datapoint_defaults_spec.rb
308
- - spec/xively-rb/parsers/json/datastream_defaults_spec.rb
309
- - spec/xively-rb/parsers/json/feed_defaults_spec.rb
310
- - spec/xively-rb/parsers/json/key_defaults_spec.rb
311
- - spec/xively-rb/parsers/json/search_result_defaults_spec.rb
312
- - spec/xively-rb/parsers/json/trigger_defaults_spec.rb
313
- - spec/xively-rb/parsers/xml/datapoint_defaults_spec.rb
314
- - spec/xively-rb/parsers/xml/datastream_defaults_spec.rb
315
- - spec/xively-rb/parsers/xml/feed_defaults_spec.rb
316
- - spec/xively-rb/parsers/xml/key_defaults_spec.rb
317
- - spec/xively-rb/parsers/xml/trigger_defaults_spec.rb
318
- - spec/xively-rb/search_result_spec.rb
319
- - spec/xively-rb/string_extensions_spec.rb
320
- - spec/xively-rb/templates/csv/datapoint_defaults_spec.rb
321
- - spec/xively-rb/templates/csv/datastream_defaults_spec.rb
322
- - spec/xively-rb/templates/csv/feed_defaults_spec.rb
323
- - spec/xively-rb/templates/json/datapoint_defaults_spec.rb
324
- - spec/xively-rb/templates/json/datastream_defaults_spec.rb
325
- - spec/xively-rb/templates/json/feed_defaults_spec.rb
326
- - spec/xively-rb/templates/json/key_defaults_spec.rb
327
- - spec/xively-rb/templates/json/search_result_defaults_spec.rb
328
- - spec/xively-rb/templates/json/trigger_defaults_spec.rb
329
- - spec/xively-rb/templates/xml/datapoint_defaults_spec.rb
330
- - spec/xively-rb/templates/xml/datastream_defaults_spec.rb
331
- - spec/xively-rb/templates/xml/feed_defaults_spec.rb
332
- - spec/xively-rb/templates/xml/search_result_defaults_spec.rb
333
- - spec/xively-rb/trigger_spec.rb
283
+ test_files: []
@@ -1 +0,0 @@
1
- ruby-1.9.3-p392