dailycred 0.1.29 → 0.1.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +10 -2
  3. data/Guardfile +15 -0
  4. data/dailycred.gemspec +1 -1
  5. data/lib/generators/dailycred_generator.rb +85 -54
  6. data/lib/generators/templates/info.html.erb +1 -1
  7. data/lib/generators/templates/migration_create_user.rb +54 -14
  8. data/lib/generators/templates/omniauth.rb +1 -5
  9. data/lib/generators/templates/sessions_controller.rb +3 -3
  10. data/lib/generators/templates/user.rb +5 -1
  11. data/spec/support/dailycred_spec.rb +1 -0
  12. data/test/generator_test.rb +116 -0
  13. data/test/test_helper.rb +6 -0
  14. metadata +7 -59
  15. data/lib/generators/test.rb +0 -17
  16. data/localtest/.gitignore +0 -15
  17. data/localtest/Gemfile +0 -39
  18. data/localtest/README.rdoc +0 -261
  19. data/localtest/Rakefile +0 -7
  20. data/localtest/app/assets/images/rails.png +0 -0
  21. data/localtest/app/assets/javascripts/application.js +0 -15
  22. data/localtest/app/assets/stylesheets/application.css +0 -13
  23. data/localtest/app/controllers/application_controller.rb +0 -42
  24. data/localtest/app/controllers/sessions_controller.rb +0 -27
  25. data/localtest/app/helpers/application_helper.rb +0 -2
  26. data/localtest/app/mailers/.gitkeep +0 -0
  27. data/localtest/app/models/.gitkeep +0 -0
  28. data/localtest/app/models/user.rb +0 -14
  29. data/localtest/app/views/layouts/application.html.erb +0 -14
  30. data/localtest/app/views/sessions/info +0 -9
  31. data/localtest/config/application.rb +0 -62
  32. data/localtest/config/boot.rb +0 -6
  33. data/localtest/config/database.yml +0 -25
  34. data/localtest/config/environment.rb +0 -5
  35. data/localtest/config/environments/development.rb +0 -37
  36. data/localtest/config/environments/production.rb +0 -67
  37. data/localtest/config/environments/test.rb +0 -37
  38. data/localtest/config/initializers/backtrace_silencers.rb +0 -7
  39. data/localtest/config/initializers/inflections.rb +0 -15
  40. data/localtest/config/initializers/mime_types.rb +0 -5
  41. data/localtest/config/initializers/omniauth.rb +0 -20
  42. data/localtest/config/initializers/secret_token.rb +0 -7
  43. data/localtest/config/initializers/session_store.rb +0 -8
  44. data/localtest/config/initializers/wrap_parameters.rb +0 -14
  45. data/localtest/config/locales/en.yml +0 -5
  46. data/localtest/config/routes.rb +0 -61
  47. data/localtest/config.ru +0 -4
  48. data/localtest/db/migrate/20120906153457_create_users.rb +0 -21
  49. data/localtest/db/migrate/20120906234358_alter_column_from_users.rb +0 -6
  50. data/localtest/db/migrate/20120907004912_add_column_to_users.rb +0 -5
  51. data/localtest/db/migrate/20120907014514_add_tags_to_users.rb +0 -6
  52. data/localtest/db/schema.rb +0 -33
  53. data/localtest/db/seeds.rb +0 -7
  54. data/localtest/lib/assets/.gitkeep +0 -0
  55. data/localtest/lib/tasks/.gitkeep +0 -0
  56. data/localtest/log/.gitkeep +0 -0
  57. data/localtest/public/404.html +0 -26
  58. data/localtest/public/422.html +0 -26
  59. data/localtest/public/500.html +0 -25
  60. data/localtest/public/favicon.ico +0 -0
  61. data/localtest/public/robots.txt +0 -5
  62. data/localtest/script/rails +0 -6
  63. data/localtest/test/fixtures/.gitkeep +0 -0
  64. data/localtest/test/functional/.gitkeep +0 -0
  65. data/localtest/test/integration/.gitkeep +0 -0
  66. data/localtest/test/performance/browsing_test.rb +0 -12
  67. data/localtest/test/test_helper.rb +0 -13
  68. data/localtest/test/unit/.gitkeep +0 -0
  69. data/localtest/vendor/assets/javascripts/.gitkeep +0 -0
  70. data/localtest/vendor/assets/stylesheets/.gitkeep +0 -0
  71. data/localtest/vendor/plugins/.gitkeep +0 -0
@@ -1,37 +0,0 @@
1
- Localtest::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
13
-
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
-
17
- # Show full error reports and disable caching
18
- config.consider_all_requests_local = true
19
- config.action_controller.perform_caching = false
20
-
21
- # Raise exceptions instead of rendering exception templates
22
- config.action_dispatch.show_exceptions = false
23
-
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
-
27
- # Tell Action Mailer not to deliver emails to the real world.
28
- # The :test delivery method accumulates sent emails in the
29
- # ActionMailer::Base.deliveries array.
30
- config.action_mailer.delivery_method = :test
31
-
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
- # Print deprecation notices to the stderr
36
- config.active_support.deprecation = :stderr
37
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
11
- #
12
- # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
- # inflect.acronym 'RESTful'
15
- # end
@@ -1,5 +0,0 @@
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
@@ -1,20 +0,0 @@
1
- Rails.configuration.DAILYCRED_CLIENT_ID = "a9dbdd59-585b-4f60-81b9-e1ee6d333ec9"
2
- Rails.configuration.DAILYCRED_SECRET_KEY = "08d7800d-2d7c-4338-87de-4eed77d1c9b2-9f367fe8-4e39-4edc-a8c7-1e759f657185"
3
-
4
- dc_id = Rails.configuration.DAILYCRED_CLIENT_ID
5
- dc_secret = Rails.configuration.DAILYCRED_SECRET_KEY
6
-
7
- dc_options = { :client_options => {:site => "http://localhost:9000"} }
8
-
9
- if File.exists?('/etc/ssl/certs')
10
- dc_options[:client_options][:ssl] = { :ca_path => '/etc/ssl/certs'}
11
- end
12
- if File.exists?('/opt/local/share/curl/curl-ca-bundle.crt')
13
- dc_options[:client_options][:ssl] = { :ca_file => '/opt/local/share/curl/curl-ca-bundle.crt' }
14
- end
15
-
16
- Rails.application.config.middleware.use OmniAuth::Builder do
17
- provider :dailycred, dc_id, dc_secret, dc_options
18
- end
19
-
20
- Rails.application.config.middleware.use "Dailycred::Middleware", dc_id, :url => "http://localhost:9000"
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- Localtest::Application.config.secret_token = 'b47ec21b5e8c6d0da7f7a4aaf6c37d11658fe996ea6ef61ea73fb6b7d085920eb296311f6c33b9eb2c67979cd7690b56ce0129e14f8e6b7d77ee3ccc2b1a7eaf'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Localtest::Application.config.session_store :cookie_store, key: '_localtest_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Localtest::Application.config.session_store :active_record_store
@@ -1,14 +0,0 @@
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]
9
- end
10
-
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,61 +0,0 @@
1
- Localtest::Application.routes.draw do
2
- match '/auth/:provider/callback' => 'sessions#create'
3
- match "/logout" => "sessions#destroy", :as => :logout
4
- match "/auth" => "sessions#info", :as => :auth
5
- # The priority is based upon order of creation:
6
- # first created -> highest priority.
7
-
8
- # Sample of regular route:
9
- # match 'products/:id' => 'catalog#view'
10
- # Keep in mind you can assign values other than :controller and :action
11
-
12
- # Sample of named route:
13
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
14
- # This route can be invoked with purchase_url(:id => product.id)
15
-
16
- # Sample resource route (maps HTTP verbs to controller actions automatically):
17
- # resources :products
18
-
19
- # Sample resource route with options:
20
- # resources :products do
21
- # member do
22
- # get 'short'
23
- # post 'toggle'
24
- # end
25
- #
26
- # collection do
27
- # get 'sold'
28
- # end
29
- # end
30
-
31
- # Sample resource route with sub-resources:
32
- # resources :products do
33
- # resources :comments, :sales
34
- # resource :seller
35
- # end
36
-
37
- # Sample resource route with more complex sub-resources
38
- # resources :products do
39
- # resources :comments
40
- # resources :sales do
41
- # get 'recent', :on => :collection
42
- # end
43
- # end
44
-
45
- # Sample resource route within a namespace:
46
- # namespace :admin do
47
- # # Directs /admin/products/* to Admin::ProductsController
48
- # # (app/controllers/admin/products_controller.rb)
49
- # resources :products
50
- # end
51
-
52
- # You can have the root of your site routed with "root"
53
- # just remember to delete public/index.html.
54
- root :to => 'sessions#info'
55
-
56
- # See how all your routes lay out with "rake routes"
57
-
58
- # This is a legacy wild controller route that's not recommended for RESTful applications.
59
- # Note: This route will make all actions in every controller accessible via GET requests.
60
- # match ':controller(/:action(/:id))(.:format)'
61
- end
data/localtest/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Localtest::Application
@@ -1,21 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration
2
- def self.up
3
- create_table :users do |t|
4
- t.string :provider, null: false
5
- t.string :uid, null: false
6
- t.string :email, null: false, uniq: true
7
- t.integer :created, :limit => 8
8
- t.string :username
9
- t.boolean :verified
10
- t.boolean :admin
11
- t.string :referred_by
12
- t.string :token
13
-
14
- t.timestamps
15
- end
16
- end
17
-
18
- def self.down
19
- drop_table :users
20
- end
21
- end
@@ -1,6 +0,0 @@
1
- class AlterColumnFromUsers < ActiveRecord::Migration
2
- def up
3
- remove_column :users, :email
4
- add_column :users, :email, :string
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- class AddColumnToUsers < ActiveRecord::Migration
2
- def change
3
- add_column :users, :facebook, :text
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- class AddTagsToUsers < ActiveRecord::Migration
2
- def change
3
- add_column :users, :tags, :text
4
- add_column :users, :referred, :text
5
- end
6
- end
@@ -1,33 +0,0 @@
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 to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 20120907014514) do
15
-
16
- create_table "users", :force => true do |t|
17
- t.string "provider", :null => false
18
- t.string "uid", :null => false
19
- t.integer "created", :limit => 8
20
- t.string "username"
21
- t.boolean "verified"
22
- t.boolean "admin"
23
- t.string "referred_by"
24
- t.string "token"
25
- t.datetime "created_at", :null => false
26
- t.datetime "updated_at", :null => false
27
- t.string "email"
28
- t.text "facebook"
29
- t.text "tags"
30
- t.text "referred"
31
- end
32
-
33
- end
@@ -1,7 +0,0 @@
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
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
File without changes
@@ -1,5 +0,0 @@
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: /
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
File without changes
File without changes
File without changes
@@ -1,12 +0,0 @@
1
- require 'test_helper'
2
- require 'rails/performance_test_help'
3
-
4
- class BrowsingTest < ActionDispatch::PerformanceTest
5
- # Refer to the documentation for all available options
6
- # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
7
- # :output => 'tmp/performance', :formats => [:flat] }
8
-
9
- def test_homepage
10
- get '/'
11
- end
12
- end
@@ -1,13 +0,0 @@
1
- ENV["RAILS_ENV"] = "test"
2
- require File.expand_path('../../config/environment', __FILE__)
3
- require 'rails/test_help'
4
-
5
- class ActiveSupport::TestCase
6
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
7
- #
8
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
9
- # -- they do not yet inherit this setting
10
- fixtures :all
11
-
12
- # Add more helper methods to be used by all tests here...
13
- end
File without changes
File without changes
File without changes
File without changes