shopify-sinatra-app 0.0.4 → 0.0.5

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: f14854ae0081a9b642032ba7eaa40ae85a5b22e0
4
- data.tar.gz: c8157d64a372e0b1ad339898a920312beee32b4a
3
+ metadata.gz: e5c6280877cb5f262f0f68438da82e68fd553968
4
+ data.tar.gz: 29f093aaf57542798dbdd0ecfa5fdc0823bc0ae0
5
5
  SHA512:
6
- metadata.gz: 50a4cd567b685d6a09eba34a43f014b535ab7f6b6ffb9c26eebc34dd7989f7b74494a894253b445426452711c031dc21a9b045a26a832fddba24b34578a5b0a9
7
- data.tar.gz: 789e5772cdb0dc839c5b9d53da1fe912fba53e78e9dee35bde4719490a1aaca8da44c4c7083d739d9f2d28df34e2410019739e2c8a3d60a7ea70c5f121a87cfa
6
+ metadata.gz: 9aab213ea3f6f4dfaaf54a1c5009dd90e3db70a726dd056562159b78d2925daabaeac46d0394bd028685f81917aa4534b2eacd0749a5794a6fdd94d7fd81e9f9
7
+ data.tar.gz: 7adc98d77829296d23f09a130ca61a02762912606628c5570ae0a93487c862c00d1100b2e067da02bcea419f9dd7b5978fa573b52282f4dc6abc5bc0650cfb9b
data/README.md CHANGED
@@ -127,15 +127,19 @@ note - a flash must be followed by a redirect or it won't work!
127
127
 
128
128
  Developing
129
129
  ----------
130
+ You can set the application url in the [Shopify Partner area](https://app.shopify.com/services/partners/api_clients) to be `http://localhost:4567/` which will allow you to install your app on a live shop while running it locally.
131
+
132
+ When developing locally you'll need to enable unsafe javascripts in your browser for the Embedded App SDK to function. Read more [here](http://docs.shopify.com/embedded-app-sdk/getting-started).
133
+
130
134
  To run the app locally we use `foreman` which comes with the [Heroku Toolbelt](https://devcenter.heroku.com/articles/quickstart). Foreman handles running our application and setting our credentials as environment variables. To run the application type:
131
135
 
132
136
  ```
133
- foreman start -p 4567
137
+ foreman run bundle exec rackup config.ru
134
138
  ```
135
139
 
136
- Debugging ...
140
+ Note - we use `foreman run ...` not foreman start because we only want to start the single process that is our app. This means if you add a debugger in your app it will trigger properly in the command line when the debugger is hit. If you don't have any debuggers feel free to use `foreman start -p 4567`.
137
141
 
138
- You can set the application url in the [Shopify Partner area](https://app.shopify.com/services/partners/api_clients) to be `http://localhost:4567/` which will allow you to install your app on a live shop while running it locally.
142
+ To debug your app simply add `require 'byebug'` at the top and then type `byebug` where you would like to drop into an interactive session. You may also want to try out Pry.
139
143
 
140
144
  While running the app locally you'll be able to test the install and other routes because your browser is aware of your local application but if you want to test a route that listens to a webhook this will not work because Shopify cannot talk to your local web application. You could expose your local application to the web but an easier solution is to use a tool called [Ngrok](https://ngrok.com/). Download Ngrok and run it on port 4567 (or whichever port you are using):
141
145
 
@@ -145,8 +149,6 @@ While running the app locally you'll be able to test the install and other route
145
149
 
146
150
  Ngrok will report what address your app is available at, leave Ngrok running and then create your webhook to point to the ngrok url plus your route e.g. `<ngrok url>/webhook_test.json`. Now trigger the webhook you are testing and it will get forwarded through ngrok to your local web application allowing you to use debuggers and repls to complete your code.
147
151
 
148
- When developing locally you'll need to enable unsafe javascripts in your browser for the Embedded App SDK to function. Read more [here](http://docs.shopify.com/embedded-app-sdk/getting-started).
149
-
150
152
 
151
153
  Deploying
152
154
  ---------
@@ -15,6 +15,9 @@ else
15
15
  app_name = ARGV[1]
16
16
  app_dir = working_dir + "/" + app_name
17
17
 
18
+ puts "Generating new app: #{app_name}"
19
+ puts "fullpath: #{app_dir}"
20
+
18
21
  begin
19
22
  Dir.mkdir(app_dir)
20
23
 
@@ -33,8 +33,6 @@ class SinatraApp < Sinatra::Base
33
33
  # inside here.
34
34
  def install
35
35
  shopify_session do
36
- params = YAML.load(File.read("config/app.yml"))
37
-
38
36
  # create an uninstall webhook, this webhook gets sent
39
37
  # when your app is uninstalled from a shop. It is good
40
38
  # practice to clean up any data from a shop when they
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopify-sinatra-app'
3
- s.version = '0.0.4'
3
+ s.version = '0.0.5'
4
4
 
5
5
  s.summary = "A classy shopify app"
6
6
  s.description = "A Sinatra extension for building Shopify Apps. Akin to the shopify_app gem but for Sinatra"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-sinatra-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Hughes