Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
5 lib/shopify-api-limits.rb
@@ -3,8 +3,9 @@
module ShopifyAPI
module Limits
# Connection hack
+ require 'shopify_api'
require 'shopify-api-limits/active_resource/connection'
- require 'shopify-api-limits/active_resource/base'
+ require 'shopify-api-limits/shopify_api/base'
require 'shopify-api-limits/shopify_api/limits'
@@ -19,4 +20,4 @@ class ShopError < Error; end
end
end
-ShopifyAPI.send(:include, ShopifyAPI::Limits)
+ShopifyAPI.send(:include, ShopifyAPI::Limits)
View
6 ...hopify-api-limits/active_resource/base.rb → lib/shopify-api-limits/shopify_api/base.rb
@@ -3,8 +3,8 @@
# Seemlessly stitches all requests to #all, #find(:all), etc, as if there were no LIMIT.
# @see http://wiki.shopify.com/Retrieving_more_than_250_Products%2C_Orders_etc.
#
-module ActiveResource
- class Base
+module ShopifyAPI
+ class Base
SHOPIFY_API_MAX_LIMIT = 250
class << self
@@ -36,4 +36,4 @@ class << self
end
end
end
-end
+end
View
4 lib/shopify-api-limits/shopify_api/limits.rb
@@ -55,8 +55,8 @@ def credit_used(scope=:shop)
# @return {HTTPResonse}
#
def response
- Shop.current unless ActiveResource::Base.connection.response
- ActiveResource::Base.connection.response
+ Shop.current unless Base.connection.response
+ Base.connection.response
end
private
View
2  spec/boot.rb
@@ -4,4 +4,4 @@
# Load shopify config
config = YAML.load_file(File.join(File.dirname(__FILE__), "shopify_api.yml"))
-ActiveResource::Base.site = config["site"]
+ShopifyAPI::Base.site = config["site"]
View
4 spec/credits_spec.rb
@@ -14,7 +14,7 @@
it "Can fetch global limits" do
count = ShopifyAPI.credit_used :global
- limit = ShopifyAPI.creidt_limit :global
+ limit = ShopifyAPI.credit_limit :global
(count < 3000 && count > 0).should be_true
(count < limit).should be_true
@@ -31,4 +31,4 @@
(ShopifyAPI.credit_left == 0).should be_true
end
-end
+end

No commit comments for this range

Something went wrong with that request. Please try again.