codemirror-rails 5.11 → 5.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/lib/codemirror/rails/version.rb +1 -1
  3. metadata +5 -126
  4. data/.gitignore +0 -3
  5. data/.travis.yml +0 -10
  6. data/Gemfile +0 -2
  7. data/Rakefile +0 -19
  8. data/codemirror-rails.gemspec +0 -20
  9. data/gemfiles/Gemfile.rails-3.2 +0 -5
  10. data/gemfiles/Gemfile.rails-4.0 +0 -4
  11. data/gemfiles/Gemfile.rails-4.1 +0 -4
  12. data/test/dummy-3.2.x/README.rdoc +0 -261
  13. data/test/dummy-3.2.x/Rakefile +0 -7
  14. data/test/dummy-3.2.x/app/assets/javascripts/application.js +0 -15
  15. data/test/dummy-3.2.x/app/assets/stylesheets/application.css +0 -13
  16. data/test/dummy-3.2.x/app/controllers/application_controller.rb +0 -3
  17. data/test/dummy-3.2.x/app/helpers/application_helper.rb +0 -2
  18. data/test/dummy-3.2.x/app/mailers/.gitkeep +0 -0
  19. data/test/dummy-3.2.x/app/models/.gitkeep +0 -0
  20. data/test/dummy-3.2.x/app/views/layouts/application.html.erb +0 -14
  21. data/test/dummy-3.2.x/config.ru +0 -4
  22. data/test/dummy-3.2.x/config/application.rb +0 -56
  23. data/test/dummy-3.2.x/config/boot.rb +0 -10
  24. data/test/dummy-3.2.x/config/database.yml +0 -25
  25. data/test/dummy-3.2.x/config/environment.rb +0 -5
  26. data/test/dummy-3.2.x/config/environments/development.rb +0 -37
  27. data/test/dummy-3.2.x/config/environments/production.rb +0 -67
  28. data/test/dummy-3.2.x/config/environments/test.rb +0 -37
  29. data/test/dummy-3.2.x/config/initializers/backtrace_silencers.rb +0 -7
  30. data/test/dummy-3.2.x/config/initializers/inflections.rb +0 -15
  31. data/test/dummy-3.2.x/config/initializers/mime_types.rb +0 -5
  32. data/test/dummy-3.2.x/config/initializers/secret_token.rb +0 -7
  33. data/test/dummy-3.2.x/config/initializers/session_store.rb +0 -8
  34. data/test/dummy-3.2.x/config/initializers/wrap_parameters.rb +0 -14
  35. data/test/dummy-3.2.x/config/locales/en.yml +0 -5
  36. data/test/dummy-3.2.x/config/routes.rb +0 -58
  37. data/test/dummy-3.2.x/db/.gitkeep +0 -0
  38. data/test/dummy-3.2.x/lib/assets/.gitkeep +0 -0
  39. data/test/dummy-3.2.x/log/.gitkeep +0 -0
  40. data/test/dummy-3.2.x/public/404.html +0 -26
  41. data/test/dummy-3.2.x/public/422.html +0 -26
  42. data/test/dummy-3.2.x/public/500.html +0 -25
  43. data/test/dummy-3.2.x/public/favicon.ico +0 -0
  44. data/test/dummy-3.2.x/script/rails +0 -6
  45. data/test/dummy-4.0.x/README.rdoc +0 -28
  46. data/test/dummy-4.0.x/Rakefile +0 -6
  47. data/test/dummy-4.0.x/app/assets/images/.keep +0 -0
  48. data/test/dummy-4.0.x/app/assets/javascripts/application.js +0 -13
  49. data/test/dummy-4.0.x/app/assets/stylesheets/application.css +0 -13
  50. data/test/dummy-4.0.x/app/controllers/application_controller.rb +0 -5
  51. data/test/dummy-4.0.x/app/controllers/concerns/.keep +0 -0
  52. data/test/dummy-4.0.x/app/helpers/application_helper.rb +0 -2
  53. data/test/dummy-4.0.x/app/mailers/.keep +0 -0
  54. data/test/dummy-4.0.x/app/models/.keep +0 -0
  55. data/test/dummy-4.0.x/app/models/concerns/.keep +0 -0
  56. data/test/dummy-4.0.x/app/views/layouts/application.html.erb +0 -14
  57. data/test/dummy-4.0.x/bin/bundle +0 -3
  58. data/test/dummy-4.0.x/bin/rails +0 -4
  59. data/test/dummy-4.0.x/bin/rake +0 -4
  60. data/test/dummy-4.0.x/config.ru +0 -4
  61. data/test/dummy-4.0.x/config/application.rb +0 -23
  62. data/test/dummy-4.0.x/config/boot.rb +0 -5
  63. data/test/dummy-4.0.x/config/database.yml +0 -25
  64. data/test/dummy-4.0.x/config/environment.rb +0 -5
  65. data/test/dummy-4.0.x/config/environments/development.rb +0 -29
  66. data/test/dummy-4.0.x/config/environments/production.rb +0 -80
  67. data/test/dummy-4.0.x/config/environments/test.rb +0 -36
  68. data/test/dummy-4.0.x/config/initializers/backtrace_silencers.rb +0 -7
  69. data/test/dummy-4.0.x/config/initializers/filter_parameter_logging.rb +0 -4
  70. data/test/dummy-4.0.x/config/initializers/inflections.rb +0 -16
  71. data/test/dummy-4.0.x/config/initializers/mime_types.rb +0 -5
  72. data/test/dummy-4.0.x/config/initializers/secret_token.rb +0 -12
  73. data/test/dummy-4.0.x/config/initializers/session_store.rb +0 -3
  74. data/test/dummy-4.0.x/config/initializers/wrap_parameters.rb +0 -14
  75. data/test/dummy-4.0.x/config/locales/en.yml +0 -23
  76. data/test/dummy-4.0.x/config/routes.rb +0 -56
  77. data/test/dummy-4.0.x/lib/assets/.keep +0 -0
  78. data/test/dummy-4.0.x/log/.keep +0 -0
  79. data/test/dummy-4.0.x/public/404.html +0 -58
  80. data/test/dummy-4.0.x/public/422.html +0 -58
  81. data/test/dummy-4.0.x/public/500.html +0 -57
  82. data/test/dummy-4.0.x/public/favicon.ico +0 -0
  83. data/test/dummy-4.1.x/README.rdoc +0 -28
  84. data/test/dummy-4.1.x/Rakefile +0 -6
  85. data/test/dummy-4.1.x/app/assets/images/.keep +0 -0
  86. data/test/dummy-4.1.x/app/assets/javascripts/application.js +0 -13
  87. data/test/dummy-4.1.x/app/assets/stylesheets/application.css +0 -15
  88. data/test/dummy-4.1.x/app/controllers/application_controller.rb +0 -5
  89. data/test/dummy-4.1.x/app/controllers/concerns/.keep +0 -0
  90. data/test/dummy-4.1.x/app/helpers/application_helper.rb +0 -2
  91. data/test/dummy-4.1.x/app/mailers/.keep +0 -0
  92. data/test/dummy-4.1.x/app/models/.keep +0 -0
  93. data/test/dummy-4.1.x/app/models/concerns/.keep +0 -0
  94. data/test/dummy-4.1.x/app/views/layouts/application.html.erb +0 -14
  95. data/test/dummy-4.1.x/bin/bundle +0 -3
  96. data/test/dummy-4.1.x/bin/rails +0 -4
  97. data/test/dummy-4.1.x/bin/rake +0 -4
  98. data/test/dummy-4.1.x/config.ru +0 -4
  99. data/test/dummy-4.1.x/config/application.rb +0 -23
  100. data/test/dummy-4.1.x/config/boot.rb +0 -5
  101. data/test/dummy-4.1.x/config/database.yml +0 -25
  102. data/test/dummy-4.1.x/config/environment.rb +0 -5
  103. data/test/dummy-4.1.x/config/environments/development.rb +0 -37
  104. data/test/dummy-4.1.x/config/environments/production.rb +0 -82
  105. data/test/dummy-4.1.x/config/environments/test.rb +0 -39
  106. data/test/dummy-4.1.x/config/initializers/assets.rb +0 -8
  107. data/test/dummy-4.1.x/config/initializers/backtrace_silencers.rb +0 -7
  108. data/test/dummy-4.1.x/config/initializers/cookies_serializer.rb +0 -3
  109. data/test/dummy-4.1.x/config/initializers/filter_parameter_logging.rb +0 -4
  110. data/test/dummy-4.1.x/config/initializers/inflections.rb +0 -16
  111. data/test/dummy-4.1.x/config/initializers/mime_types.rb +0 -4
  112. data/test/dummy-4.1.x/config/initializers/session_store.rb +0 -3
  113. data/test/dummy-4.1.x/config/initializers/wrap_parameters.rb +0 -14
  114. data/test/dummy-4.1.x/config/locales/en.yml +0 -23
  115. data/test/dummy-4.1.x/config/routes.rb +0 -56
  116. data/test/dummy-4.1.x/config/secrets.yml +0 -22
  117. data/test/dummy-4.1.x/lib/assets/.keep +0 -0
  118. data/test/dummy-4.1.x/log/.keep +0 -0
  119. data/test/dummy-4.1.x/public/404.html +0 -67
  120. data/test/dummy-4.1.x/public/422.html +0 -67
  121. data/test/dummy-4.1.x/public/500.html +0 -66
  122. data/test/dummy-4.1.x/public/favicon.ico +0 -0
  123. data/test/integration/codemirror_rails_integration_test.rb +0 -15
  124. data/test/test_helper.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1929b6a736399491a5fbf53a11bca4735924bfa2
4
- data.tar.gz: 022e71456c14fad9f3b6cb764a4d7de3dd594769
3
+ metadata.gz: 86b90957b2f67d6ec71cf4dd32a7fb5a9f9dd60a
4
+ data.tar.gz: 77cac22b1af3f1c19bb61fc392b0292a653a48d6
5
5
  SHA512:
6
- metadata.gz: 7e57b062d2e7529735bb27007f5a1e51a2d96e85a2f446c50708beb531b8bcc3bb091cc7dd9228fac3be69b3021b90063423b9424483a1fc3f06c90a450e55a9
7
- data.tar.gz: d03c8b1a078dc4b251510e56e69759c153485306d0fad08590af3d80b44bf99f2332998115e933f793e57eaa3fa1d9f9c04a4dca73f465617642b50bbecbb50f
6
+ metadata.gz: f2bf076d9971c26b1d72bc0f23aed28f7bbec97d9541fc0cb3c107c6e12835cc7fd3f74dea624719be9c5ab08360ae46669215bd8bba333ae0f0b1ad546fc2bd
7
+ data.tar.gz: e8507ab58b6d2e26dae6df6fcea6740dde2e4e960a151b09b01c92c85d10f4587397f40bc7c1009a46062c00aea476b5c1803ecd6af425665ac942c9a32856e1
@@ -1,6 +1,6 @@
1
1
  module Codemirror
2
2
  module Rails
3
- VERSION = '5.11'
3
+ VERSION = '5.11.1'
4
4
  CODEMIRROR_VERSION = '5.11'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codemirror-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: '5.11'
4
+ version: 5.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Fixler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-21 00:00:00.000000000 Z
11
+ date: 2016-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5'
22
+ version: '6.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5'
32
+ version: '6.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rails
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -78,136 +78,15 @@ executables: []
78
78
  extensions: []
79
79
  extra_rdoc_files: []
80
80
  files:
81
- - ".gitignore"
82
- - ".travis.yml"
83
- - Gemfile
84
81
  - LICENSE
85
82
  - README.md
86
- - Rakefile
87
- - codemirror-rails.gemspec
88
83
  - doc/CodeMirror-LICENSE
89
- - gemfiles/Gemfile.rails-3.2
90
- - gemfiles/Gemfile.rails-4.0
91
- - gemfiles/Gemfile.rails-4.1
92
84
  - lib/codemirror-rails.rb
93
85
  - lib/codemirror/rails.rb
94
86
  - lib/codemirror/rails/engine.rb
95
87
  - lib/codemirror/rails/railtie.rb
96
88
  - lib/codemirror/rails/version.rb
97
89
  - lib/generators/codemirror/install/install_generator.rb
98
- - test/dummy-3.2.x/README.rdoc
99
- - test/dummy-3.2.x/Rakefile
100
- - test/dummy-3.2.x/app/assets/javascripts/application.js
101
- - test/dummy-3.2.x/app/assets/stylesheets/application.css
102
- - test/dummy-3.2.x/app/controllers/application_controller.rb
103
- - test/dummy-3.2.x/app/helpers/application_helper.rb
104
- - test/dummy-3.2.x/app/mailers/.gitkeep
105
- - test/dummy-3.2.x/app/models/.gitkeep
106
- - test/dummy-3.2.x/app/views/layouts/application.html.erb
107
- - test/dummy-3.2.x/config.ru
108
- - test/dummy-3.2.x/config/application.rb
109
- - test/dummy-3.2.x/config/boot.rb
110
- - test/dummy-3.2.x/config/database.yml
111
- - test/dummy-3.2.x/config/environment.rb
112
- - test/dummy-3.2.x/config/environments/development.rb
113
- - test/dummy-3.2.x/config/environments/production.rb
114
- - test/dummy-3.2.x/config/environments/test.rb
115
- - test/dummy-3.2.x/config/initializers/backtrace_silencers.rb
116
- - test/dummy-3.2.x/config/initializers/inflections.rb
117
- - test/dummy-3.2.x/config/initializers/mime_types.rb
118
- - test/dummy-3.2.x/config/initializers/secret_token.rb
119
- - test/dummy-3.2.x/config/initializers/session_store.rb
120
- - test/dummy-3.2.x/config/initializers/wrap_parameters.rb
121
- - test/dummy-3.2.x/config/locales/en.yml
122
- - test/dummy-3.2.x/config/routes.rb
123
- - test/dummy-3.2.x/db/.gitkeep
124
- - test/dummy-3.2.x/lib/assets/.gitkeep
125
- - test/dummy-3.2.x/log/.gitkeep
126
- - test/dummy-3.2.x/public/404.html
127
- - test/dummy-3.2.x/public/422.html
128
- - test/dummy-3.2.x/public/500.html
129
- - test/dummy-3.2.x/public/favicon.ico
130
- - test/dummy-3.2.x/script/rails
131
- - test/dummy-4.0.x/README.rdoc
132
- - test/dummy-4.0.x/Rakefile
133
- - test/dummy-4.0.x/app/assets/images/.keep
134
- - test/dummy-4.0.x/app/assets/javascripts/application.js
135
- - test/dummy-4.0.x/app/assets/stylesheets/application.css
136
- - test/dummy-4.0.x/app/controllers/application_controller.rb
137
- - test/dummy-4.0.x/app/controllers/concerns/.keep
138
- - test/dummy-4.0.x/app/helpers/application_helper.rb
139
- - test/dummy-4.0.x/app/mailers/.keep
140
- - test/dummy-4.0.x/app/models/.keep
141
- - test/dummy-4.0.x/app/models/concerns/.keep
142
- - test/dummy-4.0.x/app/views/layouts/application.html.erb
143
- - test/dummy-4.0.x/bin/bundle
144
- - test/dummy-4.0.x/bin/rails
145
- - test/dummy-4.0.x/bin/rake
146
- - test/dummy-4.0.x/config.ru
147
- - test/dummy-4.0.x/config/application.rb
148
- - test/dummy-4.0.x/config/boot.rb
149
- - test/dummy-4.0.x/config/database.yml
150
- - test/dummy-4.0.x/config/environment.rb
151
- - test/dummy-4.0.x/config/environments/development.rb
152
- - test/dummy-4.0.x/config/environments/production.rb
153
- - test/dummy-4.0.x/config/environments/test.rb
154
- - test/dummy-4.0.x/config/initializers/backtrace_silencers.rb
155
- - test/dummy-4.0.x/config/initializers/filter_parameter_logging.rb
156
- - test/dummy-4.0.x/config/initializers/inflections.rb
157
- - test/dummy-4.0.x/config/initializers/mime_types.rb
158
- - test/dummy-4.0.x/config/initializers/secret_token.rb
159
- - test/dummy-4.0.x/config/initializers/session_store.rb
160
- - test/dummy-4.0.x/config/initializers/wrap_parameters.rb
161
- - test/dummy-4.0.x/config/locales/en.yml
162
- - test/dummy-4.0.x/config/routes.rb
163
- - test/dummy-4.0.x/lib/assets/.keep
164
- - test/dummy-4.0.x/log/.keep
165
- - test/dummy-4.0.x/public/404.html
166
- - test/dummy-4.0.x/public/422.html
167
- - test/dummy-4.0.x/public/500.html
168
- - test/dummy-4.0.x/public/favicon.ico
169
- - test/dummy-4.1.x/README.rdoc
170
- - test/dummy-4.1.x/Rakefile
171
- - test/dummy-4.1.x/app/assets/images/.keep
172
- - test/dummy-4.1.x/app/assets/javascripts/application.js
173
- - test/dummy-4.1.x/app/assets/stylesheets/application.css
174
- - test/dummy-4.1.x/app/controllers/application_controller.rb
175
- - test/dummy-4.1.x/app/controllers/concerns/.keep
176
- - test/dummy-4.1.x/app/helpers/application_helper.rb
177
- - test/dummy-4.1.x/app/mailers/.keep
178
- - test/dummy-4.1.x/app/models/.keep
179
- - test/dummy-4.1.x/app/models/concerns/.keep
180
- - test/dummy-4.1.x/app/views/layouts/application.html.erb
181
- - test/dummy-4.1.x/bin/bundle
182
- - test/dummy-4.1.x/bin/rails
183
- - test/dummy-4.1.x/bin/rake
184
- - test/dummy-4.1.x/config.ru
185
- - test/dummy-4.1.x/config/application.rb
186
- - test/dummy-4.1.x/config/boot.rb
187
- - test/dummy-4.1.x/config/database.yml
188
- - test/dummy-4.1.x/config/environment.rb
189
- - test/dummy-4.1.x/config/environments/development.rb
190
- - test/dummy-4.1.x/config/environments/production.rb
191
- - test/dummy-4.1.x/config/environments/test.rb
192
- - test/dummy-4.1.x/config/initializers/assets.rb
193
- - test/dummy-4.1.x/config/initializers/backtrace_silencers.rb
194
- - test/dummy-4.1.x/config/initializers/cookies_serializer.rb
195
- - test/dummy-4.1.x/config/initializers/filter_parameter_logging.rb
196
- - test/dummy-4.1.x/config/initializers/inflections.rb
197
- - test/dummy-4.1.x/config/initializers/mime_types.rb
198
- - test/dummy-4.1.x/config/initializers/session_store.rb
199
- - test/dummy-4.1.x/config/initializers/wrap_parameters.rb
200
- - test/dummy-4.1.x/config/locales/en.yml
201
- - test/dummy-4.1.x/config/routes.rb
202
- - test/dummy-4.1.x/config/secrets.yml
203
- - test/dummy-4.1.x/lib/assets/.keep
204
- - test/dummy-4.1.x/log/.keep
205
- - test/dummy-4.1.x/public/404.html
206
- - test/dummy-4.1.x/public/422.html
207
- - test/dummy-4.1.x/public/500.html
208
- - test/dummy-4.1.x/public/favicon.ico
209
- - test/integration/codemirror_rails_integration_test.rb
210
- - test/test_helper.rb
211
90
  - vendor/assets/javascripts/codemirror.js
212
91
  - vendor/assets/javascripts/codemirror/addons/comment/comment.js
213
92
  - vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js
@@ -460,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
460
339
  version: '0'
461
340
  requirements: []
462
341
  rubyforge_project:
463
- rubygems_version: 2.4.5.1
342
+ rubygems_version: 2.5.1
464
343
  signing_key:
465
344
  specification_version: 4
466
345
  summary: Use CodeMirror with Rails
data/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- *.gem
2
- Gemfile.lock
3
- test/dummy*/tmp/cache/assets/*
@@ -1,10 +0,0 @@
1
- ---
2
- language: ruby
3
- rvm:
4
- - 1.9.3
5
- - 2.0.0
6
- - 2.1.2
7
- gemfile:
8
- - gemfiles/Gemfile.rails-3.2
9
- - gemfiles/Gemfile.rails-4.0
10
- - gemfiles/Gemfile.rails-4.1
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
data/Rakefile DELETED
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env rake
2
- begin
3
- require 'bundler/setup'
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
- end
7
-
8
- Bundler::GemHelper.install_tasks
9
-
10
- require 'rake/testtask'
11
-
12
- Rake::TestTask.new(:test) do |t|
13
- t.libs << 'lib'
14
- t.libs << 'test'
15
- t.pattern = 'test/**/*_test.rb'
16
- t.verbose = false
17
- end
18
-
19
- task :default => :test
@@ -1,20 +0,0 @@
1
- require File.expand_path('../lib/codemirror/rails/version', __FILE__)
2
-
3
- Gem::Specification.new do |s|
4
- s.name = 'codemirror-rails'
5
- s.version = Codemirror::Rails::VERSION
6
- s.authors = ['Nathan Fixler']
7
- s.email = 'nathan@fixler.org'
8
- s.license = 'MIT'
9
- s.summary = 'Use CodeMirror with Rails'
10
- s.description = 'This gem provides CodeMirror assets for your Rails application.'
11
- s.homepage = 'https://rubygems.org/gems/codemirror-rails'
12
-
13
- s.files = `git ls-files`.split("\n")
14
-
15
- s.add_runtime_dependency 'railties', '>= 3.0', '< 5'
16
-
17
- s.add_development_dependency 'rails'
18
- s.add_development_dependency 'sqlite3'
19
- s.add_development_dependency 'minitest'
20
- end
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec :path => '../'
3
-
4
- gem 'rails', '~> 3.2.0'
5
- gem 'minitest', '~> 4.0'
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec :path => '../'
3
-
4
- gem 'rails', '~> 4.0.0'
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec :path => '../'
3
-
4
- gem 'rails', '~> 4.1.0'
@@ -1,261 +0,0 @@
1
- == Welcome to Rails
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.
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.
13
-
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.
19
-
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.
27
-
28
-
29
- == Getting Started
30
-
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)
33
-
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)
36
-
37
- 3. Go to http://localhost:3000/ and you'll see:
38
- "Welcome aboard: You're riding Ruby on Rails!"
39
-
40
- 4. Follow the guidelines to start developing your application. You can find
41
- the following resources handy:
42
-
43
- * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
44
- * Ruby on Rails Tutorial Book: http://www.railstutorial.org/
45
-
46
-
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.