From fde35add287deca1c5672b4c46bee06384595293 Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Wed, 17 May 2017 19:25:48 +0100 Subject: [PATCH] update version to include revision & channel --- lib/postal/http.rb | 2 +- lib/postal/version.rb | 8 ++++++++ script/version.rb | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/postal/http.rb b/lib/postal/http.rb index 960e061..143be05 100644 --- a/lib/postal/http.rb +++ b/lib/postal/http.rb @@ -42,7 +42,7 @@ module Postal #request.add_field 'X-Postal-Signature', signature end - request['User-Agent'] = options[:user_agent] || "Postal/#{Postal::VERSION}" + request['User-Agent'] = options[:user_agent] || "Postal/#{Postal.version}" connection = Net::HTTP.new(uri.host, uri.port) diff --git a/lib/postal/version.rb b/lib/postal/version.rb index 6321e76..de37751 100644 --- a/lib/postal/version.rb +++ b/lib/postal/version.rb @@ -1,3 +1,11 @@ module Postal + VERSION = '1.0.0' + REVISION = nil + CHANNEL = 'dev' + + def self.version + [VERSION, REVISION, CHANNEL].compact.join('-') + end + end diff --git a/script/version.rb b/script/version.rb index 023b67a..42c8317 100644 --- a/script/version.rb +++ b/script/version.rb @@ -1,3 +1,3 @@ #!/usr/bin/env ruby require File.expand_path('../../lib/postal/version', __FILE__) -puts Postal::VERSION +puts Postal.version