uk_buses 0.0.1 → 0.0.2

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: 97081644e0b9c221838ea068484d1fe33d5736a4
4
- data.tar.gz: 0ba3145c6a222a1258373bc0279a74ca507ec450
3
+ metadata.gz: d4805f4887607804abe20dae87c22fe79acbf950
4
+ data.tar.gz: 32626cdee3fb531cf1e505a3b2f9bb974c9d2639
5
5
  SHA512:
6
- metadata.gz: f5aac4ed93152db29294bbdabffa12016970f023dac3e5f4bd9636180010bac23d44074dfeb1c8b1a026120687dd9c4525d6b2d5fa508d567a4d3fcde832866f
7
- data.tar.gz: eb3173eba665b849245660fa367da88ad003d799eb0cafca2260037b2fa453c611b37b2b967bff3141c44a1b57fa886ce840dd8fc01f4f4af54e3ecc71ee544e
6
+ metadata.gz: 0bbdde79b78c7f60fb47c3fd636493423b4c177fe2f600a4f0fb0e8301f3390b7332e1c90bbb092300b32c1d6ca4e39c08d420fd347986a7c2b407e7f8f1bcc9
7
+ data.tar.gz: 63c850cb25bed477247fdcfe2c9e53bee213fa831042d61f1437064cf76e9b9d14f8e4951bd520eb4174900416643975f2632d7ebd8d5112b2c628208290c68b
data/Gemfile CHANGED
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in uk_buses.gemspec
4
4
  gemspec
5
- gem 'rspec'
5
+ gem 'guard-rspec'
data/Guardfile ADDED
@@ -0,0 +1,9 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec', :cli => "--color --format nested" do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+ end
9
+
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # UKBuses
2
2
 
3
+ [![Code Climate](https://codeclimate.com/github/maxehmookau/UkBuses.png)](https://codeclimate.com/github/maxehmookau/UkBuses)
4
+ [![Build Status](https://travis-ci.org/maxehmookau/UkBuses.png?branch=master)](https://travis-ci.org/maxehmookau/UkBuses)
5
+
3
6
  Grab *real-time* bus information across the entire United Kingdom.
4
7
 
5
8
  ## Installation
@@ -29,14 +32,14 @@ Create a `Query` object containing the bus stop code. This is normally the code
29
32
  q = UkBuses::Query.new('cdijtgm')
30
33
 
31
34
  Then execute the query to scrape the data:
35
+ This happens automatically.
32
36
  **This can take a little while!**
33
-
34
- results = q.run
35
37
 
36
- `run` will return an array of `UkBuses::Bus` objects.
38
+ It will return an array of `UkBuses::Bus` objects.
37
39
 
38
40
  That's it!
39
41
 
42
+ UkBuses doesn't implement any caching, but it is designed to pull real-time data so it won't be required unless you're servicing thousands of requests.
40
43
 
41
44
  This is a 0.0.1 release currently so Pull Requests are greatfully received.
42
45
 
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -1,3 +1,3 @@
1
1
  module UkBuses
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/uk_buses.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  Dir[File.dirname(__FILE__) + '/uk_buses/*.rb'].each do |file|
2
2
  require file
3
- puts file.inspect
4
3
  end
5
4
 
6
5
  module UkBuses
data/spec/bus_spec.rb ADDED
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'initialize' do
4
+
5
+ it 'should return a Bus object' do
6
+ bus = UkBuses::Bus.new()
7
+ expect(bus.class).to eq(UkBuses::Bus)
8
+ end
9
+
10
+ it 'should allow route_number to be set' do
11
+ bus = UkBuses::Bus.new()
12
+ bus.route_number = '42'
13
+ expect(bus.route_number).to eq '42'
14
+ end
15
+
16
+ it 'should allow destination to be set' do
17
+ bus = UkBuses::Bus.new()
18
+ bus.destination = 'Cadbury World'
19
+ expect(bus.destination).to eq 'Cadbury World'
20
+ end
21
+
22
+ it 'should allow arrives to be set' do
23
+ bus = UkBuses::Bus.new()
24
+ bus.arrives = '11 mins'
25
+ expect(bus.arrives).to eq '11 mins'
26
+ end
27
+
28
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'bundler/setup'
3
3
 
4
- require 'uk_buses' # and any other gems you need
4
+ require 'uk_buses'
5
5
 
6
6
  RSpec.configure do |config|
7
7
  # some (optional) config here
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uk_buses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Woolf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-18 00:00:00.000000000 Z
11
+ date: 2013-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ files:
62
62
  - .DS_Store
63
63
  - .gitignore
64
64
  - Gemfile
65
+ - Guardfile
65
66
  - LICENSE.txt
66
67
  - README.md
67
68
  - Rakefile
@@ -70,6 +71,7 @@ files:
70
71
  - lib/uk_buses/bus.rb
71
72
  - lib/uk_buses/query.rb
72
73
  - lib/uk_buses/version.rb
74
+ - spec/bus_spec.rb
73
75
  - spec/spec_helper.rb
74
76
  - uk_buses.gemspec
75
77
  homepage: http://maxehmookau.github.io
@@ -97,4 +99,5 @@ signing_key:
97
99
  specification_version: 4
98
100
  summary: Grab real-time bus info for all UK buses using a groovy Ruby DSL
99
101
  test_files:
102
+ - spec/bus_spec.rb
100
103
  - spec/spec_helper.rb