mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Add Pry::CommandContext#text
This commit is contained in:
parent
495e00caa7
commit
26d584b55b
3 changed files with 8 additions and 3 deletions
|
@ -23,8 +23,13 @@ class Pry
|
||||||
command_set.commands
|
command_set.commands
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def text
|
||||||
|
@text ||= Class.new do
|
||||||
|
extend Pry::Helpers::Color
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
include Pry::Helpers::BaseHelpers
|
include Pry::Helpers::BaseHelpers
|
||||||
include Pry::Helpers::CommandHelpers
|
include Pry::Helpers::CommandHelpers
|
||||||
include Pry::Helpers::Color
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Pry
|
||||||
|
|
||||||
history.each_with_index do |element, index|
|
history.each_with_index do |element, index|
|
||||||
if element =~ pattern
|
if element =~ pattern
|
||||||
output.puts "#{blue index}: #{element}"
|
output.puts "#{text.blue index}: #{element}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Pry
|
||||||
line_array = lines.each_line.to_a
|
line_array = lines.each_line.to_a
|
||||||
line_array.each_with_index.map do |line, idx|
|
line_array.each_with_index.map do |line, idx|
|
||||||
adjusted_index = idx + start_line
|
adjusted_index = idx + start_line
|
||||||
"#{blue adjusted_index}: #{line}"
|
"#{text.blue adjusted_index}: #{line}"
|
||||||
end.join
|
end.join
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue