shopify_app 6.2.0 → 6.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d25df222f8b66d4fa412f29bf0d467fa7c8926d
4
- data.tar.gz: 22b43d52a0dd8c63d7dac595f11bc2edbc617a01
3
+ metadata.gz: 24a872186951e1f4c991d937f7f2a30e798f357e
4
+ data.tar.gz: 38c56b9a5e8255b6b59a425819b3390d5962ad7b
5
5
  SHA512:
6
- metadata.gz: 453e91f835f95f13f51ddf570674eb691d28dca37f45d650411949ec8d52f58de7d9349e72c367da3296d6afefe4ad8206ab535982c9c970a0ec0416d0e27ec1
7
- data.tar.gz: 48dac86145f7a9433e8e23574099630caaca1d95336e4d481dc656a93d37c11442617170a07aee68e49bdd6d82c854fb61b3627169acbe1b95a145a5c29c98e3
6
+ metadata.gz: a2ccfb1a9ef061db062030078ee3015d9e832abedf8ba01a65eb826dc3a51c7f2f47787b3cf822c2bb4ac31b08b4c6dbc2ee2615981631d30459a7aff9cbe615
7
+ data.tar.gz: 1b7dee2021821fe6182b747b6392ae9887d746f33c86c8b41b292d3e4b041220c225d86c7df54c4ec48194e139c998d5f93548bbac26304f118b84ac8fbda889
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 6.2.1
2
+ -----
3
+
4
+ * add callback url to omniauth provider
5
+ * add default redirect_uri
6
+
1
7
  6.2.0
2
8
  -----
3
9
 
data/README.md CHANGED
@@ -57,18 +57,19 @@ $ rails generate shopify_app:install
57
57
 
58
58
  # or optionally with arguments:
59
59
 
60
- $ rails generate shopify_app:install -api_key=<your_api_key> -secret=<your_app_secret> -redirect_uri=<your_redirect_uri>
60
+ $ rails generate shopify_app:install -api_key=<your_api_key> -secret=<your_app_secret>
61
61
  ```
62
62
 
63
63
  Other options include:
64
64
  * `scope` - the Oauth access scope required for your app, eg 'read_products, write_orders'. For more information read the [docs](http://docs.shopify.com/api/tutorials/oauth)
65
65
  * `embedded` - the default is to generate an [embedded app](http://docs.shopify.com/embedded-app-sdk), if you want a legacy non-embedded app then set this to false, `-embedded false`
66
+ * `redirect_uri` - the default is `http://localhost:3000/auth/shopify/callback` which will allow you to develop locally. You'll need to change it to match your domain for production.
66
67
 
67
68
  You can update any of these settings later on easily, the arguments are simply for convenience.
68
69
 
69
70
  The generator creates a basic SessionsController for authenticating with your shop and a HomeController which displays basic information about your products using the ShopifyAPI. The generated controllers include concerns provided by this gem - in this way code sharing is possible and if some of these core methods are updated everyone can benefit. It is completely safe to override any of the methods provided by this gem in your application.
70
71
 
71
- After running the `install` generator you can start your app with `bundle exec rails server` and install your app by visiting localhost.
72
+ After running the `install` generator, you can start your app with `bundle exec rails server` and install your app by visiting localhost.
72
73
 
73
74
 
74
75
  ### Shop Model Generator
@@ -77,7 +78,7 @@ After running the `install` generator you can start your app with `bundle exec r
77
78
  $ rails generate shopify_app:shop_model
78
79
  ```
79
80
 
80
- The install generator doesn't create any database models for you and if you are starting a new app its quite likely that you will want one (most our internally developed apps do!). This generator creates a simple shop model and a migration. It also create a model called `SessionStorage` which interacts with `ShopifyApp::SessionRepository`. Check out the later section to learn more about `ShopifyApp::SessionRepository`
81
+ The install generator doesn't create any database models for you and if you are starting a new app its quite likely that you will want one (most our internally developed apps do!). This generator creates a simple shop model and a migration. It also creates a model called `SessionStorage` which interacts with `ShopifyApp::SessionRepository`. Check out the later section to learn more about `ShopifyApp::SessionRepository`
81
82
 
82
83
  *Note that you will need to run rake db:migrate after this generator*
83
84
 
@@ -95,13 +96,13 @@ If you just run `rails generate shopify_app` then all the generators will be run
95
96
  Managing Api Keys
96
97
  -----------------
97
98
 
98
- The `install` generator places your Api credentials directly into the shopify_app initializer which is convient and fine for development but once your app goes into production **your api credentials should not be in source control**. When we develop apps we keep our keys in environment variables so a production shopify_app initializer would look like this:
99
+ The `install` generator places your Api credentials directly into the shopify_app initializer which is convenient and fine for development but once your app goes into production **your api credentials should not be in source control**. When we develop apps we keep our keys in environment variables so a production shopify_app initializer would look like this:
99
100
 
100
101
  ```ruby
101
102
  ShopifyApp.configure do |config|
102
103
  config.api_key = ENV['SHOPIFY_CLIENT_API_KEY']
103
104
  config.secret = ENV['SHOPIFY_CLIENT_API_SECRET']
104
- config.redirect_uri = "<%= your_redirect_uri %>"
105
+ config.redirect_uri = "http://localhost:3000/auth/shopify/callback"
105
106
  config.scope = 'read_customers, read_orders, write_products'
106
107
  config.embedded_app = true
107
108
  end
@@ -157,6 +158,17 @@ AuthenticatedController
157
158
 
158
159
  The engine includes a controller called `AuthenticatedController` which inherits from `ApplicationController`. It adds some before_filters which ensure the user is authenticated and will redirect to the login page if not. It is best practice to have all controllers that belong to the Shopify part of your app inherit from this controller. The HomeController that is generated already inherits from AuthenticatedController.
159
160
 
161
+ Troubleshooting
162
+ ---------------
163
+
164
+ ### Generator shopify_app:install hangs
165
+
166
+ Rails uses spring by default to speed up development. To run the generator, spring has to be stopped:
167
+ ```sh
168
+ $ bundle exec spring stop
169
+ ```
170
+ Run shopify_app generator again.
171
+
160
172
 
161
173
  Questions or problems?
162
174
  ----------------------
@@ -19,7 +19,7 @@ module ShopifyApp
19
19
  {
20
20
  api_key: '<api_key>',
21
21
  secret: '<secret>',
22
- redirect_uri: '<redirect_uri>',
22
+ redirect_uri: 'http://localhost:3000/auth/shopify/callback',
23
23
  scope: 'read_orders, read_products',
24
24
  embedded: 'true'
25
25
  }
@@ -4,4 +4,6 @@
4
4
 
5
5
  :redirect_uri => ShopifyApp.configuration.redirect_uri,
6
6
 
7
+ :callback_url => ShopifyApp.configuration.redirect_uri,
8
+
7
9
  :scope => ShopifyApp.configuration.scope
@@ -1,3 +1,3 @@
1
1
  module ShopifyApp
2
- VERSION = '6.2.0'
2
+ VERSION = '6.2.1'
3
3
  end
@@ -17,7 +17,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
17
17
  assert_file "config/initializers/shopify_app.rb" do |shopify_app|
18
18
  assert_match 'config.api_key = "<api_key>"', shopify_app
19
19
  assert_match 'config.secret = "<secret>"', shopify_app
20
- assert_match 'config.redirect_uri = "<redirect_uri>"', shopify_app
20
+ assert_match 'config.redirect_uri = "http://localhost:3000/auth/shopify/callback"', shopify_app
21
21
  assert_match 'config.scope = "read_orders, read_products"', shopify_app
22
22
  assert_match "config.embedded_app = true", shopify_app
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-19 00:00:00.000000000 Z
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails