dailycred 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +7 -1
  4. data/dailycred.gemspec +2 -2
  5. data/dummy/.gitignore +3 -2
  6. data/dummy/Gemfile +14 -29
  7. data/dummy/README.rdoc +15 -248
  8. data/dummy/Rakefile +0 -1
  9. data/dummy/app/assets/javascripts/application.js +2 -1
  10. data/dummy/app/controllers/application_controller.rb +3 -14
  11. data/dummy/app/views/layouts/application.html.erb +2 -6
  12. data/dummy/bin/bundle +3 -0
  13. data/dummy/bin/rails +4 -0
  14. data/dummy/bin/rake +4 -0
  15. data/dummy/config/application.rb +2 -42
  16. data/dummy/config/boot.rb +0 -2
  17. data/dummy/config/environment.rb +2 -2
  18. data/dummy/config/environments/development.rb +9 -19
  19. data/dummy/config/environments/production.rb +40 -27
  20. data/dummy/config/environments/test.rb +12 -13
  21. data/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  22. data/dummy/config/initializers/inflections.rb +6 -5
  23. data/dummy/config/initializers/omniauth.rb +8 -4
  24. data/dummy/config/initializers/secret_token.rb +6 -1
  25. data/dummy/config/initializers/session_store.rb +1 -6
  26. data/dummy/config/initializers/wrap_parameters.rb +6 -6
  27. data/dummy/config/locales/en.yml +20 -2
  28. data/dummy/config/routes.rb +15 -26
  29. data/dummy/db/migrate/{20121218124721_create_users.rb → 20130417131939_create_users.rb} +2 -2
  30. data/dummy/db/schema.rb +8 -20
  31. data/dummy/public/404.html +2 -1
  32. data/dummy/public/422.html +1 -1
  33. data/dummy/public/500.html +2 -1
  34. data/dummy/public/robots.txt +1 -1
  35. data/dummy/test/models/.keep +0 -0
  36. data/dummy/test/test_helper.rb +11 -58
  37. data/dummy/vendor/assets/javascripts/.keep +0 -0
  38. data/dummy/vendor/assets/stylesheets/.keep +0 -0
  39. data/lib/dailycred/client.rb +1 -0
  40. data/lib/dailycred/version.rb +1 -1
  41. data/lib/dailycred.rb +0 -1
  42. data/spec/helper_spec.rb +0 -2
  43. metadata +24 -44
  44. data/dummy/Guardfile +0 -31
  45. data/dummy/app/assets/javascripts/posts.js.coffee +0 -3
  46. data/dummy/app/assets/stylesheets/posts.css.scss +0 -3
  47. data/dummy/app/assets/stylesheets/scaffolds.css.scss +0 -69
  48. data/dummy/app/controllers/posts_controller.rb +0 -86
  49. data/dummy/app/helpers/posts_helper.rb +0 -2
  50. data/dummy/app/models/post.rb +0 -3
  51. data/dummy/app/views/posts/_form.html.erb +0 -21
  52. data/dummy/app/views/posts/edit.html.erb +0 -6
  53. data/dummy/app/views/posts/index.html.erb +0 -23
  54. data/dummy/app/views/posts/new.html.erb +0 -5
  55. data/dummy/app/views/posts/show.html.erb +0 -10
  56. data/dummy/db/migrate/20120926012555_create_posts.rb +0 -9
  57. data/dummy/db/migrate/20121002192037_update_users_2.rb +0 -70
  58. data/dummy/db/migrate/20121108192739_add_column_to_posts.rb +0 -5
  59. data/dummy/db/migrate/20121218205329_change_created_column.rb +0 -5
  60. data/dummy/script/rails +0 -6
  61. data/dummy/test/fixtures/posts.yml +0 -7
  62. data/dummy/test/fixtures/users.yml +0 -3
  63. data/dummy/test/functional/posts_controller_test.rb +0 -51
  64. data/dummy/test/performance/browsing_test.rb +0 -12
  65. data/dummy/test/unit/helpers/posts_helper_test.rb +0 -4
  66. data/dummy/test/unit/post_test.rb +0 -7
  67. data/dummy/test/unit/user_test.rb +0 -77
  68. data/lib/omniauth/strategies/dailycred.rb +0 -81
  69. data/spec/omniauth/strategies/dailycred_spec.rb +0 -70
  70. /data/dummy/app/{mailers/.gitkeep → controllers/concerns/.keep} +0 -0
  71. /data/dummy/app/{models/.gitkeep → mailers/.keep} +0 -0
  72. /data/dummy/{lib/assets/.gitkeep → app/models/.keep} +0 -0
  73. /data/dummy/{lib/tasks/.gitkeep → app/models/concerns/.keep} +0 -0
  74. /data/dummy/{log/.gitkeep → lib/assets/.keep} +0 -0
  75. /data/dummy/{test/fixtures/.gitkeep → lib/tasks/.keep} +0 -0
  76. /data/dummy/{test/functional/.gitkeep → log/.keep} +0 -0
  77. /data/dummy/test/{integration/.gitkeep → controllers/.keep} +0 -0
  78. /data/dummy/test/{unit/.gitkeep → fixtures/.keep} +0 -0
  79. /data/dummy/{vendor/assets/javascripts/.gitkeep → test/helpers/.keep} +0 -0
  80. /data/dummy/{vendor/assets/stylesheets/.gitkeep → test/integration/.keep} +0 -0
  81. /data/dummy/{vendor/plugins/.gitkeep → test/mailers/.keep} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: 6cd53d8b942f48d6610882d52285a7893313eba1
4
- data.tar.gz: d64798b518610785c809d68ce984d5b1c1239238
3
+ metadata.gz: 701140478fbe6d7d5357fe5e4728d4c14e2cded6
4
+ data.tar.gz: e65c608925f7ce9eabfc8d6b84707c66da0b6069
5
5
  !binary "U0hBNTEy":
6
- metadata.gz: 5ee2c06b2773c5e277ac823a73e53afe6c360f7445c2cbcd39293960e381156aa00e09483f4384e32e7951123036248f2f9091d8cdf857882c9bae60aa02fc23
7
- data.tar.gz: ef66edae02677497ea2d0058ddf234f3e3e08513cdebb9533328ebce21e852ea6c1dd1481a8f3fdf0bc2ae7469b53254290291b687db4d61f0d6ba3344892d53
6
+ metadata.gz: 6b01db9cdc09eab1fa11c1500c76594091252e12510f57c9b3c8c55eab8f121f4e10aac5027954022bd0747bf7bb2a6db160026dcc1a2f96ae65b931c24f32c2
7
+ data.tar.gz: 0ce7ccde2c980d594d6fae6da73c9fd2f8ce4b387c4fc9595b83d1efc6a5b8c962d675fa64d9990074f136b0d03457476d3205d2acf26d22a21aef21161ac923
data/Gemfile CHANGED
@@ -1,7 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
4
  gem 'rspec'
6
5
  gem 'rails', '~> 3.2.12'
7
6
  gem 'simplecov'
@@ -16,3 +15,4 @@ gem 'fl-rocco'
16
15
  gem 'redcarpet', '~> 1.17'
17
16
  gem 'markdown'
18
17
  gem 'maruku'
18
+ gem 'faraday'
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## Ruby on Rails
2
2
 
