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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ab170a6b32cb4ac40276ed8d07a0372a14af4be
4
- data.tar.gz: b7069a0d42ce21b13a2809e88657fd09d2083ef4
3
+ metadata.gz: c6341c337f3c4d725cbfa463d6abe9d4e92b48d1
4
+ data.tar.gz: 435579054173ee98d845109f467d09e53beff671
5
5
  SHA512:
6
- metadata.gz: a05fefdccfbb39796f92c4eb4b51d0cbf91dbd431ee34147f387c26145b87a9121ea6c2a6465ed7be7f327b7d91fbdf49feaea073116f087b9a3d9c8507a3308
7
- data.tar.gz: fc0e3189520fe7840cbedbcae9ecb0c021789a3fcbece8b218f947532ae0a97211ea09f1461683f6173c8449667e78b3d26176a3f91594cc2695b3df61b4f8db
6
+ metadata.gz: 8a062525f4482f3f120b1035d1ad0d98402a1d0fd319fd1c3c6c6231a6d50cb6bcaec085847ebce45b02b704364c263f6a224005d517518265bc74bcc48cfc74
7
+ data.tar.gz: 767d9ebc39501caff4e0132c1a5bb5412345e8e1e39b19779d6cfdc24e5df3f2add4bd81af77fb42992966fe024eb3679bf8c768df0d13ebcdd408d2977d82df
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - jruby-19mode
6
+ - ruby-head
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
+ [![Gem Version](https://badge.fury.io/rb/ruby_rides.png)](http://badge.fury.io/rb/ruby_rides)
2
+ [![Build Status](https://travis-ci.org/darkmoves/ruby_rides.png)](https://travis-ci.org/darkmoves/ruby_rides)
3
+ [![Coverage Status](https://coveralls.io/repos/darkmoves/ruby_rides/badge.png)](https://coveralls.io/r/darkmoves/ruby_rides)
4
+ [![Dependency Status](https://gemnasium.com/darkmoves/ruby_rides.png)](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
@@ -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 HTTParty.get("http://hubwaydatachallenge.org/api/v1/station/?format=json&username=#{@options[:client_id]}&api_key=#{@options[:client_api_key]}").body
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 HTTParty.get("http://hubwaydatachallenge.org/api/v1/station/?format=json&username=#{@options[:client_id]}&api_key=#{@options[:client_api_key]}")
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
 
@@ -1,3 +1,3 @@
1
1
  module RubyRides
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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
@@ -2,6 +2,7 @@
2
2
  require 'simplecov'
3
3
  # Coveralls only reports when Travis runs the tests
4
4
  require 'coveralls'
5
+ Coveralls.wear!
5
6
 
6
7
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
8
  SimpleCov::Formatter::HTMLFormatter,
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.2
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