shopify_api 1.0.2 → 1.0.3
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/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/shopify_api.rb +2 -3
- data/shopify_api.gemspec +2 -2
- data/test/shopify_api_test.rb +6 -6
- metadata +2 -2
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ begin
|
|
14
14
|
gem.add_dependency('activeresource', '>= 2.2.2')
|
15
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
Jeweler::RubyforgeTasks.new
|
19
19
|
rescue LoadError
|
20
20
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
@@ -56,4 +56,4 @@ Rake::RDocTask.new do |rdoc|
|
|
56
56
|
rdoc.title = "shopify_api #{version}"
|
57
57
|
rdoc.rdoc_files.include('README*')
|
58
58
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
59
|
-
end
|
59
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/lib/shopify_api.rb
CHANGED
@@ -120,7 +120,6 @@ module ShopifyAPI
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def initialize(url, token = nil, params = nil)
|
123
|
-
raise ArgumentError, "A valid Shopify shop URL must be provided" if url.blank?
|
124
123
|
self.url, self.token = url, token
|
125
124
|
|
126
125
|
if params && params[:signature]
|
@@ -129,7 +128,7 @@ module ShopifyAPI
|
|
129
128
|
end
|
130
129
|
end
|
131
130
|
|
132
|
-
self.class.prepare_url(self.url)
|
131
|
+
self.class.prepare_url(self.url) if valid?
|
133
132
|
end
|
134
133
|
|
135
134
|
def shop
|
@@ -148,7 +147,7 @@ module ShopifyAPI
|
|
148
147
|
end
|
149
148
|
|
150
149
|
def valid?
|
151
|
-
|
150
|
+
url.present? && token.present?
|
152
151
|
end
|
153
152
|
|
154
153
|
private
|
data/shopify_api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{shopify_api}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tobias L\303\274tke", "Cody Fauser", "Dennis Theisen"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-28}
|
13
13
|
s.description = %q{= Shopify API
|
14
14
|
|
15
15
|
The Shopify API gem allows Ruby developers to programmatically access the admin section of Shopify stores.
|
data/test/shopify_api_test.rb
CHANGED
@@ -3,19 +3,19 @@ require 'test_helper'
|
|
3
3
|
class ShopifyApiTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
context "Session" do
|
6
|
-
should "
|
7
|
-
|
6
|
+
should "not be valid without a url" do
|
7
|
+
session = ShopifyAPI::Session.new(nil, "any-token")
|
8
|
+
assert_not session.valid?
|
8
9
|
end
|
9
|
-
|
10
|
+
|
10
11
|
should "not be valid without token" do
|
11
12
|
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
12
13
|
assert_not session.valid?
|
13
14
|
end
|
14
15
|
|
15
|
-
should "be valid with any token" do
|
16
|
+
should "be valid with any token and any url" do
|
16
17
|
session = ShopifyAPI::Session.new("testshop.myshopify.com", "any-token")
|
17
18
|
assert session.valid?
|
18
19
|
end
|
19
20
|
end
|
20
|
-
|
21
|
-
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Tobias L\xC3\xBCtke"
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2010-01-
|
14
|
+
date: 2010-01-28 00:00:00 -05:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|