storesapp-rb 0.1.7 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +0 -1
- data/README.markdown +1 -1
- data/lib/storesapp/base.rb +11 -10
- data/lib/storesapp/resources/order.rb +0 -4
- data/lib/storesapp.rb +4 -4
- data/storesapp.gemspec +2 -2
- metadata +5 -6
- data/lib/storesapp/resources/payment.rb +0 -9
data/Manifest.txt
CHANGED
@@ -9,7 +9,6 @@ lib/storesapp/resources/order.rb
|
|
9
9
|
lib/storesapp/resources/order_item.rb
|
10
10
|
lib/storesapp/resources/order_item_property.rb
|
11
11
|
lib/storesapp/resources/page.rb
|
12
|
-
lib/storesapp/resources/payment.rb
|
13
12
|
lib/storesapp/resources/product.rb
|
14
13
|
lib/storesapp/resources/product_image.rb
|
15
14
|
lib/storesapp/resources/product_property.rb
|
data/README.markdown
CHANGED
@@ -12,7 +12,7 @@ This library uses ActiveResource to provide simple, reliable access to the Store
|
|
12
12
|
|
13
13
|
All calls to the StoresApp API will originate from a StoresApp object. Initialize it like so:
|
14
14
|
|
15
|
-
`@store = StoresApp(:api_key => "12340987asdf12340987qwer", :
|
15
|
+
`@store = StoresApp(:api_key => "12340987asdf12340987qwer", :subdomain => "joeandcompany")`
|
16
16
|
|
17
17
|
### Collections ###
|
18
18
|
|
data/lib/storesapp/base.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module StoresApp
|
2
2
|
class Base
|
3
|
-
# Requires a
|
3
|
+
# Requires a subdomain, and api_key.
|
4
4
|
# Specifying headers is optional, but useful for setting a user agent.
|
5
5
|
def initialize(options={})
|
6
|
-
options.assert_valid_keys(:
|
7
|
-
options.assert_required_keys(:
|
8
|
-
@
|
9
|
-
@
|
10
|
-
@headers
|
6
|
+
options.assert_valid_keys(:subdomain, :api_key, :headers)
|
7
|
+
options.assert_required_keys(:subdomain)
|
8
|
+
@subdomain = options[:subdomain]
|
9
|
+
@api_key = options[:api_key]
|
10
|
+
@headers = options[:headers]
|
11
11
|
configure_base_resource
|
12
12
|
end
|
13
13
|
|
@@ -60,11 +60,12 @@ module StoresApp
|
|
60
60
|
# inherited classes can access the api.
|
61
61
|
def configure_base_resource
|
62
62
|
if @api_key
|
63
|
-
StoresAppResource.site = "http://#{
|
64
|
-
StoresAppResource.user = @
|
65
|
-
StoresAppResource.password =
|
63
|
+
StoresAppResource.site = "http://#{StoresApp::ApiDomain}/v1"
|
64
|
+
StoresAppResource.user = @subdomain
|
65
|
+
StoresAppResource.password = @api_key
|
66
66
|
else
|
67
|
-
StoresAppResource.site = "http://#{
|
67
|
+
StoresAppResource.site = "http://#{StoresApp::DevelopmentApiDomain}/v1"
|
68
|
+
StoresAppResource.user = @subdomain
|
68
69
|
end
|
69
70
|
StoresAppResource.headers.update(@headers) if @headers.is_a?(Hash)
|
70
71
|
load_resources
|
@@ -4,10 +4,6 @@ module StoresApp
|
|
4
4
|
def items
|
5
5
|
OrderItem.find(:all, :from => "/api/v1/order_items.xml", :params => {'search[order_id]' => self.id})
|
6
6
|
end
|
7
|
-
|
8
|
-
def payment
|
9
|
-
Payment.find(:first, :from => "/api/v1/payments.xml", :params => {'search[order_id]' => self.id})
|
10
|
-
end
|
11
7
|
end
|
12
8
|
end
|
13
9
|
end
|
data/lib/storesapp.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module StoresApp
|
2
|
-
VERSION = '0.1.
|
3
|
-
ApiDomain = 'storesapp.com'
|
4
|
-
DevelopmentApiDomain = 'storesapp-com.local'
|
2
|
+
VERSION = '0.1.9'
|
3
|
+
ApiDomain = 'api.storesapp.com'
|
4
|
+
DevelopmentApiDomain = 'api.storesapp-com.local'
|
5
5
|
|
6
6
|
# Class method to load all ruby files from a given path.
|
7
7
|
def self.load_all_ruby_files_from_path(path)
|
@@ -28,7 +28,7 @@ require File.join(File.dirname(__FILE__), "storesapp", "stores_app_resource")
|
|
28
28
|
#
|
29
29
|
# Example:
|
30
30
|
# StoresApp(:api_key => "asdf1234",
|
31
|
-
# :
|
31
|
+
# :subdomain => "myhostname",
|
32
32
|
# :headers => {"User-Agent => "Harvest Rubygem"})
|
33
33
|
def StoresApp(options={})
|
34
34
|
StoresApp::Base.new(options)
|
data/storesapp.gemspec
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "storesapp-rb"
|
6
|
-
s.version = "0.1.
|
6
|
+
s.version = "0.1.9"
|
7
7
|
s.authors = ["Next Feature"]
|
8
|
-
s.summary = "A wrapper for the StoresApp
|
8
|
+
s.summary = "A wrapper for the StoresApp API. See http://api.storesapp.com for details."
|
9
9
|
s.date = Date.today.to_s
|
10
10
|
# s.description = s.summary
|
11
11
|
s.homepage = "http://github.com/nextfeature/storesapp-rb"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: storesapp-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 9
|
10
|
+
version: 0.1.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Next Feature
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-11 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- lib/storesapp/resources/order_item.rb
|
78
78
|
- lib/storesapp/resources/order_item_property.rb
|
79
79
|
- lib/storesapp/resources/page.rb
|
80
|
-
- lib/storesapp/resources/payment.rb
|
81
80
|
- lib/storesapp/resources/product.rb
|
82
81
|
- lib/storesapp/resources/product_image.rb
|
83
82
|
- lib/storesapp/resources/product_property.rb
|
@@ -119,6 +118,6 @@ rubyforge_project:
|
|
119
118
|
rubygems_version: 1.3.7
|
120
119
|
signing_key:
|
121
120
|
specification_version: 3
|
122
|
-
summary: A wrapper for the StoresApp
|
121
|
+
summary: A wrapper for the StoresApp API. See http://api.storesapp.com for details.
|
123
122
|
test_files: []
|
124
123
|
|