rightresource 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module RightResource
11
11
  end
12
12
 
13
13
  def logger
14
- @logger ||= Logger.new(STDERR)
14
+ @logger ||= Logger.new(STDERR).tap {|l| l.level = Logger::WARN}
15
15
  end
16
16
 
17
17
  # Set RESTFul client with login authentication for HTTP Methods(Low level)
@@ -2,7 +2,7 @@ module RightResource
2
2
  class Connection
3
3
  @reraise = false
4
4
 
5
- attr_accessor :api_version, :log, :api, :format, :username, :password, :account, :reraise
5
+ attr_accessor :api_version, :log, :api, :format, :username, :password, :account, :reraise, :logger
6
6
  attr_reader :headers, :resource_id, :response, :status
7
7
 
8
8
  # Set RestFul Client Parameters
@@ -10,7 +10,7 @@ module RightResource
10
10
  @api_version = API_VERSION
11
11
  @api = "https://my.rightscale.com/api/acct/"
12
12
  @format = params[:format] || RightResource::Formats::JsonFormat
13
- @logger = params[:logger] || Logger.new(STDERR)
13
+ @logger = params[:logger] || Logger.new(STDERR).tap {|l| l.level = Logger::WARN}
14
14
  RestClient.log = STDERR if @logger.level == Logger::DEBUG # HTTP request/response log
15
15
  yield self if block_given? # RightResource::Connection.new {|conn| ...}
16
16
  end
@@ -66,6 +66,7 @@ module RightResource
66
66
  @logger.debug {"#{__FILE__} #{__LINE__}: #{self.class}\n#{self.pretty_inspect}\n"}
67
67
  end
68
68
 
69
+ # Resource clear
69
70
  def clear
70
71
  @response = @headers = @resource_id = @status = nil
71
72
  ensure
@@ -85,8 +86,6 @@ module RightResource
85
86
 
86
87
  # update
87
88
  def put(path, headers={})
88
- puts path.pretty_inspect
89
- puts headers.pretty_inspect
90
89
  self.request(path, "put", headers)
91
90
  end
92
91
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rightresource
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Satoshi Ohki
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 +09:00
18
+ date: 2010-11-09 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency