Navigation Menu

Skip to content

Commit

Permalink
Bug fix: Don't raise errors on bad convertion to path, and let the bu…
Browse files Browse the repository at this point in the history
…iltin methods convert using to_str.

         Issue marcandre#37, thanks David Fugère (v 2.0.3)
  • Loading branch information
marcandre committed Mar 28, 2011
1 parent d387d86 commit fb2e782
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION.yml
Expand Up @@ -2,4 +2,4 @@
:build:
:major: 2
:minor: 0
:patch: 2
:patch: 3
4 changes: 2 additions & 2 deletions backports.gemspec
Expand Up @@ -5,11 +5,11 @@

Gem::Specification.new do |s|
s.name = %q{backports}
s.version = "2.0.2"
s.version = "2.0.3"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Marc-Andr\303\251 Lafortune"]
s.date = %q{2011-03-08}
s.date = %q{2011-03-28}
s.description = %q{ Essential backports that enable some of the really nice features of ruby 1.8.7, ruby 1.9 and rails from ruby 1.8.6 and earlier.
}
s.email = %q{github@marc-andre.ca}
Expand Down
7 changes: 1 addition & 6 deletions lib/backports/tools.rb
Expand Up @@ -100,12 +100,7 @@ def #{aliased_target}_with_potential_path_arguments#{punctuation}(#{first_args}*
end

def self.convert_to_path(file_or_path)
begin
file_or_path = file_or_path.to_path
rescue NameError
# ignore
end
coerce_to(file_or_path, String, :to_str)
file_or_path.respond_to?(:to_path) ? file_or_path.to_path : file_or_path
end

# Modified to avoid polluting Module if so desired
Expand Down

0 comments on commit fb2e782

Please sign in to comment.