ruby_badger 4.2.0 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile.lock +116 -107
  3. data/README.md +2 -6
  4. data/lib/ruby_badger/version.rb +1 -1
  5. data/ruby_badger.gemspec +6 -6
  6. data/spec/dummy/README.rdoc +248 -15
  7. data/spec/dummy/Rakefile +2 -1
  8. data/spec/dummy/app/assets/javascripts/application.js +4 -5
  9. data/spec/dummy/app/assets/stylesheets/application.css +4 -6
  10. data/spec/dummy/app/controllers/application_controller.rb +1 -3
  11. data/spec/dummy/app/controllers/public_controller.rb +7 -0
  12. data/spec/dummy/app/{assets/images/.keep → mailers/.gitkeep} +0 -0
  13. data/spec/dummy/app/{controllers/concerns/.keep → models/.gitkeep} +0 -0
  14. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  15. data/spec/dummy/config/application.rb +39 -4
  16. data/spec/dummy/config/boot.rb +4 -1
  17. data/spec/dummy/config/database.yml +8 -8
  18. data/spec/dummy/config/environment.rb +3 -3
  19. data/spec/dummy/config/environments/development.rb +18 -22
  20. data/spec/dummy/config/environments/production.rb +34 -46
  21. data/spec/dummy/config/environments/test.rb +14 -19
  22. data/spec/dummy/config/initializers/inflections.rb +5 -6
  23. data/spec/dummy/config/initializers/mime_types.rb +1 -0
  24. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  25. data/spec/dummy/config/initializers/session_store.rb +6 -1
  26. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  27. data/spec/dummy/config/locales/en.yml +2 -20
  28. data/spec/dummy/config.ru +2 -2
  29. data/spec/dummy/{app/mailers/.keep → lib/assets/.gitkeep} +0 -0
  30. data/spec/dummy/{app/models/.keep → log/.gitkeep} +0 -0
  31. data/spec/dummy/public/404.html +13 -54
  32. data/spec/dummy/public/422.html +13 -54
  33. data/spec/dummy/public/500.html +12 -53
  34. data/spec/dummy/script/rails +6 -0
  35. metadata +39 -106
  36. data/spec/dummy/.gitignore +0 -17
  37. data/spec/dummy/Gemfile +0 -45
  38. data/spec/dummy/app/models/concerns/.keep +0 -0
  39. data/spec/dummy/bin/bundle +0 -3
  40. data/spec/dummy/bin/rails +0 -4
  41. data/spec/dummy/bin/rake +0 -4
  42. data/spec/dummy/bin/setup +0 -29
  43. data/spec/dummy/config/initializers/assets.rb +0 -11
  44. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  45. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  46. data/spec/dummy/config/secrets.yml +0 -22
  47. data/spec/dummy/db/seeds.rb +0 -7
  48. data/spec/dummy/lib/assets/.keep +0 -0
  49. data/spec/dummy/lib/tasks/.keep +0 -0
  50. data/spec/dummy/log/.keep +0 -0
  51. data/spec/dummy/public/robots.txt +0 -5
  52. data/spec/dummy/test/controllers/.keep +0 -0
  53. data/spec/dummy/test/fixtures/.keep +0 -0
  54. data/spec/dummy/test/helpers/.keep +0 -0
  55. data/spec/dummy/test/integration/.keep +0 -0
  56. data/spec/dummy/test/mailers/.keep +0 -0
  57. data/spec/dummy/test/models/.keep +0 -0
  58. data/spec/dummy/test/test_helper.rb +0 -10
  59. data/spec/dummy/vendor/assets/javascripts/.keep +0 -0
  60. data/spec/dummy/vendor/assets/stylesheets/.keep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 87bb1370a028c245f3bfea165c8a0b509b47202f
4
- data.tar.gz: a4e6de6d7443ae4ba5a4988ebecde1e60b3b245f
2
+ SHA256:
3
+ metadata.gz: '0117883af4cf4c3bd8a8067891a39df9a495cc5bdc6b3870313b5fda0239d2d2'
4
+ data.tar.gz: c7494197646daccb66bf751da471e57a6b8baeca79be283d8cc4c02fb4701252
5
5
  SHA512:
6
- metadata.gz: 74f6787b0d3dd623e24c648f6fd6da22bcc87063f9f9cb962efebc8cd8042b0efa7111294a4275c63deb00303a27ce7b07db1949d968f5653e94cc3c1352f086
7
- data.tar.gz: ed5abf04277b92bef3797731f9cda332cc93591e791cb79f0732476b0af0adeac3297cc1ac31433d33fb834fefcd694ee6f17ef91d0c8b86a5073c8d316f7bf3
6
+ metadata.gz: 7c269bf39f26566deec1ade32b100a45dc37a6951ed2cbdd32931c2f9f13b0026498df97a0bb30b7e33d725100963b7a357caa0b38a73a2ca17e32742c965d3f
7
+ data.tar.gz: db18fa87de8b973a610d86563622e79bd01973fd5af31c155cc3df969f4a390bb049949ec5aef4882f1ae76f4bd65b528d3f83d19aaecf74064dba116def121d
data/Gemfile.lock CHANGED
@@ -7,152 +7,158 @@ PATH
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (4.2.0)
11
- actionpack (= 4.2.0)
12
- actionview (= 4.2.0)
13
- activejob (= 4.2.0)
10
+ actionmailer (4.2.10)
11
+ actionpack (= 4.2.10)
12
+ actionview (= 4.2.10)
13
+ activejob (= 4.2.10)
14
14
  mail (~> 2.5, >= 2.5.4)
15
15
  rails-dom-testing (~> 1.0, >= 1.0.5)
16
- actionpack (4.2.0)
17
- actionview (= 4.2.0)
18
- activesupport (= 4.2.0)
19
- rack (~> 1.6.0)
16
+ actionpack (4.2.10)
17
+ actionview (= 4.2.10)
18
+ activesupport (= 4.2.10)
19
+ rack (~> 1.6)
20
20
  rack-test (~> 0.6.2)
21
21
  rails-dom-testing (~> 1.0, >= 1.0.5)
22
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
23
- actionview (4.2.0)
24
- activesupport (= 4.2.0)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ actionview (4.2.10)
24
+ activesupport (= 4.2.10)
25
25
  builder (~> 3.1)
26
26
  erubis (~> 2.7.0)
27
27
  rails-dom-testing (~> 1.0, >= 1.0.5)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
29
- activejob (4.2.0)
30
- activesupport (= 4.2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
29
+ activejob (4.2.10)
30
+ activesupport (= 4.2.10)
31
31
  globalid (>= 0.3.0)
32
- activemodel (4.2.0)
33
- activesupport (= 4.2.0)
32
+ activemodel (4.2.10)
33
+ activesupport (= 4.2.10)
34
34
  builder (~> 3.1)
35
- activerecord (4.2.0)
36
- activemodel (= 4.2.0)
37
- activesupport (= 4.2.0)
35
+ activerecord (4.2.10)
36
+ activemodel (= 4.2.10)
37
+ activesupport (= 4.2.10)
38
38
  arel (~> 6.0)
39
- activesupport (4.2.0)
39
+ activesupport (4.2.10)
40
40
  i18n (~> 0.7)
41
- json (~> 1.7, >= 1.7.7)
42
41
  minitest (~> 5.1)
43
42
  thread_safe (~> 0.3, >= 0.3.4)
44
43
  tzinfo (~> 1.1)
45
- arel (6.0.0)
46
- builder (3.2.2)
47
- capybara (2.4.4)
48
- mime-types (>= 1.16)
44
+ addressable (2.5.2)
45
+ public_suffix (>= 2.0.2, < 4.0)
46
+ arel (6.0.4)
47
+ builder (3.2.3)
48
+ capybara (2.18.0)
49
+ addressable
50
+ mini_mime (>= 0.1.3)
49
51
  nokogiri (>= 1.3.3)
50
52
  rack (>= 1.0.0)
51
53
  rack-test (>= 0.5.4)
52
- xpath (~> 2.0)
53
- diff-lcs (1.2.5)
54
+ xpath (>= 2.0, < 4.0)
55
+ concurrent-ruby (1.0.5)
56
+ crass (1.0.3)
57
+ diff-lcs (1.3)
54
58
  erubis (2.7.0)
55
- factory_girl (4.5.0)
59
+ factory_girl (4.9.0)
56
60
  activesupport (>= 3.0.0)
57
- factory_girl_rails (4.5.0)
58
- factory_girl (~> 4.5.0)
61
+ factory_girl_rails (4.9.0)
62
+ factory_girl (~> 4.9.0)
59
63
  railties (>= 3.0.0)
60
- fuubar (2.0.0)
61
- rspec (~> 3.0)
64
+ ffi (1.9.23)
65
+ fuubar (2.3.1)
66
+ rspec-core (~> 3.0)
62
67
  ruby-progressbar (~> 1.4)
63
- globalid (0.3.3)
64
- activesupport (>= 4.1.0)
65
- hike (1.2.3)
66
- i18n (0.7.0)
67
- jquery-rails (4.0.3)
68
- rails-dom-testing (~> 1.0)
68
+ globalid (0.4.1)
69
+ activesupport (>= 4.2.0)
70
+ i18n (0.9.5)
71
+ concurrent-ruby (~> 1.0)
72
+ jquery-rails (4.3.1)
73
+ rails-dom-testing (>= 1, < 3)
69
74
  railties (>= 4.2.0)
70
75
  thor (>= 0.14, < 2.0)
71
- json (1.8.2)
72
- loofah (2.0.1)
76
+ loofah (2.2.0)
77
+ crass (~> 1.0.2)
73
78
  nokogiri (>= 1.5.9)
74
- mail (2.6.3)
75
- mime-types (>= 1.16, < 3)
76
- mime-types (2.4.3)
77
- mini_portile (0.6.2)
78
- minitest (5.5.1)
79
- multi_json (1.10.1)
80
- nokogiri (1.6.6.2)
81
- mini_portile (~> 0.6.0)
82
- rack (1.6.0)
79
+ mail (2.7.0)
80
+ mini_mime (>= 0.1.1)
81
+ mini_mime (1.0.0)
82
+ mini_portile2 (2.3.0)
83
+ minitest (5.11.3)
84
+ nokogiri (1.8.2)
85
+ mini_portile2 (~> 2.3.0)
86
+ public_suffix (3.0.2)
87
+ rack (1.6.9)
83
88
  rack-test (0.6.3)
84
89
  rack (>= 1.0)
85
- rails (4.2.0)
86
- actionmailer (= 4.2.0)
87
- actionpack (= 4.2.0)
88
- actionview (= 4.2.0)
89
- activejob (= 4.2.0)
90
- activemodel (= 4.2.0)
91
- activerecord (= 4.2.0)
92
- activesupport (= 4.2.0)
90
+ rails (4.2.10)
91
+ actionmailer (= 4.2.10)
92
+ actionpack (= 4.2.10)
93
+ actionview (= 4.2.10)
94
+ activejob (= 4.2.10)
95
+ activemodel (= 4.2.10)
96
+ activerecord (= 4.2.10)
97
+ activesupport (= 4.2.10)
93
98
  bundler (>= 1.3.0, < 2.0)
94
- railties (= 4.2.0)
99
+ railties (= 4.2.10)
95
100
  sprockets-rails
96
101
  rails-deprecated_sanitizer (1.0.3)
97
102
  activesupport (>= 4.2.0.alpha)
98
- rails-dom-testing (1.0.5)
99
- activesupport (>= 4.2.0.beta, < 5.0)
100
- nokogiri (~> 1.6.0)
103
+ rails-dom-testing (1.0.9)
104
+ activesupport (>= 4.2.0, < 5.0)
105
+ nokogiri (~> 1.6)
101
106
  rails-deprecated_sanitizer (>= 1.0.1)
102
- rails-html-sanitizer (1.0.1)
107
+ rails-html-sanitizer (1.0.3)
103
108
  loofah (~> 2.0)
104
- railties (4.2.0)
105
- actionpack (= 4.2.0)
106
- activesupport (= 4.2.0)
109
+ railties (4.2.10)
110
+ actionpack (= 4.2.10)
111
+ activesupport (= 4.2.10)
107
112
  rake (>= 0.8.7)
108
113
  thor (>= 0.18.1, < 2.0)
109
- rake (10.4.2)
110
- rspec (3.2.0)
111
- rspec-core (~> 3.2.0)
112
- rspec-expectations (~> 3.2.0)
113
- rspec-mocks (~> 3.2.0)
114
- rspec-core (3.2.1)
115
- rspec-support (~> 3.2.0)
116
- rspec-expectations (3.2.0)
114
+ rake (12.3.0)
115
+ rb-fsevent (0.10.3)
116
+ rb-inotify (0.9.10)
117
+ ffi (>= 0.5.0, < 2)
118
+ rspec-core (3.7.1)
119
+ rspec-support (~> 3.7.0)
120
+ rspec-expectations (3.7.0)
117
121
  diff-lcs (>= 1.2.0, < 2.0)
118
- rspec-support (~> 3.2.0)
119
- rspec-mocks (3.2.1)
122
+ rspec-support (~> 3.7.0)
123
+ rspec-mocks (3.7.0)
120
124
  diff-lcs (>= 1.2.0, < 2.0)
121
- rspec-support (~> 3.2.0)
122
- rspec-rails (3.2.1)
123
- actionpack (>= 3.0, < 4.3)
124
- activesupport (>= 3.0, < 4.3)
125
- railties (>= 3.0, < 4.3)
126
- rspec-core (~> 3.2.0)
127
- rspec-expectations (~> 3.2.0)
128
- rspec-mocks (~> 3.2.0)
129
- rspec-support (~> 3.2.0)
130
- rspec-support (3.2.2)
131
- ruby-progressbar (1.7.1)
132
- sass (3.4.13)
133
- sass-rails (5.0.1)
134
- railties (>= 4.0.0, < 5.0)
135
- sass (~> 3.1)
136
- sprockets (>= 2.8, < 4.0)
137
- sprockets-rails (>= 2.0, < 4.0)
138
- tilt (~> 1.1)
139
- sprockets (2.12.3)
140
- hike (~> 1.2)
141
- multi_json (~> 1.0)
142
- rack (~> 1.0)
143
- tilt (~> 1.1, != 1.3.0)
144
- sprockets-rails (2.2.4)
125
+ rspec-support (~> 3.7.0)
126
+ rspec-rails (3.7.2)
145
127
  actionpack (>= 3.0)
146
128
  activesupport (>= 3.0)
129
+ railties (>= 3.0)
130
+ rspec-core (~> 3.7.0)
131
+ rspec-expectations (~> 3.7.0)
132
+ rspec-mocks (~> 3.7.0)
133
+ rspec-support (~> 3.7.0)
134
+ rspec-support (3.7.1)
135
+ ruby-progressbar (1.9.0)
136
+ sass (3.5.5)
137
+ sass-listen (~> 4.0.0)
138
+ sass-listen (4.0.0)
139
+ rb-fsevent (~> 0.9, >= 0.9.4)
140
+ rb-inotify (~> 0.9, >= 0.9.7)
141
+ sass-rails (5.0.7)
142
+ railties (>= 4.0.0, < 6)
143
+ sass (~> 3.1)
147
144
  sprockets (>= 2.8, < 4.0)
148
- sqlite3 (1.3.10)
149
- thor (0.19.1)
150
- thread_safe (0.3.4)
151
- tilt (1.4.1)
152
- tzinfo (1.2.2)
145
+ sprockets-rails (>= 2.0, < 4.0)
146
+ tilt (>= 1.1, < 3)
147
+ sprockets (3.7.1)
148
+ concurrent-ruby (~> 1.0)
149
+ rack (> 1, < 3)
150
+ sprockets-rails (3.2.1)
151
+ actionpack (>= 4.0)
152
+ activesupport (>= 4.0)
153
+ sprockets (>= 3.0.0)
154
+ sqlite3 (1.3.13)
155
+ thor (0.20.0)
156
+ thread_safe (0.3.6)
157
+ tilt (2.0.8)
158
+ tzinfo (1.2.5)
153
159
  thread_safe (~> 0.1)
154
- xpath (2.0.0)
155
- nokogiri (~> 1.3)
160
+ xpath (3.0.0)
161
+ nokogiri (~> 1.8)
156
162
 
157
163
  PLATFORMS
158
164
  ruby
@@ -164,8 +170,11 @@ DEPENDENCIES
164
170
  fuubar
165
171
  jquery-rails
166
172
  rails
167
- rake (~> 10.4, >= 10.4)
173
+ rake
168
174
  rspec-rails
169
175
  ruby_badger!
170
176
  sass-rails
171
177
  sqlite3
178
+
179
+ BUNDLED WITH
180
+ 1.16.1
data/README.md CHANGED
@@ -2,13 +2,9 @@
2
2
 
3
3
  Get a nice, clean badge displaying your Rails Environment or other helpful info. Want to display last deploy date? Or maybe the status of some app wide settings? Throw it in RubyBadger! He just doesn't care!
4
4
 
5
- ![RubyBadger Demo](https://img.skitch.com/20110723-h8iabtcdpb4i64xkgbrwy5kjs.jpg "RubyBadger Demo")
5
+ This is my fork/gem of [honey_badger](https://github.com/rsanheim/honey_badger) gem. This exists because honey_badger has gone dormant and hasn't been patched in many years. Although this one is not an actively changing gem, Pull requests are accepted.
6
6
 
7
- **Designed for:**
8
-
9
- - Rails 4.2
10
- - Bundler > 1.8
11
- - ruby > 2.1
7
+ # Usage (requires Rails 4.2 and Bundler > 1.8)
12
8
 
13
9
  Add to your Gemfile:
14
10
 
@@ -1,3 +1,3 @@
1
1
  module RubyBadger
2
- VERSION = "4.2.0"
2
+ VERSION = "4.2.1"
3
3
  end
data/ruby_badger.gemspec CHANGED
@@ -25,13 +25,13 @@ Gem::Specification.new do |spec|
25
25
  spec.add_runtime_dependency "rails", '~> 4.2', '>= 4.2'
26
26
 
27
27
  spec.add_development_dependency "bundler", '~> 1.8', ">= 1.8"
28
- spec.add_development_dependency "rake", '~> 10.4', ">= 10.4"
28
+ spec.add_development_dependency "rake"
29
29
 
30
- spec.add_development_dependency 'rspec-rails', '~> 2.4', ">= 2.4"
31
- spec.add_development_dependency 'capybara', '~> 2.4', ">= 2.4"
32
- spec.add_development_dependency 'factory_girl_rails', '~> 4.5', ">= 4.5"
33
- spec.add_development_dependency 'fuubar', '~> 2.0', ">= 2.0"
34
- spec.add_development_dependency 'sass-rails', '~> 5.0', ">= 5.0"
30
+ spec.add_development_dependency 'rspec-rails'
31
+ spec.add_development_dependency 'capybara'
32
+ spec.add_development_dependency 'factory_girl_rails'
33
+ spec.add_development_dependency 'fuubar'
34
+ spec.add_development_dependency 'sass-rails'
35
35
 
36
36
  spec.test_files = Dir["spec/**/*"]
37
37
  end
@@ -1,28 +1,261 @@
1
- == README
1
+ == Welcome to Rails
2
2
 
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
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.
5
5
 
6
- Things you may want to cover:
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.
7
13
 
8
- * Ruby version
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.
9
19
 
10
- * System dependencies
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.
11
27
 
12
- * Configuration
13
28
 
14
- * Database creation
29
+ == Getting Started
15
30
 
16
- * Database initialization
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)
17
33
 
18
- * How to run the test suite
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)
19
36
 
20
- * Services (job queues, cache servers, search engines, etc.)
37
+ 3. Go to http://localhost:3000/ and you'll see:
38
+ "Welcome aboard: You're riding Ruby on Rails!"
21
39
 
22
- * Deployment instructions
40
+ 4. Follow the guidelines to start developing your application. You can find
41
+ the following resources handy:
23
42
 
24
- * ...
43
+ * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
44
+ * Ruby on Rails Tutorial Book: http://www.railstutorial.org/
25
45
 
26
46
 
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
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
+ | |-- assets
177
+ | `-- tasks
178
+ |-- log
179
+ |-- public
180
+ |-- script
181
+ |-- test
182
+ | |-- fixtures
183
+ | |-- functional
184
+ | |-- integration
185
+ | |-- performance
186
+ | `-- unit
187
+ |-- tmp
188
+ | `-- cache
189
+ | `-- assets
190
+ `-- vendor
191
+ |-- assets
192
+ | |-- javascripts
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.
data/spec/dummy/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
+ #!/usr/bin/env rake
1
2
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
3
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
4
 
4
5
  require File.expand_path('../config/application', __FILE__)
5
6
 
6
- Rails.application.load_tasks
7
+ Dummy::Application.load_tasks
@@ -2,15 +2,14 @@
2
2
  // listed below.
3
3
  //
4
4
  // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
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
- // compiled file.
8
+ // the compiled file.
9
9
  //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
- // about supported directives.
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
12
  //
13
13
  //= require jquery
14
14
  //= require jquery_ujs
15
- //= require turbolinks
16
15
  //= require_tree .
@@ -3,13 +3,11 @@
3
3
  * listed below.
4
4
  *
5
5
  * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
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.
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
12
10
  *
13
- *= require_tree .
14
11
  *= require_self
12
+ *= require_tree .
15
13
  */
@@ -1,5 +1,3 @@
1
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
2
+ protect_from_forgery
5
3
  end