gosen 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -4,7 +4,7 @@ require 'gosen/deployment'
4
4
  require 'gosen/error'
5
5
 
6
6
  module Gosen
7
- VERSION = "0.1.6"
7
+ VERSION = "0.1.7"
8
8
 
9
9
  # Extracts the site part of a Grid'5000 node hostname, and returns a hash indexing the nodes by their site
10
10
  # Example:
@@ -23,7 +23,8 @@ module Gosen
23
23
  @api_options = {}
24
24
  @logger = options.delete(:logger) || NullLogger.new
25
25
 
26
- @site.session.default_headers['User-Agent'] = "Gosen/#{Gosen::VERSION} Restfully/#{Restfully::VERSION}"
26
+ user_agent = @site.session.default_headers['User-Agent']
27
+ @site.session.default_headers['User-Agent'] = "Gosen/#{Gosen::VERSION} #{user_agent}" unless user_agent =~ /^Gosen\/#{Gosen::VERSION}/
27
28
 
28
29
  @min_deployed_nodes = options.delete(:min_deployed_nodes) || 1
29
30
  raise Gosen::Error.new("Invalid minimal number of deployed nodes, should be between 0 and #{@nodes.length}") if @min_deployed_nodes > @nodes.length || @min_deployed_nodes < 0
@@ -6,6 +6,7 @@ class TestDeployment < Test::Unit::TestCase
6
6
  @site = mock()
7
7
  @session = mock()
8
8
  @default_headers = mock()
9
+ @default_headers.stubs(:[]).with('User-Agent').returns("Restfully/#{Restfully::VERSION}")
9
10
  @default_headers.stubs(:[]=).with('User-Agent', "Gosen/#{Gosen::VERSION} Restfully/#{Restfully::VERSION}")
10
11
  @session.stubs(:default_headers).returns(@default_headers)
11
12
  @site.stubs(:session).returns(@session)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 7
9
+ version: 0.1.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pierre Riteau