agx 0.2.6 → 0.3.1

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: 530128fafb07cc6d1439fd1ca86a6cc9148ffcd21154d4183ce2d7048d96c1b3
4
- data.tar.gz: 71cca97cd28d2b0f4ed6aaad2025d82b8310ffec965b8d3735632aa83baef721
3
+ metadata.gz: 882bb436fd382a7f3328601c59c6c78d5fbd823a6dd994df56f4e5ffd2ca336b
4
+ data.tar.gz: 41273c8378e4e2211d228e247fb67e340a10dabc1717f50456b50c375747cdc1
5
5
  SHA512:
6
- metadata.gz: 71bf6d954b0c8a8dfb25dd7540936aca610bc8f11e2b39f94fff5f13e5f7e002749bd76075a4c18b9297174e4b39d526cf6b5e3026f9ce5ba90185b209a8fe13
7
- data.tar.gz: f97d12d51981b17fb8f0b194f2e2dbabb342918559b5efe2be255880210df787f4813c6e0c663021f62b5571a2a71f80e193468306dd35c754b952c18a42e583
6
+ metadata.gz: f7573c8f79028550413f1017cef0aad295e0765c1b390cbf29737ea660709ded51cb31cfa8bb47ae1831d02cf44f935fbbcfdfa48f9af1c8278f41359ebe72dd
7
+ data.tar.gz: 4e0d2dadecf383a00d62b156869aac3993968c37c70e0499079b7cae7f8f32889ac7df1aac1e5f274268b55a8e144d6e0d21e94a3a028e23bbbe50f4031d85a7
data/Gemfile CHANGED
@@ -5,7 +5,5 @@ git_source(:github) do |repo_name|
5
5
  "https://github.com/#{repo_name}.git"
6
6
  end
7
7
 
8
- gem 'oauth2', github: 'oauth-xx/oauth2'
9
-
10
8
  # Specify your gem's dependencies in agx.gemspec
11
9
  gemspec
@@ -1,4 +1,4 @@
1
- Copyright (c) 2018 Bryce Johnston
1
+ Copyright (c) 2020 Bryce Johnston
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -118,46 +118,13 @@ new_grower = {
118
118
  user_transaction_id = nil
119
119
  ```
120
120
 
121
- ### agX Pictures API
122
-
123
- *Note: The pictures API client implementation still needs more work.*
124
-
125
- Setup agX Pictures Client
126
-
127
- ```ruby
128
- @agx_pictures_client = Agx::Pictures::Client.new(
129
- client_id: "your_client_id",
130
- client_secret: "your_client_secret",
131
- version: "v1", # optional
132
- sync_id: "agx_user_sync_id",
133
- access_token: "agx_user_agx_token",
134
- refresh_token: "agx_user_refresh_token",
135
- token_expires_at: "access_token_expiration_timestamp",
136
- filepath: "/path/to/pictures/",
137
- prod: true # optional, false for QA
138
- )
139
- ```
140
-
141
- Make get requests for Pictures API images and metadata
142
-
143
- ***Currently only get requests are supported***
144
- ```ruby
145
-
146
- # Get metadata
147
- image_meta = @agx_pictures_client.get_metadata("661ee0c0-0cbc-4a7b-be39-1a9de49acc86")
148
-
149
- # Get image and save to {filepath}/{sync_id}_{picture_id}.jpeg
150
- image = @agx_pictures_client.get("661ee0c0-0cbc-4a7b-be39-1a9de49acc86")
151
- # => "/path/to/pictures/7_661ee0c0-0cbc-4a7b-be39-1a9de49acc86.jpeg"
152
- ```
153
-
154
121
  ## Development
155
122
 
156
123
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`.
157
124
 
158
125
  ## Contributing
159
126
 
160
- Bug reports and pull requests are welcome on GitHub at https://github.com/beaorn/agx-ruby.
127
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cropquest/agx-ruby.
161
128
 
162
129
 
163
130
  ## License
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "agx"
8
8
  spec.version = Agx::VERSION
9
9
  spec.authors = ["Bryce Johnston"]
10
- spec.email = ["bryce@beaorn.com"]
10
+ spec.email = ["bryce.johnston@hey.com"]
11
11
 
12
12
  spec.summary = %q{Ruby client for accessing agX Platform APIs.}
13
13
  spec.description = %q{Ruby client for accessing Proagrica's agX Platform APIs.}
14
- spec.homepage = "https://github.com/beaorn/agx-ruby"
14
+ spec.homepage = "https://github.com/cropquest/agx-ruby"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -20,9 +20,9 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "oj", "< 4"
23
- # spec.add_dependency "oauth2", "< 2"
23
+ spec.add_dependency "oauth2", "< 2"
24
24
 
25
- spec.add_development_dependency "bundler", "~> 1.12"
26
- spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec", "~> 3.0"
28
- end
25
+ spec.add_development_dependency "bundler", "~> 2.1"
26
+ spec.add_development_dependency "rake", "~> 13.0"
27
+ spec.add_development_dependency "rspec", "~> 3.9"
28
+ end
@@ -117,7 +117,10 @@ module Agx
117
117
  @client_id,
118
118
  @client_secret,
119
119
  site: @site,
120
- token_url: @token_url
120
+ token_url: @token_url,
121
+ connection_opts: {
122
+ request: { timeout: 30 }
123
+ }
121
124
  )
122
125
  end
123
126
 
@@ -108,7 +108,7 @@ module Agx
108
108
  )
109
109
  return true
110
110
  rescue => e
111
- if e.response && e.response.body == "The specified transaction is invalid or expired."
111
+ if e.response && e.response.status && e.response.status.to_i >= 400
112
112
  return true
113
113
  else
114
114
  handle_error(e)
@@ -203,6 +203,9 @@ module Agx
203
203
  token_url: @token_url,
204
204
  options: {
205
205
  ssl: { ca_path: "/usr/lib/ssl/certs" }
206
+ },
207
+ connection_opts: {
208
+ request: { timeout: 20 }
206
209
  }
207
210
  }
208
211
  )
@@ -1,3 +1,3 @@
1
1
  module Agx
2
- VERSION = "0.2.6"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryce Johnston
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-21 00:00:00.000000000 Z
11
+ date: 2020-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -24,51 +24,65 @@ dependencies:
24
24
  - - "<"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: oauth2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "<"
39
+ - !ruby/object:Gem::Version
40
+ version: '2'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '1.12'
47
+ version: '2.1'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '1.12'
54
+ version: '2.1'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '10.0'
61
+ version: '13.0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '10.0'
68
+ version: '13.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '3.0'
75
+ version: '3.9'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '3.0'
82
+ version: '3.9'
69
83
  description: Ruby client for accessing Proagrica's agX Platform APIs.
70
84
  email:
71
- - bryce@beaorn.com
85
+ - bryce.johnston@hey.com
72
86
  executables: []
73
87
  extensions: []
74
88
  extra_rdoc_files: []
@@ -92,7 +106,7 @@ files:
92
106
  - lib/agx/sync.rb
93
107
  - lib/agx/sync/client.rb
94
108
  - lib/agx/version.rb
95
- homepage: https://github.com/beaorn/agx-ruby
109
+ homepage: https://github.com/cropquest/agx-ruby
96
110
  licenses:
97
111
  - MIT
98
112
  metadata: {}
@@ -111,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
125
  - !ruby/object:Gem::Version
112
126
  version: '0'
113
127
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.7.6
128
+ rubygems_version: 3.1.2
116
129
  signing_key:
117
130
  specification_version: 4
118
131
  summary: Ruby client for accessing agX Platform APIs.