Skip to content

Commit 6f62d0e

Browse files
committed
Rename AnnotateRoutes.do_annotate to AnnotateRoutes.do_annotations for consistency.
1 parent d47092e commit 6f62d0e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/annotate/annotate_routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
module AnnotateRoutes
2121
PREFIX = "# == Route Map"
2222

23-
def self.do_annotate(options={})
23+
def self.do_annotations(options={})
2424
return unless(routes_exists?)
2525

2626
if options[:require]

lib/tasks/annotate_routes.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ task :annotate_routes => :environment do
77
ENV['position'] = options[:position] = Annotate.fallback(ENV['position'], 'before')
88
options[:position_in_routes] = Annotate.fallback(ENV['position_in_routes'], ENV['position'])
99
options[:require] = ENV['require'] ? ENV['require'].split(',') : []
10-
AnnotateRoutes.do_annotate(options)
10+
AnnotateRoutes.do_annotations(options)
1111
end
1212

1313
desc "Removes the route map from routes.rb"

spec/annotate/annotate_routes_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def mock_file(stubs={})
1010
it "should check if routes.rb exists" do
1111
File.should_receive(:exists?).with("config/routes.rb").and_return(false)
1212
AnnotateRoutes.should_receive(:puts).with("Can`t find routes.rb")
13-
AnnotateRoutes.do_annotate
13+
AnnotateRoutes.do_annotations
1414
end
1515

1616
describe "When Annotating, with older Rake Versions" do
@@ -25,13 +25,13 @@ def mock_file(stubs={})
2525
it "should annotate and add a newline!" do
2626
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo")
2727
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# good line\n/)
28-
AnnotateRoutes.do_annotate
28+
AnnotateRoutes.do_annotations
2929
end
3030

3131
it "should not add a newline if there are empty lines" do
3232
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo\n")
3333
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# good line\n/)
34-
AnnotateRoutes.do_annotate
34+
AnnotateRoutes.do_annotations
3535
end
3636

3737
end
@@ -48,13 +48,13 @@ def mock_file(stubs={})
4848
it "should annotate and add a newline!" do
4949
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo")
5050
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# another good line\n# good line\n/)
51-
AnnotateRoutes.do_annotate
51+
AnnotateRoutes.do_annotations
5252
end
5353

5454
it "should not add a newline if there are empty lines" do
5555
File.should_receive(:read).with("config/routes.rb").and_return("ActionController::Routing...\nfoo\n")
5656
@mock_file.should_receive(:puts).with(/ActionController::Routing...\nfoo\n\n# == Route Map \(Updated \d{4}-\d{2}-\d{2} \d{2}:\d{2}\)\n#\n# another good line\n# good line\n/)
57-
AnnotateRoutes.do_annotate
57+
AnnotateRoutes.do_annotations
5858
end
5959

6060
end

0 commit comments

Comments
 (0)