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:
parent
64b9c2d44f
commit
a6e78b4504
3 changed files with 11 additions and 7 deletions
|
@ -9,6 +9,7 @@ rescue LoadError => e
|
||||||
raise LoadError, "no such file to load -- net/https. Try running apt-get install libopenssl-ruby"
|
raise LoadError, "no such file to load -- net/https. Try running apt-get install libopenssl-ruby"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require File.dirname(__FILE__) + '/restclient/version'
|
||||||
require File.dirname(__FILE__) + '/restclient/exceptions'
|
require File.dirname(__FILE__) + '/restclient/exceptions'
|
||||||
require File.dirname(__FILE__) + '/restclient/request'
|
require File.dirname(__FILE__) + '/restclient/request'
|
||||||
require File.dirname(__FILE__) + '/restclient/abstract_response'
|
require File.dirname(__FILE__) + '/restclient/abstract_response'
|
||||||
|
@ -103,12 +104,6 @@ module RestClient
|
||||||
@@log = create_log log
|
@@log = create_log log
|
||||||
end
|
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
|
# 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)
|
# 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
|
def self.create_log param
|
||||||
|
|
7
lib/restclient/version.rb
Normal file
7
lib/restclient/version.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
module RestClient
|
||||||
|
VERSION = '1.7.0.alpha' unless defined?(self::VERSION)
|
||||||
|
|
||||||
|
def self.version
|
||||||
|
VERSION
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,8 +1,10 @@
|
||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
|
|
||||||
|
require File.expand_path("../lib/restclient/version", __FILE__)
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = 'rest-client'
|
s.name = 'rest-client'
|
||||||
s.version = '1.7.0.alpha'
|
s.version = RestClient::VERSION
|
||||||
s.authors = ['REST Client Team']
|
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.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'
|
s.license = 'MIT'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue