gman_client 0.3.1 → 0.4.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
  SHA1:
3
- metadata.gz: c8662a82a09325d295a41196795808340e0fe21d
4
- data.tar.gz: 6ef1233291f8673940c91af6dd2168209eb0ff74
3
+ metadata.gz: 84ea72e7f24f02d14d2d510da202e4bff815a5fb
4
+ data.tar.gz: 5708dc1326a9d5cf07c0139dbd41cd06832bf3b0
5
5
  SHA512:
6
- metadata.gz: 505f5433c1867e23d51e4ee4862a4607d2f85be6b861d43fc88e2d54ab4daf10f9ff8317574558ac1e699eb3c0b27c57cdb8b9ab002cc1b92dc547a6a30855d9
7
- data.tar.gz: 42df89ca89b3a12b0c2d6efe486cb0a532be5144856db976094101b7f90a74cc3336998b3a566b23cc576e9f1782a4963fd0b2dec916720912ec9c5274382023
6
+ metadata.gz: 0485510d66d1961dce1e0be5761b82877a1e0190d454c46924eb8cd7adc17521ce4543154271f9e8759e27d88d68618b3c4a171b43b83c4d8257ad014c37d2af
7
+ data.tar.gz: 413a659faac0f23036bd354fc9662aa50591d527ee018011143895bb2977b011362de861aa280701f2e244f7494b550a2ea9fefa3ce61b3ae5667370ee95ddf5
@@ -0,0 +1,54 @@
1
+ version: 2
2
+
3
+ jobs:
4
+ build:
5
+ docker:
6
+ - image: madetech/ruby-2.2.2
7
+
8
+ working_directory: ~/repo
9
+
10
+ steps:
11
+ - checkout
12
+
13
+ # Download and cache dependencies
14
+ - restore_cache:
15
+ keys:
16
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
17
+
18
+ - run:
19
+ name: install dependencies
20
+ command: |
21
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
22
+
23
+ - run:
24
+ name: Setup Code Climate test-reporter
25
+ command: |
26
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
27
+ chmod +x ./cc-test-reporter
28
+ - save_cache:
29
+ paths:
30
+ - ./vendor/bundle
31
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
32
+
33
+ # run tests!
34
+ - run:
35
+ name: run tests
36
+ command: |
37
+ ./cc-test-reporter before-build
38
+ mkdir /tmp/test-results
39
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
40
+
41
+ bundle exec rspec --format progress \
42
+ --format RspecJunitFormatter \
43
+ --out /tmp/test-results/rspec.xml \
44
+ --format progress \
45
+ -- \
46
+ $TEST_FILES
47
+ ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
48
+
49
+ # collect reports
50
+ - store_test_results:
51
+ path: /tmp/test-results
52
+ - store_artifacts:
53
+ path: /tmp/test-results
54
+ destination: test-results
data/.codeclimate.yml ADDED
@@ -0,0 +1,5 @@
1
+ version: "2"
2
+ plugins:
3
+ rubocop:
4
+ enabled: true
5
+ channel: rubocop-0-54
data/.gitignore CHANGED
@@ -1,6 +1,6 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
3
+
4
4
  /_yardoc/
5
5
  /coverage/
6
6
  /doc/
@@ -14,3 +14,4 @@
14
14
  *.o
15
15
  *.a
16
16
  mkmf.log
17
+ coverage
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
- inherit_from: .hound-rubocop.yml
1
+ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.2
4
+ TargetRubyVersion: 2.3.3
5
5
  Exclude:
6
6
  - bin/*
7
7
  Style/AndOr:
@@ -18,7 +18,7 @@ Style/ClassAndModuleChildren:
18
18
  SupportedStyles:
19
19
  - compact
20
20
  - nested
21
- Style/DotPosition:
21
+ Layout/DotPosition:
22
22
  Description: Checks the position of the dot in multi-line method calls.
23
23
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
24
24
  Enabled: true
@@ -26,6 +26,99 @@ Style/DotPosition:
26
26
  SupportedStyles:
27
27
  - leading
28
28
  - trailing
29
+ Layout/EmptyLineAfterMagicComment:
30
+ Description: 'Add an empty line after magic comments to separate them from code.'
31
+ StyleGuide: '#separate-magic-comments-from-code'
32
+ Enabled: true
33
+ Lint/AmbiguousBlockAssociation:
34
+ Exclude:
35
+ - "spec/**/*"
36
+ Style/CollectionMethods:
37
+ Description: Preferred collection methods.
38
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
39
+ Enabled: true
40
+ PreferredMethods:
41
+ collect: map
42
+ collect!: map!
43
+ find: detect
44
+ find_all: select
45
+ reduce: inject
46
+ Naming/FileName:
47
+ Description: Use snake_case for source file names.
48
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
49
+ Enabled: false
50
+ Exclude: []
51
+ Style/GuardClause:
52
+ Description: Check for conditionals that can be replaced with guard clauses
53
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
54
+ Enabled: false
55
+ MinBodyLength: 1
56
+ Style/IfUnlessModifier:
57
+ Description: Favor modifier if/unless usage when you have a single-line body.
58
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
59
+ Enabled: false
60
+ Style/OptionHash:
61
+ Description: Don't use option hashes when you can use keyword arguments.
62
+ Enabled: false
63
+ Style/PercentLiteralDelimiters:
64
+ Description: Use `%`-literal delimiters consistently
65
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
66
+ Enabled: false
67
+ PreferredDelimiters:
68
+ "%": "()"
69
+ "%i": "()"
70
+ "%q": "()"
71
+ "%Q": "()"
72
+ "%r": "{}"
73
+ "%s": "()"
74
+ "%w": "()"
75
+ "%W": "()"
76
+ "%x": "()"
77
+ Naming/PredicateName:
78
+ Description: Check the names of predicate methods.
79
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
80
+ Enabled: true
81
+ NamePrefix:
82
+ - is_
83
+ - has_
84
+ - have_
85
+ NamePrefixBlacklist:
86
+ - is_
87
+ Exclude:
88
+ - spec/**/*
89
+ Style/RaiseArgs:
90
+ Description: Checks the arguments passed to raise/fail.
91
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
92
+ Enabled: false
93
+ EnforcedStyle: exploded
94
+ SupportedStyles:
95
+ - compact
96
+ - exploded
97
+ Style/SignalException:
98
+ Description: Checks for proper usage of fail and raise.
99
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
100
+ Enabled: true
101
+ EnforcedStyle: semantic
102
+ SupportedStyles:
103
+ - only_raise
104
+ - only_fail
105
+ - semantic
106
+ Style/SingleLineBlockParams:
107
+ Description: Enforces the names of some block params.
108
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
109
+ Enabled: false
110
+ Methods:
111
+ - reduce:
112
+ - a
113
+ - e
114
+ - inject:
115
+ - a
116
+ - e
117
+ Style/SingleLineMethods:
118
+ Description: Avoid single-line methods.
119
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
120
+ Enabled: false
121
+ AllowIfMethodIsEmpty: true
29
122
  Style/StringLiterals:
30
123
  Description: Checks if uses of quotes match the configured preference.
31
124
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
@@ -34,3 +127,135 @@ Style/StringLiterals:
34
127
  SupportedStyles:
35
128
  - single_quotes
36
129
  - double_quotes
130
+ Style/StringLiteralsInInterpolation:
131
+ Description: Checks if uses of quotes inside expressions in interpolated strings
132
+ match the configured preference.
133
+ Enabled: true
134
+ EnforcedStyle: single_quotes
135
+ SupportedStyles:
136
+ - single_quotes
137
+ - double_quotes
138
+ Style/TrailingCommaInArguments:
139
+ Description: 'Checks for trailing comma in argument lists.'
140
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
141
+ Enabled: true
142
+ EnforcedStyleForMultiline: no_comma
143
+ Style/TrailingCommaInArrayLiteral:
144
+ Description: 'Checks for trailing comma in array literals.'
145
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
146
+ Enabled: true
147
+ EnforcedStyleForMultiline: no_comma
148
+ Style/TrailingCommaInHashLiteral:
149
+ Description: 'Checks for trailing comma in hash literals.'
150
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
151
+ Enabled: true
152
+ EnforcedStyleForMultiline: no_comma
153
+ Metrics/AbcSize:
154
+ Description: A calculated magnitude based on number of assignments, branches, and
155
+ conditions.
156
+ Enabled: false
157
+ Max: 15
158
+ Metrics/ClassLength:
159
+ Description: Avoid classes longer than 100 lines of code.
160
+ Enabled: false
161
+ CountComments: false
162
+ Max: 100
163
+ Metrics/ModuleLength:
164
+ CountComments: false
165
+ Max: 100
166
+ Description: Avoid modules longer than 100 lines of code.
167
+ Enabled: false
168
+ Metrics/CyclomaticComplexity:
169
+ Description: A complexity metric that is strongly correlated to the number of test
170
+ cases needed to validate a method.
171
+ Enabled: false
172
+ Max: 6
173
+ Metrics/MethodLength:
174
+ Description: Avoid methods longer than 10 lines of code.
175
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
176
+ Enabled: false
177
+ CountComments: false
178
+ Max: 10
179
+ Metrics/ParameterLists:
180
+ Description: Avoid parameter lists longer than three or four parameters.
181
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
182
+ Enabled: false
183
+ Max: 5
184
+ CountKeywordArgs: true
185
+ Metrics/PerceivedComplexity:
186
+ Description: A complexity metric geared towards measuring complexity for a human
187
+ reader.
188
+ Enabled: false
189
+ Max: 7
190
+ Lint/AssignmentInCondition:
191
+ Description: Don't use assignment in conditions.
192
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
193
+ Enabled: false
194
+ AllowSafeAssignment: true
195
+ Style/InlineComment:
196
+ Description: Avoid inline comments.
197
+ Enabled: false
198
+ Naming/AccessorMethodName:
199
+ Description: Check the naming of accessor methods for get_/set_.
200
+ Enabled: false
201
+ Style/Alias:
202
+ Description: Use alias_method instead of alias.
203
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
204
+ Enabled: false
205
+ Style/Documentation:
206
+ Description: Document classes and non-namespace modules.
207
+ Enabled: false
208
+ Style/DoubleNegation:
209
+ Description: Checks for uses of double negation (!!).
210
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
211
+ Enabled: false
212
+ Style/EachWithObject:
213
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
214
+ Enabled: false
215
+ Style/EmptyLiteral:
216
+ Description: Prefer literals to Array.new/Hash.new/String.new.
217
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
218
+ Enabled: false
219
+ Style/ModuleFunction:
220
+ Description: Checks for usage of `extend self` in modules.
221
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
222
+ Enabled: false
223
+ Style/OneLineConditional:
224
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
225
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
226
+ Enabled: false
227
+ Style/PerlBackrefs:
228
+ Description: Avoid Perl-style regex back references.
229
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
230
+ Enabled: false
231
+ Style/Send:
232
+ Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
233
+ may overlap with existing methods.
234
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
235
+ Enabled: false
236
+ Style/SpecialGlobalVars:
237
+ Description: Avoid Perl-style global variables.
238
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
239
+ Enabled: false
240
+ Style/VariableInterpolation:
241
+ Description: Don't interpolate global, instance and class variables directly in
242
+ strings.
243
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
244
+ Enabled: false
245
+ Style/WhenThen:
246
+ Description: Use when x then ... for one-line cases.
247
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
248
+ Enabled: false
249
+ Lint/EachWithObjectArgument:
250
+ Description: Check for immutable argument given to each_with_object.
251
+ Enabled: true
252
+ Lint/HandleExceptions:
253
+ Description: Don't suppress exception.
254
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
255
+ Enabled: false
256
+ Lint/LiteralAsCondition:
257
+ Description: Checks of literals used in conditions.
258
+ Enabled: false
259
+ Lint/LiteralInInterpolation:
260
+ Description: Checks for literals used in interpolation.
261
+ Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,18 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2018-08-01 12:41:47 -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: 23
10
+ # Configuration parameters: CountComments, ExcludedMethods.
11
+ Metrics/BlockLength:
12
+ Max: 94
13
+
14
+ # Offense count: 1
15
+ # Cop supports --auto-correct.
16
+ Style/ExpandPathArguments:
17
+ Exclude:
18
+ - 'lib/gman_client.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.2.2
data/Gemfile CHANGED
@@ -1,6 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
- gem 'codeclimate-test-reporter', group: :test, require: nil
4
- gem 'rubocop', '0.43.0'
5
+ gem 'rspec_junit_formatter', group: :test
6
+ gem 'rubocop', '0.54.0'
7
+ gem 'simplecov', group: :test, require: false
5
8
 
6
9
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,106 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ gman_client (0.4.0)
5
+ blanket_wrapper (= 3.0.2)
6
+ hashie (= 3.4.3)
7
+ rest-client (= 1.8.0)
8
+ retries (= 0.0.5)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.5.2)
14
+ public_suffix (>= 2.0.2, < 4.0)
15
+ ast (2.4.0)
16
+ blanket_wrapper (3.0.2)
17
+ httparty
18
+ recursive-open-struct
19
+ crack (0.4.3)
20
+ safe_yaml (~> 1.0.0)
21
+ diff-lcs (1.3)
22
+ docile (1.1.5)
23
+ domain_name (0.5.20180417)
24
+ unf (>= 0.0.5, < 1.0.0)
25
+ hashdiff (0.3.7)
26
+ hashie (3.4.3)
27
+ http-cookie (1.0.3)
28
+ domain_name (~> 0.5)
29
+ httparty (0.16.2)
30
+ multi_xml (>= 0.5.2)
31
+ json (2.1.0)
32
+ mime-types (2.99.3)
33
+ multi_xml (0.6.0)
34
+ netrc (0.11.0)
35
+ parallel (1.12.1)
36
+ parser (2.5.1.2)
37
+ ast (~> 2.4.0)
38
+ powerpack (0.1.2)
39
+ public_suffix (3.0.2)
40
+ rainbow (3.0.0)
41
+ rake (10.5.0)
42
+ recursive-open-struct (1.1.0)
43
+ rest-client (1.8.0)
44
+ http-cookie (>= 1.0.2, < 2.0)
45
+ mime-types (>= 1.16, < 3.0)
46
+ netrc (~> 0.7)
47
+ retries (0.0.5)
48
+ rspec (3.4.0)
49
+ rspec-core (~> 3.4.0)
50
+ rspec-expectations (~> 3.4.0)
51
+ rspec-mocks (~> 3.4.0)
52
+ rspec-core (3.4.4)
53
+ rspec-support (~> 3.4.0)
54
+ rspec-expectations (3.4.0)
55
+ diff-lcs (>= 1.2.0, < 2.0)
56
+ rspec-support (~> 3.4.0)
57
+ rspec-its (1.2.0)
58
+ rspec-core (>= 3.0.0)
59
+ rspec-expectations (>= 3.0.0)
60
+ rspec-mocks (3.4.1)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.4.0)
63
+ rspec-support (3.4.1)
64
+ rspec_junit_formatter (0.4.1)
65
+ rspec-core (>= 2, < 4, != 2.12.0)
66
+ rubocop (0.54.0)
67
+ parallel (~> 1.10)
68
+ parser (>= 2.5)
69
+ powerpack (~> 0.1)
70
+ rainbow (>= 2.2.2, < 4.0)
71
+ ruby-progressbar (~> 1.7)
72
+ unicode-display_width (~> 1.0, >= 1.0.1)
73
+ ruby-progressbar (1.9.0)
74
+ safe_yaml (1.0.4)
75
+ simplecov (0.13.0)
76
+ docile (~> 1.1.0)
77
+ json (>= 1.8, < 3)
78
+ simplecov-html (~> 0.10.0)
79
+ simplecov-html (0.10.2)
80
+ unf (0.1.4)
81
+ unf_ext
82
+ unf_ext (0.0.7.5)
83
+ unicode-display_width (1.4.0)
84
+ vcr (3.0.1)
85
+ webmock (1.22.6)
86
+ addressable (>= 2.3.6)
87
+ crack (>= 0.3.2)
88
+ hashdiff
89
+
90
+ PLATFORMS
91
+ ruby
92
+
93
+ DEPENDENCIES
94
+ bundler (~> 1.7)
95
+ gman_client!
96
+ rake (~> 10.0)
97
+ rspec (= 3.4.0)
98
+ rspec-its (= 1.2.0)
99
+ rspec_junit_formatter
100
+ rubocop (= 0.54.0)
101
+ simplecov
102
+ vcr (= 3.0.1)
103
+ webmock (= 1.22.6)
104
+
105
+ BUNDLED WITH
106
+ 1.16.3
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/westernmilling/gman_client.svg?branch=master)](https://travis-ci.org/westernmilling/gman_client)
1
+ [![CircleCI](https://circleci.com/gh/westernmilling/gman_client.svg?style=svg)](https://circleci.com/gh/westernmilling/gman_client)
2
2
  [![Code Climate](https://codeclimate.com/github/westernmilling/gman_client/badges/gpa.svg)](https://codeclimate.com/github/westernmilling/gman_client)
3
3
  [![Test Coverage](https://codeclimate.com/github/westernmilling/gman_client/badges/coverage.svg)](https://codeclimate.com/github/westernmilling/gman_client/coverage)
4
4
  [![Dependency Status](https://gemnasium.com/westernmilling/gman_client.svg)](https://gemnasium.com/westernmilling/gman_client)
data/Rakefile CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
data/gman_client.gemspec CHANGED
@@ -1,5 +1,7 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+
2
+ # frozen_string_literal: true
3
+
4
+ lib = File.expand_path('lib', __dir__)
3
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
6
  require 'gman_client/version'
5
7
 
@@ -22,8 +24,8 @@ Gem::Specification.new do |spec|
22
24
  spec.add_development_dependency 'webmock', '1.22.6'
23
25
  spec.add_dependency 'blanket_wrapper', '3.0.2'
24
26
  spec.add_dependency 'hashie', '3.4.3'
25
- spec.add_dependency 'retries', '0.0.5'
26
27
  spec.add_dependency 'rest-client', '1.8.0'
28
+ spec.add_dependency 'retries', '0.0.5'
27
29
  spec.add_development_dependency 'bundler', '~> 1.7'
28
30
  spec.add_development_dependency 'rake', '~> 10.0'
29
31
  spec.add_development_dependency 'rspec', '3.4.0'
data/lib/gman/client.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gman
2
4
  class Client
3
5
  include GmanClient::Api::CustomerContracts
@@ -5,6 +7,7 @@ module Gman
5
7
  include GmanClient::Api::PickUpOrders
6
8
  include GmanClient::Api::HealthCheck
7
9
  include GmanClient::CommodityMerchandising::Contracts
10
+ include GmanClient::CommodityMerchandising::BulkContracts
8
11
  include GmanClient::Utility
9
12
 
10
13
  attr_accessor :url, :client_id, :client_secret
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GmanClient
2
4
  module Api
3
5
  module CustomerContracts
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GmanClient
2
4
  module Api
3
5
  # HealthCheck API
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GmanClient
2
4
  module Api
3
5
  # Orders API
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GmanClient
2
4
  module Api
3
5
  module PickUpOrders
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GmanClient
4
+ module CommodityMerchandising
5
+ module BulkContracts
6
+ def bulk_contracts(customer_ids)
7
+ response = attempt(@retry_attempts) do
8
+ request
9
+ .api
10
+ .v1
11
+ .commodity_merchandising
12
+ .bulk_contracts
13
+ .get(params: { customer_ids: customer_ids.join(',') })
14
+ end
15
+
16
+ response.map(&:to_h)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GmanClient
2
4
  module CommodityMerchandising
3
5
  module Contracts
@@ -17,13 +19,13 @@ module GmanClient
17
19
 
18
20
  def clean_filters(filters)
19
21
  keep = filters.select do |k, _v|
20
- [
21
- :commodity_id_eq,
22
- :contract_type_eq,
23
- :customer_id_eq,
24
- :inv_contract_id_eq,
25
- :location_id_eq
26
- ].include?(k)
22
+ %i(
23
+ commodity_id_eq
24
+ contract_type_eq
25
+ customer_id_eq
26
+ inv_contract_id_eq
27
+ location_id_eq
28
+ ).include?(k)
27
29
  end
28
30
 
29
31
  Hash[filters.to_a & keep.to_a]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GmanClient
2
4
  module Utility
3
5
  def get(resource, params)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GmanClient
2
- VERSION = '0.3.1'.freeze
4
+ VERSION = '0.4.0'
3
5
  end
data/lib/gman_client.rb CHANGED
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'gman_client/api/customer_contracts'
2
4
  require 'gman_client/api/pick_up_orders'
3
5
  require 'gman_client/api/orders'
4
6
  require 'gman_client/api/health_check'
5
7
  require 'gman_client/commodity_merchandising/contracts'
8
+ require 'gman_client/commodity_merchandising/bulk_contracts'
6
9
  require 'gman_client/utility'
7
10
  require 'gman_client/version'
8
11
  require 'gman/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'webmock'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'webmock'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'webmock'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe Gman::Client do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe Gman::Client do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe Gman::Client do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe GmanClient do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe Gman::Client do
@@ -23,12 +25,12 @@ RSpec.describe Gman::Client do
23
25
  describe 'first driver' do
24
26
  subject { client_response.first }
25
27
  its(:keys) do
26
- is_expected.to eq([:driver_id,
27
- :active_fg,
28
- :driver_type,
29
- :sub_hauler_fg,
30
- :first_name,
31
- :last_name])
28
+ is_expected.to eq(%i(driver_id
29
+ active_fg
30
+ driver_type
31
+ sub_hauler_fg
32
+ first_name
33
+ last_name))
32
34
  end
33
35
  end
34
36
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe GmanClient do
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/its'
2
4
  require 'spec_helper'
3
5
  require 'gman_client'
4
6
  require 'httparty'
5
7
  require 'securerandom'
8
+ require 'simplecov'
6
9
  require 'webmock/rspec'
7
10
 
11
+ SimpleCov.start
12
+
8
13
  Dir[File.join(GmanClient.root, 'spec/support/**/*.rb')].each { |f| require f }
9
14
 
10
15
  RSpec.configure do |config|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  def gman_adapter
2
4
  url = ENV['GMAN_SERVICES_URL']
3
5
  client_id = ENV['GMAN_SERVICES_CLIENT_ID']
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.shared_context 'grossman client' do
2
4
  let(:client) do
3
5
  url = ENV['GMAN_SERVICES_URL']
data/spec/support/vcr.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vcr'
2
4
 
3
5
  VCR.configure do |c|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gman_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MichaelAChrisco
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-03 00:00:00.000000000 Z
12
+ date: 2018-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vcr
@@ -68,59 +68,59 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  version: 3.4.3
70
70
  - !ruby/object:Gem::Dependency
71
- name: retries
71
+ name: rest-client
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 0.0.5
76
+ version: 1.8.0
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: 0.0.5
83
+ version: 1.8.0
84
84
  - !ruby/object:Gem::Dependency
85
- name: rest-client
85
+ name: retries
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - '='
89
89
  - !ruby/object:Gem::Version
90
- version: 1.8.0
90
+ version: 0.0.5
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
- version: 1.8.0
97
+ version: 0.0.5
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: bundler
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ~>
102
+ - - "~>"
103
103
  - !ruby/object:Gem::Version
104
104
  version: '1.7'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ~>
109
+ - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: '1.7'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: rake
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ~>
116
+ - - "~>"
117
117
  - !ruby/object:Gem::Version
118
118
  version: '10.0'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ~>
123
+ - - "~>"
124
124
  - !ruby/object:Gem::Version
125
125
  version: '10.0'
126
126
  - !ruby/object:Gem::Dependency
@@ -158,14 +158,16 @@ executables: []
158
158
  extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
- - .gitignore
162
- - .hound-rubocop.yml
163
- - .hound.yml
164
- - .rspec
165
- - .rubocop.yml
166
- - .simplecov
167
- - .travis.yml
161
+ - ".circleci/config.yml"
162
+ - ".codeclimate.yml"
163
+ - ".gitignore"
164
+ - ".rspec"
165
+ - ".rubocop.yml"
166
+ - ".rubocop_todo.yml"
167
+ - ".ruby-version"
168
+ - ".simplecov"
168
169
  - Gemfile
170
+ - Gemfile.lock
169
171
  - LICENSE.txt
170
172
  - README.md
171
173
  - Rakefile
@@ -176,6 +178,7 @@ files:
176
178
  - lib/gman_client/api/health_check.rb
177
179
  - lib/gman_client/api/orders.rb
178
180
  - lib/gman_client/api/pick_up_orders.rb
181
+ - lib/gman_client/commodity_merchandising/bulk_contracts.rb
179
182
  - lib/gman_client/commodity_merchandising/contracts.rb
180
183
  - lib/gman_client/inventory/items.rb
181
184
  - lib/gman_client/utility.rb
@@ -210,17 +213,17 @@ require_paths:
210
213
  - lib
211
214
  required_ruby_version: !ruby/object:Gem::Requirement
212
215
  requirements:
213
- - - '>='
216
+ - - ">="
214
217
  - !ruby/object:Gem::Version
215
218
  version: '0'
216
219
  required_rubygems_version: !ruby/object:Gem::Requirement
217
220
  requirements:
218
- - - '>='
221
+ - - ">="
219
222
  - !ruby/object:Gem::Version
220
223
  version: '0'
221
224
  requirements: []
222
225
  rubyforge_project:
223
- rubygems_version: 2.0.14.1
226
+ rubygems_version: 2.4.5
224
227
  signing_key:
225
228
  specification_version: 4
226
229
  summary: Grossman API Client for Ruby
data/.hound-rubocop.yml DELETED
@@ -1,242 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.2
3
- Exclude:
4
- UseCache: false
5
- Style/CollectionMethods:
6
- Description: Preferred collection methods.
7
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
8
- Enabled: true
9
- PreferredMethods:
10
- collect: map
11
- collect!: map!
12
- find: detect
13
- find_all: select
14
- reduce: inject
15
- Style/DotPosition:
16
- Description: Checks the position of the dot in multi-line method calls.
17
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
18
- Enabled: true
19
- EnforcedStyle: trailing
20
- SupportedStyles:
21
- - leading
22
- - trailing
23
- Style/FileName:
24
- Description: Use snake_case for source file names.
25
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
26
- Enabled: false
27
- Exclude: []
28
- Style/GuardClause:
29
- Description: Check for conditionals that can be replaced with guard clauses
30
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
31
- Enabled: false
32
- MinBodyLength: 1
33
- Style/IfUnlessModifier:
34
- Description: Favor modifier if/unless usage when you have a single-line body.
35
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
36
- Enabled: false
37
- MaxLineLength: 80
38
- Style/OptionHash:
39
- Description: Don't use option hashes when you can use keyword arguments.
40
- Enabled: false
41
- Style/PercentLiteralDelimiters:
42
- Description: Use `%`-literal delimiters consistently
43
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
44
- Enabled: false
45
- PreferredDelimiters:
46
- "%": "()"
47
- "%i": "()"
48
- "%q": "()"
49
- "%Q": "()"
50
- "%r": "{}"
51
- "%s": "()"
52
- "%w": "()"
53
- "%W": "()"
54
- "%x": "()"
55
- Style/PredicateName:
56
- Description: Check the names of predicate methods.
57
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
58
- Enabled: true
59
- NamePrefix:
60
- - is_
61
- - has_
62
- - have_
63
- NamePrefixBlacklist:
64
- - is_
65
- Exclude:
66
- - spec/**/*
67
- Style/RaiseArgs:
68
- Description: Checks the arguments passed to raise/fail.
69
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
70
- Enabled: false
71
- EnforcedStyle: exploded
72
- SupportedStyles:
73
- - compact
74
- - exploded
75
- Style/SignalException:
76
- Description: Checks for proper usage of fail and raise.
77
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
78
- Enabled: false
79
- EnforcedStyle: semantic
80
- SupportedStyles:
81
- - only_raise
82
- - only_fail
83
- - semantic
84
- Style/SingleLineBlockParams:
85
- Description: Enforces the names of some block params.
86
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
87
- Enabled: false
88
- Methods:
89
- - reduce:
90
- - a
91
- - e
92
- - inject:
93
- - a
94
- - e
95
- Style/SingleLineMethods:
96
- Description: Avoid single-line methods.
97
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
98
- Enabled: false
99
- AllowIfMethodIsEmpty: true
100
- Style/StringLiterals:
101
- Description: Checks if uses of quotes match the configured preference.
102
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
103
- Enabled: true
104
- EnforcedStyle: double_quotes
105
- SupportedStyles:
106
- - single_quotes
107
- - double_quotes
108
- Style/StringLiteralsInInterpolation:
109
- Description: Checks if uses of quotes inside expressions in interpolated strings
110
- match the configured preference.
111
- Enabled: true
112
- EnforcedStyle: single_quotes
113
- SupportedStyles:
114
- - single_quotes
115
- - double_quotes
116
- Style/TrailingCommaInArguments:
117
- Description: 'Checks for trailing comma in argument lists.'
118
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
119
- Enabled: false
120
- EnforcedStyleForMultiline: no_comma
121
- SupportedStyles:
122
- - comma
123
- - consistent_comma
124
- - no_comma
125
- Style/TrailingCommaInLiteral:
126
- Description: 'Checks for trailing comma in array and hash literals.'
127
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
128
- Enabled: false
129
- EnforcedStyleForMultiline: no_comma
130
- SupportedStyles:
131
- - comma
132
- - consistent_comma
133
- - no_comma
134
- Metrics/AbcSize:
135
- Description: A calculated magnitude based on number of assignments, branches, and
136
- conditions.
137
- Enabled: false
138
- Max: 15
139
- Metrics/ClassLength:
140
- Description: Avoid classes longer than 100 lines of code.
141
- Enabled: false
142
- CountComments: false
143
- Max: 100
144
- Metrics/ModuleLength:
145
- CountComments: false
146
- Max: 100
147
- Description: Avoid modules longer than 100 lines of code.
148
- Enabled: false
149
- Metrics/CyclomaticComplexity:
150
- Description: A complexity metric that is strongly correlated to the number of test
151
- cases needed to validate a method.
152
- Enabled: false
153
- Max: 6
154
- Metrics/MethodLength:
155
- Description: Avoid methods longer than 10 lines of code.
156
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
157
- Enabled: false
158
- CountComments: false
159
- Max: 10
160
- Metrics/ParameterLists:
161
- Description: Avoid parameter lists longer than three or four parameters.
162
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
163
- Enabled: false
164
- Max: 5
165
- CountKeywordArgs: true
166
- Metrics/PerceivedComplexity:
167
- Description: A complexity metric geared towards measuring complexity for a human
168
- reader.
169
- Enabled: false
170
- Max: 7
171
- Lint/AssignmentInCondition:
172
- Description: Don't use assignment in conditions.
173
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
174
- Enabled: false
175
- AllowSafeAssignment: true
176
- Style/InlineComment:
177
- Description: Avoid inline comments.
178
- Enabled: false
179
- Style/AccessorMethodName:
180
- Description: Check the naming of accessor methods for get_/set_.
181
- Enabled: false
182
- Style/Alias:
183
- Description: Use alias_method instead of alias.
184
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
185
- Enabled: false
186
- Style/Documentation:
187
- Description: Document classes and non-namespace modules.
188
- Enabled: false
189
- Style/DoubleNegation:
190
- Description: Checks for uses of double negation (!!).
191
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
192
- Enabled: false
193
- Style/EachWithObject:
194
- Description: Prefer `each_with_object` over `inject` or `reduce`.
195
- Enabled: false
196
- Style/EmptyLiteral:
197
- Description: Prefer literals to Array.new/Hash.new/String.new.
198
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
199
- Enabled: false
200
- Style/ModuleFunction:
201
- Description: Checks for usage of `extend self` in modules.
202
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
203
- Enabled: false
204
- Style/OneLineConditional:
205
- Description: Favor the ternary operator(?:) over if/then/else/end constructs.
206
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
207
- Enabled: false
208
- Style/PerlBackrefs:
209
- Description: Avoid Perl-style regex back references.
210
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
211
- Enabled: false
212
- Style/Send:
213
- Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
214
- may overlap with existing methods.
215
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
216
- Enabled: false
217
- Style/SpecialGlobalVars:
218
- Description: Avoid Perl-style global variables.
219
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
220
- Enabled: false
221
- Style/VariableInterpolation:
222
- Description: Don't interpolate global, instance and class variables directly in
223
- strings.
224
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
225
- Enabled: false
226
- Style/WhenThen:
227
- Description: Use when x then ... for one-line cases.
228
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
229
- Enabled: false
230
- Lint/EachWithObjectArgument:
231
- Description: Check for immutable argument given to each_with_object.
232
- Enabled: true
233
- Lint/HandleExceptions:
234
- Description: Don't suppress exception.
235
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
236
- Enabled: false
237
- Lint/LiteralInCondition:
238
- Description: Checks of literals used in conditions.
239
- Enabled: false
240
- Lint/LiteralInInterpolation:
241
- Description: Checks for literals used in interpolation.
242
- Enabled: false
data/.hound.yml DELETED
@@ -1,3 +0,0 @@
1
- ruby:
2
- config_file: .rubocop.yml
3
- fail_on_violations: true
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.0
4
- script:
5
- - bundle exec rspec -fd