From d0454e57661ceeaebd6f3fce4a608ec624257b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 17 Feb 2010 18:09:13 +0100 Subject: Add readme as method in Rails::Generators::Actions (as we had in 2.3) --- railties/lib/rails/generators/actions.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index d41da773c6..e39fa3ff11 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -280,6 +280,16 @@ module Rails end end + # Reads the given file at the source root and prints it in the console. + # + # === Example + # + # readme "README" + # + def readme(path) + say File.read(find_in_source_paths(path)) + end + protected # Define log for backwards compatibility. If just one argument is sent, -- cgit v1.2.3