Class: Cucumber::Cli::LanguageHelpFormatter
Constant Summary
collapse
- INCOMPLETE =
%{
The Cucumber grammar has evolved since this translation was written.
Please help us complete the translation by translating the missing words in
#{Cucumber::LANGUAGE_FILE}
Then contribute back to the Cucumber project. Details here:
http://wiki.github.com/aslakhellesoy/cucumber/spoken-languages
}
Formatter::Console::FORMATS
Formatter::ANSIColor::ALIASES
Instance Attribute Summary
#indent
Attributes inherited from Ast::Visitor
#options, #step_mother
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, #visit_background, #visit_background_name, #visit_comment, #visit_comment_line, #visit_examples_name, #visit_exception, #visit_feature, #visit_feature_element, #visit_feature_element_name, #visit_feature_name, #visit_features, #visit_py_string, #visit_scenario_name, #visit_step, #visit_step_name, #visit_step_result, #visit_tag_name, #visit_tags
#announce, #format_step, #format_string, #print_counts, #print_elements, #print_exception, #print_snippets, #print_steps
#grey
#announce, #initialize, #matches_scenario_names?, #visit_background, #visit_background_name, #visit_comment, #visit_comment_line, #visit_examples, #visit_examples_name, #visit_exception, #visit_feature, #visit_feature_element, #visit_feature_name, #visit_features, #visit_outline_table, #visit_py_string, #visit_scenario_name, #visit_step, #visit_step_name, #visit_step_result, #visit_steps, #visit_table_cell, #visit_tag_name, #visit_tags
Class Method Details
.list_keywords(io, lang) ⇒ Object
.list_languages(io) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/cucumber/cli/language_help_formatter.rb', line 16
def self.list_languages(io)
raw = Cucumber::LANGUAGES.keys.sort.map do |lang|
[lang, Cucumber::LANGUAGES[lang]['name'], Cucumber::LANGUAGES[lang]['native']]
end
table = Ast::Table.new(raw)
new(nil, io, {:check_lang=>true}, '').visit_multiline_arg(table)
end
|
Instance Method Details
#visit_multiline_arg(table) ⇒ Object
32
33
34
35
36
37
|
# File 'lib/cucumber/cli/language_help_formatter.rb', line 32
def visit_multiline_arg(table)
if @options[:incomplete]
@io.puts(format_string(INCOMPLETE, :failed))
end
super
end
|
#visit_table_cell_value(value, width, status) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/cucumber/cli/language_help_formatter.rb', line 44
def visit_table_cell_value(value, width, status)
if @col == 1
if(@options[:check_lang])
@incomplete = Cucumber.language_incomplete?(value)
end
status = :comment
elsif @incomplete
status = :undefined
end
@col += 1
super(value, width, status)
end
|
#visit_table_row(table_row) ⇒ Object
39
40
41
42
|
# File 'lib/cucumber/cli/language_help_formatter.rb', line 39
def visit_table_row(table_row)
@col = 1
super
end
|