shopify-routes 0.0.2 → 0.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/README.md +1 -1
- data/lib/shopify-routes.rb +8 -26
- data/shopify-routes.gemspec +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -55,7 +55,7 @@ domain in the url helper. For example:
|
|
55
55
|
|
56
56
|
Or for redirecting to a specific order:
|
57
57
|
|
58
|
-
|
58
|
+
order_url(:shop => "my-shopify-domain", :id => 1001)
|
59
59
|
|
60
60
|
Here's a list of all the routes that will be added to your app, outside of any
|
61
61
|
namespace to keep things simple.
|
data/lib/shopify-routes.rb
CHANGED
@@ -67,7 +67,7 @@ module ShopifyAPI
|
|
67
67
|
actions.each do |action|
|
68
68
|
|
69
69
|
# create the route, and it's name
|
70
|
-
route = "
|
70
|
+
route = "*shop/admin/#{path.to_s}"
|
71
71
|
name = nom.to_s
|
72
72
|
|
73
73
|
case action
|
@@ -91,11 +91,7 @@ module ShopifyAPI
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# draw the route
|
94
|
-
match_admin_path
|
95
|
-
route => name,
|
96
|
-
:action => action,
|
97
|
-
:controller => "shopify_#{nom.to_s.pluralize}"
|
98
|
-
)
|
94
|
+
match_admin_path route => path, as: name
|
99
95
|
end
|
100
96
|
|
101
97
|
end
|
@@ -133,9 +129,7 @@ module ShopifyAPI
|
|
133
129
|
uri
|
134
130
|
},
|
135
131
|
|
136
|
-
:as
|
137
|
-
:action => options[:action],
|
138
|
-
:controller => options[:controller]
|
132
|
+
:as => options[:as]
|
139
133
|
|
140
134
|
end
|
141
135
|
|
@@ -159,33 +153,21 @@ module ShopifyAPI
|
|
159
153
|
if include?(:brochure)
|
160
154
|
# route to the Shopify brochure path
|
161
155
|
brochure_path = "http://www.shopify.com#{@ref}"
|
162
|
-
r.match(
|
163
|
-
"/" => r.redirect(brochure_path),
|
164
|
-
:as => "brochure",
|
165
|
-
:controller => "shopify",
|
166
|
-
:action => "index"
|
167
|
-
)
|
156
|
+
r.match "/" => r.redirect(brochure_path), as: "brochure"
|
168
157
|
end
|
169
158
|
|
170
159
|
if include?(:signup)
|
171
160
|
# route to the Shopify sign up path
|
172
161
|
signup_path = "https://app.shopify.com/services/signup#{@ref}"
|
173
|
-
r.match(
|
174
|
-
"signup" => r.redirect(signup_path),
|
175
|
-
:as => "signup",
|
176
|
-
:controller => "shopify",
|
177
|
-
:action => "signup"
|
178
|
-
)
|
162
|
+
r.match "signup" => r.redirect(signup_path), as: "signup"
|
179
163
|
end
|
180
164
|
|
181
165
|
if include?(:admin)
|
182
166
|
# route to a shop's admin path
|
183
|
-
r.match "
|
184
|
-
"https://#{
|
167
|
+
r.match "*shop/admin" => r.redirect { |p,r|
|
168
|
+
"https://#{shop_domain[:shop]}/admin"
|
185
169
|
},
|
186
|
-
:
|
187
|
-
:controller => "shopify_admin",
|
188
|
-
:action => "index"
|
170
|
+
as: "admin"
|
189
171
|
end
|
190
172
|
|
191
173
|
# draw the routes
|
data/shopify-routes.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
13
|
gem.name = "shopify-routes"
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = "0.0.
|
15
|
+
gem.version = "0.0.3"
|
16
16
|
|
17
17
|
gem.add_runtime_dependency "shopify_api", ">= 3.0.0"
|
18
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify-routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-05-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: shopify_api
|
16
|
-
requirement: &
|
16
|
+
requirement: &20192260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *20192260
|
25
25
|
description: Provides routes that redirect back to Shopify pages.
|
26
26
|
email:
|
27
27
|
- travis.j.haynes@gmail.com
|