aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-01 21:48:46 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-01 21:48:46 -0800
commit77306550737b2dd7cecf628c50951b2d75ef2e31 (patch)
tree06604e9895df0136a90238e881623f9b1534376a /railties
parentdf1484ced51646624c8c602f5a00d6e906c5ca1b (diff)
parent553b563749517114323b4e8742509227e0daab67 (diff)
downloadrails-77306550737b2dd7cecf628c50951b2d75ef2e31.tar.gz
rails-77306550737b2dd7cecf628c50951b2d75ef2e31.tar.bz2
rails-77306550737b2dd7cecf628c50951b2d75ef2e31.zip
Merge pull request #8394 from acangiano/add_db_folder_to_annotations
Add db to the list of default annotation folders
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG.md2
-rw-r--r--railties/lib/rails/source_annotation_extractor.rb2
-rw-r--r--railties/test/application/rake/notes_test.rb4
3 files changed, 7 insertions, 1 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 7a68cf0a2e..c3da3094dc 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,5 +1,7 @@
## Rails 4.0.0 (unreleased) ##
+* Add `db` to list of folders included by `rake notes` and `rake notes:custom`. *Antonio Cangiano*
+
* Engines with a dummy app include the rake tasks of dependencies in the app namespace.
Fix #8229
diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb
index 3474b02af4..ac806e8006 100644
--- a/railties/lib/rails/source_annotation_extractor.rb
+++ b/railties/lib/rails/source_annotation_extractor.rb
@@ -15,7 +15,7 @@
class SourceAnnotationExtractor
class Annotation < Struct.new(:line, :tag, :text)
def self.directories
- @@directories ||= %w(app config lib script test) + (ENV['SOURCE_ANNOTATION_DIRECTORIES'] || '').split(',')
+ @@directories ||= %w(app config db lib script test) + (ENV['SOURCE_ANNOTATION_DIRECTORIES'] || '').split(',')
end
# Returns a representation of the annotation that looks like this:
diff --git a/railties/test/application/rake/notes_test.rb b/railties/test/application/rake/notes_test.rb
index 7a227098ba..ac214cdb03 100644
--- a/railties/test/application/rake/notes_test.rb
+++ b/railties/test/application/rake/notes_test.rb
@@ -60,6 +60,7 @@ module ApplicationTests
test 'notes finds notes in default directories' do
app_file "app/controllers/some_controller.rb", "# TODO: note in app directory"
app_file "config/initializers/some_initializer.rb", "# TODO: note in config directory"
+ app_file "db/some_seeds.rb", "# TODO: note in db directory"
app_file "lib/some_file.rb", "# TODO: note in lib directory"
app_file "script/run_something.rb", "# TODO: note in script directory"
app_file "test/some_test.rb", 1000.times.map { "" }.join("\n") << "# TODO: note in test directory"
@@ -80,6 +81,7 @@ module ApplicationTests
assert_match(/note in app directory/, output)
assert_match(/note in config directory/, output)
+ assert_match(/note in db directory/, output)
assert_match(/note in lib directory/, output)
assert_match(/note in script directory/, output)
assert_match(/note in test directory/, output)
@@ -96,6 +98,7 @@ module ApplicationTests
test 'notes finds notes in custom directories' do
app_file "app/controllers/some_controller.rb", "# TODO: note in app directory"
app_file "config/initializers/some_initializer.rb", "# TODO: note in config directory"
+ app_file "db/some_seeds.rb", "# TODO: note in db directory"
app_file "lib/some_file.rb", "# TODO: note in lib directory"
app_file "script/run_something.rb", "# TODO: note in script directory"
app_file "test/some_test.rb", 1000.times.map { "" }.join("\n") << "# TODO: note in test directory"
@@ -116,6 +119,7 @@ module ApplicationTests
assert_match(/note in app directory/, output)
assert_match(/note in config directory/, output)
+ assert_match(/note in db directory/, output)
assert_match(/note in lib directory/, output)
assert_match(/note in script directory/, output)
assert_match(/note in test directory/, output)