shopify 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.markdown +39 -0
- data/Rakefile +54 -0
- data/VERSION +1 -0
- data/lib/shopify.rb +178 -0
- data/lib/shopify/support.rb +110 -0
- data/lib/shopify_api.yml +35 -0
- data/test/helper.rb +10 -0
- data/test/test_shopify.rb +7 -0
- metadata +86 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 BehindLogic
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# shopify
|
2
|
+
|
3
|
+
## Links
|
4
|
+
|
5
|
+
* Gem: [http://gemcutter.org/gems/shopify](http://gemcutter.org/gems/shopify)
|
6
|
+
* Source: [http://github.com/dcparker/shopify](http://github.com/dcparker/shopify)
|
7
|
+
* Author: [Daniel Parker](http://github.com/dcparker) from [BehindLogic](http://behindlogic.com)
|
8
|
+
* Shopify API Documentation: [http://api.shopify.com/](http://api.shopify.com/)
|
9
|
+
|
10
|
+
## Features
|
11
|
+
|
12
|
+
* Read any kind of data from Shopify, but no support built-in yet to save data back to Shopify.
|
13
|
+
* Thread-safe: You can connect to multiple shops in the same application.
|
14
|
+
|
15
|
+
## Example Usage:
|
16
|
+
|
17
|
+
shop = Shopify.new('store_name', 'api-key', 'api-secret', 'auth-token')
|
18
|
+
order = shop.orders(:limit => 1)[0] # => gets first order
|
19
|
+
order.line_items # => the line items within that order
|
20
|
+
order.fulfillments # => gets all fulfillments related to this order
|
21
|
+
blogs = shop.blogs # => gets all blogs for this shop
|
22
|
+
articles = blogs[0].articles # => gets all the articles in this blog
|
23
|
+
articles[0].comments # => gets the comments for that article
|
24
|
+
shop.products # => get all products in this shop
|
25
|
+
... and much more ... :)
|
26
|
+
|
27
|
+
## Note on Patches/Pull Requests
|
28
|
+
|
29
|
+
* Fork the project.
|
30
|
+
* Make your feature addition or bug fix.
|
31
|
+
* Add tests for it. This is important so I don't break it in a
|
32
|
+
future version unintentionally.
|
33
|
+
* Commit, do not mess with rakefile, version, or history.
|
34
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
35
|
+
* Send me a pull request. Bonus points for topic branches.
|
36
|
+
|
37
|
+
## Copyright
|
38
|
+
|
39
|
+
Copyright (c) 2009 BehindLogic. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "shopify"
|
8
|
+
gem.summary = %Q{Communicate easily with Shopify.com's Restful API.}
|
9
|
+
gem.description = %Q{Communicate easily with Shopify.com's Restful API.}
|
10
|
+
gem.email = "gems@behindlogic.com"
|
11
|
+
gem.homepage = "http://github.com/dcparker/shopify"
|
12
|
+
gem.authors = ["BehindLogic"]
|
13
|
+
gem.add_dependency "extlib", ">= 0"
|
14
|
+
gem.add_dependency "httparty", ">= 0.5.0"
|
15
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
+
end
|
17
|
+
Jeweler::GemcutterTasks.new
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'rake/testtask'
|
23
|
+
Rake::TestTask.new(:test) do |test|
|
24
|
+
test.libs << 'lib' << 'test'
|
25
|
+
test.pattern = 'test/**/test_*.rb'
|
26
|
+
test.verbose = true
|
27
|
+
end
|
28
|
+
|
29
|
+
begin
|
30
|
+
require 'rcov/rcovtask'
|
31
|
+
Rcov::RcovTask.new do |test|
|
32
|
+
test.libs << 'test'
|
33
|
+
test.pattern = 'test/**/test_*.rb'
|
34
|
+
test.verbose = true
|
35
|
+
end
|
36
|
+
rescue LoadError
|
37
|
+
task :rcov do
|
38
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
task :test => :check_dependencies
|
43
|
+
|
44
|
+
task :default => :test
|
45
|
+
|
46
|
+
require 'rake/rdoctask'
|
47
|
+
Rake::RDocTask.new do |rdoc|
|
48
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
+
|
50
|
+
rdoc.rdoc_dir = 'rdoc'
|
51
|
+
rdoc.title = "shopify #{version}"
|
52
|
+
rdoc.rdoc_files.include('README*')
|
53
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.3.0
|
data/lib/shopify.rb
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
require 'bigdecimal'
|
2
|
+
require 'digest/md5'
|
3
|
+
require 'extlib'
|
4
|
+
require 'httparty'
|
5
|
+
|
6
|
+
|
7
|
+
# Class: Shopify
|
8
|
+
# Usage:
|
9
|
+
# shop = Shopify.new(host, [key, [secret, [token]]])
|
10
|
+
# shop.orders
|
11
|
+
class Shopify
|
12
|
+
attr_reader :host
|
13
|
+
include HTTParty
|
14
|
+
|
15
|
+
def initialize(host, key=nil, secret=nil, token=nil)
|
16
|
+
host.gsub!(/https?:\/\//, '') # remove http(s)://
|
17
|
+
@host = host.include?('.') ? host : "#{host}.myshopify.com" # extend url to myshopify.com if no host is given
|
18
|
+
@key = key
|
19
|
+
@secret = secret
|
20
|
+
@token = token
|
21
|
+
setup
|
22
|
+
end
|
23
|
+
|
24
|
+
def needs_authorization?
|
25
|
+
![@host, @key, @secret, @token].all?
|
26
|
+
end
|
27
|
+
|
28
|
+
def authorize!(token)
|
29
|
+
@token = token
|
30
|
+
setup
|
31
|
+
end
|
32
|
+
|
33
|
+
def authorization_url(mode='w')
|
34
|
+
"http://#{@host}/admin/api/auth?api_key=#{@key}&mode=#{mode}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup
|
38
|
+
unless needs_authorization?
|
39
|
+
@base_uri = "http://#{@host}/admin"
|
40
|
+
@basic_auth = {:username => @key, :password => Digest::MD5.hexdigest("#{@secret.chomp}#{@token.chomp}")}
|
41
|
+
@format = :xml
|
42
|
+
end
|
43
|
+
end
|
44
|
+
private :setup
|
45
|
+
|
46
|
+
def options(opts={})
|
47
|
+
{:base_uri => @base_uri, :basic_auth => @basic_auth, :format => @format}.merge(opts)
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
class ShopifyModel
|
52
|
+
class << self
|
53
|
+
def load_api_classes(api)
|
54
|
+
api.each_key do |klass_name|
|
55
|
+
next unless klass_name.is_a?(String)
|
56
|
+
mode = []
|
57
|
+
singular = klass_name.singular
|
58
|
+
mode = [:singular] if singular == klass_name
|
59
|
+
klass = Shopify.const_set(singular, Class.new(ShopifyModel))
|
60
|
+
|
61
|
+
# Set up the top_level or children_of setting
|
62
|
+
self == ShopifyModel ?
|
63
|
+
klass.send(:top_level, *mode) :
|
64
|
+
klass.send(:children_of, self)
|
65
|
+
|
66
|
+
# Set up the properties
|
67
|
+
klass.send(:attr_accessor, *api[klass_name].delete(:properties).split(', ').map {|s| s.to_sym})
|
68
|
+
|
69
|
+
# If there are any children to be had, set them up
|
70
|
+
klass.load_api_classes(api[klass_name])
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def top_level(*options)
|
75
|
+
klass_name = self.name.gsub(/.*::/,'')
|
76
|
+
if options.include?(:singular)
|
77
|
+
# Defines the singular accessor in the Shopify object
|
78
|
+
# TODO: Make the object cache the results of queries, per set of parameters,
|
79
|
+
# and reload only when you include true as the first argument.
|
80
|
+
Shopify.class_eval "
|
81
|
+
def #{klass_name.snake_case}(query_params={})
|
82
|
+
json = Shopify.get(\"/#{klass_name.snake_case}.xml\", options(:query => query_params))
|
83
|
+
begin
|
84
|
+
#{klass_name}.instantiate(self, json['#{klass_name.snake_case}'])
|
85
|
+
rescue => e
|
86
|
+
warn \"Error: \#{e.inspect}\"
|
87
|
+
json
|
88
|
+
end
|
89
|
+
end
|
90
|
+
"
|
91
|
+
else
|
92
|
+
# Defines the plural accessor in the Shopify object
|
93
|
+
# TODO: Make the object cache the results of queries, per set of parameters,
|
94
|
+
# and reload only when you include true as the first argument.
|
95
|
+
Shopify.class_eval "
|
96
|
+
def #{klass_name.snake_case.pluralize}(query_params={})
|
97
|
+
json = Shopify.get(\"/#{klass_name.snake_case.pluralize}.xml\", options(:query => query_params))
|
98
|
+
if json['#{klass_name.snake_case.pluralize}']
|
99
|
+
json['#{klass_name.snake_case.pluralize}'].collect {|i| #{klass_name}.instantiate(self, i)}
|
100
|
+
else
|
101
|
+
json
|
102
|
+
end
|
103
|
+
end
|
104
|
+
def #{klass_name.snake_case}(id)
|
105
|
+
json = Shopify.get(\"/#{klass_name.snake_case.pluralize}/\#{id}.xml\", options)
|
106
|
+
if json['#{klass_name.snake_case}']
|
107
|
+
#{klass_name}.instantiate(self, json['#{klass_name.snake_case}'])
|
108
|
+
else
|
109
|
+
json
|
110
|
+
end
|
111
|
+
end
|
112
|
+
"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
def children_of(parent_klass)
|
116
|
+
@parent = parent_klass
|
117
|
+
parent_klass_name = parent_klass.name.gsub(/.*::/,'')
|
118
|
+
klass_name = self.name.gsub(/.*::/,'')
|
119
|
+
# Defines the getter method in the parent class
|
120
|
+
# TODO: Make the object cache the results of queries, per set of parameters,
|
121
|
+
# and reload only when you include true as the first argument.
|
122
|
+
parent_klass.class_eval "
|
123
|
+
def #{klass_name.snake_case.pluralize}(query_params={})
|
124
|
+
@#{klass_name.snake_case.pluralize} ||= begin
|
125
|
+
json = Shopify.get(\"/#{parent_klass_name.snake_case.pluralize}/\#{id}/#{klass_name.snake_case.pluralize}.xml\", shop.options(:query => query_params))
|
126
|
+
case
|
127
|
+
when json['#{parent_klass_name.snake_case}_#{klass_name.snake_case.pluralize}']
|
128
|
+
json['#{parent_klass_name.snake_case}_#{klass_name.snake_case.pluralize}']
|
129
|
+
when json['#{klass_name.snake_case.pluralize}']
|
130
|
+
json['#{klass_name.snake_case.pluralize}']
|
131
|
+
else
|
132
|
+
json
|
133
|
+
end
|
134
|
+
end
|
135
|
+
@#{klass_name.snake_case.pluralize} = (@#{klass_name.snake_case.pluralize}.is_a?(Array) ? @#{klass_name.snake_case.pluralize}.collect {|i| #{klass_name}.instantiate(shop, i)} : [#{klass_name}.instantiate(shop, @#{klass_name.snake_case.pluralize})]) unless @#{klass_name.snake_case.pluralize}.is_a?(#{klass_name}) || @#{klass_name.snake_case.pluralize}.is_a?(Array) && @#{klass_name.snake_case.pluralize}[0].is_a?(#{klass_name})
|
136
|
+
@#{klass_name.snake_case.pluralize}
|
137
|
+
end
|
138
|
+
"
|
139
|
+
end
|
140
|
+
def is_child?
|
141
|
+
(@parent ||= nil)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def self.instantiate(shop, attrs={})
|
146
|
+
new(shop, attrs.merge('new_record' => false))
|
147
|
+
end
|
148
|
+
def initialize(shop, attrs={})
|
149
|
+
@new_record = true
|
150
|
+
attrs.each { |k,v| instance_variable_set("@#{k}", v) }
|
151
|
+
@shop = shop
|
152
|
+
end
|
153
|
+
attr_accessor :shop
|
154
|
+
|
155
|
+
def inspect
|
156
|
+
"<#{self.class.name} shop=#{@shop.host} #{instance_variables.reject {|i| i=='@shop' || instance_variable_get(i).to_s==''}.map {|i| "#{i}=#{instance_variable_get(i).inspect}"}.join(' ')}>"
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
|
161
|
+
########################################
|
162
|
+
## Load the Shopify Object Classes! ##
|
163
|
+
########################################
|
164
|
+
ShopifyModel.load_api_classes YAML.load_file(File.dirname(__FILE__)+'/shopify_api.yml')
|
165
|
+
|
166
|
+
|
167
|
+
# Add some extra touches to a couple of the models
|
168
|
+
class Article < ShopifyModel
|
169
|
+
def comments(query_params={})
|
170
|
+
shop.comments(query_params.merge(:article_id => id, :blog_id => blog_id))
|
171
|
+
end
|
172
|
+
end
|
173
|
+
class CustomCollection < ShopifyModel
|
174
|
+
def products(query_params={})
|
175
|
+
shop.products(query_params.merge(:collection_id => id))
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
require 'extlib'
|
2
|
+
require 'bigdecimal'
|
3
|
+
require 'digest/md5'
|
4
|
+
require 'httparty'
|
5
|
+
|
6
|
+
class Shopify
|
7
|
+
class ShopifyModel
|
8
|
+
class << self
|
9
|
+
def load_api_classes(api)
|
10
|
+
api.each_key do |klass_name|
|
11
|
+
next unless klass_name.is_a?(String)
|
12
|
+
mode = []
|
13
|
+
singular = klass_name.singular
|
14
|
+
mode = [:singular] if singular == klass_name
|
15
|
+
klass = Shopify.const_set(singular, Class.new(ShopifyModel))
|
16
|
+
|
17
|
+
# Set up the top_level or children_of setting
|
18
|
+
if self == ShopifyModel
|
19
|
+
klass.send(:top_level, *mode)
|
20
|
+
else
|
21
|
+
klass.send(:children_of, self)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Set up the properties
|
25
|
+
klass.send(:attr_accessor, *api[klass_name].delete(:properties).split(', ').map {|s| s.to_sym})
|
26
|
+
|
27
|
+
# If there are any children to be had, set them up
|
28
|
+
klass.load_api_classes(api[klass_name])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def top_level(*options)
|
33
|
+
klass_name = self.name.gsub(/.*::/,'')
|
34
|
+
if options.include?(:singular)
|
35
|
+
# Define singular accessor in Shopify
|
36
|
+
Shopify.class_eval "
|
37
|
+
def #{klass_name.snake_case}(query_params={})
|
38
|
+
json = Shopify.get(\"/#{klass_name.snake_case}.xml\", options(:query => query_params))
|
39
|
+
begin
|
40
|
+
#{klass_name}.instantiate(self, json['#{klass_name.snake_case}'])
|
41
|
+
rescue => e
|
42
|
+
warn \"Error: \#{e.inspect}\"
|
43
|
+
json
|
44
|
+
end
|
45
|
+
end
|
46
|
+
"
|
47
|
+
else
|
48
|
+
# Define plural accessor in Shopify
|
49
|
+
Shopify.class_eval "
|
50
|
+
def #{klass_name.snake_case.pluralize}(query_params={})
|
51
|
+
json = Shopify.get(\"/#{klass_name.snake_case.pluralize}.xml\", options(:query => query_params))
|
52
|
+
if json['#{klass_name.snake_case.pluralize}']
|
53
|
+
json['#{klass_name.snake_case.pluralize}'].collect {|i| #{klass_name}.instantiate(self, i)}
|
54
|
+
else
|
55
|
+
json
|
56
|
+
end
|
57
|
+
end
|
58
|
+
def #{klass_name.snake_case}(id)
|
59
|
+
json = Shopify.get(\"/#{klass_name.snake_case.pluralize}/\#{id}.xml\", options)
|
60
|
+
if json['#{klass_name.snake_case}']
|
61
|
+
#{klass_name}.instantiate(self, json['#{klass_name.snake_case}'])
|
62
|
+
else
|
63
|
+
json
|
64
|
+
end
|
65
|
+
end
|
66
|
+
"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
def children_of(parent_klass)
|
70
|
+
@parent = parent_klass
|
71
|
+
parent_klass_name = parent_klass.name.gsub(/.*::/,'')
|
72
|
+
klass_name = self.name.gsub(/.*::/,'')
|
73
|
+
parent_klass.class_eval "
|
74
|
+
def #{klass_name.snake_case.pluralize}(query_params={})
|
75
|
+
@#{klass_name.snake_case.pluralize} ||= begin
|
76
|
+
json = Shopify.get(\"/#{parent_klass_name.snake_case.pluralize}/\#{id}/#{klass_name.snake_case.pluralize}.xml\", shop.options(:query => query_params))
|
77
|
+
case
|
78
|
+
when json['#{parent_klass_name.snake_case}_#{klass_name.snake_case.pluralize}']
|
79
|
+
json['#{parent_klass_name.snake_case}_#{klass_name.snake_case.pluralize}']
|
80
|
+
when json['#{klass_name.snake_case.pluralize}']
|
81
|
+
json['#{klass_name.snake_case.pluralize}']
|
82
|
+
else
|
83
|
+
json
|
84
|
+
end
|
85
|
+
end
|
86
|
+
@#{klass_name.snake_case.pluralize} = (@#{klass_name.snake_case.pluralize}.is_a?(Array) ? @#{klass_name.snake_case.pluralize}.collect {|i| #{klass_name}.instantiate(shop, i)} : [#{klass_name}.instantiate(shop, @#{klass_name.snake_case.pluralize})]) unless @#{klass_name.snake_case.pluralize}.is_a?(#{klass_name}) || @#{klass_name.snake_case.pluralize}.is_a?(Array) && @#{klass_name.snake_case.pluralize}[0].is_a?(#{klass_name})
|
87
|
+
@#{klass_name.snake_case.pluralize}
|
88
|
+
end
|
89
|
+
"
|
90
|
+
end
|
91
|
+
def is_child?
|
92
|
+
(@parent ||= nil)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.instantiate(shop, attrs={})
|
97
|
+
new(shop, attrs.merge('new_record' => false))
|
98
|
+
end
|
99
|
+
def initialize(shop, attrs={})
|
100
|
+
@new_record = true
|
101
|
+
attrs.each { |k,v| instance_variable_set("@#{k}", v) }
|
102
|
+
@shop = shop
|
103
|
+
end
|
104
|
+
attr_accessor :shop
|
105
|
+
|
106
|
+
def inspect
|
107
|
+
"<#{self.class.name} shop=#{@shop.host} #{instance_variables.reject {|i| i=='@shop' || instance_variable_get(i).to_s==''}.map {|i| "#{i}=#{instance_variable_get(i).inspect}"}.join(' ')}>"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
data/lib/shopify_api.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
Blogs:
|
3
|
+
:properties: commentable, feedburner, feedburner_locations, handle, id, shop_id, title, updated_at
|
4
|
+
Articles:
|
5
|
+
:properties: author, blog_id, body, body_html, created_at, id, published_at, title, updated_at
|
6
|
+
Comments:
|
7
|
+
:properties: article_id, author, blog_id, body, body_html, created_at, email, id, ip, published_at, shop_id, status, updated_at, user_agent
|
8
|
+
Collects:
|
9
|
+
:properties: collection_id, featured, id, position, product_id
|
10
|
+
Countries:
|
11
|
+
:properties: code, id, name, tax
|
12
|
+
Provinces:
|
13
|
+
:properties: code, id, name, tax
|
14
|
+
CustomCollections:
|
15
|
+
:properties: body, body_html, handle, id, published_at, sort_order, title, updated_at
|
16
|
+
Orders:
|
17
|
+
:properties: buyer_accepts_marketing, closed_at, created_at, currency, email, financial_status, fulfillment_status, gateway, id, name, note, number, subtotal_price, taxes_included, token, total_discounts, total_line_items_price, total_price, total_tax, total_weight, updated_at, browser_ip, billing_address, shipping_address, line_items, shipping_line
|
18
|
+
LineItems:
|
19
|
+
:properties: fulfillment_service, grams, id, price, quantity, sku, title, variant_id, vendor, name, product_title
|
20
|
+
Fulfillments:
|
21
|
+
:properties: id, order_id, status, tracking_number, line_items, receipt
|
22
|
+
Transactions:
|
23
|
+
:properties: amount, authorization, created_at, kind, order_id, status, receipt
|
24
|
+
Pages:
|
25
|
+
:properties: author, body, body_html, created_at, handle, ip, published_at, shop_id, title, updated_at
|
26
|
+
Products:
|
27
|
+
:properties: body, body_html, created_at, handle, id, product_type, published_at, title, updated_at, vendor, tags, variants, images
|
28
|
+
Images:
|
29
|
+
:properties: id, position, product_id, src
|
30
|
+
Variants:
|
31
|
+
:properties: compare_at_price, fulfillment_service, grams, id, inventory_management, inventory_policy, inventory_quantity, position, price, product_id, sku, title
|
32
|
+
Redirects:
|
33
|
+
:properties: id, path, shop_id, target
|
34
|
+
Shop:
|
35
|
+
:properties: active_subscription_id, address1, city, country, created_at, domain, email, id, name, phone, province, public, source, zip, taxes_included, currency, timezone, shop_owner
|
data/test/helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: shopify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- BehindLogic
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-12-17 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: extlib
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: httparty
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.5.0
|
34
|
+
version:
|
35
|
+
description: Communicate easily with Shopify.com's Restful API.
|
36
|
+
email: gems@behindlogic.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README.markdown
|
44
|
+
files:
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.markdown
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- lib/shopify.rb
|
52
|
+
- lib/shopify/support.rb
|
53
|
+
- lib/shopify_api.yml
|
54
|
+
- test/helper.rb
|
55
|
+
- test/test_shopify.rb
|
56
|
+
has_rdoc: true
|
57
|
+
homepage: http://github.com/dcparker/shopify
|
58
|
+
licenses: []
|
59
|
+
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options:
|
62
|
+
- --charset=UTF-8
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: "0"
|
76
|
+
version:
|
77
|
+
requirements: []
|
78
|
+
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 1.3.5
|
81
|
+
signing_key:
|
82
|
+
specification_version: 3
|
83
|
+
summary: Communicate easily with Shopify.com's Restful API.
|
84
|
+
test_files:
|
85
|
+
- test/helper.rb
|
86
|
+
- test/test_shopify.rb
|