supercamp 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/.coveralls.yml +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +6 -0
- data/README.md +64 -16
- data/Rakefile +1 -1
- data/lib/supercamp/criteria/campground.rb +2 -2
- data/lib/supercamp/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/supercamp.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dba108960b355a8c635e29d37344a702a874dc0f
|
4
|
+
data.tar.gz: 103109c66ecc53341bb04cba71cbeee82a9e9260
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36927842aa84a87d326430316d7bd5a67e26d838d4a5d1b684fabe217dca42a8d0a82f8b100381e5a981443d33d0831b09936492c8e276ac3ec049fef9ddb5dd
|
7
|
+
data.tar.gz: 9627ec1aa2954199a813208e4f4b42099ea07c1104be9ff95cd1edf64895cfdad588de778b81be8f0f2d0057549fea73768a28616768989fcdc4ef3f86681863
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,31 +1,79 @@
|
|
1
|
-
|
1
|
+
Supercamp [![Build Status](https://travis-ci.org/davekrupinski/supercamp.svg?branch=master)](https://travis-ci.org/davekrupinski/supercamp.svg?branch=master) [![Coverage Status](https://img.shields.io/coveralls/davekrupinski/supercamp.svg)](https://coveralls.io/r/davekrupinski/supercamp?branch=master)
|
2
|
+
============
|
2
3
|
|
3
|
-
|
4
|
+
Wrapper for the Active Network Campground API, and probably a bad Supertramp joke at the same time.
|
4
5
|
|
5
|
-
|
6
|
+
Installation
|
7
|
+
------------
|
6
8
|
|
7
|
-
Add
|
9
|
+
Add to your Gemfile:
|
8
10
|
|
9
11
|
```ruby
|
10
12
|
gem 'supercamp'
|
11
13
|
```
|
12
14
|
|
13
|
-
|
15
|
+
Configuration
|
16
|
+
------------
|
17
|
+
The only required configuration setting is a valid API KEY for Active Network's Campground API. These can be obtained by registering at http://developer.active.com/docs/read/Campground_APIs
|
14
18
|
|
15
|
-
|
19
|
+
```ruby
|
20
|
+
Supercamp.configure do |config|
|
21
|
+
config.api_key = "YOUR-API-KEY"
|
22
|
+
end
|
23
|
+
```
|
24
|
+
Additionally, a custom timeout span can be given. The default is 5 seconds.
|
25
|
+
```ruby
|
26
|
+
Supercamp.configure do |config|
|
27
|
+
config.api_key = "YOUR-API-KEY"
|
28
|
+
config.timeout = 10
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
General Usage
|
33
|
+
------------
|
16
34
|
|
17
|
-
|
35
|
+
The wrapper supports all 3 of the API endpoints:
|
36
|
+
* Campgrounds
|
37
|
+
* Campsites
|
38
|
+
* Details
|
39
|
+
|
40
|
+
Each service implements a search interface that can be used as chainable methods or a block search.
|
41
|
+
```ruby
|
42
|
+
Supercamp.campgrounds.state("CA").amenity(:biking)
|
43
|
+
```
|
44
|
+
-- or --
|
45
|
+
```ruby
|
46
|
+
Supercamp.campgrounds.search do
|
47
|
+
state "CA"
|
48
|
+
amenity "biking"
|
49
|
+
has "water", :pets, "sewer"
|
50
|
+
end
|
51
|
+
```
|
18
52
|
|
19
|
-
|
53
|
+
## Campsite API
|
20
54
|
|
21
|
-
|
55
|
+
The campgrounds interface supports:
|
56
|
+
* **site_type** (rv, cabin, lodging, tent, trailer, group_site, day_use, horse_site, or boat_site)
|
57
|
+
* **arrival** (mm/dd/yyyy)
|
58
|
+
* **nights** (integer) *used with *arrival* to specify duration of stay*
|
59
|
+
* **min_equip_length** (feet)
|
60
|
+
* **people** (integer)
|
61
|
+
* **min_elec_amps** (15, 20, 30, or 50)
|
22
62
|
|
23
|
-
|
63
|
+
## Camground API
|
64
|
+
Supports all options from **Campsite API** with additional support for:
|
65
|
+
* **geo** (lat, long)
|
66
|
+
* **state** (string) *2 character abbreviation*
|
67
|
+
* **name** (string) *Name of Park*
|
68
|
+
* **amenity** (biking, boating, equipment_rentals, fishing, golf, hiking, horseback_riding, hunting, rec_activities, scenic_trails, sports, beach_or_water, or winter_activities)
|
69
|
+
* **has** (Multiple: water, sewer, pull, pets, waterfront)
|
24
70
|
|
25
|
-
##
|
71
|
+
## Details API
|
72
|
+
##### Note: Both Parameters are Required
|
73
|
+
* **contract_code** (string) *contract_id returned from Campground API Search*
|
74
|
+
* **id** (string) *facility_id returned from Campground API Search*
|
26
75
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
5. Create a new Pull Request
|
76
|
+
## TODO
|
77
|
+
* Configuration Validation
|
78
|
+
* Search Parameter Validation
|
79
|
+
* Search Lookup Caching
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require 'bundler/gem_tasks'
|
|
4
4
|
# Default directory to look in is `/specs`
|
5
5
|
# Run with `rake spec`
|
6
6
|
RSpec::Core::RakeTask.new(:spec) do |task|
|
7
|
-
task.rspec_opts = ['--color', '--format', '
|
7
|
+
task.rspec_opts = ['--color', '--format', 'documentation']
|
8
8
|
end
|
9
9
|
|
10
10
|
task default: :spec
|
data/lib/supercamp/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/supercamp.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "typhoeus", "~> 0.6.0"
|
22
|
-
spec.add_dependency "oga", "~> 0.
|
22
|
+
spec.add_dependency "oga", "~> 0.2.0"
|
23
23
|
spec.add_dependency "hashr", "~> 0.0.0"
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.7"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: supercamp
|
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
|
- Dave Krupinski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hashr
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,9 +143,11 @@ executables: []
|
|
143
143
|
extensions: []
|
144
144
|
extra_rdoc_files: []
|
145
145
|
files:
|
146
|
+
- ".coveralls.yml"
|
146
147
|
- ".gitignore"
|
147
148
|
- ".rspec"
|
148
149
|
- ".rvmrc"
|
150
|
+
- ".travis.yml"
|
149
151
|
- Gemfile
|
150
152
|
- Guardfile
|
151
153
|
- LICENSE.txt
|