sk_sdk 0.0.6 → 0.0.7
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.
- data/VERSION +1 -1
- data/lib/sk_sdk/base.rb +12 -1
- data/sk_sdk.gemspec +2 -14
- data/spec/resources_spec_helper.rb +1 -3
- data/spec/sk_sdk/resources/clients_spec.rb +1 -4
- metadata +6 -15
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/lib/sk_sdk/base.rb
CHANGED
@@ -42,4 +42,15 @@ class SK::SDK::Base < ActiveResource::Base
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
|
45
|
+
# If headers are not defined in a given subclass, then obtain
|
46
|
+
# headers from the superclass.
|
47
|
+
def self.headers
|
48
|
+
if defined?(@headers)
|
49
|
+
@headers
|
50
|
+
elsif superclass != Object && superclass.headers
|
51
|
+
superclass.headers
|
52
|
+
else
|
53
|
+
@headers ||= {}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/sk_sdk.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sk_sdk}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Georg Leciejewski"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-03}
|
13
13
|
s.description = %q{Connect your business world with SalesKing. This gem gives ruby developers a jump-start for building SalesKing Business Apps. Under the hood it provides classes to handle oAuth, make RESTfull API requests and parses JSON Schema }
|
14
14
|
s.email = %q{gl@salesking.eu}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -50,18 +50,6 @@ Gem::Specification.new do |s|
|
|
50
50
|
s.require_paths = ["lib"]
|
51
51
|
s.rubygems_version = %q{1.6.2}
|
52
52
|
s.summary = %q{SalesKing SDK Ruby}
|
53
|
-
s.test_files = [
|
54
|
-
"spec/resources_spec_helper.rb",
|
55
|
-
"spec/sk_sdk/ar_cli_spec.rb",
|
56
|
-
"spec/sk_sdk/base_spec.rb",
|
57
|
-
"spec/sk_sdk/oauth_spec.rb",
|
58
|
-
"spec/sk_sdk/resources/clients_spec.rb",
|
59
|
-
"spec/sk_sdk/resources/credit_note_spec.rb",
|
60
|
-
"spec/sk_sdk/resources/invoice_spec.rb",
|
61
|
-
"spec/sk_sdk/resources/product_spec.rb",
|
62
|
-
"spec/sk_sdk/signed_request_spec.rb",
|
63
|
-
"spec/spec_helper.rb"
|
64
|
-
]
|
65
53
|
|
66
54
|
if s.respond_to? :specification_version then
|
67
55
|
s.specification_version = 3
|
@@ -5,15 +5,13 @@ CONNECTION = {
|
|
5
5
|
} unless defined?(CONNECTION)
|
6
6
|
|
7
7
|
# create all classes and set their connection
|
8
|
-
%w[Client Address CreditNote Invoice Product LineItem].each do |model|
|
8
|
+
%w[Client Address CreditNote Invoice Product LineItem User].each do |model|
|
9
9
|
eval "class #{model} < SK::SDK::Base;end" unless Object.const_defined?(model)
|
10
10
|
end
|
11
11
|
SK::SDK::Base.set_connection CONNECTION
|
12
12
|
|
13
13
|
# check if a SalesKing instance is available by calling /users/current.json
|
14
14
|
def sk_available?
|
15
|
-
SK::SDK::ArCli.make(:user) unless Object.const_defined?('User')
|
16
|
-
User.set_connection( CONNECTION )
|
17
15
|
begin
|
18
16
|
User.get(:current)
|
19
17
|
rescue Errno::ECONNREFUSED #ActiveResource::ResourceNotFound => e
|
@@ -88,10 +88,7 @@ else
|
|
88
88
|
|
89
89
|
it "should destroy an address" do
|
90
90
|
cnt_before = @client.addresses.length
|
91
|
-
|
92
|
-
# @client.addresses << adr
|
93
|
-
# @client.save
|
94
|
-
@client.addresses.last._delete = 1
|
91
|
+
@client.addresses.last._destroy = 1
|
95
92
|
@client.save
|
96
93
|
@client.reload
|
97
94
|
@client.addresses.length.should == cnt_before-1
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sk_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Georg Leciejewski
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-03 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -146,14 +146,5 @@ rubygems_version: 1.6.2
|
|
146
146
|
signing_key:
|
147
147
|
specification_version: 3
|
148
148
|
summary: SalesKing SDK Ruby
|
149
|
-
test_files:
|
150
|
-
|
151
|
-
- spec/sk_sdk/ar_cli_spec.rb
|
152
|
-
- spec/sk_sdk/base_spec.rb
|
153
|
-
- spec/sk_sdk/oauth_spec.rb
|
154
|
-
- spec/sk_sdk/resources/clients_spec.rb
|
155
|
-
- spec/sk_sdk/resources/credit_note_spec.rb
|
156
|
-
- spec/sk_sdk/resources/invoice_spec.rb
|
157
|
-
- spec/sk_sdk/resources/product_spec.rb
|
158
|
-
- spec/sk_sdk/signed_request_spec.rb
|
159
|
-
- spec/spec_helper.rb
|
149
|
+
test_files: []
|
150
|
+
|