insales_api 0.1.0 → 0.1.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/lib/insales_api.rb +3 -0
- data/lib/insales_api/active_resource_proxy.rb +2 -3
- data/lib/insales_api/app.rb +2 -2
- data/lib/insales_api/characteristic.rb +5 -0
- data/lib/insales_api/notification.rb +3 -0
- data/lib/insales_api/password.rb +2 -2
- data/lib/insales_api/property.rb +5 -1
- data/lib/insales_api/user.rb +3 -0
- data/lib/insales_api/version.rb +1 -1
- data/spec/lib/insales_api/active_resource_proxy_spec.rb +0 -10
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b059c0e53db8c1515b0f80fdd4f6a3b8d8540fa
|
4
|
+
data.tar.gz: b51b151c44b1e340c8a88043ae09cfa1ccf44c28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e283d1aa7c0a1d311615566d30bf3319c9553d90ce1d2b44ed56950917d694ed980689fb24973e2747547a7c3160a4ad2a46172a62fe485bc5e34a1a522df419
|
7
|
+
data.tar.gz: 150b0dc5f8f81a3f822a03752aadd189f296e35778276c6866bd7f4ff8e75c70922a0c2f8b92c274bd8d9ba83bcb9ae2e480a2b10c9f8acc535a1d3ae267f897
|
data/lib/insales_api.rb
CHANGED
@@ -32,6 +32,7 @@ module InsalesApi
|
|
32
32
|
autoload :File
|
33
33
|
autoload :Image
|
34
34
|
autoload :JsTag
|
35
|
+
autoload :Notification
|
35
36
|
autoload :OptionName
|
36
37
|
autoload :OptionValue
|
37
38
|
autoload :Order
|
@@ -42,8 +43,10 @@ module InsalesApi
|
|
42
43
|
autoload :ProductField
|
43
44
|
autoload :ProductFieldValue
|
44
45
|
autoload :Property
|
46
|
+
autoload :Characteristic
|
45
47
|
autoload :RecurringApplicationCharge
|
46
48
|
autoload :Theme
|
49
|
+
autoload :User
|
47
50
|
autoload :Variant
|
48
51
|
autoload :Webhook
|
49
52
|
end
|
@@ -2,7 +2,6 @@ module InsalesApi
|
|
2
2
|
class ActiveResourceProxy
|
3
3
|
class << self
|
4
4
|
def need_proxy?(value)
|
5
|
-
return true if value.is_a?(Hash) || value.is_a?(Array)
|
6
5
|
klass = value.is_a?(Class) ? value : value.class
|
7
6
|
return true if klass < Base || klass <= ActiveResource::Collection
|
8
7
|
false
|
@@ -14,8 +13,8 @@ module InsalesApi
|
|
14
13
|
@subject = subject
|
15
14
|
end
|
16
15
|
|
17
|
-
def respond_to_missing?(method_name)
|
18
|
-
@subject.respond_to?(method_name) || super
|
16
|
+
def respond_to_missing?(method_name, include_private)
|
17
|
+
@subject.respond_to?(method_name, include_private) || super
|
19
18
|
end
|
20
19
|
|
21
20
|
def method_missing(method_id, *args, &block)
|
data/lib/insales_api/app.rb
CHANGED
@@ -57,8 +57,8 @@ module InsalesApi
|
|
57
57
|
).to_s
|
58
58
|
end
|
59
59
|
|
60
|
-
def auth_token
|
61
|
-
@auth_token ||= InsalesApi::Password.create(password, salt)
|
60
|
+
def auth_token(salt = self.salt, user_email = '', user_name = '', user_id = '')
|
61
|
+
@auth_token ||= InsalesApi::Password.create(password, salt, user_email, user_name, user_id)
|
62
62
|
end
|
63
63
|
|
64
64
|
def salt
|
data/lib/insales_api/password.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module InsalesApi
|
2
2
|
module Password
|
3
|
-
def self.create(secret, token)
|
4
|
-
Digest::MD5.hexdigest("#{token}#{secret}")
|
3
|
+
def self.create(secret, token, user_email = '', user_name = '', user_id = '')
|
4
|
+
Digest::MD5.hexdigest("#{token}#{user_email}#{user_name}#{user_id}#{secret}")
|
5
5
|
end
|
6
6
|
end
|
7
7
|
end
|
data/lib/insales_api/property.rb
CHANGED
data/lib/insales_api/version.rb
CHANGED
@@ -26,16 +26,6 @@ describe InsalesApi::ActiveResourceProxy do
|
|
26
26
|
it { should be false }
|
27
27
|
end
|
28
28
|
|
29
|
-
context 'for array' do
|
30
|
-
let(:object) { [] }
|
31
|
-
it { should be true }
|
32
|
-
end
|
33
|
-
|
34
|
-
context 'for hash' do
|
35
|
-
let(:object) { {} }
|
36
|
-
it { should be true }
|
37
|
-
end
|
38
|
-
|
39
29
|
context 'for InsalesApi::Base class' do
|
40
30
|
let(:object) { InsalesApi::Account }
|
41
31
|
it { should be true }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: insales_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InSales
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- lib/insales_api/asset.rb
|
96
96
|
- lib/insales_api/base.rb
|
97
97
|
- lib/insales_api/category.rb
|
98
|
+
- lib/insales_api/characteristic.rb
|
98
99
|
- lib/insales_api/client.rb
|
99
100
|
- lib/insales_api/client_group.rb
|
100
101
|
- lib/insales_api/collect.rb
|
@@ -108,6 +109,7 @@ files:
|
|
108
109
|
- lib/insales_api/helpers/init_api.rb
|
109
110
|
- lib/insales_api/image.rb
|
110
111
|
- lib/insales_api/js_tag.rb
|
112
|
+
- lib/insales_api/notification.rb
|
111
113
|
- lib/insales_api/option_name.rb
|
112
114
|
- lib/insales_api/option_value.rb
|
113
115
|
- lib/insales_api/order.rb
|
@@ -124,6 +126,7 @@ files:
|
|
124
126
|
- lib/insales_api/resource/paginated.rb
|
125
127
|
- lib/insales_api/resource/with_updated_since.rb
|
126
128
|
- lib/insales_api/theme.rb
|
129
|
+
- lib/insales_api/user.rb
|
127
130
|
- lib/insales_api/variant.rb
|
128
131
|
- lib/insales_api/version.rb
|
129
132
|
- lib/insales_api/webhook.rb
|
@@ -150,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
153
|
version: '0'
|
151
154
|
requirements: []
|
152
155
|
rubyforge_project: insales_api
|
153
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.4.8
|
154
157
|
signing_key:
|
155
158
|
specification_version: 4
|
156
159
|
summary: Gem for accessing the InSales REST web services
|