lib/patron.rb in patron-0.4.10 vs lib/patron.rb in patron-0.4.11

- old
+ new

@@ -20,24 +20,18 @@ ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ## THE SOFTWARE. ## ## ------------------------------------------------------------------- -require 'yaml' require 'pathname' cwd = Pathname(__FILE__).dirname $:.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.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}" + VERSION end end