summaryrefslogtreecommitdiff
path: root/lib/bundler/vendor/thor/lib/thor/util.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/vendor/thor/lib/thor/util.rb')
-rw-r--r--lib/bundler/vendor/thor/lib/thor/util.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/bundler/vendor/thor/lib/thor/util.rb b/lib/bundler/vendor/thor/lib/thor/util.rb
index 0fe7d4d859..ddf4d21b90 100644
--- a/lib/bundler/vendor/thor/lib/thor/util.rb
+++ b/lib/bundler/vendor/thor/lib/thor/util.rb
@@ -211,7 +211,7 @@ class Bundler::Thor
#
def globs_for(path)
path = escape_globs(path)
- ["#{path}/Bundler::Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/*.thor"]
+ ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/*.thor"]
end
# Return the path to the ruby interpreter taking into account multiple
@@ -263,6 +263,22 @@ class Bundler::Thor
def escape_globs(path)
path.to_s.gsub(/[*?{}\[\]]/, '\\\\\\&')
end
+
+ # Returns a string that has had any HTML characters escaped.
+ #
+ # ==== Examples
+ #
+ # Bundler::Thor::Util.escape_html('<div>') # => "&lt;div&gt;"
+ #
+ # ==== Parameters
+ # String
+ #
+ # ==== Returns
+ # String
+ #
+ def escape_html(string)
+ CGI.escapeHTML(string)
+ end
end
end
end