lib/patron.rb in patron-0.4.3 vs lib/patron.rb in patron-0.4.4
- old
+ new
@@ -24,18 +24,18 @@
## -------------------------------------------------------------------
require 'yaml'
require 'pathname'
cwd = Pathname(__FILE__).dirname
-$:.unshift(cwd) unless $:.include?(cwd) || $:.include?(cwd.expand_path)
+$:.unshift(cwd.to_s) unless $:.include?(cwd.to_s) || $:.include?(cwd.expand_path.to_s)
require 'patron/session'
module Patron #:nodoc:
# Returns the version number of the Patron library as a string
def self.version
- cwd = Pathname(__FILE__).dirname
- yaml = YAML.load_file(cwd.expand_path + '../VERSION.yml')
+ cwd = Pathname(__FILE__).dirname.expand_path.to_s
+ yaml = YAML.load_file(cwd + '/../VERSION.yml')
major = (yaml['major'] || yaml[:major]).to_i
minor = (yaml['minor'] || yaml[:minor]).to_i
patch = (yaml['patch'] || yaml[:patch]).to_i
"#{major}.#{minor}.#{patch}"
end