agris 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +55 -0
- data/.codeclimate.yml +5 -0
- data/.rubocop.yml +320 -5
- data/.rubocop_todo.yml +14 -0
- data/agris.gemspec +1 -0
- data/lib/agris/api/grain.rb +3 -2
- data/lib/agris/api/grain/purchase_contracts.rb +1 -1
- data/lib/agris/api/grain/sales_contracts.rb +29 -0
- data/lib/agris/api/grain/{specific_purchase_contract_extract.rb → specific_contract_extract.rb} +1 -1
- data/lib/agris/api/messages.rb +4 -0
- data/lib/agris/api/messages/query_changed_sales_contracts.rb +18 -0
- data/lib/agris/api/messages/query_sales_contract_documents.rb +21 -0
- data/lib/agris/client.rb +1 -0
- data/lib/agris/version.rb +1 -1
- metadata +24 -6
- data/.hound-rubocop.yml +0 -247
- data/.hound.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e08ee4d8c500d0bf6fe130ffefd982eb20ec584b
|
4
|
+
data.tar.gz: e88f886947099f3e7b2a504077ff44898048495c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85269cd57099f20c4649528269a28e7354740fffa5cf26e776a42b7f86485f464ddf9f69a2eddbcb73beaea8bd6feb0f1f0c2b2baa4a5c979fd0a527921ec153
|
7
|
+
data.tar.gz: f089d7e7df738c333398f8ed5fdc27470742655bc1bd4d039051c18d8523a643f2bc0508c7a68a6ed08cae4620f873c419bd7fd359a6eaf79478107f6c8f3604
|
@@ -0,0 +1,55 @@
|
|
1
|
+
version: 2
|
2
|
+
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
docker:
|
6
|
+
# specify the version you desire here
|
7
|
+
- image: circleci/ruby:2.4.1
|
8
|
+
|
9
|
+
working_directory: ~/agris
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- checkout
|
13
|
+
|
14
|
+
# Download and cache dependencies
|
15
|
+
- restore_cache:
|
16
|
+
keys:
|
17
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
18
|
+
|
19
|
+
- run:
|
20
|
+
name: install dependencies
|
21
|
+
command: |
|
22
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
23
|
+
|
24
|
+
- run:
|
25
|
+
name: Setup Code Climate test-reporter
|
26
|
+
command: |
|
27
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
28
|
+
chmod +x ./cc-test-reporter
|
29
|
+
- save_cache:
|
30
|
+
paths:
|
31
|
+
- ./vendor/bundle
|
32
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
33
|
+
|
34
|
+
# run tests!
|
35
|
+
- run:
|
36
|
+
name: run tests
|
37
|
+
command: |
|
38
|
+
./cc-test-reporter before-build
|
39
|
+
mkdir /tmp/test-results
|
40
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
41
|
+
|
42
|
+
bundle exec rspec --format progress \
|
43
|
+
--format RspecJunitFormatter \
|
44
|
+
--out /tmp/test-results/rspec.xml \
|
45
|
+
--format progress \
|
46
|
+
-- \
|
47
|
+
$TEST_FILES
|
48
|
+
./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
|
49
|
+
|
50
|
+
# collect reports
|
51
|
+
- store_test_results:
|
52
|
+
path: /tmp/test-results
|
53
|
+
- store_artifacts:
|
54
|
+
path: /tmp/test-results
|
55
|
+
destination: test-results
|
data/.codeclimate.yml
ADDED
data/.rubocop.yml
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
inherit_from:
|
2
|
-
- .hound-rubocop.yml
|
1
|
+
inherit_from: .rubocop_todo.yml
|
3
2
|
|
4
3
|
Rails:
|
5
4
|
Enabled: false
|
@@ -10,6 +9,325 @@ AllCops:
|
|
10
9
|
- "db/schema.rb"
|
11
10
|
- "node_modules/**/*"
|
12
11
|
- bin/*
|
12
|
+
UseCache: false
|
13
|
+
Layout/DotPosition:
|
14
|
+
Description: Checks the position of the dot in multi-line method calls.
|
15
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
16
|
+
Enabled: true
|
17
|
+
EnforcedStyle: trailing
|
18
|
+
SupportedStyles:
|
19
|
+
- leading
|
20
|
+
- trailing
|
21
|
+
Layout/EmptyLineAfterMagicComment:
|
22
|
+
Description: 'Add an empty line after magic comments to separate them from code.'
|
23
|
+
StyleGuide: '#separate-magic-comments-from-code'
|
24
|
+
Enabled: false
|
25
|
+
Lint/AmbiguousBlockAssociation:
|
26
|
+
Exclude:
|
27
|
+
- "spec/**/*"
|
28
|
+
Style/CollectionMethods:
|
29
|
+
Description: Preferred collection methods.
|
30
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
31
|
+
Enabled: true
|
32
|
+
PreferredMethods:
|
33
|
+
collect: map
|
34
|
+
collect!: map!
|
35
|
+
find: detect
|
36
|
+
find_all: select
|
37
|
+
reduce: inject
|
38
|
+
Naming/FileName:
|
39
|
+
Description: Use snake_case for source file names.
|
40
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
41
|
+
Enabled: false
|
42
|
+
Exclude: []
|
43
|
+
Style/GuardClause:
|
44
|
+
Description: Check for conditionals that can be replaced with guard clauses
|
45
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
46
|
+
Enabled: false
|
47
|
+
MinBodyLength: 1
|
48
|
+
Style/IfUnlessModifier:
|
49
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
50
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
51
|
+
Enabled: false
|
52
|
+
Style/OptionHash:
|
53
|
+
Description: Don't use option hashes when you can use keyword arguments.
|
54
|
+
Enabled: false
|
55
|
+
Style/PercentLiteralDelimiters:
|
56
|
+
Description: Use `%`-literal delimiters consistently
|
57
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
58
|
+
Enabled: false
|
59
|
+
PreferredDelimiters:
|
60
|
+
"%": "()"
|
61
|
+
"%i": "()"
|
62
|
+
"%q": "()"
|
63
|
+
"%Q": "()"
|
64
|
+
"%r": "{}"
|
65
|
+
"%s": "()"
|
66
|
+
"%w": "()"
|
67
|
+
"%W": "()"
|
68
|
+
"%x": "()"
|
69
|
+
Naming/PredicateName:
|
70
|
+
Description: Check the names of predicate methods.
|
71
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
72
|
+
Enabled: true
|
73
|
+
NamePrefix:
|
74
|
+
- is_
|
75
|
+
- has_
|
76
|
+
- have_
|
77
|
+
NamePrefixBlacklist:
|
78
|
+
- is_
|
79
|
+
Exclude:
|
80
|
+
- spec/**/*
|
81
|
+
Style/RaiseArgs:
|
82
|
+
Description: Checks the arguments passed to raise/fail.
|
83
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
84
|
+
Enabled: false
|
85
|
+
EnforcedStyle: exploded
|
86
|
+
SupportedStyles:
|
87
|
+
- compact
|
88
|
+
- exploded
|
89
|
+
Style/SignalException:
|
90
|
+
Description: Checks for proper usage of fail and raise.
|
91
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
92
|
+
Enabled: true
|
93
|
+
EnforcedStyle: semantic
|
94
|
+
SupportedStyles:
|
95
|
+
- only_raise
|
96
|
+
- only_fail
|
97
|
+
- semantic
|
98
|
+
Style/SingleLineBlockParams:
|
99
|
+
Description: Enforces the names of some block params.
|
100
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
101
|
+
Enabled: false
|
102
|
+
Methods:
|
103
|
+
- reduce:
|
104
|
+
- a
|
105
|
+
- e
|
106
|
+
- inject:
|
107
|
+
- a
|
108
|
+
- e
|
109
|
+
Style/SingleLineMethods:
|
110
|
+
Description: Avoid single-line methods.
|
111
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
112
|
+
Enabled: false
|
113
|
+
AllowIfMethodIsEmpty: true
|
114
|
+
Style/StringLiterals:
|
115
|
+
Description: Checks if uses of quotes match the configured preference.
|
116
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
117
|
+
Enabled: true
|
118
|
+
EnforcedStyle: single_quotes
|
119
|
+
SupportedStyles:
|
120
|
+
- single_quotes
|
121
|
+
- double_quotes
|
122
|
+
Style/StringLiteralsInInterpolation:
|
123
|
+
Description: Checks if uses of quotes inside expressions in interpolated strings
|
124
|
+
match the configured preference.
|
125
|
+
Enabled: true
|
126
|
+
EnforcedStyle: single_quotes
|
127
|
+
SupportedStyles:
|
128
|
+
- single_quotes
|
129
|
+
- double_quotes
|
130
|
+
Style/TrailingCommaInArguments:
|
131
|
+
Description: 'Checks for trailing comma in argument lists.'
|
132
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
133
|
+
Enabled: true
|
134
|
+
EnforcedStyleForMultiline: no_comma
|
135
|
+
Style/TrailingCommaInArrayLiteral:
|
136
|
+
Description: 'Checks for trailing comma in array literals.'
|
137
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
138
|
+
Enabled: true
|
139
|
+
EnforcedStyleForMultiline: no_comma
|
140
|
+
Style/TrailingCommaInHashLiteral:
|
141
|
+
Description: 'Checks for trailing comma in hash literals.'
|
142
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
143
|
+
Enabled: true
|
144
|
+
EnforcedStyleForMultiline: no_comma
|
145
|
+
Metrics/AbcSize:
|
146
|
+
Description: A calculated magnitude based on number of assignments, branches, and
|
147
|
+
conditions.
|
148
|
+
Enabled: false
|
149
|
+
Max: 15
|
150
|
+
Metrics/ClassLength:
|
151
|
+
Description: Avoid classes longer than 100 lines of code.
|
152
|
+
Enabled: false
|
153
|
+
CountComments: false
|
154
|
+
Max: 100
|
155
|
+
Metrics/ModuleLength:
|
156
|
+
CountComments: false
|
157
|
+
Max: 100
|
158
|
+
Description: Avoid modules longer than 100 lines of code.
|
159
|
+
Enabled: false
|
160
|
+
Metrics/CyclomaticComplexity:
|
161
|
+
Description: A complexity metric that is strongly correlated to the number of test
|
162
|
+
cases needed to validate a method.
|
163
|
+
Enabled: false
|
164
|
+
Max: 6
|
165
|
+
Metrics/MethodLength:
|
166
|
+
Description: Avoid methods longer than 10 lines of code.
|
167
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
168
|
+
Enabled: false
|
169
|
+
CountComments: false
|
170
|
+
Max: 10
|
171
|
+
Metrics/ParameterLists:
|
172
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
173
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
174
|
+
Enabled: false
|
175
|
+
Max: 5
|
176
|
+
CountKeywordArgs: true
|
177
|
+
Metrics/PerceivedComplexity:
|
178
|
+
Description: A complexity metric geared towards measuring complexity for a human
|
179
|
+
reader.
|
180
|
+
Enabled: false
|
181
|
+
Max: 7
|
182
|
+
Lint/AssignmentInCondition:
|
183
|
+
Description: Don't use assignment in conditions.
|
184
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
185
|
+
Enabled: false
|
186
|
+
AllowSafeAssignment: true
|
187
|
+
Style/InlineComment:
|
188
|
+
Description: Avoid inline comments.
|
189
|
+
Enabled: false
|
190
|
+
Naming/AccessorMethodName:
|
191
|
+
Description: Check the naming of accessor methods for get_/set_.
|
192
|
+
Enabled: false
|
193
|
+
Style/Alias:
|
194
|
+
Description: Use alias_method instead of alias.
|
195
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
196
|
+
Enabled: false
|
197
|
+
Style/Documentation:
|
198
|
+
Description: Document classes and non-namespace modules.
|
199
|
+
Enabled: false
|
200
|
+
Style/DoubleNegation:
|
201
|
+
Description: Checks for uses of double negation (!!).
|
202
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
203
|
+
Enabled: false
|
204
|
+
Style/EachWithObject:
|
205
|
+
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
206
|
+
Enabled: false
|
207
|
+
Style/EmptyLiteral:
|
208
|
+
Description: Prefer literals to Array.new/Hash.new/String.new.
|
209
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
210
|
+
Enabled: false
|
211
|
+
Style/ModuleFunction:
|
212
|
+
Description: Checks for usage of `extend self` in modules.
|
213
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
214
|
+
Enabled: false
|
215
|
+
Style/OneLineConditional:
|
216
|
+
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
217
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
218
|
+
Enabled: false
|
219
|
+
Style/PerlBackrefs:
|
220
|
+
Description: Avoid Perl-style regex back references.
|
221
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
222
|
+
Enabled: false
|
223
|
+
Style/Send:
|
224
|
+
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
225
|
+
may overlap with existing methods.
|
226
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
227
|
+
Enabled: false
|
228
|
+
Style/SpecialGlobalVars:
|
229
|
+
Description: Avoid Perl-style global variables.
|
230
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
231
|
+
Enabled: false
|
232
|
+
Style/VariableInterpolation:
|
233
|
+
Description: Don't interpolate global, instance and class variables directly in
|
234
|
+
strings.
|
235
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
236
|
+
Enabled: false
|
237
|
+
Style/WhenThen:
|
238
|
+
Description: Use when x then ... for one-line cases.
|
239
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
240
|
+
Enabled: false
|
241
|
+
Lint/EachWithObjectArgument:
|
242
|
+
Description: Check for immutable argument given to each_with_object.
|
243
|
+
Enabled: true
|
244
|
+
Lint/HandleExceptions:
|
245
|
+
Description: Don't suppress exception.
|
246
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
247
|
+
Enabled: false
|
248
|
+
Lint/LiteralAsCondition:
|
249
|
+
Description: Checks of literals used in conditions.
|
250
|
+
Enabled: false
|
251
|
+
Lint/LiteralInInterpolation:
|
252
|
+
Description: Checks for literals used in interpolation.
|
253
|
+
Enabled: false
|
254
|
+
|
255
|
+
##################### Rails ##################################
|
256
|
+
|
257
|
+
Rails/ActionFilter:
|
258
|
+
Description: 'Enforces consistent use of action filter methods.'
|
259
|
+
Enabled: true
|
260
|
+
Rails/Date:
|
261
|
+
Description: >-
|
262
|
+
Checks the correct usage of date aware methods,
|
263
|
+
such as Date.today, Date.current etc.
|
264
|
+
Enabled: true
|
265
|
+
Rails/Delegate:
|
266
|
+
Description: 'Prefer delegate method for delegations.'
|
267
|
+
Enabled: true
|
268
|
+
Rails/Exit:
|
269
|
+
Description: >-
|
270
|
+
Favor `fail`, `break`, `return`, etc. over `exit` in
|
271
|
+
application or library code outside of Rake files to avoid
|
272
|
+
exits during unit testing or running in production.
|
273
|
+
Enabled: true
|
274
|
+
Rails/FindBy:
|
275
|
+
Description: 'Prefer find_by over where.first.'
|
276
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
|
277
|
+
Enabled: true
|
278
|
+
Rails/FindEach:
|
279
|
+
Description: 'Prefer all.find_each over all.find.'
|
280
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find-each'
|
281
|
+
Enabled: true
|
282
|
+
Rails/HasAndBelongsToMany:
|
283
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
284
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
|
285
|
+
Enabled: true
|
286
|
+
Rails/HttpPositionalArguments:
|
287
|
+
Description: 'Rails 5 only, disabled to keep Hound quiet'
|
288
|
+
Enabled: false
|
289
|
+
Rails/NotNullColumn:
|
290
|
+
Description: 'Do not add a NOT NULL column without a default value'
|
291
|
+
Enabled: false
|
292
|
+
Rails/Output:
|
293
|
+
Description: 'Checks for calls to puts, print, etc.'
|
294
|
+
Enabled: true
|
295
|
+
Rails/OutputSafety:
|
296
|
+
Description: 'The use of `html_safe` or `raw` may be a security risk.'
|
297
|
+
Enabled: true
|
298
|
+
Rails/PluralizationGrammar:
|
299
|
+
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
|
300
|
+
Enabled: true
|
301
|
+
Rails/ReadWriteAttribute:
|
302
|
+
Description: >-
|
303
|
+
Checks for read_attribute(:attr) and
|
304
|
+
write_attribute(:attr, val).
|
305
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
|
306
|
+
Enabled: true
|
307
|
+
Rails/RequestReferer:
|
308
|
+
Description: 'Use consistent syntax for request.referer.'
|
309
|
+
Enabled: true
|
310
|
+
Rails/SafeNavigation:
|
311
|
+
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
|
312
|
+
Enabled: true
|
313
|
+
Rails/ScopeArgs:
|
314
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
315
|
+
Enabled: true
|
316
|
+
Rails/TimeZone:
|
317
|
+
Description: 'Checks the correct usage of time zone aware methods.'
|
318
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
|
319
|
+
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
320
|
+
Enabled: true
|
321
|
+
Rails/UniqBeforePluck:
|
322
|
+
Description: 'Prefer the use of uniq or distinct before pluck.'
|
323
|
+
Enabled: true
|
324
|
+
Rails/Validation:
|
325
|
+
Description: 'Use validates :attribute, hash of validations.'
|
326
|
+
Enabled: true
|
327
|
+
Security/JSONLoad:
|
328
|
+
Description : 'Prefer usage of JSON.parse'
|
329
|
+
Enabled: true
|
330
|
+
|
13
331
|
Layout/DotPosition:
|
14
332
|
Description: Checks the position of the dot in multi-line method calls.
|
15
333
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
@@ -44,6 +362,3 @@ Style/StringLiterals:
|
|
44
362
|
SupportedStyles:
|
45
363
|
- single_quotes
|
46
364
|
- double_quotes
|
47
|
-
Rails/DynamicFindBy:
|
48
|
-
Exclude:
|
49
|
-
- "spec/features/**/*"
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-07-27 11:54:32 -0400 using RuboCop version 0.54.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 341
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
12
|
+
# SupportedStyles: single_quotes, double_quotes
|
13
|
+
Style/StringLiterals:
|
14
|
+
Enabled: false
|
data/agris.gemspec
CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'pry-byebug'
|
27
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
28
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
29
30
|
spec.add_development_dependency 'rubocop', '0.54.0'
|
30
31
|
spec.add_development_dependency 'simplecov'
|
31
32
|
spec.add_development_dependency 'webmock', '~> 2.3'
|
data/lib/agris/api/grain.rb
CHANGED
@@ -9,10 +9,11 @@ module Agris
|
|
9
9
|
autoload :NewTicket, 'agris/api/grain/new_ticket'
|
10
10
|
autoload :NewTicketApplication, 'agris/api/grain/new_ticket_application'
|
11
11
|
autoload :NewTicketRemark, 'agris/api/grain/new_ticket_remark'
|
12
|
+
autoload :SalesContracts, 'agris/api/grain/sales_contracts'
|
12
13
|
autoload :SpecificCommodityCodeExtract,
|
13
14
|
'agris/api/grain/specific_commodity_code_extract'
|
14
|
-
autoload :
|
15
|
-
'agris/api/grain/
|
15
|
+
autoload :SpecificContractExtract,
|
16
|
+
'agris/api/grain/specific_contract_extract'
|
16
17
|
autoload :Tickets,
|
17
18
|
'agris/api/grain/tickets'
|
18
19
|
end
|
@@ -4,7 +4,7 @@ module Agris
|
|
4
4
|
module Grain
|
5
5
|
module PurchaseContracts
|
6
6
|
def purchase_contract(contract_location, contract_number)
|
7
|
-
extract = Agris::Api::Grain::
|
7
|
+
extract = Agris::Api::Grain::SpecificContractExtract
|
8
8
|
.new(contract_location, contract_number)
|
9
9
|
|
10
10
|
purchase_contracts([extract])
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Agris
|
3
|
+
module Api
|
4
|
+
module Grain
|
5
|
+
module SalesContracts
|
6
|
+
def sales_contract(contract_location, contract_number)
|
7
|
+
extract = Agris::Api::Grain::SpecificContractExtract
|
8
|
+
.new(contract_location, contract_number)
|
9
|
+
|
10
|
+
sales_contracts([extract])
|
11
|
+
end
|
12
|
+
|
13
|
+
def sales_contracts(extracts)
|
14
|
+
extract_documents(
|
15
|
+
Messages::QuerySalesContractDocuments.new(extracts),
|
16
|
+
Agris::Api::Grain::Contract
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def sales_contracts_changed_since(datetime, detail = false)
|
21
|
+
extract_documents(
|
22
|
+
Messages::QueryChangedSalesContracts.new(datetime, detail),
|
23
|
+
Agris::Api::Grain::Contract
|
24
|
+
)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/agris/api/messages.rb
CHANGED
@@ -16,12 +16,16 @@ module Agris
|
|
16
16
|
'agris/api/messages/query_commodity_code_documents'
|
17
17
|
autoload :QueryChangedDeliveryTickets,
|
18
18
|
'agris/api/messages/query_changed_delivery_tickets'
|
19
|
+
autoload :QueryChangedSalesContracts,
|
20
|
+
'agris/api/messages/query_changed_sales_contracts'
|
19
21
|
autoload :QueryChangedPurchaseContracts,
|
20
22
|
'agris/api/messages/query_changed_purchase_contracts'
|
21
23
|
autoload :QueryChangedInvoices,
|
22
24
|
'agris/api/messages/query_changed_invoices'
|
23
25
|
autoload :QueryChangedOrders,
|
24
26
|
'agris/api/messages/query_changed_orders'
|
27
|
+
autoload :QuerySalesContractDocuments,
|
28
|
+
'agris/api/messages/query_sales_contract_documents'
|
25
29
|
autoload :QueryPurchaseContractDocuments,
|
26
30
|
'agris/api/messages/query_purchase_contract_documents'
|
27
31
|
autoload :QueryDeliveryTicketDocuments,
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Agris
|
3
|
+
module Api
|
4
|
+
module Messages
|
5
|
+
class QueryChangedSalesContracts < ChangedQueryBase
|
6
|
+
def message_number
|
7
|
+
80_170
|
8
|
+
end
|
9
|
+
|
10
|
+
protected
|
11
|
+
|
12
|
+
def xml_hash
|
13
|
+
xml_base_hash
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Agris
|
3
|
+
module Api
|
4
|
+
module Messages
|
5
|
+
class QuerySalesContractDocuments < DocumentQueryBase
|
6
|
+
def message_number
|
7
|
+
80_170
|
8
|
+
end
|
9
|
+
|
10
|
+
protected
|
11
|
+
|
12
|
+
def xml_hash
|
13
|
+
xml_base_hash
|
14
|
+
.merge(
|
15
|
+
contract: @document_references.map(&:to_xml_hash)
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/agris/client.rb
CHANGED
@@ -5,6 +5,7 @@ module Agris
|
|
5
5
|
include Api::AccountsReceivables::Invoices
|
6
6
|
include Api::Grain::CommodityCodes
|
7
7
|
include Api::Grain::PurchaseContracts
|
8
|
+
include Api::Grain::SalesContracts
|
8
9
|
include Api::Grain::Tickets
|
9
10
|
include Api::Inventory::DeliveryTickets
|
10
11
|
include Api::Inventory::Orders
|
data/lib/agris/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agris
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Gray
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: savon
|
@@ -81,6 +81,20 @@ dependencies:
|
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '3.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec_junit_formatter
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: rubocop
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -131,11 +145,12 @@ executables: []
|
|
131
145
|
extensions: []
|
132
146
|
extra_rdoc_files: []
|
133
147
|
files:
|
148
|
+
- ".circleci/config.yml"
|
149
|
+
- ".codeclimate.yml"
|
134
150
|
- ".gitignore"
|
135
|
-
- ".hound-rubocop.yml"
|
136
|
-
- ".hound.yml"
|
137
151
|
- ".rspec"
|
138
152
|
- ".rubocop.yml"
|
153
|
+
- ".rubocop_todo.yml"
|
139
154
|
- Gemfile
|
140
155
|
- LICENSE
|
141
156
|
- README.md
|
@@ -159,8 +174,9 @@ files:
|
|
159
174
|
- lib/agris/api/grain/new_ticket_application.rb
|
160
175
|
- lib/agris/api/grain/new_ticket_remark.rb
|
161
176
|
- lib/agris/api/grain/purchase_contracts.rb
|
177
|
+
- lib/agris/api/grain/sales_contracts.rb
|
162
178
|
- lib/agris/api/grain/specific_commodity_code_extract.rb
|
163
|
-
- lib/agris/api/grain/
|
179
|
+
- lib/agris/api/grain/specific_contract_extract.rb
|
164
180
|
- lib/agris/api/grain/tickets.rb
|
165
181
|
- lib/agris/api/inventory.rb
|
166
182
|
- lib/agris/api/inventory/delivery_ticket.rb
|
@@ -179,11 +195,13 @@ files:
|
|
179
195
|
- lib/agris/api/messages/query_changed_invoices.rb
|
180
196
|
- lib/agris/api/messages/query_changed_orders.rb
|
181
197
|
- lib/agris/api/messages/query_changed_purchase_contracts.rb
|
198
|
+
- lib/agris/api/messages/query_changed_sales_contracts.rb
|
182
199
|
- lib/agris/api/messages/query_commodity_code_documents.rb
|
183
200
|
- lib/agris/api/messages/query_delivery_ticket_documents.rb
|
184
201
|
- lib/agris/api/messages/query_invoice_documents.rb
|
185
202
|
- lib/agris/api/messages/query_order_documents.rb
|
186
203
|
- lib/agris/api/messages/query_purchase_contract_documents.rb
|
204
|
+
- lib/agris/api/messages/query_sales_contract_documents.rb
|
187
205
|
- lib/agris/api/new_order.rb
|
188
206
|
- lib/agris/api/new_order_remark.rb
|
189
207
|
- lib/agris/api/new_voucher.rb
|
@@ -226,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
244
|
version: '0'
|
227
245
|
requirements: []
|
228
246
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.6.14
|
247
|
+
rubygems_version: 2.6.14
|
230
248
|
signing_key:
|
231
249
|
specification_version: 4
|
232
250
|
summary: Ruby client library for Agris API
|
data/.hound-rubocop.yml
DELETED
@@ -1,247 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: 2.2
|
3
|
-
Exclude:
|
4
|
-
- "vendor/**/*"
|
5
|
-
- "db/schema.rb"
|
6
|
-
UseCache: false
|
7
|
-
Layout/DotPosition:
|
8
|
-
Description: Checks the position of the dot in multi-line method calls.
|
9
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
10
|
-
Enabled: true
|
11
|
-
EnforcedStyle: trailing
|
12
|
-
SupportedStyles:
|
13
|
-
- leading
|
14
|
-
- trailing
|
15
|
-
Layout/EmptyLineAfterMagicComment:
|
16
|
-
Description: 'Add an empty line after magic comments to separate them from code.'
|
17
|
-
StyleGuide: '#separate-magic-comments-from-code'
|
18
|
-
Enabled: false
|
19
|
-
Lint/AmbiguousBlockAssociation:
|
20
|
-
Exclude:
|
21
|
-
- "spec/**/*"
|
22
|
-
Style/CollectionMethods:
|
23
|
-
Description: Preferred collection methods.
|
24
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
25
|
-
Enabled: true
|
26
|
-
PreferredMethods:
|
27
|
-
collect: map
|
28
|
-
collect!: map!
|
29
|
-
find: detect
|
30
|
-
find_all: select
|
31
|
-
reduce: inject
|
32
|
-
Naming/FileName:
|
33
|
-
Description: Use snake_case for source file names.
|
34
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
35
|
-
Enabled: false
|
36
|
-
Exclude: []
|
37
|
-
Style/GuardClause:
|
38
|
-
Description: Check for conditionals that can be replaced with guard clauses
|
39
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
40
|
-
Enabled: false
|
41
|
-
MinBodyLength: 1
|
42
|
-
Style/IfUnlessModifier:
|
43
|
-
Description: Favor modifier if/unless usage when you have a single-line body.
|
44
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
45
|
-
Enabled: false
|
46
|
-
Style/OptionHash:
|
47
|
-
Description: Don't use option hashes when you can use keyword arguments.
|
48
|
-
Enabled: false
|
49
|
-
Style/PercentLiteralDelimiters:
|
50
|
-
Description: Use `%`-literal delimiters consistently
|
51
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
52
|
-
Enabled: false
|
53
|
-
PreferredDelimiters:
|
54
|
-
"%": "()"
|
55
|
-
"%i": "()"
|
56
|
-
"%q": "()"
|
57
|
-
"%Q": "()"
|
58
|
-
"%r": "{}"
|
59
|
-
"%s": "()"
|
60
|
-
"%w": "()"
|
61
|
-
"%W": "()"
|
62
|
-
"%x": "()"
|
63
|
-
Naming/PredicateName:
|
64
|
-
Description: Check the names of predicate methods.
|
65
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
66
|
-
Enabled: true
|
67
|
-
NamePrefix:
|
68
|
-
- is_
|
69
|
-
- has_
|
70
|
-
- have_
|
71
|
-
NamePrefixBlacklist:
|
72
|
-
- is_
|
73
|
-
Exclude:
|
74
|
-
- spec/**/*
|
75
|
-
Style/RaiseArgs:
|
76
|
-
Description: Checks the arguments passed to raise/fail.
|
77
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
78
|
-
Enabled: false
|
79
|
-
EnforcedStyle: exploded
|
80
|
-
SupportedStyles:
|
81
|
-
- compact
|
82
|
-
- exploded
|
83
|
-
Style/SignalException:
|
84
|
-
Description: Checks for proper usage of fail and raise.
|
85
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
86
|
-
Enabled: true
|
87
|
-
EnforcedStyle: semantic
|
88
|
-
SupportedStyles:
|
89
|
-
- only_raise
|
90
|
-
- only_fail
|
91
|
-
- semantic
|
92
|
-
Style/SingleLineBlockParams:
|
93
|
-
Description: Enforces the names of some block params.
|
94
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
95
|
-
Enabled: false
|
96
|
-
Methods:
|
97
|
-
- reduce:
|
98
|
-
- a
|
99
|
-
- e
|
100
|
-
- inject:
|
101
|
-
- a
|
102
|
-
- e
|
103
|
-
Style/SingleLineMethods:
|
104
|
-
Description: Avoid single-line methods.
|
105
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
106
|
-
Enabled: false
|
107
|
-
AllowIfMethodIsEmpty: true
|
108
|
-
Style/StringLiterals:
|
109
|
-
Description: Checks if uses of quotes match the configured preference.
|
110
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
111
|
-
Enabled: true
|
112
|
-
EnforcedStyle: double_quotes
|
113
|
-
SupportedStyles:
|
114
|
-
- single_quotes
|
115
|
-
- double_quotes
|
116
|
-
Style/StringLiteralsInInterpolation:
|
117
|
-
Description: Checks if uses of quotes inside expressions in interpolated strings
|
118
|
-
match the configured preference.
|
119
|
-
Enabled: true
|
120
|
-
EnforcedStyle: single_quotes
|
121
|
-
SupportedStyles:
|
122
|
-
- single_quotes
|
123
|
-
- double_quotes
|
124
|
-
Style/TrailingCommaInArguments:
|
125
|
-
Description: 'Checks for trailing comma in argument lists.'
|
126
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
127
|
-
Enabled: true
|
128
|
-
EnforcedStyleForMultiline: no_comma
|
129
|
-
Style/TrailingCommaInArrayLiteral:
|
130
|
-
Description: 'Checks for trailing comma in array literals.'
|
131
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
132
|
-
Enabled: true
|
133
|
-
EnforcedStyleForMultiline: no_comma
|
134
|
-
Style/TrailingCommaInHashLiteral:
|
135
|
-
Description: 'Checks for trailing comma in hash literals.'
|
136
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
137
|
-
Enabled: true
|
138
|
-
EnforcedStyleForMultiline: no_comma
|
139
|
-
Metrics/AbcSize:
|
140
|
-
Description: A calculated magnitude based on number of assignments, branches, and
|
141
|
-
conditions.
|
142
|
-
Enabled: false
|
143
|
-
Max: 15
|
144
|
-
Metrics/ClassLength:
|
145
|
-
Description: Avoid classes longer than 100 lines of code.
|
146
|
-
Enabled: false
|
147
|
-
CountComments: false
|
148
|
-
Max: 100
|
149
|
-
Metrics/ModuleLength:
|
150
|
-
CountComments: false
|
151
|
-
Max: 100
|
152
|
-
Description: Avoid modules longer than 100 lines of code.
|
153
|
-
Enabled: false
|
154
|
-
Metrics/CyclomaticComplexity:
|
155
|
-
Description: A complexity metric that is strongly correlated to the number of test
|
156
|
-
cases needed to validate a method.
|
157
|
-
Enabled: false
|
158
|
-
Max: 6
|
159
|
-
Metrics/MethodLength:
|
160
|
-
Description: Avoid methods longer than 10 lines of code.
|
161
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
162
|
-
Enabled: false
|
163
|
-
CountComments: false
|
164
|
-
Max: 10
|
165
|
-
Metrics/ParameterLists:
|
166
|
-
Description: Avoid parameter lists longer than three or four parameters.
|
167
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
168
|
-
Enabled: false
|
169
|
-
Max: 5
|
170
|
-
CountKeywordArgs: true
|
171
|
-
Metrics/PerceivedComplexity:
|
172
|
-
Description: A complexity metric geared towards measuring complexity for a human
|
173
|
-
reader.
|
174
|
-
Enabled: false
|
175
|
-
Max: 7
|
176
|
-
Lint/AssignmentInCondition:
|
177
|
-
Description: Don't use assignment in conditions.
|
178
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
179
|
-
Enabled: false
|
180
|
-
AllowSafeAssignment: true
|
181
|
-
Style/InlineComment:
|
182
|
-
Description: Avoid inline comments.
|
183
|
-
Enabled: false
|
184
|
-
Naming/AccessorMethodName:
|
185
|
-
Description: Check the naming of accessor methods for get_/set_.
|
186
|
-
Enabled: false
|
187
|
-
Style/Alias:
|
188
|
-
Description: Use alias_method instead of alias.
|
189
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
190
|
-
Enabled: false
|
191
|
-
Style/Documentation:
|
192
|
-
Description: Document classes and non-namespace modules.
|
193
|
-
Enabled: false
|
194
|
-
Style/DoubleNegation:
|
195
|
-
Description: Checks for uses of double negation (!!).
|
196
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
197
|
-
Enabled: false
|
198
|
-
Style/EachWithObject:
|
199
|
-
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
200
|
-
Enabled: false
|
201
|
-
Style/EmptyLiteral:
|
202
|
-
Description: Prefer literals to Array.new/Hash.new/String.new.
|
203
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
204
|
-
Enabled: false
|
205
|
-
Style/ModuleFunction:
|
206
|
-
Description: Checks for usage of `extend self` in modules.
|
207
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
208
|
-
Enabled: false
|
209
|
-
Style/OneLineConditional:
|
210
|
-
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
211
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
212
|
-
Enabled: false
|
213
|
-
Style/PerlBackrefs:
|
214
|
-
Description: Avoid Perl-style regex back references.
|
215
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
216
|
-
Enabled: false
|
217
|
-
Style/Send:
|
218
|
-
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
219
|
-
may overlap with existing methods.
|
220
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
221
|
-
Enabled: false
|
222
|
-
Style/SpecialGlobalVars:
|
223
|
-
Description: Avoid Perl-style global variables.
|
224
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
225
|
-
Enabled: false
|
226
|
-
Style/VariableInterpolation:
|
227
|
-
Description: Don't interpolate global, instance and class variables directly in
|
228
|
-
strings.
|
229
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
230
|
-
Enabled: false
|
231
|
-
Style/WhenThen:
|
232
|
-
Description: Use when x then ... for one-line cases.
|
233
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
234
|
-
Enabled: false
|
235
|
-
Lint/EachWithObjectArgument:
|
236
|
-
Description: Check for immutable argument given to each_with_object.
|
237
|
-
Enabled: true
|
238
|
-
Lint/HandleExceptions:
|
239
|
-
Description: Don't suppress exception.
|
240
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
241
|
-
Enabled: false
|
242
|
-
Lint/LiteralAsCondition:
|
243
|
-
Description: Checks of literals used in conditions.
|
244
|
-
Enabled: false
|
245
|
-
Lint/LiteralInInterpolation:
|
246
|
-
Description: Checks for literals used in interpolation.
|
247
|
-
Enabled: false
|