3
- The Dailycred ruby gem is everything you need to get off the ground running with robust authentication. It includes an [omniauth](https://github.com/intridea/omniauth) provider and a generator to create necessary models and controllers. The generated authentication structure is inspired by [nifty-generators](https://github.com/ryanb/nifty-generators). To get started using Dailycred with Ruby on Rails, the first thing you need to do is add the dailycred gem to your gemfile:
3
+ The Dailycred ruby gem is everything you need to get off the ground running with robust authentication. It includes an [omniauth](https://github.com/intridea/omniauth) provider and a generator to create necessary models and controllers. The generated authentication structure is inspired by [nifty-generators](https://github.com/ryanb/nifty-generators).
4
+
5
+ If you'd rather only communicate with Dailycred through OAuth and provide your own authentication controllers and models, you can use the [omniauth_dailycred](https://github.com/dailycred/omniauth_dailycred) gem.
6
+
7
+ ##Installation
8
+
9
+ To get started using Dailycred with Ruby on Rails, the first thing you need to do is add the dailycred gem to your gemfile:
4
10
 
5
11
  gem 'dailycred'
6
12
 
data/dailycred.gemspec CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |gem|
7
7
  gem.description = %q{A Ruby on Rails engine for authentication with Dailycred.}
8
8
  gem.summary = %q{}
9
9
  gem.homepage = "https://www.dailycred.com"
10
- gem.add_dependency("omniauth")
11
- gem.add_dependency("omniauth-oauth2")
10
+ gem.add_dependency("omniauth_dailycred")
11
+ gem.add_dependency("faraday")
12
12
 
13
13
 
14
14
  gem.files = `git ls-files`.split("\n")
data/dummy/.gitignore CHANGED
@@ -2,13 +2,14 @@
2
2
  #
3
3
  # If you find yourself ignoring temporary files generated by your text editor
4
4
  # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile ~/.gitignore_global
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
6
 
7
- # Ignore bundler config
7
+ # Ignore bundler config.
8
8
  /.bundle
9
9
 
10
10
  # Ignore the default SQLite database.
11
11
  /db/*.sqlite3
12
+ /db/*.sqlite3-journal
12
13
 
13
14
  # Ignore all logfiles and tempfiles.
14
15
  /log/*.log
data/dummy/Gemfile CHANGED
@@ -1,55 +1,40 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '3.2.8'
4
-
5
- # Bundle edge Rails instead:
6
- # gem 'rails', :git => 'git://github.com/rails/rails.git'
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.0.beta1'
7
5
 
8
6
  gem 'sqlite3'
9
- gem 'dailycred', :path => '../'
10
- gem 'awesome_print'
11
-
7
+ gem 'omniauth_dailycred', path: '../../omniauth_dailycred'
8
+ gem 'dailycred', path: '../'
12
9
 
13
10
  # Gems used only for assets and not required
14
11
  # in production environments by default.
15
12
  group :assets do
16
- gem 'sass-rails', '~> 3.2.3'
17
- gem 'coffee-rails', '~> 3.2.1'
13
+ gem 'sass-rails', '~> 4.0.0.beta1'
14
+ gem 'coffee-rails', '~> 4.0.0.beta1'
18
15
 
19
16
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
20
- # gem 'therubyracer', :platforms => :ruby
17
+ # gem 'therubyracer', platforms: :ruby
21
18
 
22
19
  gem 'uglifier', '>= 1.0.3'
23
20
  end
24
21
 
25
22
  gem 'jquery-rails'
26
- gem 'factory_girl'
27
-
28
- gem 'quiet_assets', :group => :development
29
-
30
- group :test, :development do
31
- gem 'guard-test'
32
- gem 'rb-fsevent', '~> 0.9.1'
33
- gem 'guard'
34
- gem 'growl'
35
- gem 'guard-spork'
36
- gem 'ruby_gntp'
37
- gem 'spork-rails'
38
- gem 'spork-testunit'
39
- gem 'mocha'
40
- end
23
+
24
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
25
+ gem 'turbolinks'
26
+
27
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
28
+ gem 'jbuilder', '~> 1.0.1'
41
29
 
42
30
  # To use ActiveModel has_secure_password
43
31
  # gem 'bcrypt-ruby', '~> 3.0.0'
44
32
 
45
- # To use Jbuilder templates for JSON
46
- # gem 'jbuilder'
47
-
48
33
  # Use unicorn as the app server
49
34
  # gem 'unicorn'
50
35
 
51
36
  # Deploy with Capistrano
52
- # gem 'capistrano'
37
+ # gem 'capistrano', group: :development
53
38
 
54
39
  # To use debugger
55
40
  # gem 'debugger'
data/dummy/README.rdoc CHANGED
@@ -1,261 +1,28 @@
1
- == Welcome to Rails
1
+ == README
2
2
 
3
- Rails is a web-application framework that includes everything needed to create
4
- database-backed web applications according to the Model-View-Control pattern.
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
5
 
6
- This pattern splits the view (also called the presentation) into "dumb"
7
- templates that are primarily responsible for inserting pre-built data in between
8
- HTML tags. The model contains the "smart" domain objects (such as Account,
9
- Product, Person, Post) that holds all the business logic and knows how to
10
- persist themselves to a database. The controller handles the incoming requests
11
- (such as Save New Account, Update Product, Show Post) by manipulating the model
12
- and directing data to the view.
6
+ Things you may want to cover:
13
7
 
14
- In Rails, the model is handled by what's called an object-relational mapping
15
- layer entitled Active Record. This layer allows you to present the data from
16
- database rows as objects and embellish these data objects with business logic
17
- methods. You can read more about Active Record in
18
- link:files/vendor/rails/activerecord/README.html.
8
+ * Ruby version
19
9
 
20
- The controller and view are handled by the Action Pack, which handles both
21
- layers by its two parts: Action View and Action Controller. These two layers
22
- are bundled in a single package due to their heavy interdependence. This is
23
- unlike the relationship between the Active Record and Action Pack that is much
24
- more separate. Each of these packages can be used independently outside of
25
- Rails. You can read more about Action Pack in
26
- link:files/vendor/rails/actionpack/README.html.
10
+ * System dependencies
27
11
 
12
+ * Configuration
28
13
 
29
- == Getting Started
14
+ * Database creation
30
15
 
31
- 1. At the command prompt, create a new Rails application:
32
- <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
16
+ * Database initialization
33
17
 
34
- 2. Change directory to <tt>myapp</tt> and start the web server:
35
- <tt>cd myapp; rails server</tt> (run with --help for options)
18
+ * How to run the test suite
36
19
 
37
- 3. Go to http://localhost:3000/ and you'll see:
38
- "Welcome aboard: You're riding Ruby on Rails!"
20
+ * Services (job queues, cache servers, search engines, etc.)
39
21
 
40
- 4. Follow the guidelines to start developing your application. You can find
41
- the following resources handy:
22
+ * Deployment instructions
42
23
 
43
- * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
44
- * Ruby on Rails Tutorial Book: http://www.railstutorial.org/
24
+ * ...
45
25
 
46
26
 
47
- == Debugging Rails
48
-
49
- Sometimes your application goes wrong. Fortunately there are a lot of tools that
50
- will help you debug it and get it back on the rails.
51
-
52
- First area to check is the application log files. Have "tail -f" commands
53
- running on the server.log and development.log. Rails will automatically display
54
- debugging and runtime information to these files. Debugging info will also be
55
- shown in the browser on requests from 127.0.0.1.
56
-
57
- You can also log your own messages directly into the log file from your code
58
- using the Ruby logger class from inside your controllers. Example:
59
-
60
- class WeblogController < ActionController::Base
61
- def destroy
62
- @weblog = Weblog.find(params[:id])
63
- @weblog.destroy
64
- logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
65
- end
66
- end
67
-
68
- The result will be a message in your log file along the lines of:
69
-
70
- Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
71
-
72
- More information on how to use the logger is at http://www.ruby-doc.org/core/
73
-
74
- Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
75
- several books available online as well:
76
-
77
- * Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
78
- * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
79
-
80
- These two books will bring you up to speed on the Ruby language and also on
81
- programming in general.
82
-
83
-
84
- == Debugger
85
-
86
- Debugger support is available through the debugger command when you start your
87
- Mongrel or WEBrick server with --debugger. This means that you can break out of
88
- execution at any point in the code, investigate and change the model, and then,
89
- resume execution! You need to install ruby-debug to run the server in debugging
90
- mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
91
-
92
- class WeblogController < ActionController::Base
93
- def index
94
- @posts = Post.all
95
- debugger
96
- end
97
- end
98
-
99
- So the controller will accept the action, run the first line, then present you
100
- with a IRB prompt in the server window. Here you can do things like:
101
-
102
- >> @posts.inspect
103
- => "[#<Post:0x14a6be8
104
- @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
105
- #<Post:0x14a6620
106
- @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
107
- >> @posts.first.title = "hello from a debugger"
108
- => "hello from a debugger"
109
-
110
- ...and even better, you can examine how your runtime objects actually work:
111
-
112
- >> f = @posts.first
113
- => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
114
- >> f.
115
- Display all 152 possibilities? (y or n)
116
-
117
- Finally, when you're ready to resume execution, you can enter "cont".
118
-
119
-
120
- == Console
121
-
122
- The console is a Ruby shell, which allows you to interact with your
123
- application's domain model. Here you'll have all parts of the application
124
- configured, just like it is when the application is running. You can inspect
125
- domain models, change values, and save to the database. Starting the script
126
- without arguments will launch it in the development environment.
127
-
128
- To start the console, run <tt>rails console</tt> from the application
129
- directory.
130
-
131
- Options:
132
-
133
- * Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
134
- made to the database.
135
- * Passing an environment name as an argument will load the corresponding
136
- environment. Example: <tt>rails console production</tt>.
137
-
138
- To reload your controllers and models after launching the console run
139
- <tt>reload!</tt>
140
-
141
- More information about irb can be found at:
142
- link:http://www.rubycentral.org/pickaxe/irb.html
143
-
144
-
145
- == dbconsole
146
-
147
- You can go to the command line of your database directly through <tt>rails
148
- dbconsole</tt>. You would be connected to the database with the credentials
149
- defined in database.yml. Starting the script without arguments will connect you
150
- to the development database. Passing an argument will connect you to a different
151
- database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
152
- PostgreSQL and SQLite 3.
153
-
154
- == Description of Contents
155
-
156
- The default directory structure of a generated Ruby on Rails application:
157
-
158
- |-- app
159
- | |-- assets
160
- | |-- images
161
- | |-- javascripts
162
- | `-- stylesheets
163
- | |-- controllers
164
- | |-- helpers
165
- | |-- mailers
166
- | |-- models
167
- | `-- views
168
- | `-- layouts
169
- |-- config
170
- | |-- environments
171
- | |-- initializers
172
- | `-- locales
173
- |-- db
174
- |-- doc
175
- |-- lib
176
- | `-- tasks
177
- |-- log
178
- |-- public
179
- |-- script
180
- |-- test
181
- | |-- fixtures
182
- | |-- functional
183
- | |-- integration
184
- | |-- performance
185
- | `-- unit
186
- |-- tmp
187
- | |-- cache
188
- | |-- pids
189
- | |-- sessions
190
- | `-- sockets
191
- `-- vendor
192
- |-- assets
193
- `-- stylesheets
194
- `-- plugins
195
-
196
- app
197
- Holds all the code that's specific to this particular application.
198
-
199
- app/assets
200
- Contains subdirectories for images, stylesheets, and JavaScript files.
201
-
202
- app/controllers
203
- Holds controllers that should be named like weblogs_controller.rb for
204
- automated URL mapping. All controllers should descend from
205
- ApplicationController which itself descends from ActionController::Base.
206
-
207
- app/models
208
- Holds models that should be named like post.rb. Models descend from
209
- ActiveRecord::Base by default.
210
-
211
- app/views
212
- Holds the template files for the view that should be named like
213
- weblogs/index.html.erb for the WeblogsController#index action. All views use
214
- eRuby syntax by default.
215
-
216
- app/views/layouts
217
- Holds the template files for layouts to be used with views. This models the
218
- common header/footer method of wrapping views. In your views, define a layout
219
- using the <tt>layout :default</tt> and create a file named default.html.erb.
220
- Inside default.html.erb, call <% yield %> to render the view using this
221
- layout.
222
-
223
- app/helpers
224
- Holds view helpers that should be named like weblogs_helper.rb. These are
225
- generated for you automatically when using generators for controllers.
226
- Helpers can be used to wrap functionality for your views into methods.
227
-
228
- config
229
- Configuration files for the Rails environment, the routing map, the database,
230
- and other dependencies.
231
-
232
- db
233
- Contains the database schema in schema.rb. db/migrate contains all the
234
- sequence of Migrations for your schema.
235
-
236
- doc
237
- This directory is where your application documentation will be stored when
238
- generated using <tt>rake doc:app</tt>
239
-
240
- lib
241
- Application specific libraries. Basically, any kind of custom code that
242
- doesn't belong under controllers, models, or helpers. This directory is in
243
- the load path.
244
-
245
- public
246
- The directory available for the web server. Also contains the dispatchers and the
247
- default HTML files. This should be set as the DOCUMENT_ROOT of your web
248
- server.
249
-
250
- script
251
- Helper scripts for automation and generation.
252
-
253
- test
254
- Unit and functional tests along with fixtures. When using the rails generate
255
- command, template test files will be generated for you and placed in this
256
- directory.
257
-
258
- vendor
259
- External libraries that the application depends on. Also includes the plugins
260
- subdirectory. If the app has frozen rails, those gems also go here, under
261
- vendor/rails/. This directory is in the load path.
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
data/dummy/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env rake
2
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
3
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
3
 
@@ -5,11 +5,12 @@
5
5
  // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // the compiled file.
8
+ // compiled file.
9
9
  //
10
10
  // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
11
  // GO AFTER THE REQUIRES BELOW.
12
12
  //
13
13
  //= require jquery
14
14
  //= require jquery_ujs
15
+ //= require turbolinks
15
16
  //= require_tree .
@@ -11,18 +11,7 @@ class ApplicationController < ActionController::Base
11
11
  nil
12
12
  end
13
13
  end
14
- helper_method :current_user
15
- private
16
-
17
- # helper method for getting the current signed in user
18
- def current_user
19
- begin
20
- @current_user ||= User.find(session[:user_id]) if session[:user_id]
21
- ap @current_user
22
- @current_user
23
- rescue
24
- nil
25
- end
26
- end
27
- protect_from_forgery
14
+ # Prevent CSRF attacks by raising an exception.
15
+ # For APIs, you may want to use :null_session instead.
16
+ protect_from_forgery with: :exception
28
17
  end
@@ -2,17 +2,13 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", :media => "all" %>
6
- <%= javascript_include_tag "application" %>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
10
10
 
11
11
  <%= yield %>
12
- <%= link_to 'login', connect_path %>
13
- <% if !current_user.nil? %>
14
- <%= debug current_user %>
15
- <% end %>
16
12
 
17
13
  </body>
18
14
  </html>
data/dummy/bin/bundle ADDED
@@ -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')
data/dummy/bin/rails ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
data/dummy/bin/rake ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -2,12 +2,8 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- if defined?(Bundler)
6
- # If you precompile assets before deploying to production, use this line
7
- Bundler.require(*Rails.groups(:assets => %w(development test)))
8
- # If you want your assets lazily compiled in production, use this line
9
- # Bundler.require(:default, :assets, Rails.env)
10
- end
5
+ # Assets should be precompiled for production (so we don't need the gems loaded then)
6
+ Bundler.require(*Rails.groups(assets: %w(development test)))
11
7
 
12
8
  module Dummy
13
9
  class Application < Rails::Application
@@ -15,16 +11,6 @@ module Dummy
15
11
  # Application configuration should go into files in config/initializers
16
12
  # -- all .rb files in that directory are automatically loaded.
17
13
 
18
- # Custom directories with classes and modules you want to be autoloadable.
19
- # config.autoload_paths += %W(#{config.root}/extras)
20
-
21
- # Only load the plugins named here, in the order given (default is alphabetical).
22
- # :all can be used as a placeholder for all plugins not explicitly named.
23
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
-
25
- # Activate observers that should always be running.
26
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
-
28
14
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
15
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
16
  # config.time_zone = 'Central Time (US & Canada)'
@@ -32,31 +18,5 @@ module Dummy
32
18
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
19
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
20
  # config.i18n.default_locale = :de
35
-
36
- # Configure the default encoding used in templates for Ruby 1.9.
37
- config.encoding = "utf-8"
38
-
39
- # Configure sensitive parameters which will be filtered from the log file.
40
- config.filter_parameters += [:password]
41
-
42
- # Enable escaping HTML in JSON.
43
- config.active_support.escape_html_entities_in_json = true
44
-
45
- # Use SQL instead of Active Record's schema dumper when creating the database.
46
- # This is necessary if your schema can't be completely dumped by the schema dumper,
47
- # like if you have constraints or database-specific column types
48
- # config.active_record.schema_format = :sql
49
-
50
- # Enforce whitelist mode for mass assignment.
51
- # This will create an empty whitelist of attributes available for mass-assignment for all models
52
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
53
- # parameters by using an attr_accessible or attr_protected declaration.
54
- config.active_record.whitelist_attributes = true
55
-
56
- # Enable the asset pipeline
57
- config.assets.enabled = true
58
-
59
- # Version of your assets, change this if you want to expire all your assets
60
- config.assets.version = '1.0'
61
21
  end
62
22
  end
data/dummy/config/boot.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'rubygems'
2
-
3
1
  # Set up gems listed in the Gemfile.
4
2
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
3
 
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
4
+ # Initialize the rails application.
5
5
  Dummy::Application.initialize!
@@ -1,37 +1,27 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
12
+ # Show full error reports and disable caching.
13
13
  config.consider_all_requests_local = true
14
14
  config.action_controller.perform_caching = false
15
15
 
16
- # Don't care if the mailer can't send
16
+ # Don't care if the mailer can't send.
17
17
  config.action_mailer.raise_delivery_errors = false
18
18
 
19
- # Print deprecation notices to the Rails logger
19
+ # Print deprecation notices to the Rails logger.
20
20
  config.active_support.deprecation = :log
21
21
 
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
24
 
25
- # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict
27
-
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
31
-
32
- # Do not compress assets
33
- config.assets.compress = false
34
-
35
- # Expands the lines which load the assets
25
+ # Debug mode disables concatenation and preprocessing of assets.
36
26
  config.assets.debug = true
37
27
  end