ruby_spark 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f147c684f6fb7473b04b4f6aac6089f93bef71b
4
- data.tar.gz: 62ac1c2b712e27e5d4b79c559dd13612113247ba
3
+ metadata.gz: 84a1c59d2d9a832c4480eab8511e481f75bd3bb9
4
+ data.tar.gz: 4e1e129c0c8901463930751de034ea263fc1ad73
5
5
  SHA512:
6
- metadata.gz: 4903c3db3b4d4ca770f6c717f05a03d3a1102d24111b079c4fec85a2020979677acb2e2dc366787fa19cf9d03e6fca1dda2450f6b5d69c9608d8d6be8f10c25c
7
- data.tar.gz: 9146be81e0c787d70fb4cb57b336d04e0a10d3d2e502bc67c761e7ad54cb46b91c2f9bfd6b7267d44c8a9f9aa252ae5ba8897ff4737dfc14a1728af478cc8398
6
+ metadata.gz: b14196cfa903efa3b8f2a698606c7aa36f140f54a6a9b23bc56f688d5fa5a299b734334ed0d900aaef731f989b8b1374b5e0d0f9ccfaa72488f1b4664bb87b35
7
+ data.tar.gz: ecba90f558d501a401de11b1a90ae0f61944ef404c2b5dbbfe71eb9fcf5882e6ec1f11a045537cb3be078c48e37068f01f2fd977eee6f4867ac2ba2fc2741e9b
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # RubySpark
2
2
 
3
- Ruby Gem to make API requests to the [Spark Cloud API](http://docs.spark.io/#/api)
3
+ Easily control you [Particle](http://particle.io) (formerly Spark) Device with Ruby.
4
4
 
5
- ## Obtaining a Spark Core Access Token and Core ID
5
+ ## Obtaining a Particle Access Token and Core ID
6
6
 
7
- Assuming at this point you've followed the Spark Core's [Getting Started](http://docs.spark.io/#/start) guides and connected your Core with the Spark Cloud.
7
+ Assuming at this point you've followed Particle's [Getting Started](http://docs.particle.io/#/start) guides and connected your Core with the Particle Cloud.
8
8
 
9
- Head over to the [Spark Build IDE](https://www.spark.io/build). In the Settings tab you can get your Access Token, and you can fetch your Device ID from the Cores tab. You'll need these both to authenticate your API calls, and the Device ID to direct them.
9
+ Head over to the [Particle Build IDE](https://www.particle.io/build). In the Settings tab you can get your Access Token, and you can fetch your Device ID from the Cores tab. You'll need these both to authenticate your API calls, and the Device ID to direct them.
10
10
 
11
11
  ## Installation
12
12
 
@@ -0,0 +1,27 @@
1
+ module Configuration
2
+
3
+ def configuration
4
+ yield self
5
+ end
6
+
7
+ def define_setting(name, default = nil)
8
+ class_variable_set("@@#{name}", default)
9
+
10
+ define_class_method "#{name}=" do |value|
11
+ class_variable_set("@@#{name}", value)
12
+ end
13
+
14
+ define_class_method name do
15
+ class_variable_get("@@#{name}")
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def define_class_method(name, &block)
22
+ (class << self; self; end).instance_eval do
23
+ define_method name, &block
24
+ end
25
+ end
26
+
27
+ end
@@ -64,7 +64,7 @@ module RubySpark
64
64
  end
65
65
 
66
66
  def base_url
67
- "https://api.spark.io/v1/devices/#{@core_id}/"
67
+ "https://api.particle.io/v1/devices/#{@core_id}/"
68
68
  end
69
69
 
70
70
  def access_params
@@ -1,3 +1,3 @@
1
1
  module RubySpark
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/ruby_spark.rb CHANGED
@@ -3,12 +3,12 @@ require 'httparty'
3
3
  require 'ruby_spark/version'
4
4
  require 'ruby_spark/core'
5
5
  require 'ruby_spark/tinker'
6
- require 'ruby_spark/helpers/configuration'
6
+ require 'helpers/configuration'
7
7
 
8
8
  module RubySpark
9
9
  class ConfigurationError < StandardError; end
10
10
 
11
- include Configuration
11
+ extend Configuration
12
12
 
13
13
  define_setting :access_token
14
14
  define_setting :timeout, 30
data/ruby_spark.gemspec CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.version = RubySpark::VERSION
10
10
  spec.authors = ["Eli Fatsi"]
11
11
  spec.email = ["eli.fatsi@viget.com"]
12
- spec.description = "Ruby Gem to make API calls to the Spark Cloud"
13
- spec.summary = "Ruby Gem to make API calls to the Spark Cloud"
12
+ spec.description = "Ruby Gem to make API calls to the Particle Cloud"
13
+ spec.summary = "Ruby Gem to make API calls to the Particle Cloud"
14
14
  spec.homepage = "http://github.com/efatsi/ruby_spark"
15
15
  spec.license = "MIT"
16
16
 
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.spark.io/v1/devices/good_core_id/analogread
5
+ uri: https://api.particle.io/v1/devices/good_core_id/analogread
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: access_token=good_access_token&params=A6
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.spark.io/v1/devices/good_core_id/analogwrite
5
+ uri: https://api.particle.io/v1/devices/good_core_id/analogwrite
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: access_token=good_access_token&params=A7%2C130
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.spark.io/v1/devices/bad_core_id/?access_token=good_access_token
5
+ uri: https://api.particle.io/v1/devices/bad_core_id/?access_token=good_access_token
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.spark.io/v1/devices/good_core_id/?access_token=bad_token
5
+ uri: https://api.particle.io/v1/devices/good_core_id/?access_token=bad_token
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.spark.io/v1/devices/good_core_id/digitalread
5
+ uri: https://api.particle.io/v1/devices/good_core_id/digitalread
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: access_token=good_access_token&params=D6
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.spark.io/v1/devices/good_core_id/digitalwrite
5
+ uri: https://api.particle.io/v1/devices/good_core_id/digitalwrite
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: access_token=good_access_token&params=D7%2CHIGH
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.spark.io/v1/devices/good_core_id/readTemp
5
+ uri: https://api.particle.io/v1/devices/good_core_id/readTemp
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: access_token=good_access_token&params=outside
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.spark.io/v1/devices/good_core_id/?access_token=good_access_token
5
+ uri: https://api.particle.io/v1/devices/good_core_id/?access_token=good_access_token
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.spark.io/v1/devices/good_core_id/?access_token=good_access_token
5
+ uri: https://api.particle.io/v1/devices/good_core_id/?access_token=good_access_token
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.spark.io/v1/devices/good_core_id/temperature?access_token=good_access_token
5
+ uri: https://api.particle.io/v1/devices/good_core_id/temperature?access_token=good_access_token
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -82,7 +82,7 @@ describe RubySpark::Core do
82
82
  end
83
83
  end
84
84
 
85
- it "returns the appropriate error when the Spark API times out" do
85
+ it "returns the appropriate error when the Particle API times out" do
86
86
  RubySpark.access_token = "good_access_token"
87
87
  subject = described_class.new("good_core_id")
88
88
 
metadata CHANGED
@@ -1,130 +1,130 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_spark
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli Fatsi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-27 00:00:00.000000000 Z
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.14'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.14'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: vcr
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.5'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.5'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.11'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.11'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0.9'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.9'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: httparty
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0.13'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.13'
111
- description: Ruby Gem to make API calls to the Spark Cloud
111
+ description: Ruby Gem to make API calls to the Particle Cloud
112
112
  email:
113
113
  - eli.fatsi@viget.com
114
114
  executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - .gitignore
118
+ - ".gitignore"
119
119
  - Gemfile
120
120
  - LICENSE.txt
121
121
  - README.md
122
122
  - Rakefile
123
123
  - examples/core_example.rb
124
124
  - examples/tinker_example.rb
125
+ - lib/helpers/configuration.rb
125
126
  - lib/ruby_spark.rb
126
127
  - lib/ruby_spark/core.rb
127
- - lib/ruby_spark/helpers/configuration.rb
128
128
  - lib/ruby_spark/tinker.rb
129
129
  - lib/ruby_spark/version.rb
130
130
  - ruby_spark.gemspec
@@ -151,20 +151,20 @@ require_paths:
151
151
  - lib
152
152
  required_ruby_version: !ruby/object:Gem::Requirement
153
153
  requirements:
154
- - - '>='
154
+ - - ">="
155
155
  - !ruby/object:Gem::Version
156
156
  version: '0'
157
157
  required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - '>='
159
+ - - ">="
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.4.1
164
+ rubygems_version: 2.2.0
165
165
  signing_key:
166
166
  specification_version: 4
167
- summary: Ruby Gem to make API calls to the Spark Cloud
167
+ summary: Ruby Gem to make API calls to the Particle Cloud
168
168
  test_files:
169
169
  - spec/fixtures/vcr_cassettes/analog_read.yml
170
170
  - spec/fixtures/vcr_cassettes/analog_write.yml
@@ -1,33 +0,0 @@
1
- module RubySpark
2
- module Configuration
3
-
4
- def self.included(base)
5
- base.extend ClassMethods
6
- end
7
-
8
- module ClassMethods
9
- def configuration
10
- yield self
11
- end
12
-
13
- def define_setting(name, default = nil)
14
- class_variable_set("@@#{name}", default)
15
-
16
- define_class_method "#{name}=" do |value|
17
- class_variable_set("@@#{name}", value)
18
- end
19
-
20
- define_class_method name do
21
- class_variable_get("@@#{name}")
22
- end
23
- end
24
-
25
- private
26
-
27
- def define_class_method(name, &block)
28
- (class << self; self; end).instance_eval { define_method name, &block }
29
- end
30
- end
31
-
32
- end
33
- end