vayacondios-client 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/vayacondios/client/itemset.rb +25 -8
  2. metadata +4 -4
@@ -33,11 +33,17 @@ class Vayacondios
33
33
  private
34
34
 
35
35
  def execute_request req
36
- resp = Net::HTTP.start(@host, @port) do |http|
37
- http.request(req)
38
- end.body
39
- result = MultiJson.decode(resp) unless resp.nil? or resp.empty?
40
- (result.respond_to?(:has_key?) and result.has_key? "error") ? nil : result
36
+ begin
37
+ resp = Net::HTTP.start(@host, @port) do |http|
38
+ http.request(req)
39
+ end.body
40
+ result = MultiJson.decode(resp) unless resp.nil? or resp.empty?
41
+ (result.respond_to?(:has_key?) and result.has_key? "error") ? nil : result
42
+ rescue StandardError => ex
43
+ Log.warn("problem contacting vayacondios: #{ex.message}")
44
+ Log.debug(ex.backtrace.join("\n"))
45
+ nil
46
+ end
41
47
  end
42
48
 
43
49
  def path organization, topic, id
@@ -83,9 +89,6 @@ class Vayacondios
83
89
  @poll_wait_sec = poll_wait_sec
84
90
  end
85
91
 
86
- def setup() end
87
- def teardown() end
88
-
89
92
  def run
90
93
  setup
91
94
  loop do
@@ -103,6 +106,20 @@ class Vayacondios
103
106
  end
104
107
  teardown
105
108
  end
109
+
110
+ protected
111
+
112
+ def add_items
113
+ raise NoMethodError.new("class #{self.class.name} must override add_items")
114
+ end
115
+
116
+ def remove_items
117
+ raise NoMethodError.new("class #{self.class.name} must override remove_items")
118
+ end
119
+
120
+ def setup() end
121
+ def teardown() end
122
+
106
123
  end
107
124
  end
108
125
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vayacondios-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-04-02 00:00:00.000000000 Z
15
+ date: 2013-04-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: configliere
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: 1788839692772857414
143
+ hash: -2782447061261388226
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: 1788839692772857414
152
+ hash: -2782447061261388226
153
153
  requirements: []
154
154
  rubyforge_project:
155
155
  rubygems_version: 1.8.25