work_surfer 0.0.2 → 0.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +117 -0
  4. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c456764defdde3b3827c67ae0666f72a8a500780
4
- data.tar.gz: 35e2173c4f097597631d3a9b86636a419d6eba7c
3
+ metadata.gz: 2f3e6bd26314e1046952b44162a063aab79b5c0e
4
+ data.tar.gz: 1ce3a4a51a208000624267ac3bf72906242ad828
5
5
  SHA512:
6
- metadata.gz: c1eb2b9e3cbaf0a72e8545871ff30c295112023ee8b83f2f1adb910a5df4815be2bf557ecaab204fb0f6b64472e63b55376a4bc647c78bfad9c3b57089fa5332
7
- data.tar.gz: d201a387bdbb4eff926f96d84c831e415d74656be2de4bdba7d1c6238c9f2e4d295d1b88cc1728c1424439856dcb14476b6a5da4e7fd90378b95025aa01fafcf
6
+ metadata.gz: 1ff3690db024ed262a2473bc4ce476670d987521926faf7dcc7eb19d82d720215c28cb314427fef7228d634e9d38126f31c0082b574351bc5fffb68fdb892d78
7
+ data.tar.gz: e0d5dba24b9553325728080ab4aa216d56dc3807fcb251b522f4e4786ef036f954dc4940682cbe80fbdfa4798ed20590fbe0cda7646727e31ae86761b9271d6e
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # work_surfer Changelog
2
+
3
+ An experiemental unofficial Ruby client for the
4
+ [WorkWave.com Route Manager API](https://wwrm.workwave.com/api).
5
+
6
+ ## v0
7
+
8
+ ### v0.0.2 (2016-10-26)
9
+
10
+ - Removed implicit dependency on ActiveSupport.
11
+ - Auto-require Faraday.
12
+ - Fixed reference to Faraday Middleware's JSON parser.
13
+ - Added a Gemfile for bundler-friendliness.
14
+ - Auto-parse dates from either date-like Strings, Time-like or Date-like
15
+ objects.
data/README.md ADDED
@@ -0,0 +1,117 @@
1
+ # work_surfer
2
+
3
+ An experiemental unofficial Ruby client for the
4
+ [WorkWave.com Route Manager API](https://wwrm.workwave.com/api).
5
+
6
+ [![Gem Version](https://badge.fury.io/rb/work_surfer.svg)](https://badge.fury.io/rb/work_surfer)
7
+
8
+ ## Usage
9
+
10
+ ### Client Options
11
+
12
+ If not explicitly passed a client, all methods will fall back to
13
+ `Client.default_client`. You can set that default client directly or
14
+ have it auto-constructed from a set of default options:
15
+
16
+ #### api_key
17
+
18
+ **Has no default, must be provided.**
19
+
20
+ Your WorkWave API key. You can e.g. get this key from the [WorkWave
21
+ Route Manager web application](https://wwrm.workwave.com/) by clicking
22
+ on your name in the top right corner, then clicking on "Account
23
+ Settings" and finally copying the "API Key" from the modal dialog.
24
+
25
+ #### connection_builder
26
+
27
+ **Optional**
28
+
29
+ A Faraday connection builder. Defaults to:
30
+
31
+ ```ruby
32
+ ->(builder) {
33
+ builder.adapter Faraday.default_adapter
34
+ builder.request :url_encoded
35
+ builder.response :parse_json
36
+ }
37
+ ```
38
+
39
+ #### connection_options
40
+
41
+ **Optional**
42
+
43
+ A `Hash` of options passed as the second parameter to
44
+ `Faraday::Connection.new`.
45
+
46
+ #### default_headers
47
+
48
+ **Optional**
49
+
50
+ Defaults to:
51
+
52
+ ```ruby
53
+ {
54
+ "X-WorkWave-Key": proc { api_key },
55
+ }
56
+ ```
57
+
58
+ As demonstrated, you can use `Proc`s as values, which will be evaluated
59
+ in the context of the `Client` instance.
60
+
61
+ When you overwrite this, take care to include the `X-WorkWave-Key`
62
+ header.
63
+
64
+ #### default_territory_id
65
+
66
+ **Optional**
67
+
68
+ If you wish to execute all your API calls against a single territory,
69
+ setting this value will save you some keystrokes.
70
+
71
+ #### url_base
72
+
73
+ **Optional**
74
+
75
+ Defaults to `"https://wwrm.workwave.com/api/v1/"` and should probably
76
+ not be overwritten in most cases.
77
+
78
+ ### APIs
79
+
80
+ - `Territories.list()`
81
+ - `ApprovedPlans.get(route_id, territory_id: WorkSurfer::Client.default_territory_id)`
82
+ - `ApprovedPlans.list(date: "today", territory_id: WorkSurfer::Client.default_territory_id)`
83
+ - `TimeOfArrival.get(route_id, territory_id: WorkSurfer::Client.default_territory_id)`
84
+ - `TimeOfArrival.list(date: nil, territory_id: WorkSurfer::Client.default_territory_id, vehicle_id: nil)`
85
+
86
+ ### Response format
87
+
88
+ All responses are returned as a `Hash` with all keys and values exactly
89
+ as described in the [API Reference Documentation](https://wwrm.workwave.com/api).
90
+
91
+ ## Compatibility
92
+
93
+ So far, this has only been verified to work on Ruby (MRI) 2.3.1. I have
94
+ no plans to support any Ruby versions below 2.3.
95
+
96
+ ## Status
97
+
98
+ This library is in a very early stage and e.g. does not yet feature any
99
+ automated tests, nor does it significantly transform any API responses,
100
+ nor does it in fact support any API calls other than a few very basic
101
+ read-only calls to a subset of APIs.
102
+
103
+ At the moment, The following APIs are supported:
104
+
105
+ ### [Approved Plans](https://wwrm.workwave.com/api/#approved-plans-api)
106
+
107
+ - List Approved Routes
108
+ - Get Approved Route
109
+
110
+ ### [Territories](https://wwrm.workwave.com/api/#territories-api)
111
+
112
+ Fully supported.
113
+
114
+ ### [Time Of Arrival](https://wwrm.workwave.com/api/#time-of-arrival-api)
115
+
116
+ - List Current Routes
117
+ - Get Current Route
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: work_surfer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niels Ganser
@@ -48,8 +48,12 @@ description:
48
48
  email: niels@herimedia.com
49
49
  executables: []
50
50
  extensions: []
51
- extra_rdoc_files: []
51
+ extra_rdoc_files:
52
+ - CHANGELOG.md
53
+ - README.md
52
54
  files:
55
+ - CHANGELOG.md
56
+ - README.md
53
57
  - lib/work_surfer.rb
54
58
  - lib/work_surfer/api.rb
55
59
  - lib/work_surfer/api/approved_plans.rb