Skip to content

Commit 0c6861f

Browse files
authored
fix: position-of-column-comment option (#275)
Now the parser option `position-of-column-comments` does not work well. The option name `position-of-column-comment` may be correct. Because it is defined at another place. https://github.com/drwl/annotaterb/blob/d9c92140ba13468ec23443b81a99e34818e2544e/lib/annotate_rb/options.rb#L61 Test passed - [x] `bundle exec rake spec:unit`
1 parent bbbb796 commit 0c6861f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Annotate model options:
149149
--without-comment exclude database comments in model annotations
150150
--with-column-comments include column comments in model annotations
151151
--without-column-comments exclude column comments in model annotations
152-
--position-of-column-comments [with_name|rightmost_column]
152+
--position-of-column-comment [with_name|rightmost_column]
153153
set the position, in the annotation block, of the column comment
154154
--with-table-comments include table comments in model annotations
155155
--without-table-comments exclude table comments in model annotations

lib/annotate_rb/parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def add_model_options_to_parser(option_parser)
246246
@options[:with_column_comments] = false
247247
end
248248

249-
option_parser.on("--position-of-column-comments [with_name|rightmost_column]",
249+
option_parser.on("--position-of-column-comment [with_name|rightmost_column]",
250250
"set the position, in the annotation block, of the column comment") do |value|
251-
@options[:position_of_column_comments] = value.to_sym
251+
@options[:position_of_column_comment] = value.to_sym
252252
end
253253

254254
option_parser.on("--with-table-comments",

spec/lib/annotate_rb/parser_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,13 @@ module AnnotateRb # rubocop:disable Metrics/ModuleLength
591591
end
592592
end
593593

594-
describe "--position-of-column-comments" do
595-
let(:option) { "--position-of-column-comments" }
594+
describe "--position-of-column-comment" do
595+
let(:option) { "--position-of-column-comment" }
596596
let(:values) { "rightmost_column" }
597597
let(:args) { [option, values] }
598598

599599
it "sets with_column_comments to true" do
600-
expect(result).to include(position_of_column_comments: :rightmost_column)
600+
expect(result).to include(position_of_column_comment: :rightmost_column)
601601
end
602602
end
603603

0 commit comments

Comments
 (0)