summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2017-09-24 23:03:21 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2017-09-25 06:51:00 -0300
commit32df1901c7220bf54832fcf14856406beea2fe7e (patch)
tree84c5a4f4c2e59faad6ca83043df015a437ff000e
parent8a8df658f6ef233ff3a75de2f9e989c942cd0c05 (diff)
downloadhighline-32df1901c7220bf54832fcf14856406beea2fe7e.tar.gz
Add meaningful heredoc delimiters
-rw-r--r--examples/page_and_wrap.rb4
-rw-r--r--highline.gemspec4
-rw-r--r--lib/highline/string_extensions.rb12
-rw-r--r--test/acceptance/acceptance.rb4
4 files changed, 12 insertions, 12 deletions
diff --git a/examples/page_and_wrap.rb b/examples/page_and_wrap.rb
index 2dd3c23..d9c0662 100644
--- a/examples/page_and_wrap.rb
+++ b/examples/page_and_wrap.rb
@@ -12,7 +12,7 @@ require "highline/import"
HighLine.default_instance.wrap_at = 80
HighLine.default_instance.page_at = 22
-say(<<END)
+say(<<CONSTITUTION)
THE UNITED STATES CONSTITUTION
We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.
@@ -320,4 +320,4 @@ James Wilson.
Gouv Morris
Attest William Jackson Secretary
-END
+CONSTITUTION
diff --git a/highline.gemspec b/highline.gemspec
index 69dbc60..fc8e7f5 100644
--- a/highline.gemspec
+++ b/highline.gemspec
@@ -11,12 +11,12 @@ Gem::Specification.new do |spec|
spec.email = "james@graysoftinc.com"
spec.summary = "HighLine is a high-level command-line IO library."
- spec.description = <<END_DESC
+ spec.description = <<DESCRIPTION
A high-level IO library that provides validation, type conversion, and more for
command-line interfaces. HighLine also includes a complete menu system that can
crank out anything from simple list selection to complete shells with just
minutes of work.
-END_DESC
+DESCRIPTION
spec.homepage = "https://github.com/JEG2/highline"
spec.license = "Ruby"
diff --git a/lib/highline/string_extensions.rb b/lib/highline/string_extensions.rb
index 521c4e4..f6c4c6b 100644
--- a/lib/highline/string_extensions.rb
+++ b/lib/highline/string_extensions.rb
@@ -96,28 +96,28 @@ class HighLine #:nodoc:
def self.define_builtin_style_methods(base)
HighLine::COLORS.each do |color|
color = color.downcase
- base.class_eval <<-END
+ base.class_eval <<-METHOD_DEFINITION
undef :#{color} if method_defined? :#{color}
def #{color}
color(:#{color})
end
- END
+ METHOD_DEFINITION
- base.class_eval <<-END
+ base.class_eval <<-METHOD_DEFINITION
undef :on_#{color} if method_defined? :on_#{color}
def on_#{color}
on(:#{color})
end
- END
+ METHOD_DEFINITION
HighLine::STYLES.each do |style|
style = style.downcase
- base.class_eval <<-END
+ base.class_eval <<-METHOD_DEFINITION
undef :#{style} if method_defined? :#{style}
def #{style}
color(:#{style})
end
- END
+ METHOD_DEFINITION
end
end
end
diff --git a/test/acceptance/acceptance.rb b/test/acceptance/acceptance.rb
index f9eecf6..9867b55 100644
--- a/test/acceptance/acceptance.rb
+++ b/test/acceptance/acceptance.rb
@@ -12,7 +12,7 @@ acceptance_test_files.each { |file| load file }
# Print a report
-report = <<EOF
+report = <<REPORT
===
Well done!
@@ -52,7 +52,7 @@ ENV['TERM_PROGRAM']: #{ENV['TERM_PROGRAM']}
Answers:
#{HighLine::AcceptanceTest.answers_for_report}
-EOF
+REPORT
puts report