grape-client 0.3.0 → 0.3.1
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 +4 -4
- data/.rubocop_todo.yml +3 -3
- data/lib/grape_client.rb +9 -0
- data/lib/grape_client/base.rb +9 -7
- data/lib/grape_client/configuration.rb +5 -0
- data/lib/grape_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f778c9c9490d2a4ca55036ac634f6d2c756224f5
|
4
|
+
data.tar.gz: 374ef037944a5e988a6479b297d2eb02f249b225
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53b9f9bbd6d40bb80db727c4a004705f9f485dda500a86850d18ec6789a86c4fdb0604d31451e7c350cb584c381a491d088fcc39294f5a33154cc6ba1644231a
|
7
|
+
data.tar.gz: 4cf5927a28c13e720098fb23bf7d5537c3710d607d8c8cb8f274334a9a8a54b3cf281a508eb2204a7d3b57d1014ac0ed08c9abb2c7693e8df57e78744c1f88de
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-03-
|
3
|
+
# on 2016-03-27 13:31:12 +0300 using RuboCop version 0.37.2.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -8,9 +8,9 @@
|
|
8
8
|
|
9
9
|
# Offense count: 1
|
10
10
|
Metrics/AbcSize:
|
11
|
-
Max:
|
11
|
+
Max: 18
|
12
12
|
|
13
|
-
# Offense count:
|
13
|
+
# Offense count: 8
|
14
14
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
15
15
|
# URISchemes: http, https
|
16
16
|
Metrics/LineLength:
|
data/lib/grape_client.rb
CHANGED
data/lib/grape_client/base.rb
CHANGED
@@ -2,7 +2,6 @@ module GrapeClient
|
|
2
2
|
class Base
|
3
3
|
include RestMethodsMember
|
4
4
|
|
5
|
-
mattr_accessor :site, :user, :password, :prefix
|
6
5
|
attr_reader :attributes
|
7
6
|
|
8
7
|
class << self
|
@@ -10,8 +9,16 @@ module GrapeClient
|
|
10
9
|
include BelongsTo
|
11
10
|
include HasMany
|
12
11
|
|
12
|
+
mattr_accessor :attributes
|
13
|
+
mattr_accessor :site, :user, :password, :prefix
|
14
|
+
|
15
|
+
self.attributes = []
|
16
|
+
self.site = GrapeClient.configuration.site
|
17
|
+
self.user = GrapeClient.configuration.user
|
18
|
+
self.password = GrapeClient.configuration.password
|
19
|
+
self.prefix = GrapeClient.configuration.prefix
|
20
|
+
|
13
21
|
def attr_accessor(*names)
|
14
|
-
attributes = self.attributes
|
15
22
|
names.each do |name|
|
16
23
|
attributes << name.to_sym
|
17
24
|
end
|
@@ -32,11 +39,6 @@ module GrapeClient
|
|
32
39
|
def endpoint
|
33
40
|
site + prefix + entity_name.pluralize
|
34
41
|
end
|
35
|
-
|
36
|
-
def attributes
|
37
|
-
class_variable_set('@@attributes', []) unless class_variable_defined?('@@attributes')
|
38
|
-
class_variable_get('@@attributes')
|
39
|
-
end
|
40
42
|
end
|
41
43
|
|
42
44
|
def initialize(attrs = {})
|
data/lib/grape_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Silchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/grape_client/belongs_to.rb
|
92
92
|
- lib/grape_client/cache.rb
|
93
93
|
- lib/grape_client/collection.rb
|
94
|
+
- lib/grape_client/configuration.rb
|
94
95
|
- lib/grape_client/connection.rb
|
95
96
|
- lib/grape_client/has_many.rb
|
96
97
|
- lib/grape_client/response_parser.rb
|