my_john_deere_api 1.2.2 → 1.3.0

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
  SHA256:
3
- metadata.gz: 323b2dbcafff1df5b7b99acdeca601dadbac2c505dcbc1083409c5140b24d004
4
- data.tar.gz: '08836d5ef6a97a75a41819be9e0b4bc03e5b278c495c42e660e063dcd432f4c4'
3
+ metadata.gz: d50aa3fc0ca62985954cd44e295bded9e99d4c4dfe0f54476790d67a8c9ec9c7
4
+ data.tar.gz: ff0e198656370bf7db40d83d389750c02fc9bf687f721f1aa1633ea3ea62dafa
5
5
  SHA512:
6
- metadata.gz: e2649b788f9abdad89c05f5335a181be1d2df328d1c093325c9e1dfc9ef728f87115ab2a5c386c509fecc649de5040aa64407c5d038258cee5b4fcf5ff26d604
7
- data.tar.gz: baa8f6cf444d43be11907b42c618ff70b43a27e11c811c656c163ce56b7c7b4b9055281023603f4108d670cc8d5ec002e2f24398876210418208a9fe81fc4856
6
+ metadata.gz: cc0e69436e3a50c0f3c14cbe472415478d7fa1ee79ad308c12054da7a5c03d6e298f0c85aebfdc32edf42c0ff4abc50b8cba1908f308564adfa75fdf57928adc
7
+ data.tar.gz: 18f7ba0176b534e2af940205145b97172dd64c4083b2c43fdf586ce602742fc6110e059dff26fbbf1e408d43a9cf67488eae7b7e0ec10166288b5bf137f400ec
data/README.md CHANGED
@@ -467,5 +467,16 @@ client.delete('/assets/123123')
467
467
 
468
468
  John Deere's standard response is a 204 HTTP status code, with the message "No Content". This method returns the full Net::HTTP response.
469
469
 
470
-
471
- More details coming soon.
470
+ ### Contributing to This Gem
471
+
472
+ The easiest way to contribute is:
473
+
474
+ * Clone the repo
475
+ * Create a feature branch
476
+ * Grep for "raise NotYetImplementedError" in the lib directory
477
+ * Replace one of these exceptions with working code, following the conventions used in the rest of the app
478
+ * Run tests.
479
+ * You may need to regenerate all VCR cassettes from scratch.
480
+ * All VCR cassettes should be pre-recorded in `vcr_setup`
481
+ * Anything that is created in the JD sandbox as a result of running the tests should be removed, also in `vcr_setup`.
482
+ * When tests are passing, submit a Pull Request.
@@ -1,6 +1,7 @@
1
1
  module MyJohnDeereApi::Errors
2
2
  require 'my_john_deere_api/errors/access_token_error'
3
3
  require 'my_john_deere_api/errors/invalid_record_error'
4
+ require 'my_john_deere_api/errors/not_yet_implemented_error'
4
5
  require 'my_john_deere_api/errors/type_mismatch_error'
5
6
  require 'my_john_deere_api/errors/unsupported_environment_error'
6
7
  end
@@ -0,0 +1,12 @@
1
+ module MyJohnDeereApi
2
+ ##
3
+ # This error is used in a context that will fail in the absence of
4
+ # a valid oAuth access token. We have classes that may only need
5
+ # access tokens for some use cases.
6
+
7
+ class NotYetImplementedError < StandardError
8
+ def initialize(message = 'This is not yet implemented. View README to help make this gem better!')
9
+ super
10
+ end
11
+ end
12
+ end
@@ -15,5 +15,19 @@ module MyJohnDeereApi::Request
15
15
  def model
16
16
  MyJohnDeereApi::Model::Flag
17
17
  end
18
+
19
+ ##
20
+ # Create a new flag (NOT YET IMPLEMENTED)
21
+
22
+ def create(attributes)
23
+ raise NotImplementedError
24
+ end
25
+
26
+ ##
27
+ # Retrieve an flag from JD (NOT YET IMPLEMENTED)
28
+
29
+ def find(asset_id)
30
+ raise NotImplementedError
31
+ end
18
32
  end
19
33
  end
@@ -1,3 +1,3 @@
1
1
  module MyJohnDeereApi
2
- VERSION='1.2.2'
2
+ VERSION='1.3.0'
3
3
  end
@@ -0,0 +1,13 @@
1
+ require 'support/helper'
2
+
3
+ describe 'MyJohnDeereApi::NotYetImplementedError' do
4
+ it 'inherits from StandardError' do
5
+ error = MyJohnDeereApi::NotYetImplementedError.new
6
+ assert_kind_of StandardError, error
7
+ end
8
+
9
+ it 'has a default message' do
10
+ error = MyJohnDeereApi::NotYetImplementedError.new
11
+ assert_includes error.message, 'This is not yet implemented. View README to help make this gem better!'
12
+ end
13
+ end
@@ -10,6 +10,10 @@ describe 'MyJohnDeereApi Errors' do
10
10
  assert JD::InvalidRecordError
11
11
  end
12
12
 
13
+ it 'loads NotYetImplementedError' do
14
+ assert JD::NotYetImplementedError
15
+ end
16
+
13
17
  it 'loads TypeMismatchError' do
14
18
  assert JD::TypeMismatchError
15
19
  end
@@ -57,6 +57,18 @@ describe 'MyJohnDeereApi::Request::Collection::Flags' do
57
57
  end
58
58
  end
59
59
 
60
+ describe '#create(attributes)' do
61
+ it 'raises an error, not yet implemented' do
62
+ assert_raises(NotImplementedError) { collection.create({}) }
63
+ end
64
+ end
65
+
66
+ describe '#find(id)' do
67
+ it 'raises an error, not yet implemented' do
68
+ assert_raises(NotImplementedError) { collection.find(123) }
69
+ end
70
+ end
71
+
60
72
  describe 'results' do
61
73
  let(:flag_geometries) do
62
74
  contents = File.read('test/support/vcr/get_flags.yml')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_john_deere_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Bellmyer
@@ -109,6 +109,7 @@ files:
109
109
  - lib/my_john_deere_api/errors.rb
110
110
  - lib/my_john_deere_api/errors/access_token_error.rb
111
111
  - lib/my_john_deere_api/errors/invalid_record_error.rb
112
+ - lib/my_john_deere_api/errors/not_yet_implemented_error.rb
112
113
  - lib/my_john_deere_api/errors/type_mismatch_error.rb
113
114
  - lib/my_john_deere_api/errors/unsupported_environment_error.rb
114
115
  - lib/my_john_deere_api/helpers.rb
@@ -151,6 +152,7 @@ files:
151
152
  - test/lib/my_john_deere_api/consumer_test.rb
152
153
  - test/lib/my_john_deere_api/errors/access_token_error_test.rb
153
154
  - test/lib/my_john_deere_api/errors/invalid_record_error_test.rb
155
+ - test/lib/my_john_deere_api/errors/not_yet_implemented_error_test.rb
154
156
  - test/lib/my_john_deere_api/errors/type_mismatch_error_test.rb
155
157
  - test/lib/my_john_deere_api/errors/unsupported_environment_error_test.rb
156
158
  - test/lib/my_john_deere_api/errors_test.rb