Commit Graph

9398 Commits

Author SHA1 Message Date
T.J. Schuck
4a99e10199 bcrypt-ruby v3.1.2 supports Ruby 2.0 on Windows 2013-09-23 14:28:26 -04:00
Rafael Mendonça França
68d7a1e3f2 Merge pull request #12070 from wangjohn/small_refactors_to_generators
Small refactoring changes to generators.

Conflicts:
	railties/lib/rails/generators/rails/controller/controller_generator.rb
2013-09-23 12:09:11 -03:00
schneems
5f98bb402b Only output Server logs in Development
Right now when you start a server via `rails s`, the logger gets extended so that it logs to the file system and also to stdout. This extension behavior is not "intelligent" and if the default logger is already set to output to stdout, then the contents will be received twice.

To capture logs in accordance with http://www.12factor.net/logs some platforms require the logs to be sent to standard out. If a logger is set to stdout, and the server is started using `rails server` instead of another method (i.e. `thin start` etc.) then the app will produce double logs.

This PR fixes the issue by only extending the logger to standard out in the development environment. So that in production you don't get double logs like this:

```
ActionView::Template::Error (wrong number of arguments (5 for 4)):
    1: <% lang_index = 0 %>
    2: <div class="row">
    3:   <ul class="nav nav-tabs nav-stacked span2" data-tabs="tabs" id="repo-tabs">
    4:     <% repos.group_by(&:language).each do |lang, repos| %>
    5:       <% unless lang == nil %>
    6:         <li><a href="#<%= "#{lang.parameterize}#{lang.hash}" %>" data-toggle="tab"><%= lang %></a></li>
    7:       <% end -%>
  app/views/shared/_repos.html.erb:4:in `_app_views_shared__repos_html_erb___1685450633638247395_70300668607000'
  app/views/pages/index.html.erb:13:in `_app_views_pages_index_html_erb__2084723628308867770_70300687584880'

ActionView::Template::Error (wrong number of arguments (5 for 4)):
    1: <% lang_index = 0 %>
    2: <div class="row">
    3:   <ul class="nav nav-tabs nav-stacked span2" data-tabs="tabs" id="repo-tabs">
    4:     <% repos.group_by(&:language).each do |lang, repos| %>
    5:       <% unless lang == nil %>
    6:         <li><a href="#<%= "#{lang.parameterize}#{lang.hash}" %>" data-toggle="tab"><%= lang %></a></li>
    7:       <% end -%>
  app/views/shared/_repos.html.erb:4:in `_app_views_shared__repos_html_erb___1685450633638247395_70300668607000'
  app/views/pages/index.html.erb:13:in `_app_views_pages_index_html_erb__2084723628308867770_70300687584880'
```

ATP Railties. Opened against master in favor of #10999
2013-09-22 20:56:31 -05:00
Piotr Sarnacki
47ac67b8d4 Don't require using application_name before options
Before this commit options for `rails new` and `rails plugin new` had to
be passed in a strict order, trying to execute a following command:

    rails new -J path/to/app

resulted in an error.

This commit fixes the situation and allows to pass path to app anywhere
after `new`
2013-09-13 18:02:25 +02:00
Rafael Mendonça França
d891c19066 Merge pull request #12216 from suginoy/a-an
Fix typos: the indefinite articles(a -> an).
2013-09-13 05:55:28 -07:00
SUGINO Yasuhiro
4a36eb64a5 Fix typos: the indefinite articles(a -> an) 2013-09-13 20:44:37 +09:00
Akira Matsuda & Yukiko Kawamoto
1eebfc9f66 Missing destroy command 2013-09-13 18:19:35 +09:00
Aaron Patterson
802876854d Revert "Add meta tag with charset information to application layout."
This reverts commit ba0407337e93c4ef55cef3472143f62e8a984a64.
2013-09-11 11:35:51 -07:00
Steve Klabnik
ba0407337e Add meta tag with charset information to application layout.
Previously, our default HTML would validate properly, but would generate
a warning: it doesn't declare a character encoding.

According to [the spec][encoding-spec], if you don't specify an
encoding, a 7 step algorithm happens, with a toooon of sub-steps. Or, we
could just actually specify it.

Since everything else in Rails assumes UTF-8, we should make sure pages
are served with that encoding too. This meta tag is the simplest way to
accomplish this.

More resources:

* http://blog.whatwg.org/the-road-to-html-5-character-encoding
* http://www.w3.org/International/tutorials/tutorial-char-enc/
* http://validator.w3.org/

[encoding-spec]: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding
2013-09-10 14:37:39 -07:00
Akira Matsuda
5374960a04 Use Ruby 2.0 caller_locations instead of caller if available
* we no more have to manipulate the each caller strings by ourselves using caller_locations

* caller_locations runs slightly faster, and creates less objects than good old caller
Benchmark (loading an Engine 1000 times):
  caller: 262.89 ms
  caller_locations: 186.068 ms
2013-09-10 19:57:52 +02:00
Guillermo Iguaran
005b33222d Merge pull request #12173 from arunagw/fixes_reverted_by_revert_commit
Revert fixes
2013-09-10 07:05:17 -07:00
José Valim
1385ae138d Remove BasicRendering tests 2013-09-09 16:10:41 -03:00
Arun Agrawal
17e860c14e grab executable from rubygems 2013-09-09 17:06:02 +02:00
Arun Agrawal
047b187d0e Fixed API task file
1. As we have vendor in AV only
2. No more vendor in AC
3. No vendor folder in AR
2013-09-09 17:04:04 +02:00
José Valim
daf426291a Merge pull request #12097 from kassio/remove-unused-delegate-on-railtie
Remove unused delegate
2013-08-31 14:58:40 -07:00
Kassio Borges
c56a4a4f51 Remove unused delegate
Related with commit 4a2a504
2013-08-31 18:55:21 -03:00
Rafael Mendonça França
0329bab9d4 Merge pull request #11912 from jonkessler/respond-to-signature-fixes
Update Rails::Railtie::Configuration and ActionDispatch::Response#respond_to? to accept include_private argument
2013-08-31 14:41:14 -07:00
wangjohn
30aa2b97e5 Using indent method to refactor controller generator.
[John J. Wang & Prathamesh Sonpatki]
2013-08-31 03:48:13 -04:00
Prathamesh Sonpatki
c2df74938e Fix typo in generators test helpr -> helper [ci skip] 2013-08-30 11:21:46 +05:30
wangjohn
21e68853fd Small refactoring changes to generators.
Made a method name clearer (added a bang to the end to show that it
mutates arguments) and extracted indentation into its own method.
2013-08-29 00:34:42 -05:00
wangjohn
ecd4e70a1f Refactoring Generators::Base.
The defaults hash isn't used unless the +class_options+ hash has a
particular key, so we don't need to compute it unless this is true.

Also moving some code for extracting a module into its own method.
2013-08-28 15:22:05 -05:00
Thibault Jouan
1cb5094903 Comply with current umask when generating new app:
When creating a new application using the default rails generator
(`rails new my_app`), it will apply some permissions bypassing the
current process umask. The `bin' directory and any files inside it will
always be set a mode of 0755.

  This change removes the current umask bits from the mode applied by
the generator on the `bin' directory and its content.
2013-08-27 18:38:11 +00:00
Łukasz Strzałkowski
a2ca04bb3a Extend basic rendering, test it in railties 2013-08-25 11:40:10 +02:00
Łukasz Strzałkowski
1b1c23599b Add --skip-action-view to app generator 2013-08-25 11:39:13 +02:00
Łukasz Strzałkowski
c9ffd73968 Include AV railtie when we're not loading full rails stack 2013-08-25 11:39:13 +02:00
Łukasz Strzałkowski
ac036cc38c Missing AV requires in railties tests 2013-08-25 11:39:13 +02:00
Łukasz Strzałkowski
e291e6a479 Include AV railtie in railties isolation tests 2013-08-25 11:39:12 +02:00
Łukasz Strzałkowski
d7d3e34172 Add AV as development dependency for railties
It's needed for tests
2013-08-25 11:39:12 +02:00
Łukasz Strzałkowski
718332536c Fix railtie tests 2013-08-25 11:39:11 +02:00
Łukasz Strzałkowski
b2ae1fae5d Add loading 'action_view' as part of rails/all 2013-08-25 11:39:07 +02:00
Semyon Perepelitsa
d1f33e0963 Fix typo in file path, should include extension. 2013-08-23 16:16:05 +04:00
Rafael Mendonça França
a0b948e9f5 Fix the indentation on the from template of the scaffold generator 2013-08-19 10:52:01 -03:00
Vijay Dev
9abe72c760 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	actionview/README.rdoc
	activerecord/lib/active_record/migration.rb
	guides/source/development_dependencies_install.md
	guides/source/getting_started.md
2013-08-17 21:49:16 +05:30
Vijay Dev
ec8ef1e105 Revert "Merge branch 'master' of github.com:rails/docrails"
This reverts commit 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing
changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9.

Seems to be a code merge done by mistake.
2013-08-17 21:46:39 +05:30
Jon Kessler
ba5fab4c01 update Rails::Railtie::Configuration and ActionDispatch::Response#respond_to? to accept include_private argument 2013-08-16 08:22:08 -07:00
Yves Senn
5c6e11d6b8 fix build error caused by #11900. 2013-08-15 14:17:08 +02:00
Josh Crowder
f3073773a3 Adding LESS to rake notes 2013-08-15 11:30:01 +01:00
Prathamesh Sonpatki
53c5794a4b Generate namespaced routes correctly for generators. Fix for #11532 2013-08-14 08:53:38 +05:30
Avner Cohen
86f2061cd5 Revert "Removing obsolete html tags in favor of markdown code block"
This reverts commit 157dc275da0ad38635337b7c1d96de656d91de8e.
2013-08-06 22:16:03 +03:00
Avner Cohen
157dc275da Removing obsolete html tags in favor of markdown code block. 2013-08-06 21:20:33 +03:00
thedarkone
a0907bbdad "Naked" rescue clauses only catch StandardError subclasses.
Similar to #11497.
2013-08-06 17:04:02 +02:00
thedarkone
3af8a91c38 Add a missing require.
This makes the rack_logger_test.rb runnable by itself (outside of the `rake test` suite).
2013-08-06 17:03:55 +02:00
Rafael Mendonça França
d86ccec097 Use the right instrumentation name
The pattern is event.component

Closes #11769

Conflicts:
	railties/CHANGELOG.md
2013-08-05 18:20:22 -03:00
Rafael Mendonça França
3a7e321246 Add CHANGELOG entry for #11665
[ci skip]
2013-08-04 11:38:14 -03:00
Rafael Mendonça França
067393895d Merge pull request #11665 from mshytikov/fix-config-log_level
Rails.logger should have level specified by config.log_level.
2013-08-04 07:34:45 -07:00
Guillermo Iguaran
71f512646a Revert "Isolate railties Generators Tests"
This fixes railties tests in JRuby but break it in MRI
This reverts commit fea99276c7024f183bf72a16ad9f36af4bae1d42.
2013-08-02 21:48:34 -05:00
Alex Tambellini
fea99276c7 Isolate railties Generators Tests
With this change jruby should pass all of the railties tests.
2013-08-02 22:26:58 -04:00
Arun Agrawal
65624e9030 Added action_view in Rails::Info 2013-08-02 10:30:04 -04:00
Rafael Mendonça França
ffb680e121 Merge pull request #11601 from TylerRick/dont_permanently_silence_all_warnings
Remove $VERBOSE = nil from tasks.rb
2013-07-30 19:00:04 -07:00
Max Shytikov
e2180e84a9 Rails.logger should have level specified by config.log_level.
Fix bug when log level of Rails.logger (which was set via config.logger) does not match the    config.log_level.
2013-07-30 18:25:00 +03:00