1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Restore version file and use it in gemspec.

After the VERSION file was removed in ca52137496, RestClient.version
would always return "0.0.0".
This commit is contained in:
Andy Brody 2013-08-06 20:17:08 -07:00 committed by Andy Brody
parent 64b9c2d44f
commit a6e78b4504
3 changed files with 11 additions and 7 deletions

View file

@ -9,6 +9,7 @@ rescue LoadError => e
raise LoadError, "no such file to load -- net/https. Try running apt-get install libopenssl-ruby"
end
require File.dirname(__FILE__) + '/restclient/version'
require File.dirname(__FILE__) + '/restclient/exceptions'
require File.dirname(__FILE__) + '/restclient/request'
require File.dirname(__FILE__) + '/restclient/abstract_response'
@ -103,12 +104,6 @@ module RestClient
@@log = create_log log
end
def self.version
version_path = File.dirname(__FILE__) + "/../VERSION"
return File.read(version_path).chomp if File.file?(version_path)
"0.0.0"
end
# Create a log that respond to << like a logger
# param can be 'stdout', 'stderr', a string (then we will log to that file) or a logger (then we return it)
def self.create_log param

View file

@ -0,0 +1,7 @@
module RestClient
VERSION = '1.7.0.alpha' unless defined?(self::VERSION)
def self.version
VERSION
end
end

View file

@ -1,8 +1,10 @@
# -*- encoding: utf-8 -*-
require File.expand_path("../lib/restclient/version", __FILE__)
Gem::Specification.new do |s|
s.name = 'rest-client'
s.version = '1.7.0.alpha'
s.version = RestClient::VERSION
s.authors = ['REST Client Team']
s.description = 'A simple HTTP and REST client for Ruby, inspired by the Sinatra microframework style of specifying actions: get, put, post, delete.'
s.license = 'MIT'