Commit Graph

8395 Commits

Author SHA1 Message Date
Piotr Sarnacki
cf992fba95 Fix railties_order when application object is passed
railites_order method, introduced in 40b19e0, had a bug that was causing
loading application instance twice in initializers if railties_order
already included application instance. So for example

    railties_order = [Foo::Engine, :main_app, Bar::Engine]

would result in such railties array:

    [MyApp::Application, Foo::Engine, MyAppApplication, Bar::Engine]

In order to fix it, we need to check for existence of application in
both railties_order and railties arrays.
2012-05-27 14:26:13 +02:00
Waseem Ahmad
baa336364d Fixes build 4008.1
This fixex build 4008.1[1] because of the changes made in

4001835db00ce44cb75bca33ec02cd76b8ccc790

[1] http://travis-ci.org/#!/rails/rails/jobs/1429671
2012-05-25 09:49:34 +05:30
Rafael Mendonça França
641ab7cedf Merge pull request #6481 from schneems/schneems/sextant-routes
Remove Unnecessary Test from route_inspect_test
2012-05-24 19:35:59 -07:00
schneems
4459125018 remove unnecessary test from route_inspect_test 2012-05-24 21:31:09 -05:00
Aaron Patterson
d476129691 do not set the ENGINE_PATH to nil 2012-05-24 15:54:30 -07:00
Aaron Patterson
d5dc462cd2 name should be public. 2012-05-24 15:32:38 -07:00
schneems
c3e3102904 Rails::InfoController tests passing
This includes new tests for /rails/info/routes
2012-05-24 12:50:16 -05:00
schneems
cb44e0fed9 /rails/info/routes path shows routing information
Will show similar contents to the output of `$ rake routes` in the browser in development. This speeds the time required to generate routes, since the application is already initialized.
2012-05-24 12:50:16 -05:00
Philip Arndt
66db0b9440 Fixed backward incompatibility for engines.
- Many engines rely on being able to join directories to the Rails root:

    Rails.root.join('somedir')

- This was now impossible because Rails.root returned a String:

    NoMethodError: undefined method `join' for "/code/myrailsapp":String

- This was broken in 4001835db00ce44cb75bca33ec02cd76b8ccc790
2012-05-24 17:42:31 +12:00
Aaron Patterson
880481a355 use File.join rather than depend on Pathname 2012-05-23 16:43:16 -07:00
Aaron Patterson
9875574bbf Revert "require the constants we use. ensure that root always returns a Pathname"
This reverts commit d77b576c0330d8b1c6189cb94814382ce32baab6.
2012-05-23 16:41:40 -07:00
Aaron Patterson
d77b576c03 require the constants we use. ensure that root always returns a Pathname 2012-05-23 16:12:51 -07:00
Aaron Patterson
4001835db0 removing more pathnameisms 2012-05-23 15:56:49 -07:00
Aaron Patterson
4e5175e957 use File.join to decrease dependencies on Pathname 2012-05-23 15:44:24 -07:00
Vijay Dev
91305adef8 Merge branch 'master' of github.com:lifo/docrails 2012-05-23 23:26:39 +05:30
Vijay Dev
1ad0b378cc Revert "Remove blank trailing comments"
This reverts commit fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a.

Reason: Not a fan of such massive changes. We usually close such changes
if made to Rails master as a pull request. Following the same principle
here and reverting.

[ci skip]
2012-05-23 22:43:08 +05:30
Matt Griffin
6c7b250ac0 Add license field to gemspecs, by Matt Griffin 2012-05-23 09:22:25 -07:00
Uģis Ozols
bd9953f11e Remove unnecessary comment. 2012-05-23 11:45:08 +03:00
Aaron Patterson
d7de7a79c5 I guess we have to return a pathname object. o_O 2012-05-22 19:21:56 -07:00
Aaron Patterson
3f870f607d use File.realpath and avoid making Pathname objects 2012-05-22 17:22:06 -07:00
Aaron Patterson
1ca1b1ab91 use RUBY_PLATFORM in case of cross compiled ruby 2012-05-22 16:52:39 -07:00
Aaron Patterson
580333fdc2 initialize instance variables 2012-05-22 16:52:39 -07:00
Aaron Patterson
8662722f4f initialize our instance variables 2012-05-22 16:52:39 -07:00
Gaurish Sharma
43fa48e5aa Move root method at TOP of routes file
Made the change as per the following text in routing guide:-
"You should put the root route at the top of the file,
because it is the most popular route and should be matched first."

However, if root is best left at bottom. We will change to fix that text
2012-05-22 19:51:02 +05:30
Alexey Vakhov
fe7038eac8 Use new hash syntax for generators gem method
The Gemfile of new application uses ruby 1.9 hashes. Gem method of
generators should use them too. It prevents from mixing two kinds of
syntax in one file.
2012-05-22 13:26:06 +04:00
Piotr Sarnacki
29d17d3ab6 Use require_dependency in generated controllers
Using require in development mode will prevent required files from
reloading, even if they're changed. In order to keep namespaced
application_controller reloadable, we need to use require_dependency
instead of require.
2012-05-22 01:40:51 -07:00
Alexey Vakhov
09be692159 Remove obsolete comment from generator gem method
This comment about :env option for gem method was actual for rails 2.3
without bundler. Now bundler uses grups for this goal.
2012-05-22 11:45:59 +04:00
Alexey Vakhov
1fed1f14fc Fix rails db -h and cosmetic fixes in usage banners
Ruby tries to use '-h' as short version of '--header' by default
https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb#L1372-1381.
To force `rails db -h` prints an usage message we should add the `-h`
options explicitly.
2012-05-22 08:59:30 +04:00
Alexey Vakhov
a060c41ef7 Use relative path to sqlite3 db in rails db command
Rails uses sqlit3 db file with a path relative to the rails root. It
allows to execute server not from rails root only. For example you
can fire `./spec/dummy/script/rails s` to start dummy application
server if you develop some engine gem.

Now the `rails db` command uses relative paths also and you can explore
your dummy db via `./spec/dummy/script/rails db` command.
2012-05-22 08:59:25 +04:00
Aaron Patterson
edb87b19d4 using __method__ for the command method calls 2012-05-21 16:20:40 -07:00
Piotr Sarnacki
7c95be54b4 Fix generators to help with ambiguous ApplicationController issue
In development mode, dependencies are loaded dynamically at runtime,
using `const_missing`. Because of that, when one of the constants is
already loaded and `const_missing` is not triggered, user can end up
with unexpected results.

Given such file in an Engine:

```ruby
module Blog
  class PostsController < ApplicationController
  end
end
```

If you load it first, before loading any application files, it will
correctly load `Blog::ApplicationController`, because second line will
hit `const_missing`. However if you load `ApplicationController` first,
the constant will be loaded already, `const_missing` hook will not be
fired and in result `PostsController` will inherit from
`ApplicationController` instead of `Blog::ApplicationController`.

Since it can't be fixed in `AS::Dependencies`, the easiest fix is to
just explicitly load application controller.

closes #6413
2012-05-20 16:28:02 -07:00
Henrik Hodne
fa6d921e11 Remove blank trailing comments
For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
with the first match, and voilà! Note that the regex matches a little bit too
much, so you probably want to `git add -i .` and go through every single diff
to check if it actually should be changed.
2012-05-20 01:29:13 +02:00
Rafael Mendonça França
6df96c90ab Merge pull request #3359 from mrreynolds/datamapper_naming_fix
Fixed DataMapper namings in symbols and constants.
2012-05-19 08:19:39 -07:00
Andrew White
71a83a9cfd Add CHANGELOG entry for #6369 & #6391 2012-05-19 14:19:19 +01:00
Carlos Antonio da Silva
3e7070622a Remove delegated methods from generators test case
`class_attribute` already generates instance readers/writers by default,
so there's no need to add delegation methods.

Removes some "method redefined" warnings.
2012-05-19 09:22:06 -03:00
Carlos Antonio da Silva
573448f011 Remove warning in namespaced generator test 2012-05-19 09:17:11 -03:00
Piotr Sarnacki
bd838c0e74 Fix railties tests
Minitest uses different signature for assert_no_match, so we have to
swap arguments.
2012-05-19 04:53:35 -07:00
Andrew White
ec77498351 Improve rake routes output for redirects - closes #6369. 2012-05-19 11:22:00 +01:00
Łukasz Strzałkowski
5f7bfb7778 Fix inspecting route redirections, closes #6369
This commit fixes route inspection in `rake routes`

Before:

  foo  /foo(.:format) :controller#:action"

After:

  foo  /foo(.:format)  Redirect (301)
2012-05-18 23:55:39 +02:00
Łukasz Strzałkowski
61fc10d233 More DRY route inspect tests 2012-05-18 23:54:22 +02:00
Piotr Sarnacki
0f5cc34ab5 Revert changes related to bundle install fixes in rails new
Reverted changes:
  f3482a9 Fix tests in railties
  5904295 improve #6318
  aed906a prevent using already loaded Gemfile for 'bundle install'

In order to fix this, we need a fix in bundler related to GEM_PATH,
which will allow to run tests properly. I will get this changes back
when it happens.
2012-05-17 11:33:40 -07:00
Piotr Sarnacki
8bc1e532a9 Load all the env files available in config.paths (closes #6335) 2012-05-16 15:47:00 -07:00
Aaron Patterson
78b6fdd89f Merge pull request #6337 from bcardarella/patch-1
Changing the indentation level of the block comment close for Sass
2012-05-16 14:39:46 -07:00
Piotr Sarnacki
f3482a9fb1 Fix tests in railties
Since `bundle install` was fixed in `rails plugin new`, it
now requires `rails 4.0.0.beta` version in filesystem when
running tests. Instead of providing it, we can run tested
command with `--dev` option, to use rails from the local
directory.
2012-05-15 22:48:05 -07:00
Michal Papis
5904295b23 improve #6318 2012-05-15 22:31:08 -07:00
Brian Cardarella
ef703b537b Changing the indentation level of the block comment close for SASS
If one wants to use use SASS for application.css.sass the comment block indentation is invalid.
2012-05-15 22:57:14 -03:00
Vijay Dev
59b03d418f Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_view/helpers/asset_tag_helper.rb
2012-05-15 13:13:55 +05:30
Michal Papis
aed906af97 prevent using already loaded Gemfile for 'bundle install', fix #6314 2012-05-15 08:57:05 +02:00
Francesco Rodriguez
17059a4868 Removing ==Examples and last blank lines of docs from railties 2012-05-14 10:50:59 -05:00
Carlos Antonio da Silva
017632fe2b Remove not used date variable and another test warning 2012-05-14 12:31:51 -03:00