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 +4 -4
- data/Gemfile +1 -1
- data/Guardfile +9 -0
- data/README.md +6 -3
- data/Rakefile +5 -0
- data/lib/uk_buses/version.rb +1 -1
- data/lib/uk_buses.rb +0 -1
- data/spec/bus_spec.rb +28 -0
- data/spec/spec_helper.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4805f4887607804abe20dae87c22fe79acbf950
|
4
|
+
data.tar.gz: 32626cdee3fb531cf1e505a3b2f9bb974c9d2639
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bbdde79b78c7f60fb47c3fd636493423b4c177fe2f600a4f0fb0e8301f3390b7332e1c90bbb092300b32c1d6ca4e39c08d420fd347986a7c2b407e7f8f1bcc9
|
7
|
+
data.tar.gz: 63c850cb25bed477247fdcfe2c9e53bee213fa831042d61f1437064cf76e9b9d14f8e4951bd520eb4174900416643975f2632d7ebd8d5112b2c628208290c68b
|
data/Gemfile
CHANGED
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
|
-
|
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
data/lib/uk_buses/version.rb
CHANGED
data/lib/uk_buses.rb
CHANGED
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
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.
|
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-
|
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
|