quickbooks-sinatra-app 0.0.2 → 0.0.4

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: 1beaca822f6b8a9555a4fbd7d4a7a430b3c66697
4
- data.tar.gz: e3679e119fd451a847e3096f9fc53695b803f73e
3
+ metadata.gz: 30073c59ea654272dcf319fd81b985d008358baa
4
+ data.tar.gz: dc21bd9554229fde4f7678f785b1e8ee5cbbe097
5
5
  SHA512:
6
- metadata.gz: af38e61662dbb67ea996792a561beced8edfc689894635bcd1bd5c96896d3402354f0f9cbbcb6b59db941474224478618ec75954cf4ca86ac75f96d9f190eb55
7
- data.tar.gz: 630f00383031477bd2dfbf25d951c2b1ebb90396b8461ce2ed842a1c93d1487b79577db51510eb9d1ec7bec83a3696ec706fdc76890cb74541fced04adcf8f0f
6
+ metadata.gz: f602d2d8d6bb9b3a9948bebc27e18649c48ff0d7469a515de9594d88b0aa335718b911ca82d556dd883ada56b869891e680a4045324d3e07fdbdee6b12c2c460
7
+ data.tar.gz: aba6b74473855f43532b6c3587ffd77c9cbde00731a6ffd65ed79a4866099363618e54e8785f0e69224cc1db80fe51929e6d4a7edfbdc2f24f03465cb6969a87
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- gem 'omniauth-quickbooks', :git => 'https://github.com/pickle27/omniauth-quickbooks.git'
@@ -0,0 +1,40 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ quickbooks-sinatra-app (0.0.3)
5
+ multi_json
6
+ omniauth-oauth
7
+ omniauth-quickbooks (~> 0.0.2)
8
+ rack-flash3
9
+ sinatra
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ hashie (3.3.2)
15
+ multi_json (1.10.1)
16
+ oauth (0.4.7)
17
+ omniauth (1.2.2)
18
+ hashie (>= 1.2, < 4)
19
+ rack (~> 1.0)
20
+ omniauth-oauth (1.0.1)
21
+ oauth
22
+ omniauth (~> 1.0)
23
+ omniauth-quickbooks (0.0.2)
24
+ omniauth-oauth (~> 1.0)
25
+ rack (1.5.2)
26
+ rack-flash3 (1.0.5)
27
+ rack
28
+ rack-protection (1.5.3)
29
+ rack
30
+ sinatra (1.4.5)
31
+ rack (~> 1.4)
32
+ rack-protection (~> 1.4)
33
+ tilt (~> 1.3, >= 1.3.4)
34
+ tilt (1.4.1)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ quickbooks-sinatra-app!
data/README.md CHANGED
@@ -3,6 +3,12 @@ Quickbooks-Sinatra-App
3
3
 
4
4
  Sinatra extension for building Quickbooks Online Apps
5
5
 
6
+ Installing
7
+ ----------
8
+ ```
9
+ gem install quickbooks-sinatra-app
10
+ ```
11
+
6
12
  Example Usage
7
13
  -------------
8
14
 
@@ -21,3 +27,5 @@ class SinatraApp < Sinatra::Base
21
27
  end
22
28
  end
23
29
  ```
30
+
31
+ For an example including making a few api calls see this [repo](https://github.com/pickle27/quickbooks-sinatra-example)
@@ -1,4 +1,5 @@
1
1
  require 'sinatra/base'
2
+ require 'rack-flash'
2
3
  require 'omniauth-quickbooks'
3
4
 
4
5
  module Sinatra
@@ -8,6 +9,15 @@ module Sinatra
8
9
  def base_url
9
10
  @base_url ||= "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}"
10
11
  end
12
+
13
+ private
14
+
15
+ def close_and_refresh_parent
16
+ erb "<script>
17
+ window.opener.location.reload();
18
+ close();
19
+ </script>", :layout => false
20
+ end
11
21
  end
12
22
 
13
23
  def self.registered(app)
@@ -20,6 +30,8 @@ module Sinatra
20
30
  app.set :qbo_key, ENV['QBO_KEY']
21
31
  app.set :qbo_secret, ENV['QBO_SECRET']
22
32
 
33
+ app.use Rack::Flash, :sweep => true
34
+
23
35
  app.use Rack::Session::Cookie, :key => '#{base_url}.session',
24
36
  :path => '/',
25
37
  :secret => app.settings.secret,
@@ -34,12 +46,13 @@ module Sinatra
34
46
  session[:qbo_secret] = request.env['omniauth.auth']['credentials']['secret']
35
47
  session[:realm_id] = params['realmId']
36
48
 
37
- erb 'Your QuickBooks account has been successfully linked', :layout => false
49
+ flash[:notice] = 'Your QuickBooks account has been successfully linked'
50
+ close_and_refresh_parent
38
51
  end
39
52
 
40
53
  app.get '/auth/failure' do
41
- erb "<h1>Authentication Failed:</h1>
42
- <h3>message:<h3> <pre>#{params}</pre>", :layout => false
54
+ flash[:error] = "Quickbooks authentication failed"
55
+ close_and_refresh_parent
43
56
  end
44
57
  end
45
58
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'quickbooks-sinatra-app'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.4'
4
4
 
5
5
  s.summary = "A classy quickbooks app"
6
6
  s.description = "A Sinatra extension for building Quickbooks Online Apps."
@@ -13,7 +13,8 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split("\n")
14
14
 
15
15
  s.add_runtime_dependency 'sinatra'
16
+ s.add_runtime_dependency 'rack-flash3'
16
17
  s.add_runtime_dependency 'omniauth-oauth'
17
18
  s.add_runtime_dependency 'multi_json' # required by omniauth-oauth - https://github.com/intridea/omniauth-oauth/pull/4
18
- s.add_runtime_dependency 'omniauth-quickbooks' # ensure your version has this: https://github.com/davidlumley/omniauth-quickbooks/pull/2
19
+ s.add_runtime_dependency 'omniauth-quickbooks', '~> 0.0.2'
19
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickbooks-sinatra-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Hughes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: omniauth-oauth
28
+ name: rack-flash3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: multi_json
42
+ name: omniauth-oauth
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: omniauth-quickbooks
56
+ name: multi_json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: omniauth-quickbooks
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.0.2
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.0.2
69
83
  description: A Sinatra extension for building Quickbooks Online Apps.
70
84
  email: kevin.hughes@shopify.com
71
85
  executables: []
@@ -74,6 +88,7 @@ extra_rdoc_files: []
74
88
  files:
75
89
  - ".gitignore"
76
90
  - Gemfile
91
+ - Gemfile.lock
77
92
  - README.md
78
93
  - lib/sinatra/quickbooks-sinatra-app.rb
79
94
  - quickbooks-sinatra-app.gemspec