Skip to content

Commit

Permalink
Removed AS core_ext/kernel/requires as it's not used and is bad pract…
Browse files Browse the repository at this point in the history
…ice.
  • Loading branch information
joshk committed May 23, 2011
1 parent a8b2a89 commit eff5d9a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'active_record/connection_adapters/abstract_adapter'
require 'active_support/core_ext/kernel/requires'
require 'active_support/core_ext/object/blank'
require 'set'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'active_record/connection_adapters/abstract_adapter'
require 'active_support/core_ext/kernel/requires'
require 'active_support/core_ext/object/blank'

# Make sure we're using pg high enough for PGResult#values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'active_record/connection_adapters/abstract_adapter'
require 'active_support/core_ext/kernel/requires'

module ActiveRecord
module ConnectionAdapters #:nodoc:
Expand Down
1 change: 0 additions & 1 deletion activesupport/lib/active_support/core_ext/kernel.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'active_support/core_ext/kernel/reporting'
require 'active_support/core_ext/kernel/agnostics'
require 'active_support/core_ext/kernel/requires'
require 'active_support/core_ext/kernel/debugger'
require 'active_support/core_ext/kernel/singleton_class'
26 changes: 0 additions & 26 deletions activesupport/lib/active_support/core_ext/kernel/requires.rb

This file was deleted.

7 changes: 3 additions & 4 deletions railties/lib/rails/rack/debugger.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'active_support/core_ext/kernel/requires'

module Rails
module Rack
class Debugger
Expand All @@ -8,11 +6,12 @@ def initialize(app)

ARGV.clear # clear ARGV so that rails server options aren't passed to IRB

require_library_or_gem 'ruby-debug'
require 'ruby-debug'

::Debugger.start
::Debugger.settings[:autoeval] = true if ::Debugger.respond_to?(:settings)
puts "=> Debugger enabled"
rescue Exception
rescue LoadError
puts "You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'"
exit
end
Expand Down
1 change: 0 additions & 1 deletion railties/lib/rails/test_help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
abort("Abort testing: Your Rails environment is running in production mode!") if Rails.env.production?

require 'test/unit'
require 'active_support/core_ext/kernel/requires'
require 'active_support/test_case'
require 'action_controller/test_case'
require 'action_dispatch/testing/integration'
Expand Down

13 comments on commit eff5d9a

@fxn
Copy link
Member

@fxn fxn commented on eff5d9a May 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, there are still references to this method in the project. Could you perform another grep?

@joshk
Copy link
Contributor Author

@joshk joshk commented on eff5d9a May 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there? I'm sorry, I will check into it further, my ack didn't pick anything up.

@fxn
Copy link
Member

@fxn fxn commented on eff5d9a May 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not the first one to fall there, I promise you :).

Thing is guides are written in Textile, and ack ignores .textile files by default. You need to pass -a to have them ack'ed :).

@joshk
Copy link
Contributor Author

@joshk joshk commented on eff5d9a May 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhhhhhhhh, so require_library_or_gem is referenced in the guides? I am using the textmate ack bundle, not sure how to tell it to include textile, I'll look into it and get this updated.

Thanks for letting me know.

@vijaydev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fxn I just tried out using ack and it did search through the textile files. @joshk: Check out Active Support Core Extensions Guide! :)

@joshk
Copy link
Contributor Author

@joshk joshk commented on eff5d9a May 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshk
Copy link
Contributor Author

@joshk joshk commented on eff5d9a May 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vijaydec i fixed my ackmate textmate plugin to include textile for now on

@fxn
Copy link
Member

@fxn fxn commented on eff5d9a May 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vijaydev could it be the case that you've got a custom ~/.ackrc ?

@vijaydev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fxn No, I don't have one.

@fxn
Copy link
Member

@fxn fxn commented on eff5d9a May 24, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's strange. The default types do not include .textile

https://github.com/petdance/ack/blob/master/Ack.pm#L74-128

What does the command

ack --help=types | ack textile

output in your machine?

@vijaydev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... the command outputs nothing. Meaning textile is not a supported type?!

ack-grep version: 1.92

@fxn
Copy link
Member

@fxn fxn commented on eff5d9a May 24, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the expected output. I have 1.94 here, but .textile has never been among the types known by ack by default. Errrr, can't understand why is searching them in your machine.

What about environment variables? For example,

env | ack ACK

@vijaydev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing in env either!

Please sign in to comment.