surbase 0.0.5

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 (77) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +70 -0
  6. data/Rakefile +1 -0
  7. data/lib/generators/surbase/install/install_generator.rb +70 -0
  8. data/lib/surbase.rb +137 -0
  9. data/lib/surbase/controller.rb +128 -0
  10. data/lib/surbase/model.rb +11 -0
  11. data/lib/surbase/version.rb +3 -0
  12. data/sample/surbase/.gitignore +19 -0
  13. data/sample/surbase/Gemfile +53 -0
  14. data/sample/surbase/README.rdoc +28 -0
  15. data/sample/surbase/Rakefile +6 -0
  16. data/sample/surbase/app/assets/images/.keep +0 -0
  17. data/sample/surbase/app/assets/javascripts/accounts.js.coffee +3 -0
  18. data/sample/surbase/app/assets/javascripts/application.js +16 -0
  19. data/sample/surbase/app/assets/stylesheets/accounts.css.scss +3 -0
  20. data/sample/surbase/app/assets/stylesheets/application.css +13 -0
  21. data/sample/surbase/app/controllers/accounts_controller.rb +3 -0
  22. data/sample/surbase/app/controllers/application_controller.rb +5 -0
  23. data/sample/surbase/app/controllers/concerns/.keep +0 -0
  24. data/sample/surbase/app/helpers/accounts_helper.rb +2 -0
  25. data/sample/surbase/app/helpers/application_helper.rb +2 -0
  26. data/sample/surbase/app/mailers/.keep +0 -0
  27. data/sample/surbase/app/models/.keep +0 -0
  28. data/sample/surbase/app/models/account.rb +2 -0
  29. data/sample/surbase/app/models/concerns/.keep +0 -0
  30. data/sample/surbase/app/models/provider_account.rb +2 -0
  31. data/sample/surbase/app/views/layouts/application.html.erb +14 -0
  32. data/sample/surbase/bin/bundle +3 -0
  33. data/sample/surbase/bin/rails +4 -0
  34. data/sample/surbase/bin/rake +4 -0
  35. data/sample/surbase/config.ru +4 -0
  36. data/sample/surbase/config/application.rb +23 -0
  37. data/sample/surbase/config/boot.rb +4 -0
  38. data/sample/surbase/config/environment.rb +5 -0
  39. data/sample/surbase/config/environments/development.rb +29 -0
  40. data/sample/surbase/config/environments/production.rb +80 -0
  41. data/sample/surbase/config/environments/test.rb +36 -0
  42. data/sample/surbase/config/initializers/backtrace_silencers.rb +7 -0
  43. data/sample/surbase/config/initializers/filter_parameter_logging.rb +4 -0
  44. data/sample/surbase/config/initializers/inflections.rb +16 -0
  45. data/sample/surbase/config/initializers/mime_types.rb +5 -0
  46. data/sample/surbase/config/initializers/secret_token.rb +12 -0
  47. data/sample/surbase/config/initializers/session_store.rb +3 -0
  48. data/sample/surbase/config/initializers/surbase.rb +7 -0
  49. data/sample/surbase/config/initializers/wrap_parameters.rb +14 -0
  50. data/sample/surbase/config/routes.rb +59 -0
  51. data/sample/surbase/db/migrate/20150312144839_create_accounts.rb +10 -0
  52. data/sample/surbase/db/migrate/20150313172400_create_provider_accounts.rb +12 -0
  53. data/sample/surbase/db/schema.rb +35 -0
  54. data/sample/surbase/db/seeds.rb +7 -0
  55. data/sample/surbase/lib/assets/.keep +0 -0
  56. data/sample/surbase/lib/tasks/.keep +0 -0
  57. data/sample/surbase/log/.keep +0 -0
  58. data/sample/surbase/public/404.html +58 -0
  59. data/sample/surbase/public/422.html +58 -0
  60. data/sample/surbase/public/500.html +57 -0
  61. data/sample/surbase/public/favicon.ico +0 -0
  62. data/sample/surbase/public/robots.txt +5 -0
  63. data/sample/surbase/test/controllers/.keep +0 -0
  64. data/sample/surbase/test/controllers/accounts_controller_test.rb +7 -0
  65. data/sample/surbase/test/fixtures/.keep +0 -0
  66. data/sample/surbase/test/helpers/.keep +0 -0
  67. data/sample/surbase/test/helpers/accounts_helper_test.rb +4 -0
  68. data/sample/surbase/test/integration/.keep +0 -0
  69. data/sample/surbase/test/mailers/.keep +0 -0
  70. data/sample/surbase/test/models/.keep +0 -0
  71. data/sample/surbase/test/models/account_test.rb +7 -0
  72. data/sample/surbase/test/models/provider_account_test.rb +7 -0
  73. data/sample/surbase/test/test_helper.rb +15 -0
  74. data/sample/surbase/vendor/assets/javascripts/.keep +0 -0
  75. data/sample/surbase/vendor/assets/stylesheets/.keep +0 -0
  76. data/surbase.gemspec +23 -0
  77. metadata +147 -0
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Surbase::Application.config.secret_key_base = 'ac95d8935186b16df8ffc8d0cbad059f895fc7893729577e709ca2416b238f1abb6e6d8a24dc8b441f7ab1d0dc52c3f363770f705fdc2eee4a647d6ea864510f'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Surbase::Application.config.session_store :cookie_store, key: '_surbase_session'
@@ -0,0 +1,7 @@
1
+ Surbase::Config.setup do
2
+ prefix ""
3
+
4
+ provider :twitter
5
+ provider :facebook
6
+ provider :github
7
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,59 @@
1
+ Surbase::Application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
+
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
10
+
11
+ get "login/:provider" => "accounts#login"
12
+ get "auth/:provider/callback" => "accounts#auth_callback"
13
+
14
+ # Example of named route that can be invoked with purchase_url(id: product.id)
15
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
16
+
17
+ # Example resource route (maps HTTP verbs to controller actions automatically):
18
+ # resources :products
19
+
20
+ # Example resource route with options:
21
+ # resources :products do
22
+ # member do
23
+ # get 'short'
24
+ # post 'toggle'
25
+ # end
26
+ #
27
+ # collection do
28
+ # get 'sold'
29
+ # end
30
+ # end
31
+
32
+ # Example resource route with sub-resources:
33
+ # resources :products do
34
+ # resources :comments, :sales
35
+ # resource :seller
36
+ # end
37
+
38
+ # Example resource route with more complex sub-resources:
39
+ # resources :products do
40
+ # resources :comments
41
+ # resources :sales do
42
+ # get 'recent', on: :collection
43
+ # end
44
+ # end
45
+
46
+ # Example resource route with concerns:
47
+ # concern :toggleable do
48
+ # post 'toggle'
49
+ # end
50
+ # resources :posts, concerns: :toggleable
51
+ # resources :photos, concerns: :toggleable
52
+
53
+ # Example resource route within a namespace:
54
+ # namespace :admin do
55
+ # # Directs /admin/products/* to Admin::ProductsController
56
+ # # (app/controllers/admin/products_controller.rb)
57
+ # resources :products
58
+ # end
59
+ end
@@ -0,0 +1,10 @@
1
+ class CreateAccounts < ActiveRecord::Migration
2
+ def change
3
+ create_table :accounts do |t|
4
+ t.string :provider_id
5
+ t.string :login_key
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ class CreateProviderAccounts < ActiveRecord::Migration
2
+ def change
3
+ create_table :provider_accounts do |t|
4
+ t.integer :account_id
5
+ t.string :name
6
+ t.string :icon
7
+ t.string :encrypted_access_token
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,35 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150313172400) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "accounts", force: true do |t|
20
+ t.string "provider_id"
21
+ t.string "login_key"
22
+ t.datetime "created_at"
23
+ t.datetime "updated_at"
24
+ end
25
+
26
+ create_table "provider_accounts", force: true do |t|
27
+ t.integer "account_id"
28
+ t.string "name"
29
+ t.string "icon"
30
+ t.string "encrypted_access_token"
31
+ t.datetime "created_at"
32
+ t.datetime "updated_at"
33
+ end
34
+
35
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
File without changes
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
File without changes
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class AccountsControllerTest < ActionController::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
File without changes
File without changes
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class AccountsHelperTest < ActionView::TestCase
4
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class AccountTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class ProviderAccountTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,15 @@
1
+ ENV["RAILS_ENV"] ||= "test"
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ ActiveRecord::Migration.check_pending!
7
+
8
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
9
+ #
10
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
11
+ # -- they do not yet inherit this setting
12
+ fixtures :all
13
+
14
+ # Add more helper methods to be used by all tests here...
15
+ end