Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed typo in indent word #198

Merged
merged 1 commit into from

2 participants

@wijet

No description provided.

@wycats
Owner

Whoa!

@wycats wycats merged commit f8bef7c into erikhuda:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 23, 2011
  1. @wijet
This page is out of date. Refresh to see the latest.
View
4 lib/thor.rb
@@ -164,7 +164,7 @@ def task_help(shell, task_name)
class_options_help(shell, nil => task.options.map { |_, o| o })
if task.long_description
shell.say "Description:"
- shell.print_wrapped(task.long_description, :ident => 2)
+ shell.print_wrapped(task.long_description, :indent => 2)
else
shell.say task.description
end
@@ -183,7 +183,7 @@ def help(shell, subcommand = false)
list.sort!{ |a,b| a[0] <=> b[0] }
shell.say "Tasks:"
- shell.print_table(list, :ident => 2, :truncate => true)
+ shell.print_table(list, :indent => 2, :truncate => true)
shell.say
class_options_help(shell)
end
View
2  lib/thor/base.rb
@@ -476,7 +476,7 @@ def print_options(shell, options, group_name=nil)
end
shell.say(group_name ? "#{group_name} options:" : "Options:")
- shell.print_table(list, :ident => 2)
+ shell.print_table(list, :indent => 2)
shell.say ""
end
View
14 lib/thor/shell/basic.rb
@@ -100,13 +100,13 @@ def no?(statement, color=nil)
# Array[Array[String, String, ...]]
#
# ==== Options
- # ident<Integer>:: Indent the first column by ident value.
+ # indent<Integer>:: Indent the first column by indent value.
# colwidth<Integer>:: Force the first column to colwidth spaces wide.
#
def print_table(table, options={})
return if table.empty?
- formats, ident, colwidth = [], options[:ident].to_i, options[:colwidth]
+ formats, indent, colwidth = [], options[:indent].to_i, options[:colwidth]
options[:truncate] = terminal_width if options[:truncate] == true
formats << "%-#{colwidth + 2}s" if colwidth
@@ -119,7 +119,7 @@ def print_table(table, options={})
formats << "%-#{maxima + 2}s"
end
- formats[0] = formats[0].insert(0, " " * ident)
+ formats[0] = formats[0].insert(0, " " * indent)
formats << "%s"
table.each do |row|
@@ -141,11 +141,11 @@ def print_table(table, options={})
# String
#
# ==== Options
- # ident<Integer>:: Indent each line of the printed paragraph by ident value.
+ # indent<Integer>:: Indent each line of the printed paragraph by indent value.
#
def print_wrapped(message, options={})
- ident = options[:ident] || 0
- width = terminal_width - ident
+ indent = options[:indent] || 0
+ width = terminal_width - indent
paras = message.split("\n\n")
paras.map! do |unwrapped|
@@ -156,7 +156,7 @@ def print_wrapped(message, options={})
paras.each do |para|
para.split("\n").each do |line|
- stdout.puts line.insert(0, " " * ident)
+ stdout.puts line.insert(0, " " * indent)
end
stdout.puts unless para == paras.last
end
View
6 spec/shell/basic_spec.rb
@@ -122,8 +122,8 @@ def shell
TABLE
end
- it "prints a table with identation" do
- content = capture(:stdout){ shell.print_table(@table, :ident => 2) }
+ it "prints a table with indentation" do
+ content = capture(:stdout){ shell.print_table(@table, :indent => 2) }
content.should == <<-TABLE
abc #123 first three
#0 empty
@@ -133,7 +133,7 @@ def shell
it "uses maximum terminal width" do
shell.should_receive(:terminal_width).and_return(20)
- content = capture(:stdout){ shell.print_table(@table, :ident => 2, :truncate => true) }
+ content = capture(:stdout){ shell.print_table(@table, :indent => 2, :truncate => true) }
content.should == <<-TABLE
abc #123 firs...
#0 empty
Something went wrong with that request. Please try again.