- Locks JSON api version which fixed an issue with downloading large binary files -- Tyler Ball
- Respect API limits when downloading theme assets from Shopify API -- Chris Saunders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def request(data, hmac=nil) | |
options = { | |
:method => 'POST', | |
:input => data, | |
'X-Shopify-Hmac-SHA256' => hmac || calculate_hmac(data) | |
} | |
ActionDispatch::Request.new(Rack::MockRequest.env_for("", options)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Importer | |
def import | |
api_products = ShopifyAPI::Product.find(:all) | |
ShopProductSink::Product.create_from_resources(api_products) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ShopProductSink | |
module ApiCreatable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def initialize_from_resource(resource) | |
attributes = usable_keys.reduce({}) do |result, key| | |
result[key] = resource.public_send(key) if resource.respond_to?(key) | |
result | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
%%{ | |
machine simplemath; | |
number = digit+; | |
operator = '+'; | |
main := (digit operator digit) 0 @{ res = 1; }; | |
}%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.gitignore b/.gitignore | |
index 8b6632c..2a33328 100644 | |
--- a/.gitignore | |
+++ b/.gitignore | |
@@ -5,3 +5,4 @@ rdoc | |
pkg | |
doc | |
.yardoc | |
+.rbenv-version | |
diff --git a/Gemfile b/Gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'base64' | |
class WebhooksController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :verify_webhook, :fetch_shop | |
def create | |
case topic | |
when 'orders/fulfilled' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shops GET /shops(.:format) shops#index => shops_path | |
POST /shops(.:format) shops#create => shops_path | |
new_shop GET /shops/new(.:format) shops#new => new_shop_path | |
edit_shop GET /shops/:id/edit(.:format) shops#edit => edit_shop_path | |
shop GET /shops/:id(.:format) shops#show => shop_path(shop) | |
PUT /shops/:id(.:format) shops#update => shop_path(shop) | |
DELETE /shops/:id(.:format) shops#destroy => shop_path(shop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'shopify_theme' |
NewerOlder