cfoundry 0.3.37 → 0.3.38

Sign up to get free protection for your applications and to get access to all the features.
@@ -199,17 +199,10 @@ module CFoundry
199
199
 
200
200
  data = log_data(time, request, response)
201
201
 
202
- if @log.is_a?(Array)
203
- @log << data
204
- return
205
- end
206
-
207
202
  case @log
208
- when Array
209
- @log << data
210
- return
211
203
  when IO
212
204
  log_line(@log, data)
205
+ return
213
206
  when String
214
207
  if File.exists?(@log)
215
208
  log = File.readlines(@log).last(LOG_LENGTH - 1)
@@ -221,6 +214,18 @@ module CFoundry
221
214
  log.each { |l| io.print l } if log
222
215
  log_line(io, data)
223
216
  end
217
+
218
+ return
219
+ end
220
+
221
+ if @log.respond_to?(:call)
222
+ @log.call(data)
223
+ return
224
+ end
225
+
226
+ if @log.respond_to?(:<<)
227
+ @log << data
228
+ return
224
229
  end
225
230
  end
226
231
 
@@ -29,6 +29,7 @@ module CFoundry::V2
29
29
  attribute :disk_quota, :integer, :default => 256
30
30
  attribute :state, :integer, :default => "STOPPED"
31
31
  attribute :command, :string, :default => nil
32
+ attribute :console, :boolean, :default => false
32
33
  to_many :service_bindings
33
34
  to_many :routes
34
35
 
@@ -69,10 +70,6 @@ module CFoundry::V2
69
70
  nil
70
71
  end
71
72
 
72
- def console # TODO v2
73
- nil
74
- end
75
-
76
73
  def uris
77
74
  routes.collect do |r|
78
75
  "#{r.host}.#{r.domain.name}"
@@ -227,7 +227,9 @@ module CFoundry::V2
227
227
  true
228
228
  end
229
229
 
230
- def update!(diff = @diff)
230
+ def update!(diff = {})
231
+ diff = @diff.merge(diff)
232
+
231
233
  @manifest = @client.base.send(:"update_#{object_name}", @guid, diff)
232
234
 
233
235
  @diff.clear if diff == @diff
@@ -1,4 +1,4 @@
1
1
  module CFoundry # :nodoc:
2
2
  # CFoundry library version number.
3
- VERSION = "0.3.37"
3
+ VERSION = "0.3.38"
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfoundry
3
3
  version: !ruby/object:Gem::Version
4
- hash: 89
4
+ hash: 95
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 37
10
- version: 0.3.37
9
+ - 38
10
+ version: 0.3.38
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Suraci