aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/command/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/command/base.rb')
-rw-r--r--railties/lib/rails/command/base.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb
index 2ef8393863..73ebaca66f 100644
--- a/railties/lib/rails/command/base.rb
+++ b/railties/lib/rails/command/base.rb
@@ -15,6 +15,11 @@ module Rails
include Actions
class << self
+ # Returns true when the app is a Rails engine.
+ def engine?
+ defined?(ENGINE_ROOT)
+ end
+
# Tries to get the description from a USAGE file one folder above the command
# root.
def desc(usage = nil, description = nil)