finapps 2.0.5 → 2.0.6

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
  SHA1:
3
- metadata.gz: c1467952204aa017d2c08fe58cdae31a62b57aa4
4
- data.tar.gz: 6e0a321efe02addaf8731dfdff3de8ba59c9cd90
3
+ metadata.gz: 3744a2198661b2f9ec29349d7fab215fec21ca59
4
+ data.tar.gz: 89aa372c099626f02b74029badf483e8a8b5f857
5
5
  SHA512:
6
- metadata.gz: 4a2a307d85c1e7d4aa958444f7d2e2b790f074f20eee1e2836f21fbb9e61ff13d5ced6fd8522a720ff1575805d94a4199fe83a58fd5e59a2f15c4a7980f65446
7
- data.tar.gz: 5c0dd965c386d2e827086ca559d48d394a4bd9b6f4f4e1189e0a65498475baa7daed195211835ca152c45404b32061ec319d9e7f940f9fcaa1e78964676c9b87
6
+ metadata.gz: 75115e8917ab7e2f6ca094113a7412d31e5f2aac5372b854a9218495de744d5b3f7d26be8a2b5564aab82a828359980df8b380b4d2090cf712079ce9c29f5b75
7
+ data.tar.gz: f0962398b0663b53931eb3a5ee11f665c2f5f8b9ac906d6eaeb4b35e9c18a1be72a96b7ee1344defeb18b4628ca0e914c7a12f0d192a137ac99b9e9ce84e4f2e
data/.codeclimate.yml ADDED
@@ -0,0 +1,24 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ #checks:
5
+ # Rubocop/Metrics/ClassLength:
6
+ # enabled: false
7
+ brakeman:
8
+ enabled: true
9
+ eslint:
10
+ enabled: true
11
+ csslint:
12
+ enabled: true
13
+ duplication:
14
+ enabled: true
15
+ config:
16
+ languages:
17
+ - ruby
18
+ ratings:
19
+ paths:
20
+ - lib/**
21
+ - "**.rb"
22
+ exclude_paths:
23
+ - spec/**/*
24
+ - "**/vendor/**/*"
data/.rubocop.yml CHANGED
@@ -1,78 +1,22 @@
1
- AllCops:
2
- Exclude:
3
- - "bin/**/*"
4
-
5
1
  Rails:
6
2
  Enabled: true
7
3
 
8
- ##################### Metrics ##################################
9
-
10
- Metrics/AbcSize:
11
- # The ABC size is a calculated magnitude, so this number can be a Fixnum or
12
- # a Float.
13
- Max: 25
4
+ AllCops:
5
+ Exclude:
6
+ - "vendor/**/*"
7
+ - "db/schema.rb"
8
+ - "bin/**/*"
9
+ UseCache: false
14
10
 
15
11
  # Commonly used screens these days easily fit more than 80 characters.
16
12
  Metrics/LineLength:
17
13
  Max: 120
18
14
 
19
- # Too short methods lead to extraction of single-use methods, which can make
20
- # the code easier to read (by naming things), but can also clutter the class
21
- Metrics/MethodLength:
22
- Max: 20
23
-
24
15
  # No space makes the method definition shorter and differentiates
25
16
  # from a regular assignment.
26
17
  Style/SpaceAroundEqualsInParameterDefault:
27
18
  EnforcedStyle: no_space
28
19
 
29
- # We do not need to support Ruby 1.9, so this is good to use.
30
- Style/SymbolArray:
31
- Enabled: true
32
-
33
- # Most readable form.
34
- Style/AlignHash:
35
- EnforcedHashRocketStyle: table
36
- EnforcedColonStyle: table
37
-
38
- # Mixing the styles looks just silly.
39
- Style/HashSyntax:
40
- EnforcedStyle: ruby19_no_mixed_keys
41
-
42
- # String#% is by far the least verbose and only object oriented variant.
43
- Style/FormatString:
44
- EnforcedStyle: percent
45
-
46
- Style/CollectionMethods:
47
- Enabled: true
48
- PreferredMethods:
49
- # inject seems more common in the community.
50
- reduce: "inject"
51
-
52
- # Either allow this style or don't. Marking it as safe with parenthesis
53
- # is silly. Let's try to live without them for now.
54
- Style/ParenthesesAroundCondition:
55
- AllowSafeAssignment: false
56
- Lint/AssignmentInCondition:
57
- AllowSafeAssignment: false
58
-
59
- # A specialized exception class will take one or more arguments and construct the message from it.
60
- # So both variants make sense.
61
- Style/RaiseArgs:
62
- Enabled: false
63
-
64
- # Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
65
- # The argument that fail should be used to abort the program is wrong too,
66
- # there's Kernel#abort for that.
67
- Style/SignalException:
68
- EnforcedStyle: only_raise
69
-
70
- # Suppressing exceptions can be perfectly fine, and be it to avoid to
71
- # explicitly type nil into the rescue since that's what you want to return,
72
- # or suppressing LoadError for optional dependencies
73
- Lint/HandleExceptions:
74
- Enabled: false
75
-
76
20
  Style/SpaceInsideBlockBraces:
77
21
  # The space here provides no real gain in readability while consuming
78
22
  # horizontal space that could be used for a better parameter name.
@@ -84,19 +28,242 @@ Style/SpaceInsideBlockBraces:
84
28
  Style/SpaceInsideHashLiteralBraces:
85
29
  EnforcedStyle: no_space
86
30
 
87
- # Enforcing -> would be nice, but not at the cost of enforcing lambda { } for
88
- # multiline lambdas.
89
- Style/Lambda:
90
- Enabled: false
91
31
 
92
- # Enforcing the names of variables? To single letter ones? Just no.
32
+ Style/CollectionMethods:
33
+ Description: Preferred collection methods.
34
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
35
+ Enabled: true
36
+ PreferredMethods:
37
+ collect: map
38
+ collect!: map!
39
+ find: detect
40
+ find_all: select
41
+ reduce: inject
42
+ Style/DotPosition:
43
+ Description: Checks the position of the dot in multi-line method calls.
44
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
45
+ Enabled: true
46
+ EnforcedStyle: leading
47
+ SupportedStyles:
48
+ - leading
49
+ - trailing
50
+ Style/FileName:
51
+ Description: Use snake_case for source file names.
52
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
53
+ Enabled: false
54
+ Exclude: []
55
+ Style/GuardClause:
56
+ Description: Check for conditionals that can be replaced with guard clauses
57
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
58
+ Enabled: false
59
+ MinBodyLength: 1
60
+ Style/IfUnlessModifier:
61
+ Description: Favor modifier if/unless usage when you have a single-line body.
62
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
63
+ Enabled: false
64
+ MaxLineLength: 80
65
+ Style/OptionHash:
66
+ Description: Don't use option hashes when you can use keyword arguments.
67
+ Enabled: false
68
+ Style/PercentLiteralDelimiters:
69
+ Description: Use `%`-literal delimiters consistently
70
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
71
+ Enabled: false
72
+ PreferredDelimiters:
73
+ "%": "()"
74
+ "%i": "()"
75
+ "%q": "()"
76
+ "%Q": "()"
77
+ "%r": "{}"
78
+ "%s": "()"
79
+ "%w": "()"
80
+ "%W": "()"
81
+ "%x": "()"
82
+ Style/PredicateName:
83
+ Description: Check the names of predicate methods.
84
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
85
+ Enabled: true
86
+ NamePrefix:
87
+ - is_
88
+ - has_
89
+ - have_
90
+ NamePrefixBlacklist:
91
+ - is_
92
+ Exclude:
93
+ - spec/**/*
94
+ Style/RaiseArgs:
95
+ Description: Checks the arguments passed to raise/fail.
96
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
97
+ Enabled: false
98
+ EnforcedStyle: exploded
99
+ SupportedStyles:
100
+ - compact
101
+ - exploded
102
+ Style/SignalException:
103
+ Description: Checks for proper usage of fail and raise.
104
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
105
+ Enabled: false
106
+ EnforcedStyle: semantic
107
+ SupportedStyles:
108
+ - only_raise
109
+ - only_fail
110
+ - semantic
93
111
  Style/SingleLineBlockParams:
112
+ Description: Enforces the names of some block params.
113
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
94
114
  Enabled: false
95
-
96
- # This is just silly. Calling the argument `other` in all cases makes no sense.
97
- Style/OpMethod:
115
+ Methods:
116
+ - reduce:
117
+ - a
118
+ - e
119
+ - inject:
120
+ - a
121
+ - e
122
+ Style/SingleLineMethods:
123
+ Description: Avoid single-line methods.
124
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
125
+ Enabled: false
126
+ AllowIfMethodIsEmpty: true
127
+ Style/StringLiterals:
128
+ Description: Checks if uses of quotes match the configured preference.
129
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
130
+ Enabled: true
131
+ EnforcedStyle: single_quotes
132
+ SupportedStyles:
133
+ - single_quotes
134
+ - double_quotes
135
+ Style/StringLiteralsInInterpolation:
136
+ Description: Checks if uses of quotes inside expressions in interpolated strings
137
+ match the configured preference.
138
+ Enabled: true
139
+ EnforcedStyle: single_quotes
140
+ SupportedStyles:
141
+ - single_quotes
142
+ - double_quotes
143
+ Style/TrailingCommaInArguments:
144
+ Description: 'Checks for trailing comma in argument lists.'
145
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
146
+ Enabled: false
147
+ EnforcedStyleForMultiline: no_comma
148
+ SupportedStyles:
149
+ - comma
150
+ - consistent_comma
151
+ - no_comma
152
+ Style/TrailingCommaInLiteral:
153
+ Description: 'Checks for trailing comma in array and hash literals.'
154
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
155
+ Enabled: false
156
+ EnforcedStyleForMultiline: no_comma
157
+ SupportedStyles:
158
+ - comma
159
+ - consistent_comma
160
+ - no_comma
161
+ Metrics/AbcSize:
162
+ Description: A calculated magnitude based on number of assignments, branches, and
163
+ conditions.
164
+ Enabled: false
165
+ Max: 15
166
+ Metrics/ClassLength:
167
+ Description: Avoid classes longer than 100 lines of code.
168
+ Enabled: false
169
+ CountComments: false
170
+ Max: 100
171
+ Metrics/ModuleLength:
172
+ CountComments: false
173
+ Max: 100
174
+ Description: Avoid modules longer than 100 lines of code.
175
+ Enabled: false
176
+ Metrics/CyclomaticComplexity:
177
+ Description: A complexity metric that is strongly correlated to the number of test
178
+ cases needed to validate a method.
179
+ Enabled: false
180
+ Max: 6
181
+ Metrics/MethodLength:
182
+ Description: Avoid methods longer than 10 lines of code.
183
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
184
+ Enabled: false
185
+ CountComments: false
186
+ Max: 10
187
+ Metrics/ParameterLists:
188
+ Description: Avoid parameter lists longer than three or four parameters.
189
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
190
+ Enabled: false
191
+ Max: 5
192
+ CountKeywordArgs: true
193
+ Metrics/PerceivedComplexity:
194
+ Description: A complexity metric geared towards measuring complexity for a human
195
+ reader.
196
+ Enabled: false
197
+ Max: 7
198
+ Lint/AssignmentInCondition:
199
+ Description: Don't use assignment in conditions.
200
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
201
+ Enabled: false
202
+ AllowSafeAssignment: true
203
+ Style/InlineComment:
204
+ Description: Avoid inline comments.
205
+ Enabled: false
206
+ Style/AccessorMethodName:
207
+ Description: Check the naming of accessor methods for get_/set_.
208
+ Enabled: false
209
+ Style/Alias:
210
+ Description: Use alias_method instead of alias.
211
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
212
+ Enabled: false
213
+ Style/Documentation:
214
+ Description: Document classes and non-namespace modules.
215
+ Enabled: false
216
+ Style/DoubleNegation:
217
+ Description: Checks for uses of double negation (!!).
218
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
219
+ Enabled: false
220
+ Style/EachWithObject:
221
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
222
+ Enabled: false
223
+ Style/EmptyLiteral:
224
+ Description: Prefer literals to Array.new/Hash.new/String.new.
225
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
226
+ Enabled: false
227
+ Style/ModuleFunction:
228
+ Description: Checks for usage of `extend self` in modules.
229
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
230
+ Enabled: false
231
+ Style/OneLineConditional:
232
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
233
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
234
+ Enabled: false
235
+ Style/PerlBackrefs:
236
+ Description: Avoid Perl-style regex back references.
237
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
238
+ Enabled: false
239
+ Style/Send:
240
+ Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
241
+ may overlap with existing methods.
242
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
243
+ Enabled: false
244
+ Style/SpecialGlobalVars:
245
+ Description: Avoid Perl-style global variables.
246
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
247
+ Enabled: false
248
+ Style/VariableInterpolation:
249
+ Description: Don't interpolate global, instance and class variables directly in
250
+ strings.
251
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
252
+ Enabled: false
253
+ Style/WhenThen:
254
+ Description: Use when x then ... for one-line cases.
255
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
256
+ Enabled: false
257
+ Lint/EachWithObjectArgument:
258
+ Description: Check for immutable argument given to each_with_object.
259
+ Enabled: true
260
+ Lint/HandleExceptions:
261
+ Description: Don't suppress exception.
262
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
263
+ Enabled: false
264
+ Lint/LiteralInCondition:
265
+ Description: Checks of literals used in conditions.
266
+ Enabled: false
267
+ Lint/LiteralInInterpolation:
268
+ Description: Checks for literals used in interpolation.
98
269
  Enabled: false
99
-
100
- # Reset some HoundCI changes back to Rubocop defaults
101
- Style/DotPosition:
102
- EnforcedStyle: leading
data/.travis.yml CHANGED
@@ -1,4 +1,15 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
- - 2.2.2
4
- - jruby
4
+ - 2.3.0
5
+ - 2.3.1
6
+ before_install:
7
+ - "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
8
+ script:
9
+ - bundle exec rspec
10
+ notifications:
11
+ email: false
12
+ slack: financialapps:fA8XwEcap3hHZk0iNmPPJvT1
13
+ addons:
14
+ code_climate:
15
+ repo_token: dc180b31d340bd88cedd0ec3ea8ba8ec5093f2bafe77a7bf5bbdcb1c5ff9dc7f
data/README.md CHANGED
@@ -2,10 +2,11 @@
2
2
  FinApps Ruby-Client
3
3
  ===================
4
4
 
5
-
6
- [![Gem Version](http://img.shields.io/gem/v/finapps.svg)][gem]
7
-
8
- [![Build Status](http://teamciti.powerwallet.com/app/rest/builds/buildType:(id:FaRuby_BuildMaster)/statusIcon)][build_status]
5
+ [![Gem Version](https://badge.fury.io/rb/finapps.svg)](https://badge.fury.io/rb/finapps)
6
+ [![Build Status](http://img.shields.io/travis/finapps/ruby-client.svg?style=flat-square)](https://travis-ci.org/finapps/ruby-client)
7
+ [![Code Climate](https://codeclimate.com/github/finapps/ruby-client/badges/gpa.svg)](https://codeclimate.com/github/finapps/ruby-client)
8
+ [![Dependency Status](https://gemnasium.com/badges/github.com/finapps/ruby-client.svg)](https://gemnasium.com/github.com/finapps/ruby-client)
9
+ [![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://finapps.mit-license.org)
9
10
 
10
11
 
11
12
  Ruby client for [FinApps][financialapps].
@@ -72,5 +73,4 @@ Please check the [FinApps wiki][wiki] for extended documentation.
72
73
  [builder]: http://builder.rubyforge.org/
73
74
  [bundler]: http://bundler.io
74
75
  [rubygems]: http://rubygems.org
75
- [gem]: https://rubygems.org/gems/finapps
76
76
  [build_status]: http://teamciti.powerwallet.com/viewType.html?buildTypeId=FaRuby_BuildMaster&guest=1
data/finapps.gemspec CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'webmock', '~> 2.1', '>= 2.1.0'
33
33
  spec.add_development_dependency 'sinatra', '~> 1.4', '>= 1.4.7'
34
34
  spec.add_development_dependency 'simplecov', '~> 0.11', '>= 0.11.2'
35
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.6.0'
35
36
 
36
37
  spec.extra_rdoc_files = %w(README.md LICENSE.txt)
37
38
  spec.rdoc_options = %w(--line-numbers --inline-source --title finapps-ruby --main README.md)
data/lib/finapps.rb CHANGED
@@ -16,7 +16,6 @@ require 'finapps/middleware/tenant_authentication'
16
16
  require 'finapps/middleware/raise_error'
17
17
 
18
18
  require 'finapps/rest/defaults'
19
- require 'finapps/rest/resource'
20
19
  require 'finapps/rest/resources'
21
20
 
22
21
  require 'finapps/rest/users'
@@ -1,3 +1,3 @@
1
1
  module FinApps
2
- VERSION = '2.0.5'.freeze
2
+ VERSION = '2.0.6'.freeze
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,8 @@
1
+ if ENV['CODECLIMATE_REPO_TOKEN']
2
+ require 'codeclimate-test-reporter'
3
+ CodeClimate::TestReporter.start
4
+ end
5
+
1
6
  require 'bundler/setup'
2
7
  Bundler.setup
3
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-12 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -230,6 +230,20 @@ dependencies:
230
230
  - - ">="
231
231
  - !ruby/object:Gem::Version
232
232
  version: 0.11.2
233
+ - !ruby/object:Gem::Dependency
234
+ name: codeclimate-test-reporter
235
+ requirement: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - "~>"
238
+ - !ruby/object:Gem::Version
239
+ version: 0.6.0
240
+ type: :development
241
+ prerelease: false
242
+ version_requirements: !ruby/object:Gem::Requirement
243
+ requirements:
244
+ - - "~>"
245
+ - !ruby/object:Gem::Version
246
+ version: 0.6.0
233
247
  description: A simple library for communicating with the FinApps REST API.
234
248
  email:
235
249
  - erich@financialapps.com
@@ -239,6 +253,7 @@ extra_rdoc_files:
239
253
  - README.md
240
254
  - LICENSE.txt
241
255
  files:
256
+ - ".codeclimate.yml"
242
257
  - ".gitignore"
243
258
  - ".rspec"
244
259
  - ".rubocop.yml"
@@ -262,7 +277,6 @@ files:
262
277
  - lib/finapps/rest/connection.rb
263
278
  - lib/finapps/rest/defaults.rb
264
279
  - lib/finapps/rest/orders.rb
265
- - lib/finapps/rest/resource.rb
266
280
  - lib/finapps/rest/resources.rb
267
281
  - lib/finapps/rest/users.rb
268
282
  - lib/finapps/utils/loggeable.rb
@@ -1,11 +0,0 @@
1
- module FinApps
2
- module REST
3
- class Resource # :nodoc:
4
- # @param [Hash] hash
5
- def initialize(hash)
6
- hash.each {|k, v| instance_variable_set("@#{k}", v) unless v.nil? } if hash.present?
7
- self
8
- end
9
- end
10
- end
11
- end