nearmiss-ruby 1.0.1 → 1.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 -0
- data/README.md +7 -5
- data/lib/nearmiss-ruby/client/incidents.rb +15 -3
- data/lib/nearmiss-ruby/client.rb +7 -0
- data/lib/nearmiss-ruby/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec8f7bdcd5b27032275dc0b9be3dfae267ec791f
|
4
|
+
data.tar.gz: be841b2a0d32430584ef34030b1d9c968cb9c097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95946f45a1163cbb61cfed13add140e7372790cf7cb0466366775f1f9ca55c6c3675244844949bc8b24474ba4b61ae52f16f39458ffa1869a1a319f3907ea994
|
7
|
+
data.tar.gz: f3d28ef2ed3895ee43e3d18df33ee94a4b13c1d5a9595b3aec50440087003afe8266a0ffb4a4862015d54d1a4596ab35c09333d6dedbd7cecf00b9a6205b8e7e
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -184,18 +184,20 @@ If you've instead found a bug in the library or would like new features added, g
|
|
184
184
|
|
185
185
|
## Development
|
186
186
|
|
187
|
-
|
187
|
+
If you want to hack on Nearmiss locally, we try to make bootstrapping the project as painless as possible. To start hacking, clone and run:
|
188
|
+
|
189
|
+
To get started call
|
188
190
|
``` unix
|
189
|
-
|
191
|
+
./script/bootstrap
|
190
192
|
```
|
191
193
|
|
192
194
|
To build the gem, call the following from the terminal:
|
193
195
|
``` unix
|
194
|
-
|
196
|
+
./script/package
|
195
197
|
```
|
196
|
-
To
|
198
|
+
To push new version to RubyGem and create a git version tag:
|
197
199
|
``` unix
|
198
|
-
|
200
|
+
./script/release
|
199
201
|
```
|
200
202
|
|
201
203
|
|
@@ -11,9 +11,9 @@ module Nearmiss
|
|
11
11
|
#
|
12
12
|
def incidents(options = {})
|
13
13
|
since = options[:since] || options["since"]
|
14
|
-
|
14
|
+
|
15
15
|
options.merge!(since: iso8601(parse_date(since))) if since
|
16
|
-
|
16
|
+
|
17
17
|
paginate "incidents", options
|
18
18
|
end
|
19
19
|
alias :list_incidents :incidents
|
@@ -31,6 +31,18 @@ module Nearmiss
|
|
31
31
|
end
|
32
32
|
alias :nearmiss :incident
|
33
33
|
|
34
|
+
# Project incidents
|
35
|
+
#
|
36
|
+
# @param project [String] ID of project
|
37
|
+
# @return [Sawyer::Resource] Incident information
|
38
|
+
#
|
39
|
+
def project_incidents(project, options = {})
|
40
|
+
|
41
|
+
paginate "#{Project.new(project).path}/incidents", options
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
|
34
46
|
# Create an incident
|
35
47
|
#
|
36
48
|
# @param options [Hash] Incident information.
|
@@ -41,7 +53,7 @@ module Nearmiss
|
|
41
53
|
# @option options [String] :company Which company did the incident
|
42
54
|
# @option options [String] :date When did the nearmiss occur
|
43
55
|
# @option options [String] :trade e.g. is actually the activity
|
44
|
-
# @option options [Boolean] :is_public Submit the nearmiss publically or private
|
56
|
+
# @option options [Boolean] :is_public Submit the nearmiss publically or private
|
45
57
|
#
|
46
58
|
# @option options [String] :bad_weather "rainy", "sunny", "cloudy", "windy"
|
47
59
|
# @option options [String] :injured Answers: "yes", "no"
|
data/lib/nearmiss-ruby/client.rb
CHANGED
@@ -4,6 +4,8 @@ require_relative "configurable"
|
|
4
4
|
require_relative "arguments"
|
5
5
|
require_relative "util"
|
6
6
|
require_relative 'rate_limit'
|
7
|
+
require_relative 'project'
|
8
|
+
require_relative 'incident'
|
7
9
|
|
8
10
|
require_relative 'client/account'
|
9
11
|
require_relative 'client/bookmarks'
|
@@ -13,6 +15,9 @@ require_relative 'client/notifications'
|
|
13
15
|
require_relative 'client/projects'
|
14
16
|
require_relative 'client/rate_limit'
|
15
17
|
require_relative 'client/users'
|
18
|
+
require_relative 'client/companies'
|
19
|
+
require_relative 'client/attachments'
|
20
|
+
|
16
21
|
|
17
22
|
module Nearmiss
|
18
23
|
|
@@ -29,6 +34,8 @@ module Nearmiss
|
|
29
34
|
include Nearmiss::Client::Projects
|
30
35
|
include Nearmiss::Client::RateLimit
|
31
36
|
include Nearmiss::Client::Users
|
37
|
+
include Nearmiss::Client::Companies
|
38
|
+
include Nearmiss::Client::Attachments
|
32
39
|
|
33
40
|
# include Nearmiss::Client::Users
|
34
41
|
# include Nearmiss::Client::ProjectLibrary
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nearmiss-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Klooth
|
@@ -112,3 +112,4 @@ signing_key:
|
|
112
112
|
specification_version: 4
|
113
113
|
summary: A wrapper around the nearmiss.com API.
|
114
114
|
test_files: []
|
115
|
+
has_rdoc:
|