nearmiss-ruby 1.0.1 → 1.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: bc475b62dc5ae1de962481ca0eb29ef689c4fc0d
4
- data.tar.gz: 0b553e592377eb27d5cd03155238cbf839942ab1
3
+ metadata.gz: ec8f7bdcd5b27032275dc0b9be3dfae267ec791f
4
+ data.tar.gz: be841b2a0d32430584ef34030b1d9c968cb9c097
5
5
  SHA512:
6
- metadata.gz: 692476657b076f48ff6f0da311c0036bdbf87a34dea03c3b1dbb2bf0ff89a8b823951288956e5bf4d4b4043a95409e9fe2fc8c59d86e64fcdd8c787632131e49
7
- data.tar.gz: 3c5db1ddef1acd426b8afcab536d9c8bb743cb38a52621e59efa1d9dcb93d174108e5963afb67c911a10e68e4feb3eee0e3dbdb33011944939464bbc01b2d699
6
+ metadata.gz: 95946f45a1163cbb61cfed13add140e7372790cf7cb0466366775f1f9ca55c6c3675244844949bc8b24474ba4b61ae52f16f39458ffa1869a1a319f3907ea994
7
+ data.tar.gz: f3d28ef2ed3895ee43e3d18df33ee94a4b13c1d5a9595b3aec50440087003afe8266a0ffb4a4862015d54d1a4596ab35c09333d6dedbd7cecf00b9a6205b8e7e
data/Gemfile CHANGED
@@ -6,4 +6,5 @@ group :development, :spec do
6
6
  # gem 'jruby-openssl', :platforms => :jruby
7
7
  gem 'rake'
8
8
  gem 'rspec', '~> 3.3.0'
9
+ gem 'pry'
9
10
  end
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
- From the terminal call:
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
- make install
191
+ ./script/bootstrap
190
192
  ```
191
193
 
192
194
  To build the gem, call the following from the terminal:
193
195
  ``` unix
194
- gem build nearmiss-ruby.gemspec
196
+ ./script/package
195
197
  ```
196
- To update to the RubyGem server, call:
198
+ To push new version to RubyGem and create a git version tag:
197
199
  ``` unix
198
- make deploy
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"
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Nearmiss
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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: