ruby_rides 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/README.md +5 -2
- data/lib/ruby_rides/client.rb +3 -3
- data/lib/ruby_rides/version.rb +1 -1
- data/spec/ruby_rides/client_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6341c337f3c4d725cbfa463d6abe9d4e92b48d1
|
4
|
+
data.tar.gz: 435579054173ee98d845109f467d09e53beff671
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a062525f4482f3f120b1035d1ad0d98402a1d0fd319fd1c3c6c6231a6d50cb6bcaec085847ebce45b02b704364c263f6a224005d517518265bc74bcc48cfc74
|
7
|
+
data.tar.gz: 767d9ebc39501caff4e0132c1a5bb5412345e8e1e39b19779d6cfdc24e5df3f2add4bd81af77fb42992966fe024eb3679bf8c768df0d13ebcdd408d2977d82df
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
[](http://badge.fury.io/rb/ruby_rides)
|
2
|
+
[](https://travis-ci.org/darkmoves/ruby_rides)
|
3
|
+
[](https://coveralls.io/r/darkmoves/ruby_rides)
|
4
|
+
[](https://gemnasium.com/darkmoves/ruby_rides)
|
1
5
|
#ruby_rides
|
2
|
-
---
|
3
6
|
A Ruby gem to interface with Hubway's API.
|
4
7
|
|
5
8
|
## Installation
|
@@ -44,4 +47,4 @@ client.station_geo_locations
|
|
44
47
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
45
48
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
46
49
|
4. Push to the branch (`git push origin my-new-feature`)
|
47
|
-
5. Create new Pull Request
|
50
|
+
5. Create new Pull Request
|
data/lib/ruby_rides/client.rb
CHANGED
@@ -4,7 +4,7 @@ require 'pry'
|
|
4
4
|
module RubyRides
|
5
5
|
class Client
|
6
6
|
include HTTParty
|
7
|
-
|
7
|
+
base_uri "http://hubwaydatachallenge.org/api/v1"
|
8
8
|
attr_accessor :options
|
9
9
|
|
10
10
|
def initialize(options={})
|
@@ -23,11 +23,11 @@ module RubyRides
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def station_data
|
26
|
-
JSON.parse
|
26
|
+
JSON.parse self.class.get("/station/?format=json&username=#{@options[:client_id]}&api_key=#{@options[:client_api_key]}").body
|
27
27
|
end
|
28
28
|
|
29
29
|
def station_geo_locations
|
30
|
-
json = JSON.parse
|
30
|
+
json = JSON.parse self.class.get("/station/?format=json&username=#{@options[:client_id]}&api_key=#{@options[:client_api_key]}").body
|
31
31
|
data = json['objects']
|
32
32
|
station_coordinates = {}
|
33
33
|
|
data/lib/ruby_rides/version.rb
CHANGED
@@ -32,7 +32,7 @@ describe RubyRides::Client do
|
|
32
32
|
|
33
33
|
it 'makes a get request which retrieves a set of data including all Hubway stations' do
|
34
34
|
data = @client.station_data
|
35
|
-
|
35
|
+
|
36
36
|
expect(a_request(:get, "http://hubwaydatachallenge.org/api/v1/station/?format=json&username=gandalf&api_key=asdf")).to have_been_made
|
37
37
|
|
38
38
|
expect(data['objects'].first['id']).to eq(3)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_rides
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Clement
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- .gitignore
|
77
77
|
- .rspec
|
78
|
+
- .travis.yml
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE.txt
|
80
81
|
- README.md
|