rightresource 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,6 @@ require 'right_resource/macro'
38
38
  require 'right_resource/credential'
39
39
 
40
40
  module RightResource
41
- VERSION = '0.3.4'
41
+ VERSION = '0.3.5'
42
42
  API_VERSION = "1.0"
43
43
  end
@@ -41,6 +41,24 @@ class Server < RightResource::Base
41
41
  end
42
42
  end
43
43
 
44
+ # Get Current instance of server
45
+ def show_current(id, params={})
46
+ path = element_path(id, :current, params)
47
+ connection.clear
48
+ result = format.decode(connection.get(path)).tap do |resource|
49
+ correct_attributes(resource)
50
+ end
51
+ instantiate_record(result).tap do |resource|
52
+ resource.id = resource.href.sub(/\/current$/, "").match(/[0-9]+$/).to_s.to_i
53
+ end
54
+ rescue => e
55
+ logger.error("#{e.class}: #{e.pretty_inspect}")
56
+ logger.debug {"Backtrace:\n#{e.backtrace.pretty_inspect}"}
57
+ nil
58
+ ensure
59
+ logger.debug {"#{__FILE__} #{__LINE__}: #{self.class}\n#{self.pretty_inspect}\n"}
60
+ end
61
+
44
62
  # Get sampleing data
45
63
  # === Return
46
64
  # Hash (keys # => [:cf, :start, :vars, :lag_time, :end, :data :avg_lag_time])
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- version: 0.3.4
9
+ - 5
10
+ version: 0.3.5
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-12-02 00:00:00 +09:00
18
+ date: 2010-12-21 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency