fera-api 0.1.2 → 0.1.3

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: 340f111ef9ae910374f8b8556b80a4c7cea4a982be22c807e1330b52f5a222a8
4
- data.tar.gz: 758fe26ac14a9a4012039d14800e657690d821862eda47ea8e0866ea714a16d1
3
+ metadata.gz: 5f5fcef6bfad094e9853066b852f6992540e9321015531350e7bc6b02b94d71e
4
+ data.tar.gz: eff0b267a65ad12bbb8bb42c24c42409224774e1e45a53005e1fecf0b0be5fa2
5
5
  SHA512:
6
- metadata.gz: db7db0bd5a14e64dce22219b385d21db5675ddc5dc07196756c2a88dc20cb628786a48e911b5ad638b741c2124be96e7008dff341366d4a7ab83e827b767d5b5
7
- data.tar.gz: 53ea2d445404901fc1377edd5720f186e3cccad97eafd420f4e13959fedb55d8778ca39847e3eb2622226b06b9261e5fbc38417f3d23a523acfe083701f84303
6
+ metadata.gz: d0e8f790bdcced7f48af3b8d0f2e59773e3a69ec429b584068ad5d769cdb39835b87c4301f012ed3da06af8b9ffecb1e21e5ce69e94265472473be543996bb46
7
+ data.tar.gz: 49380fcbb2c591cb0c7c7c730e38bde23a17f3ce1ab59af08c3b6e340700932bc5219af9c11a0bc55e92201ccba8dcd9ada8ee053edae6f3a0faf656967434fe
data/.rubocop.yml CHANGED
@@ -1,173 +1,10 @@
1
- # Base was copied from https://github.com/sider/meowcop/blob/master/config/rubocop.yml which is what Sider uses by default
1
+ inherit_from:
2
+ - 'https://raw.githubusercontent.com/feracommerce/code-standards/master/.rubocop.yml'
3
+ - 'https://raw.githubusercontent.com/feracommerce/code-standards/master/.rubocop-rspec.yml'
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
2
7
  AllCops:
3
8
  TargetRubyVersion: 2.3
4
- Exclude:
5
- - 'vendor/**/*'
6
- - 'db/schema.rb'
7
- - 'node_modules/**/*'
8
- - 'tmp/**/*'
9
- - 'lib/tasks/one_offs/**/*' # We don't really care about linting one-off tasks
10
- - 'app/migrators/**/*' # Migrators are one-off tasks so there isn't much need to lint them
11
- DisplayCopNames: true
12
- DisplayStyleGuide: true
13
- NewCops: enable
14
-
15
- Lint/NonLocalExitFromIterator:
16
- Enabled: false # We actually believe that it is more readable with premature returns
17
- Layout/BeginEndAlignment:
18
- Enabled: false # We believe it's more readable to have begin blocks aligned to the end blocks (and also helps with code smells)
19
- Lint/AmbiguousRegexpLiteral:
20
- Enabled: false
21
- Lint/AssignmentInCondition:
22
- Enabled: false
23
- Metrics/AbcSize:
24
- Max: 60
25
- # Use the default setting
26
- Metrics/BlockLength:
27
- Max: 200
28
- Exclude:
29
- # RuboCop's default
30
- - 'Rakefile'
31
- - '**/*.rake'
32
- # In many cases, config/routes.rb has very long block
33
- - 'config/routes.rb'
34
- Metrics/ClassLength:
35
- Enabled: false
36
- Metrics/CyclomaticComplexity:
37
- Max: 60
38
- Metrics/MethodLength:
39
- Enabled: false
40
- Metrics/ModuleLength:
41
- Enabled: false
42
- Metrics/ParameterLists:
43
- Max: 5
44
- Metrics/PerceivedComplexity:
45
- Enabled: false
46
- Layout/ArgumentAlignment:
47
- Enabled: false
48
- Layout/HashAlignment:
49
- Enabled: false
50
- Layout/ParameterAlignment:
51
- Enabled: false
52
- Layout/IndentationWidth:
53
- Enabled: false
54
- Layout/FirstHashElementIndentation:
55
- Enabled: false
56
- Layout/HeredocIndentation:
57
- Enabled: false
58
- Layout/LineLength:
59
- Max: 200
60
- AllowedPatterns: ['^\s*#', '^\s*([a-zA-Z]*[lL]og[a-zA-Z]*)[ (]', '^\s*[''"]', '.*#.{30,300}', '^\s*[a-z_]:\s*".+",?[}\s]*$']
61
- Layout/MultilineArrayBraceLayout:
62
- Enabled: false
63
- Layout/MultilineAssignmentLayout:
64
- Enabled: false
65
- Layout/MultilineBlockLayout:
66
- Enabled: false
67
- Layout/MultilineHashBraceLayout:
68
- Enabled: false
69
- Layout/MultilineMethodCallBraceLayout:
70
- Enabled: false
71
- Layout/MultilineMethodCallIndentation:
72
- Enabled: false
73
- Layout/MultilineMethodDefinitionBraceLayout:
74
- Enabled: false
75
- Layout/MultilineOperationIndentation:
76
- Enabled: false
77
- Layout/RescueEnsureAlignment:
78
- Enabled: false
79
- Layout/SpaceAfterNot:
80
- Enabled: false
81
- Layout/SpaceBeforeBlockBraces:
82
- Enabled: false
83
- Layout/SpaceInLambdaLiteral:
84
- Enabled: false
85
- Layout/SpaceInsideStringInterpolation:
86
- EnforcedStyle: space
87
- Naming/PredicateName:
88
- Enabled: false # As of February 2022 we now want some methods to have is_ prefix so it is congruent with JavaScript
89
- Naming/VariableNumber:
90
- Enabled: false
91
- Style/AsciiComments:
92
- Enabled: false # It's 2022, emojis are everywhere
93
- Style/Alias:
94
- EnforcedStyle: prefer_alias_method
95
- Style/CaseLikeIf:
96
- Enabled: false
97
- Style/CommentAnnotation:
98
- Enabled: false # Don't really care about being picky on comments like this. Not worth slowing down the developer.
99
- Style/CommentedKeyword:
100
- Enabled: false # We want to allow comments on single-line method definitions like `# @alias`
101
- Style/ConstantVisibility:
102
- Enabled: false
103
- Style/Copyright:
104
- Enabled: false
105
- Style/DisableCopsWithinSourceCodeDirective:
106
- Enabled: false # Allow disabling cops and we will use PRs to determine whether it should be enforced
107
- Style/Documentation:
108
- Enabled: false # We will decide in PR whether public method should be documented or not.
109
- Style/DocumentationMethod:
110
- Enabled: false # We will decide in PR whether public method should be documented or not.
111
- Style/EmptyElse:
112
- AllowComments: true # When a comment is there then it means the programmer thought about the case so we can ignore it.
113
- EnforcedStyle: empty # When a comment or nil is there it means the programmer thought about the case, so there is no need for concern
114
- Style/FloatDivision:
115
- Enabled: false # Sometimes we're trying to force the number to become a float and it could be nil
116
- Style/FrozenStringLiteralComment:
117
- Enabled: false
118
- Style/GlobalVars:
119
- Enabled: false # If we're using global variables, we have a darn good reason or it should be blocked in the PR
120
- Style/IfUnlessModifier:
121
- Enabled: false # This isn't always easier to read. Sometimes you want to put the IF in front of the block of code to make it more clear.
122
- Style/ImplicitRuntimeError:
123
- Enabled: false # These are actually readable as long as we all know that they represent a RuntimeError
124
- Style/InlineComment:
125
- Enabled: false # Trailing inline comments are pretty compact and more readable
126
- Style/Lambda:
127
- Enabled: false
128
- Style/LambdaCall:
129
- Enabled: false
130
- Style/MethodCallWithArgsParentheses:
131
- Enabled: false
132
- Style/MethodCallWithoutArgsParentheses:
133
- Enabled: true # We use whatever is more readable
134
- Style/MethodCalledOnDoEndBlock:
135
- Enabled: false # Actually don't mind these - they look more readable
136
- Style/MissingElse:
137
- Enabled: false # Sometimes it's obvious we don't care about the else case (e.g. if we're prematurely returning from method)
138
- Style/MultilineBlockChain:
139
- Enabled: false # Sometimes these are more readable
140
- Style/MutableConstant:
141
- Enabled: false
142
- Style/MapToHash:
143
- Enabled: false # We believe it's more readable to use map vs hash with block syntax
144
- Style/NumericPredicate:
145
- Enabled: false # .zero? and .positive? are a bit less readable than == 0 IMO
146
- Style/OptionHash:
147
- Enabled: false # It is more intuitive to pass option hashes to other objects in many times
148
- Style/OpenStructUse:
149
- Enabled: false
150
- Style/RedundantRegexpCharacterClass:
151
- Enabled: false # No need to make regexp less readable than they already are by reducing redundancy
152
- Style/RedundantRegexpEscape:
153
- Enabled: false # No need to make regexp less readable than they already are by reducing redundancy
154
- Style/RedundantSelf:
155
- Enabled: false # Sometimes it's actually more readable to explicitly reference self
156
- Style/RegexpLiteral:
157
- Enabled: false
158
- Style/ReturnNil:
159
- Enabled: false # Returning nil is more clear what is happening and can prevent issues with returning mixed types
160
- Style/Send:
161
- Enabled: false
162
- Style/SingleLineMethods:
163
- Enabled: false # Sometimes these are more compact and easier to read. No need to spam our file with simple method definitions.
164
- Style/StringLiterals:
165
- Enabled: false
166
- Style/SymbolArray:
167
- Enabled: false
168
- Style/TernaryParentheses:
169
- Enabled: false
170
- Style/TrailingCommaInArrayLiteral:
171
- EnforcedStyleForMultiline: consistent_comma # It makes managing arrays much easier when we have commas at the end
172
- Style/TrailingCommaInHashLiteral:
173
- EnforcedStyleForMultiline: consistent_comma # It makes managing hashes much easier when we have commas at the end
9
+ require:
10
+ - rubocop-rspec
data/Gemfile CHANGED
@@ -13,4 +13,5 @@ group :development, :test do
13
13
  gem "pry-rescue"
14
14
  gem "pry-stack_explorer"
15
15
  gem "rubocop"
16
+ gem "rubocop-rspec"
16
17
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fera-api (0.1.2)
4
+ fera-api (0.1.3)
5
5
  activemodel (>= 4)
6
6
  activeresource (>= 6)
7
7
  activesupport (>= 4.0)
@@ -47,7 +47,7 @@ GEM
47
47
  concurrent-ruby (~> 1.0)
48
48
  interception (0.5)
49
49
  json (2.6.2)
50
- json-jwt (1.15.2)
50
+ json-jwt (1.15.3)
51
51
  activesupport (>= 4.2)
52
52
  aes_key_wrap
53
53
  bindata
@@ -104,6 +104,8 @@ GEM
104
104
  unicode-display_width (>= 1.4.0, < 3.0)
105
105
  rubocop-ast (1.21.0)
106
106
  parser (>= 3.1.1.0)
107
+ rubocop-rspec (2.12.1)
108
+ rubocop (~> 1.31)
107
109
  ruby-progressbar (1.11.0)
108
110
  slop (3.6.0)
109
111
  to_bool (2.0.0)
@@ -130,6 +132,7 @@ DEPENDENCIES
130
132
  pry-stack_explorer
131
133
  rspec (>= 3.0)
132
134
  rubocop
135
+ rubocop-rspec
133
136
  to_bool
134
137
  webmock (>= 3.0)
135
138
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fera
4
4
  module API
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/fera/api.rb CHANGED
@@ -18,6 +18,7 @@ module Fera
18
18
 
19
19
  ##
20
20
  # @param api_key [String] Public API key, Secret API key or Auth Token (if app)
21
+ # @return [Object, ::Fera::API] Result of the block operation if given, otherwise self
21
22
  def self.configure(api_key, api_url: nil, strict_mode: false, debug_mode: false)
22
23
  previous_base_site = Base.site
23
24
  previous_base_headers = Base.headers
@@ -209,7 +209,7 @@ module Fera
209
209
  end
210
210
  end
211
211
 
212
- connection.post(collection_path(nil, extra_params), data.to_json, self.class.headers).tap do |response|
212
+ connection.post(collection_path(nil, extra_params), { data: data }.to_json, self.class.headers).tap do |response|
213
213
  self.id = id_from_response(response)
214
214
  load_attributes_from_response(response)
215
215
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fera-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fera Commerce Inc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-17 00:00:00.000000000 Z
11
+ date: 2022-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel