supercamp 0.0.1 → 0.0.2

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: 8febad2fae0ba82c928a3fde98a0e6032d9f14b6
4
- data.tar.gz: 2641fdcc51a40cf1755a1da6f97930386a9654e5
3
+ metadata.gz: dba108960b355a8c635e29d37344a702a874dc0f
4
+ data.tar.gz: 103109c66ecc53341bb04cba71cbeee82a9e9260
5
5
  SHA512:
6
- metadata.gz: 2351f837d0c80a1be178bfe9c3d45c264284361f8e576b52b437feabcc1e274edfcd68f883ffdf306fbaa88b98c792812cd4083ca1e5b8bf620a0f36c5f05cc2
7
- data.tar.gz: 3f5ef2f2617a53108c8dfa98776c81fdae8a7a4d0fce59d721d69fbab52169341746dc3b1d0a92a12a32fc629bfde28571816a52577747eb1fff7777b0138c1e
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
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.4
data/Gemfile CHANGED
@@ -2,3 +2,9 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in supercamp.gemspec
4
4
  gemspec
5
+
6
+ gem "rake"
7
+
8
+ group :test do
9
+ gem "coveralls", "~> 0.7.0", require: false
10
+ end
data/README.md CHANGED
@@ -1,31 +1,79 @@
1
- # Supercamp
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
- TODO: Write a gem description
4
+ Wrapper for the Active Network Campground API, and probably a bad Supertramp joke at the same time.
4
5
 
5
- ## Installation
6
+ Installation
7
+ ------------
6
8
 
7
- Add this line to your application's Gemfile:
9
+ Add to your Gemfile:
8
10
 
9
11
  ```ruby
10
12
  gem 'supercamp'
11
13
  ```
12
14
 
13
- And then execute:
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
- $ bundle
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
- Or install it yourself as:
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
- $ gem install supercamp
53
+ ## Campsite API
20
54
 
21
- ## Usage
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
- TODO: Write usage instructions here
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
- ## Contributing
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
- 1. Fork it ( https://github.com/[my-github-username]/supercamp/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
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', 'nested']
7
+ task.rspec_opts = ['--color', '--format', 'documentation']
8
8
  end
9
9
 
10
10
  task default: :spec
@@ -46,8 +46,8 @@ module Supercamp
46
46
  # the API performs a string-match query for parks containing
47
47
  # the character string specified.
48
48
  #
49
- def name(city)
50
- merge_option(:pname, city)
49
+ def name(park)
50
+ merge_option(:pname, park)
51
51
  self
52
52
  end
53
53
 
@@ -1,3 +1,3 @@
1
1
  module Supercamp
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -3,6 +3,9 @@ require 'supercamp'
3
3
  require 'vcr'
4
4
  require 'dotenv'
5
5
 
6
+ require 'coveralls'
7
+ Coveralls.wear!
8
+
6
9
  RSpec.configure do |config|
7
10
 
8
11
  Dotenv.load
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.1.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.1
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-17 00:00:00.000000000 Z
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.1.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.1.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