omniauth-bancsabadell 0.1.0

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.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/CHANGELOG.md +3 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +37 -0
  6. data/README.md +43 -0
  7. data/lib/.DS_Store +0 -0
  8. data/lib/omniauth/.DS_Store +0 -0
  9. data/lib/omniauth/bancsabadell/version.rb +5 -0
  10. data/lib/omniauth/bancsabadell.rb +2 -0
  11. data/lib/omniauth/strategies/bancsabadell.rb +27 -0
  12. data/lib/omniauth-bancsabadell.rb +1 -0
  13. data/omniauth-bancsabadell.gemspec +19 -0
  14. data/test_app/.gitignore +18 -0
  15. data/test_app/Gemfile +50 -0
  16. data/test_app/Gemfile.lock +179 -0
  17. data/test_app/README.rdoc +28 -0
  18. data/test_app/Rakefile +6 -0
  19. data/test_app/app/assets/images/.keep +0 -0
  20. data/test_app/app/assets/javascripts/application.js +16 -0
  21. data/test_app/app/assets/stylesheets/application.css +15 -0
  22. data/test_app/app/controllers/application_controller.rb +5 -0
  23. data/test_app/app/controllers/concerns/.keep +0 -0
  24. data/test_app/app/controllers/home_controller.rb +2 -0
  25. data/test_app/app/controllers/omniauth_controller.rb +12 -0
  26. data/test_app/app/helpers/application_helper.rb +2 -0
  27. data/test_app/app/mailers/.keep +0 -0
  28. data/test_app/app/models/.keep +0 -0
  29. data/test_app/app/models/concerns/.keep +0 -0
  30. data/test_app/app/views/home/landing.html.slim +6 -0
  31. data/test_app/app/views/layouts/application.html.erb +14 -0
  32. data/test_app/bin/bundle +3 -0
  33. data/test_app/bin/rails +8 -0
  34. data/test_app/bin/rake +8 -0
  35. data/test_app/bin/spring +18 -0
  36. data/test_app/config/app_example.yml +4 -0
  37. data/test_app/config/application.rb +23 -0
  38. data/test_app/config/boot.rb +4 -0
  39. data/test_app/config/database.yml +25 -0
  40. data/test_app/config/environment.rb +8 -0
  41. data/test_app/config/environments/development.rb +37 -0
  42. data/test_app/config/environments/production.rb +78 -0
  43. data/test_app/config/environments/test.rb +39 -0
  44. data/test_app/config/initializers/assets.rb +8 -0
  45. data/test_app/config/initializers/backtrace_silencers.rb +7 -0
  46. data/test_app/config/initializers/cookies_serializer.rb +3 -0
  47. data/test_app/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/test_app/config/initializers/inflections.rb +16 -0
  49. data/test_app/config/initializers/mime_types.rb +4 -0
  50. data/test_app/config/initializers/omniauth.rb +7 -0
  51. data/test_app/config/initializers/session_store.rb +3 -0
  52. data/test_app/config/initializers/wrap_parameters.rb +14 -0
  53. data/test_app/config/locales/en.yml +23 -0
  54. data/test_app/config/routes.rb +5 -0
  55. data/test_app/config/secrets.yml +22 -0
  56. data/test_app/config.ru +4 -0
  57. data/test_app/db/seeds.rb +7 -0
  58. data/test_app/lib/assets/.keep +0 -0
  59. data/test_app/lib/tasks/.keep +0 -0
  60. data/test_app/log/.keep +0 -0
  61. data/test_app/public/404.html +67 -0
  62. data/test_app/public/422.html +67 -0
  63. data/test_app/public/500.html +66 -0
  64. data/test_app/public/favicon.ico +0 -0
  65. data/test_app/public/robots.txt +5 -0
  66. data/test_app/test/controllers/.keep +0 -0
  67. data/test_app/test/fixtures/.keep +0 -0
  68. data/test_app/test/helpers/.keep +0 -0
  69. data/test_app/test/integration/.keep +0 -0
  70. data/test_app/test/mailers/.keep +0 -0
  71. data/test_app/test/models/.keep +0 -0
  72. data/test_app/test/test_helper.rb +10 -0
  73. data/test_app/vendor/assets/javascripts/.keep +0 -0
  74. data/test_app/vendor/assets/stylesheets/.keep +0 -0
  75. metadata +131 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ee1614508c03d7dd4c763a4561e9c2ea74f4bc9b
4
+ data.tar.gz: d8f802d6671854e15f33e92ecb49f1bbf9865d31
5
+ SHA512:
6
+ metadata.gz: cfbd3b3e276b2784140a161747b0e4694c00856a19fc051c83330b129baaadfd273d6735e9fc2fe4b320de02d66f49cb2685d3e3de4f5782595442d33056cec1
7
+ data.tar.gz: 8cc5201205d03a022b74270908e7cea37dc7e988a891ae6de7b4371bdee54b856f07681522e4639c8ea15b1d1708e4238463ddefd6f36155f6b907ffa024e7ae
data/.DS_Store ADDED
Binary file
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # 0.1.0 (11/10/2014)
2
+
3
+ - First version of the gem
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,37 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-bancsabadell (0.1.0)
5
+ omniauth-oauth2 (~> 1.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ faraday (0.9.0)
11
+ multipart-post (>= 1.2, < 3)
12
+ hashie (3.3.1)
13
+ jwt (1.0.0)
14
+ multi_json (1.10.1)
15
+ multi_xml (0.5.5)
16
+ multipart-post (2.0.0)
17
+ oauth2 (1.0.0)
18
+ faraday (>= 0.8, < 0.10)
19
+ jwt (~> 1.0)
20
+ multi_json (~> 1.3)
21
+ multi_xml (~> 0.5)
22
+ rack (~> 1.2)
23
+ omniauth (1.2.2)
24
+ hashie (>= 1.2, < 4)
25
+ rack (~> 1.0)
26
+ omniauth-oauth2 (1.2.0)
27
+ faraday (>= 0.8, < 0.10)
28
+ multi_json (~> 1.3)
29
+ oauth2 (~> 1.0)
30
+ omniauth (~> 1.2)
31
+ rack (1.5.2)
32
+
33
+ PLATFORMS
34
+ ruby
35
+
36
+ DEPENDENCIES
37
+ omniauth-bancsabadell!
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ ---
2
+
3
+ # OmniAuth BancSabadell
4
+
5
+ Facebook OAuth2 Strategy for BancSabadell.
6
+
7
+ ## Installing
8
+
9
+ Add to your `Gemfile`:
10
+
11
+ ```ruby
12
+ gem 'omniauth-bancsabadell'
13
+ ```
14
+
15
+ Then `bundle install`.
16
+
17
+ ## Usage
18
+
19
+ `OmniAuth::Strategies::Bancsabadell` is a middleware. You can read more
20
+ info here: https://github.com/intridea/omniauth.
21
+
22
+ An example would be placing this inside `config/initializers/omniauth.rb`:
23
+
24
+ ```ruby
25
+ Rails.application.config.middleware.use OmniAuth::Builder do
26
+ provider :bancsabadell, ENV['BANC_SABADELL_KEY'], ENV['BANC_SABADELL_SECRET']
27
+ end
28
+ ```
29
+
30
+ Once receiving the callback from BancSabadell, you can get the token by simply doing:
31
+ ```ruby
32
+ class OmniAuthController < ApplicationController
33
+ def bancsabadell
34
+ token = request.env["omniauth.auth"].credentials.token
35
+
36
+ ...
37
+ end
38
+ end
39
+ ```
40
+
41
+ ## Test app
42
+
43
+ You have a super basic test app in test_app/ in order to see how to use it in Rails.
data/lib/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Bancsabadell
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require 'omniauth/bancsabadell/version'
2
+ require 'omniauth/strategies/bancsabadell'
@@ -0,0 +1,27 @@
1
+ require 'omniauth/strategies/oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Bancsabadell < OmniAuth::Strategies::OAuth2
6
+ API_BS_HOST = 'https://developers.bancsabadell.com'
7
+
8
+ option :client_options, {
9
+ site: 'https://developers.bancsabadell.com',
10
+ authorize_url: 'https://developers.bancsabadell.com/AuthServerBS/oauth/authorize',
11
+ token_url: 'https://developers.bancsabadell.com/AuthServerBS/oauth/token'
12
+ }
13
+
14
+ def request_phase
15
+ super
16
+ end
17
+
18
+ def authorize_params
19
+ super.merge({
20
+ response_type: :code,
21
+ client_id: options.client_id,
22
+ scope: "read write"
23
+ })
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1 @@
1
+ require 'omniauth/bancsabadell'
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'omniauth/bancsabadell/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'omniauth-bancsabadell'
7
+ s.version = OmniAuth::Bancsabadell::VERSION
8
+ s.authors = ['Albert Bellonch']
9
+ s.email = ['albert@getquipu.com']
10
+ s.summary = 'BancSabadell OAuth2 Strategy for OmniAuth'
11
+ s.homepage = 'https://getquipu.com'
12
+ s.license = 'MIT'
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
16
+ s.require_paths = ['lib']
17
+
18
+ s.add_runtime_dependency 'omniauth-oauth2', '~> 1.2'
19
+ end
@@ -0,0 +1,18 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
17
+
18
+ config/app.yml
data/test_app/Gemfile ADDED
@@ -0,0 +1,50 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.6'
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 4.0.3'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .js.coffee assets and views
13
+ gem 'coffee-rails', '~> 4.0.0'
14
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
25
+
26
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
27
+ gem 'spring', group: :development
28
+
29
+ # Use ActiveModel has_secure_password
30
+ # gem 'bcrypt', '~> 3.1.7'
31
+
32
+ # Use unicorn as the app server
33
+ # gem 'unicorn'
34
+
35
+ # Use Capistrano for deployment
36
+ # gem 'capistrano-rails', group: :development
37
+
38
+ # Use debugger
39
+ # gem 'debugger', group: [:development, :test]
40
+
41
+ gem 'thin'
42
+ gem 'slim-rails'
43
+
44
+ gem 'byebug'
45
+
46
+ gem 'omniauth'
47
+ gem 'omniauth-bancsabadell', path: '..'
48
+
49
+ gem 'quiet_assets'
50
+ gem 'better_errors'
@@ -0,0 +1,179 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ omniauth-bancsabadell (0.1.0)
5
+ omniauth-oauth2 (~> 1.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (4.1.6)
11
+ actionpack (= 4.1.6)
12
+ actionview (= 4.1.6)
13
+ mail (~> 2.5, >= 2.5.4)
14
+ actionpack (4.1.6)
15
+ actionview (= 4.1.6)
16
+ activesupport (= 4.1.6)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ actionview (4.1.6)
20
+ activesupport (= 4.1.6)
21
+ builder (~> 3.1)
22
+ erubis (~> 2.7.0)
23
+ activemodel (4.1.6)
24
+ activesupport (= 4.1.6)
25
+ builder (~> 3.1)
26
+ activerecord (4.1.6)
27
+ activemodel (= 4.1.6)
28
+ activesupport (= 4.1.6)
29
+ arel (~> 5.0.0)
30
+ activesupport (4.1.6)
31
+ i18n (~> 0.6, >= 0.6.9)
32
+ json (~> 1.7, >= 1.7.7)
33
+ minitest (~> 5.1)
34
+ thread_safe (~> 0.1)
35
+ tzinfo (~> 1.1)
36
+ arel (5.0.1.20140414130214)
37
+ better_errors (1.1.0)
38
+ coderay (>= 1.0.0)
39
+ erubis (>= 2.6.6)
40
+ builder (3.2.2)
41
+ byebug (3.1.2)
42
+ columnize (~> 0.8)
43
+ debugger-linecache (~> 1.2)
44
+ coderay (1.1.0)
45
+ coffee-rails (4.0.1)
46
+ coffee-script (>= 2.2.0)
47
+ railties (>= 4.0.0, < 5.0)
48
+ coffee-script (2.3.0)
49
+ coffee-script-source
50
+ execjs
51
+ coffee-script-source (1.8.0)
52
+ columnize (0.8.9)
53
+ daemons (1.1.8)
54
+ debugger-linecache (1.2.0)
55
+ erubis (2.7.0)
56
+ eventmachine (1.0.1)
57
+ execjs (2.2.1)
58
+ faraday (0.9.0)
59
+ multipart-post (>= 1.2, < 3)
60
+ hashie (3.3.1)
61
+ hike (1.2.3)
62
+ i18n (0.6.11)
63
+ jbuilder (2.2.2)
64
+ activesupport (>= 3.0.0, < 5)
65
+ multi_json (~> 1.2)
66
+ jquery-rails (3.1.2)
67
+ railties (>= 3.0, < 5.0)
68
+ thor (>= 0.14, < 2.0)
69
+ json (1.8.1)
70
+ jwt (1.0.0)
71
+ mail (2.6.1)
72
+ mime-types (>= 1.16, < 3)
73
+ mime-types (2.4.1)
74
+ minitest (5.4.2)
75
+ multi_json (1.10.1)
76
+ multi_xml (0.5.5)
77
+ multipart-post (2.0.0)
78
+ oauth2 (1.0.0)
79
+ faraday (>= 0.8, < 0.10)
80
+ jwt (~> 1.0)
81
+ multi_json (~> 1.3)
82
+ multi_xml (~> 0.5)
83
+ rack (~> 1.2)
84
+ omniauth (1.2.2)
85
+ hashie (>= 1.2, < 4)
86
+ rack (~> 1.0)
87
+ omniauth-oauth2 (1.2.0)
88
+ faraday (>= 0.8, < 0.10)
89
+ multi_json (~> 1.3)
90
+ oauth2 (~> 1.0)
91
+ omniauth (~> 1.2)
92
+ quiet_assets (1.0.2)
93
+ railties (>= 3.1, < 5.0)
94
+ rack (1.5.2)
95
+ rack-test (0.6.2)
96
+ rack (>= 1.0)
97
+ rails (4.1.6)
98
+ actionmailer (= 4.1.6)
99
+ actionpack (= 4.1.6)
100
+ actionview (= 4.1.6)
101
+ activemodel (= 4.1.6)
102
+ activerecord (= 4.1.6)
103
+ activesupport (= 4.1.6)
104
+ bundler (>= 1.3.0, < 2.0)
105
+ railties (= 4.1.6)
106
+ sprockets-rails (~> 2.0)
107
+ railties (4.1.6)
108
+ actionpack (= 4.1.6)
109
+ activesupport (= 4.1.6)
110
+ rake (>= 0.8.7)
111
+ thor (>= 0.18.1, < 2.0)
112
+ rake (10.3.2)
113
+ rdoc (4.1.2)
114
+ json (~> 1.4)
115
+ sass (3.2.19)
116
+ sass-rails (4.0.3)
117
+ railties (>= 4.0.0, < 5.0)
118
+ sass (~> 3.2.0)
119
+ sprockets (~> 2.8, <= 2.11.0)
120
+ sprockets-rails (~> 2.0)
121
+ sdoc (0.4.1)
122
+ json (~> 1.7, >= 1.7.7)
123
+ rdoc (~> 4.0)
124
+ slim (2.0.3)
125
+ temple (~> 0.6.6)
126
+ tilt (>= 1.3.3, < 2.1)
127
+ slim-rails (2.1.5)
128
+ actionpack (>= 3.0, < 4.2)
129
+ activesupport (>= 3.0, < 4.2)
130
+ railties (>= 3.0, < 4.2)
131
+ slim (~> 2.0)
132
+ spring (1.1.3)
133
+ sprockets (2.11.0)
134
+ hike (~> 1.2)
135
+ multi_json (~> 1.0)
136
+ rack (~> 1.0)
137
+ tilt (~> 1.1, != 1.3.0)
138
+ sprockets-rails (2.2.0)
139
+ actionpack (>= 3.0)
140
+ activesupport (>= 3.0)
141
+ sprockets (>= 2.8, < 4.0)
142
+ sqlite3 (1.3.9)
143
+ temple (0.6.8)
144
+ thin (1.6.3)
145
+ daemons (~> 1.0, >= 1.0.9)
146
+ eventmachine (~> 1.0)
147
+ rack (~> 1.0)
148
+ thor (0.19.1)
149
+ thread_safe (0.3.4)
150
+ tilt (1.4.1)
151
+ turbolinks (2.4.0)
152
+ coffee-rails
153
+ tzinfo (1.2.2)
154
+ thread_safe (~> 0.1)
155
+ uglifier (2.5.3)
156
+ execjs (>= 0.3.0)
157
+ json (>= 1.8.0)
158
+
159
+ PLATFORMS
160
+ ruby
161
+
162
+ DEPENDENCIES
163
+ better_errors
164
+ byebug
165
+ coffee-rails (~> 4.0.0)
166
+ jbuilder (~> 2.0)
167
+ jquery-rails
168
+ omniauth
169
+ omniauth-bancsabadell!
170
+ quiet_assets
171
+ rails (= 4.1.6)
172
+ sass-rails (~> 4.0.3)
173
+ sdoc (~> 0.4.0)
174
+ slim-rails
175
+ spring
176
+ sqlite3
177
+ thin
178
+ turbolinks
179
+ uglifier (>= 1.3.0)
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
data/test_app/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ class HomeController < ApplicationController
2
+ end
@@ -0,0 +1,12 @@
1
+ class OmniauthController < ApplicationController
2
+ def bancsabadell
3
+ puts "--------------------"
4
+ puts "Callback received. Getting the token..."
5
+ session[:token] = request.env["omniauth.auth"].credentials.token
6
+ puts "Token is #{session[:token]}. Try this:"
7
+ puts "https://developers.bancsabadell.com/ResourcesServerBS/oauthservices/v1.0.0/cuentasvista?access_token=#{session[:token]}"
8
+ puts "--------------------"
9
+
10
+ redirect_to root_path
11
+ end
12
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ h1 Hi there!
2
+
3
+ - if session[:token].present?
4
+ | You are logged in. YEAH, BITCH!
5
+ - else
6
+ = link_to 'Sign in with BancSabadell', '/auth/bancsabadell'
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>TestApp</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
7
+ require_relative '../config/boot'
8
+ require 'rails/commands'
data/test_app/bin/rake ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require_relative '../config/boot'
7
+ require 'rake'
8
+ Rake.application.run
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast
4
+ # It gets overwritten when you run the `spring binstub` command
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12
+ ENV["GEM_HOME"] = ""
13
+ Gem.paths = ENV
14
+
15
+ gem "spring", match[1]
16
+ require "spring/binstub"
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ development:
2
+ banc_sabadell:
3
+ client_id: ""
4
+ client_secret: ""
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module TestApp
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+ end
23
+ end
@@ -0,0 +1,4 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,8 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Load custom configuration
5
+ CUSTOM_CONFIG = YAML.load_file("#{Rails.root}/config/app.yml")[Rails.env]
6
+
7
+ # Initialize the Rails application.
8
+ Rails.application.initialize!