cropio-ruby 0.32 → 0.34

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 832c9a3eb8e7b266f7466e3c9a5ddf96ad58a833a89e3049ea1b5dfb2cdc0b41
4
- data.tar.gz: '058fec100bde5c710cf07c82d8a84a8233a1517eae946b9bfee026a278d18cc1'
3
+ metadata.gz: 514089bb440f38ca6b6fc984d3e48662b33bd827df4c05385121904a76d9f84e
4
+ data.tar.gz: 8c89dd1f3ad2491b08ec6afa53a1ff03436e9ad81929c037ac5e8328147e55f6
5
5
  SHA512:
6
- metadata.gz: 283317dbeff4918a132d062826cb591056e462f60cc45c9b37bbf660010722d6fa1af7450a307ca86d6c8a010581ebba5a08d385af5dd51587d7805027a190c9
7
- data.tar.gz: 500e8bfe2a67dc843e17d271bce9b261ae5e68cd3256c7251281e025f2596eab85bab50906a3bb8cebc0961a61a1b624781e14be7456d0877a9ea90b6b497658
6
+ metadata.gz: 4eab719f31115566c5e67d5aa37ee39bf74cef1f529e18b1b2a7ea230ed84d5cd263e88c17a2685e459b37befd322657ccbaa4dec22f66bafd1ee3d8dc1c1bb3
7
+ data.tar.gz: bdb2f4b555f76faca34acad8053c4dd052a66658ec3c3c08d8a50f40ff5158050d09dc1416b71d02c28e924048781a155ef1e33a240d1ad02e8a44ed91c338b6
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
Binary file
data/cropio-ruby.gemspec CHANGED
@@ -29,7 +29,7 @@ STR
29
29
  spec.add_dependency 'json'
30
30
  spec.add_dependency 'rest-client', '~>2.1.0rc1'
31
31
 
32
- spec.add_development_dependency 'bundler', '~> 1.9'
32
+ spec.add_development_dependency 'bundler'
33
33
  spec.add_development_dependency 'rake', '~> 10.0'
34
34
  spec.add_development_dependency 'pry'
35
35
  spec.add_development_dependency 'byebug'
@@ -4,7 +4,9 @@ module Cropio
4
4
  module Connection
5
5
  # Contains logic of proxing calls to HTTPS requests.
6
6
  module Proxiable
7
- # Accepts reources name and params to perform HTTPS GET request.
7
+ V3A_RESOURCES = %w[weather_history_items growth_scales].freeze
8
+
9
+ # Accepts resources name and params to perform HTTPS GET request.
8
10
  def get(resource, query = {})
9
11
  rmethod = extract_resource_method!(query)
10
12
  id = extract_record_id!(query)
@@ -13,17 +15,17 @@ module Cropio
13
15
  headers: { params: query })
14
16
  end
15
17
 
16
- # Accepts reources name and params to perform HTTPS POST request.
18
+ # Accepts resources name and params to perform HTTPS POST request.
17
19
  def post(resource, data)
18
20
  proxy(method: :post, url: url_for(resource), data: data)
19
21
  end
20
22
 
21
- # Accepts reources name and params to perform HTTPS PATCH request.
23
+ # Accepts resources name and params to perform HTTPS PATCH request.
22
24
  def patch(resource, data)
23
25
  proxy(method: :patch, url: url_for(resource), data: data)
24
26
  end
25
27
 
26
- # Accepts reources name and params to perform HTTPS DELETE request.
28
+ # Accepts resources name and params to perform HTTPS DELETE request.
27
29
  def delete(resource)
28
30
  proxy(method: :delete, url: url_for(resource))
29
31
  end
@@ -31,12 +33,18 @@ module Cropio
31
33
  protected
32
34
 
33
35
  def url_for(resource, resource_method = nil, id = nil)
34
- url = "#{Cropio::Connection::Configurable::BASE_URL}/#{resource}"
36
+ url = resolve_api_url(resource)
35
37
  url += "/#{resource_method}" if resource_method
36
38
  url += "/#{id}" if id
37
39
  url
38
40
  end
39
41
 
42
+ def resolve_api_url(resource)
43
+ version_suffix = V3A_RESOURCES.include?(resource) ? 'a' : ''
44
+
45
+ "#{Cropio::Connection::Configurable::BASE_URL}#{version_suffix}/#{resource}"
46
+ end
47
+
40
48
  def extract_resource_method!(query)
41
49
  raise ArgumentError unless query.is_a?(Hash)
42
50
 
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class GrowthScale < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class GrowthStage < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class GrowthStageGroup < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class GrowthStagesPrediction < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class ScoutReportPoint < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class ScoutReportPointGrowthStageStructure < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class ScoutReportPointIssue < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
9
+ 1
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class ScoutReportPointIssuePlantPart < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class ScoutReportPointMeasurement < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class ScoutingTask < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cropio
4
+ module Resources
5
+ class WeatherHistoryItem < Cropio::Resource::Base
6
+ end
7
+ end
8
+ end
@@ -70,6 +70,17 @@ require_relative './resources/fuel_type'
70
70
  require_relative './resources/fuel_tank'
71
71
  require_relative './resources/fuel_pump'
72
72
  require_relative './resources/fuel_movement'
73
+ require_relative './resources/weather_history_item'
74
+ require_relative './resources/scouting_task'
75
+ require_relative './resources/scout_report_point'
76
+ require_relative './resources/scout_report_point_issue'
77
+ require_relative './resources/scout_report_point_issue_plant_part'
78
+ require_relative './resources/scout_report_point_measurement'
79
+ require_relative './resources/scout_report_point_growth_stage_structure'
80
+ require_relative './resources/growth_scale'
81
+ require_relative './resources/growth_stage'
82
+ require_relative './resources/growth_stage_group'
83
+ require_relative './resources/growth_stages_prediction'
73
84
 
74
85
  module Cropio
75
86
  module Resources
@@ -1,3 +1,3 @@
1
1
  module Cropio
2
- VERSION = '0.32'.freeze
2
+ VERSION = '0.34'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cropio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.32'
4
+ version: '0.34'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Vernidub
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-10 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.9'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.9'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -105,6 +105,7 @@ extra_rdoc_files: []
105
105
  files:
106
106
  - ".gitignore"
107
107
  - ".rspec"
108
+ - ".ruby-version"
108
109
  - ".travis.yml"
109
110
  - Gemfile
110
111
  - LICENSE
@@ -113,6 +114,7 @@ files:
113
114
  - bin/console
114
115
  - bin/login
115
116
  - bin/setup
117
+ - cropio-ruby-0.33.gem
116
118
  - cropio-ruby.gemspec
117
119
  - lib/cropio.rb
118
120
  - lib/cropio/connection.rb
@@ -152,6 +154,10 @@ files:
152
154
  - lib/cropio/resources/fuel_tank.rb
153
155
  - lib/cropio/resources/fuel_type.rb
154
156
  - lib/cropio/resources/group_folder.rb
157
+ - lib/cropio/resources/growth_scale.rb
158
+ - lib/cropio/resources/growth_stage.rb
159
+ - lib/cropio/resources/growth_stage_group.rb
160
+ - lib/cropio/resources/growth_stages_prediction.rb
155
161
  - lib/cropio/resources/harvest_weighing.rb
156
162
  - lib/cropio/resources/historical_value.rb
157
163
  - lib/cropio/resources/history_item.rb
@@ -184,6 +190,12 @@ files:
184
190
  - lib/cropio/resources/productivity_estimate_peer.rb
185
191
  - lib/cropio/resources/protected_document.rb
186
192
  - lib/cropio/resources/satellite_image.rb
193
+ - lib/cropio/resources/scout_report_point.rb
194
+ - lib/cropio/resources/scout_report_point_growth_stage_structure.rb
195
+ - lib/cropio/resources/scout_report_point_issue.rb
196
+ - lib/cropio/resources/scout_report_point_issue_plant_part.rb
197
+ - lib/cropio/resources/scout_report_point_measurement.rb
198
+ - lib/cropio/resources/scouting_task.rb
187
199
  - lib/cropio/resources/seed.rb
188
200
  - lib/cropio/resources/soil_test.rb
189
201
  - lib/cropio/resources/soil_test_sample.rb
@@ -194,6 +206,7 @@ files:
194
206
  - lib/cropio/resources/user_role_assignment.rb
195
207
  - lib/cropio/resources/user_role_permission.rb
196
208
  - lib/cropio/resources/version.rb
209
+ - lib/cropio/resources/weather_history_item.rb
197
210
  - lib/cropio/resources/work_record.rb
198
211
  - lib/cropio/resources/work_record_machine_region_mapping_item.rb
199
212
  - lib/cropio/resources/work_type.rb
@@ -218,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
231
  - !ruby/object:Gem::Version
219
232
  version: '0'
220
233
  requirements: []
221
- rubygems_version: 3.2.15
234
+ rubygems_version: 3.4.10
222
235
  signing_key:
223
236
  specification_version: 4
224
237
  summary: Cropio API bindings for Ruby