ruby_spark 0.0.3 → 0.0.4

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: c6bf3d029f59c6e969d9abeabd7a82d52718735e
4
- data.tar.gz: 39aebe52e18003261d274ec1673d9c15d25ce89b
3
+ metadata.gz: 9324c9a6228dcc21ff13bd9d695389055af9cca7
4
+ data.tar.gz: 6a858029a91ba90690a2d1a9711dae5667159fcd
5
5
  SHA512:
6
- metadata.gz: fd94661e1548ef5097b5e26634e881963f5f558e3a9428ae30ea1a5f17c72205418338aac6a48d492fc1bdd9380df0edbac05e6799c7b69554687d4f3cc8974d
7
- data.tar.gz: ab23e92c205d57b6d21f0463a950df1a6ee073edd337993eb97a31245ee64139f240da161f8d77e90ddaf37a808f30f980c398d9a7078eb87f9999a5302171ba
6
+ metadata.gz: 9e5516528e6443dc4f54132079ac5680e4c204153e3a592241c5e24670e34fb60f5346be0b3367253f5ebdc87fd169c61bcc0af1bfab4eba2d685e02c0ca8b07
7
+ data.tar.gz: 1dc2900c9ba70089e4310268e166e55a68729894101b6683244815ce15029c1769c8b9fec4a29509697b98dc0ee0a81cdb5a3c44ebf5ac113f862024edec874b
@@ -1,7 +1,7 @@
1
1
  require "bundler/setup"
2
- require "spark"
2
+ require "ruby_spark"
3
3
 
4
- core = Spark::Core.new(ARGV[0], ARGV[1])
4
+ core = RubySpark::Core.new(ARGV[0], ARGV[1])
5
5
 
6
6
  p core.info
7
7
  p core.function("set", "1")
@@ -1,7 +1,7 @@
1
1
  require "bundler/setup"
2
- require "spark"
2
+ require "ruby_spark"
3
3
 
4
- core = Spark::Tinker.new(ARGV[0], ARGV[1])
4
+ core = RubySpark::Tinker.new(ARGV[0], ARGV[1])
5
5
 
6
6
  p core.info
7
7
 
@@ -1,10 +1,10 @@
1
1
  require 'httparty'
2
2
 
3
- require 'spark/version'
4
- require 'spark/core'
5
- require 'spark/tinker'
3
+ require 'ruby_spark/version'
4
+ require 'ruby_spark/core'
5
+ require 'ruby_spark/tinker'
6
6
 
7
- module Spark
7
+ module RubySpark
8
8
  class ConfigurationError < StandardError; end
9
9
 
10
10
  class << self
@@ -1,10 +1,10 @@
1
- module Spark
1
+ module RubySpark
2
2
 
3
3
  class Core
4
4
  class ApiError < StandardError; end
5
5
 
6
- def initialize(core_id, access_token = Spark.access_token)
7
- raise Spark::ConfigurationError.new("Access Token not defined") if access_token.nil?
6
+ def initialize(core_id, access_token = RubySpark.access_token)
7
+ raise RubySpark::ConfigurationError.new("Access Token not defined") if access_token.nil?
8
8
 
9
9
  @access_token = access_token
10
10
  @core_id = core_id
@@ -1,4 +1,4 @@
1
- module Spark
1
+ module RubySpark
2
2
 
3
3
  class Tinker < Core
4
4
  def digital_write(pin, message)
@@ -1,3 +1,3 @@
1
1
  module RubySpark
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,8 +1,8 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'spark/version'
5
- require 'spark/core'
4
+ require 'ruby_spark/version'
5
+ require 'ruby_spark/core'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "ruby_spark"
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'pry'
3
3
 
4
- describe Spark::Tinker do
4
+ describe RubySpark::Tinker do
5
5
 
6
6
  context "with Access Token set in config variable" do
7
- before { Spark.access_token = "good_access_token" }
7
+ before { RubySpark.access_token = "good_access_token" }
8
8
  subject { described_class.new("good_core_id") }
9
9
 
10
10
  describe "#digital_write" do
@@ -15,12 +15,12 @@ describe Spark::Tinker do
15
15
  end
16
16
 
17
17
  it "returns the appropriate error when Access Token is bad" do
18
- Spark.access_token = "bad_token"
18
+ RubySpark.access_token = "bad_token"
19
19
 
20
20
  VCR.use_cassette("bad_token") do
21
21
  expect {
22
22
  subject.digital_write(7, "HIGH")
23
- }.to raise_error(Spark::Core::ApiError)
23
+ }.to raise_error(RubySpark::Core::ApiError)
24
24
  end
25
25
 
26
26
  VCR.use_cassette("bad_token") do
@@ -38,7 +38,7 @@ describe Spark::Tinker do
38
38
  VCR.use_cassette("bad_core_id") do
39
39
  expect {
40
40
  subject.digital_write(7, "HIGH")
41
- }.to raise_error(Spark::Core::ApiError)
41
+ }.to raise_error(RubySpark::Core::ApiError)
42
42
  end
43
43
 
44
44
  VCR.use_cassette("bad_core_id") do
@@ -54,7 +54,7 @@ describe Spark::Tinker do
54
54
  VCR.use_cassette("spark_timeout") do
55
55
  expect {
56
56
  subject.digital_write(7, "HIGH")
57
- }.to raise_error(Spark::Core::ApiError)
57
+ }.to raise_error(RubySpark::Core::ApiError)
58
58
  end
59
59
 
60
60
  VCR.use_cassette("spark_timeout") do
@@ -105,14 +105,14 @@ describe Spark::Tinker do
105
105
  end
106
106
 
107
107
  context "with no Access Token defined" do
108
- before { Spark.access_token = nil }
108
+ before { RubySpark.access_token = nil }
109
109
  subject { described_class.new("good_core_id") }
110
110
 
111
111
  it "returns proper error if Access Token is not defined" do
112
112
  VCR.use_cassette("no_token") do
113
113
  expect {
114
114
  subject.digital_read(6)
115
- }.to raise_error(Spark::ConfigurationError)
115
+ }.to raise_error(RubySpark::ConfigurationError)
116
116
  end
117
117
 
118
118
  VCR.use_cassette("no_token") do
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
  require 'vcr'
4
4
 
5
- require 'spark' # and any other gems you need
5
+ require 'ruby_spark' # and any other gems you need
6
6
 
7
7
  VCR.configure do |c|
8
8
  c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_spark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli Fatsi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-26 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,10 +122,10 @@ files:
122
122
  - Rakefile
123
123
  - examples/core_example.rb
124
124
  - examples/tinker_example.rb
125
- - lib/spark.rb
126
- - lib/spark/core.rb
127
- - lib/spark/tinker.rb
128
- - lib/spark/version.rb
125
+ - lib/ruby_spark.rb
126
+ - lib/ruby_spark/core.rb
127
+ - lib/ruby_spark/tinker.rb
128
+ - lib/ruby_spark/version.rb
129
129
  - ruby_spark.gemspec
130
130
  - spec/fixtures/vcr_cassettes/analog_read.yml
131
131
  - spec/fixtures/vcr_cassettes/analog_write.yml