engineyard-serverside 1.5.26 → 1.5.27.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/lib/engineyard-serverside.rb +1 -2
  2. data/lib/engineyard-serverside/cli.rb +19 -35
  3. data/lib/engineyard-serverside/deploy.rb +4 -3
  4. data/lib/engineyard-serverside/future.rb +29 -0
  5. data/lib/engineyard-serverside/futures/celluloid.rb +25 -0
  6. data/lib/engineyard-serverside/futures/dataflow.rb +31 -0
  7. data/lib/engineyard-serverside/server.rb +27 -2
  8. data/lib/engineyard-serverside/task.rb +10 -11
  9. data/lib/engineyard-serverside/version.rb +1 -1
  10. data/lib/vendor/celluloid/lib/celluloid.rb +261 -0
  11. data/lib/vendor/celluloid/lib/celluloid/actor.rb +242 -0
  12. data/lib/vendor/celluloid/lib/celluloid/actor_pool.rb +54 -0
  13. data/lib/vendor/celluloid/lib/celluloid/actor_proxy.rb +75 -0
  14. data/lib/vendor/celluloid/lib/celluloid/application.rb +78 -0
  15. data/lib/vendor/celluloid/lib/celluloid/calls.rb +94 -0
  16. data/lib/vendor/celluloid/lib/celluloid/core_ext.rb +14 -0
  17. data/lib/vendor/celluloid/lib/celluloid/events.rb +14 -0
  18. data/lib/vendor/celluloid/lib/celluloid/fiber.rb +33 -0
  19. data/lib/vendor/celluloid/lib/celluloid/fsm.rb +141 -0
  20. data/lib/vendor/celluloid/lib/celluloid/future.rb +60 -0
  21. data/lib/vendor/celluloid/lib/celluloid/links.rb +61 -0
  22. data/lib/vendor/celluloid/lib/celluloid/logger.rb +32 -0
  23. data/lib/vendor/celluloid/lib/celluloid/mailbox.rb +124 -0
  24. data/lib/vendor/celluloid/lib/celluloid/receivers.rb +66 -0
  25. data/lib/vendor/celluloid/lib/celluloid/registry.rb +33 -0
  26. data/lib/vendor/celluloid/lib/celluloid/responses.rb +26 -0
  27. data/lib/vendor/celluloid/lib/celluloid/rspec.rb +2 -0
  28. data/lib/vendor/celluloid/lib/celluloid/signals.rb +50 -0
  29. data/lib/vendor/celluloid/lib/celluloid/supervisor.rb +57 -0
  30. data/lib/vendor/celluloid/lib/celluloid/task.rb +73 -0
  31. data/lib/vendor/celluloid/lib/celluloid/tcp_server.rb +33 -0
  32. data/lib/vendor/celluloid/lib/celluloid/timers.rb +109 -0
  33. data/lib/vendor/celluloid/lib/celluloid/version.rb +4 -0
  34. data/spec/basic_deploy_spec.rb +1 -1
  35. data/spec/bundler_deploy_spec.rb +1 -1
  36. data/spec/nodejs_deploy_spec.rb +1 -1
  37. data/spec/rails31_deploy_spec.rb +1 -1
  38. data/spec/services_deploy_spec.rb +1 -1
  39. metadata +78 -87
@@ -0,0 +1,109 @@
1
+ module Celluloid
2
+ # Low precision timers implemented in pure Ruby
3
+ class Timers
4
+ def initialize
5
+ @timers = []
6
+ end
7
+
8
+ # Call the given block after the given interval
9
+ def add(interval, &block)
10
+ Timer.new(self, interval, block)
11
+ end
12
+
13
+ # Wait for the next timer and fire it
14
+ def wait
15
+ return if @timers.empty?
16
+
17
+ interval = wait_interval
18
+ sleep interval if interval >= Timer::QUANTUM
19
+ fire
20
+ end
21
+
22
+ # Interval to wait until when the next timer will fire
23
+ def wait_interval
24
+ @timers.first.time - Time.now unless empty?
25
+ end
26
+
27
+ # Fire all timers that are ready
28
+ def fire
29
+ return if @timers.empty?
30
+
31
+ time = Time.now + Timer::QUANTUM
32
+ while not empty? and time > @timers.first.time
33
+ timer = @timers.shift
34
+ timer.call
35
+ end
36
+ end
37
+
38
+ # Insert a timer into the active timers
39
+ def insert(timer)
40
+ @timers.insert(index(timer), timer)
41
+ end
42
+
43
+ # Remove a given timer from the set we're monitoring
44
+ def cancel(timer)
45
+ @timers.delete timer
46
+ end
47
+
48
+ # Are there any timers pending?
49
+ def empty?
50
+ @timers.empty?
51
+ end
52
+
53
+ # Index where a timer would be located in the sorted timers array
54
+ def index(timer)
55
+ l, r = 0, @timers.size - 1
56
+
57
+ while l <= r
58
+ m = (r + l) / 2
59
+ if timer < @timers.at(m)
60
+ r = m - 1
61
+ else
62
+ l = m + 1
63
+ end
64
+ end
65
+ l
66
+ end
67
+ end
68
+
69
+ # An individual timer set to fire a given proc at a given time
70
+ class Timer
71
+ include Comparable
72
+
73
+ # The timer system is guaranteed (at least by the specs) to be this precise
74
+ # during normal operation. Long blocking calls within actors will delay the
75
+ # firing of timers
76
+ QUANTUM = 0.02
77
+
78
+ attr_reader :interval, :time
79
+
80
+ def initialize(timers, interval, block)
81
+ @timers, @interval = timers, interval
82
+ @block = block
83
+
84
+ reset
85
+ end
86
+
87
+ def <=>(other)
88
+ @time <=> other.time
89
+ end
90
+
91
+ # Cancel this timer
92
+ def cancel
93
+ @timers.cancel self
94
+ end
95
+
96
+ # Reset this timer
97
+ def reset
98
+ @timers.cancel self if defined?(@time)
99
+ @time = Time.now + @interval
100
+ @timers.insert self
101
+ end
102
+
103
+ # Fire the block
104
+ def fire
105
+ @block.call
106
+ end
107
+ alias_method :call, :fire
108
+ end
109
+ end
@@ -0,0 +1,4 @@
1
+ module Celluloid
2
+ VERSION = '0.7.1'
3
+ def self.version; VERSION; end
4
+ end
@@ -4,7 +4,7 @@ describe "Deploying an application without Bundler" do
4
4
  before(:all) do
5
5
  $DISABLE_GEMFILE = true # Don't generate Gemfile/Gemfile.lock
6
6
  $DISABLE_LOCKFILE = true
7
- @deploy_dir = Pathname.new(Dir.tmpdir).join("serverside-deploy-#{Time.now.to_i}-#{$$}")
7
+ @deploy_dir = Pathname.new(Dir.mktmpdir("serverside-deploy-#{Time.now.to_i}-#{$$}"))
8
8
 
9
9
  # set up EY::Serverside::Server like we're on a solo
10
10
  EY::Serverside::Server.reset
@@ -7,7 +7,7 @@ describe "Deploying an application that uses Bundler" do
7
7
  end
8
8
 
9
9
  def deploy_test_application
10
- @deploy_dir = File.join(Dir.tmpdir, "serverside-deploy-#{Time.now.to_i}-#{$$}")
10
+ @deploy_dir = Dir.mktmpdir("serverside-deploy-#{Time.now.to_i}-#{$$}")
11
11
 
12
12
  # set up EY::Serverside::Server like we're on a solo
13
13
  EY::Serverside::Server.reset
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe "Deploying an application that uses Node.js and NPM" do
4
4
  def deploy_test_application
5
- @deploy_dir = File.join(Dir.tmpdir, "serverside-deploy-#{Time.now.to_i}-#{$$}")
5
+ @deploy_dir = Dir.mktmpdir( "serverside-deploy-#{Time.now.to_i}-#{$$}")
6
6
 
7
7
  # set up EY::Serverside::Server like we're on a solo
8
8
  EY::Serverside::Server.reset
@@ -4,7 +4,7 @@ describe "Deploying a Rails 3.1 application" do
4
4
  def deploy_test_application(assets_enabled = true, &block)
5
5
  $DISABLE_GEMFILE = false
6
6
  $DISABLE_LOCKFILE = false
7
- @deploy_dir = File.join(Dir.tmpdir, "serverside-deploy-#{Time.now.to_i}-#{$$}")
7
+ @deploy_dir = Dir.mktmpdir("serverside-deploy-#{Time.now.to_i}-#{$$}")
8
8
 
9
9
  # set up EY::Serverside::Server like we're on a solo
10
10
  EY::Serverside::Server.reset
@@ -4,7 +4,7 @@ describe "Deploying an application with services" do
4
4
  before(:each) do
5
5
  #$DISABLE_GEMFILE = true # Don't generate Gemfile/Gemfile.lock
6
6
  #$DISABLE_LOCKFILE = true
7
- @deploy_dir = Pathname.new(Dir.tmpdir).join("serverside-deploy-#{Time.now.to_i}-#{$$}")
7
+ @deploy_dir = Pathname.new(Dir.mktmpdir("serverside-deploy-#{Time.now.to_i}-#{$$}"))
8
8
 
9
9
  # set up EY::Serverside::Server like we're on a solo
10
10
  EY::Serverside::Server.reset
metadata CHANGED
@@ -1,92 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
- version: !ruby/object:Gem::Version
4
- hash: 55
5
- prerelease:
6
- segments:
7
- - 1
8
- - 5
9
- - 26
10
- version: 1.5.26
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.27.pre
5
+ prerelease: 7
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - EY Cloud Team
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-01-21 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-01-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70200398795580 !ruby/object:Gem::Requirement
22
17
  none: false
23
- requirements:
24
- - - "="
25
- - !ruby/object:Gem::Version
26
- hash: 31
27
- segments:
28
- - 1
29
- - 3
30
- - 2
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
31
21
  version: 1.3.2
32
- requirement: *id001
33
22
  type: :development
34
23
  prerelease: false
35
- name: rspec
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70200398795580
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &70200398794920 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 11
43
- segments:
44
- - 0
45
- - 9
46
- - 2
47
- - 2
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
48
32
  version: 0.9.2.2
49
- requirement: *id002
50
33
  type: :development
51
34
  prerelease: false
52
- name: rake
53
- - !ruby/object:Gem::Dependency
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70200398794920
36
+ - !ruby/object:Gem::Dependency
37
+ name: rdoc
38
+ requirement: &70200398794340 !ruby/object:Gem::Requirement
55
39
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
63
- requirement: *id003
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
64
44
  type: :development
65
45
  prerelease: false
66
- name: rdoc
67
- - !ruby/object:Gem::Dependency
68
- version_requirements: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70200398794340
47
+ - !ruby/object:Gem::Dependency
48
+ name: timecop
49
+ requirement: &70200398793700 !ruby/object:Gem::Requirement
69
50
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 3
74
- segments:
75
- - 0
76
- version: "0"
77
- requirement: *id004
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
78
55
  type: :development
79
56
  prerelease: false
80
- name: timecop
57
+ version_requirements: *70200398793700
81
58
  description:
82
59
  email: cloud@engineyard.com
83
- executables:
60
+ executables:
84
61
  - engineyard-serverside
85
62
  extensions: []
86
-
87
63
  extra_rdoc_files: []
88
-
89
- files:
64
+ files:
90
65
  - bin/engineyard-serverside
91
66
  - lib/engineyard-serverside/cli.rb
92
67
  - lib/engineyard-serverside/configuration.rb
@@ -94,6 +69,9 @@ files:
94
69
  - lib/engineyard-serverside/deploy.rb
95
70
  - lib/engineyard-serverside/deploy_hook.rb
96
71
  - lib/engineyard-serverside/deprecation.rb
72
+ - lib/engineyard-serverside/future.rb
73
+ - lib/engineyard-serverside/futures/celluloid.rb
74
+ - lib/engineyard-serverside/futures/dataflow.rb
97
75
  - lib/engineyard-serverside/lockfile_parser.rb
98
76
  - lib/engineyard-serverside/logged_output.rb
99
77
  - lib/engineyard-serverside/rails_asset_support.rb
@@ -102,6 +80,30 @@ files:
102
80
  - lib/engineyard-serverside/task.rb
103
81
  - lib/engineyard-serverside/version.rb
104
82
  - lib/engineyard-serverside.rb
83
+ - lib/vendor/celluloid/lib/celluloid/actor.rb
84
+ - lib/vendor/celluloid/lib/celluloid/actor_pool.rb
85
+ - lib/vendor/celluloid/lib/celluloid/actor_proxy.rb
86
+ - lib/vendor/celluloid/lib/celluloid/application.rb
87
+ - lib/vendor/celluloid/lib/celluloid/calls.rb
88
+ - lib/vendor/celluloid/lib/celluloid/core_ext.rb
89
+ - lib/vendor/celluloid/lib/celluloid/events.rb
90
+ - lib/vendor/celluloid/lib/celluloid/fiber.rb
91
+ - lib/vendor/celluloid/lib/celluloid/fsm.rb
92
+ - lib/vendor/celluloid/lib/celluloid/future.rb
93
+ - lib/vendor/celluloid/lib/celluloid/links.rb
94
+ - lib/vendor/celluloid/lib/celluloid/logger.rb
95
+ - lib/vendor/celluloid/lib/celluloid/mailbox.rb
96
+ - lib/vendor/celluloid/lib/celluloid/receivers.rb
97
+ - lib/vendor/celluloid/lib/celluloid/registry.rb
98
+ - lib/vendor/celluloid/lib/celluloid/responses.rb
99
+ - lib/vendor/celluloid/lib/celluloid/rspec.rb
100
+ - lib/vendor/celluloid/lib/celluloid/signals.rb
101
+ - lib/vendor/celluloid/lib/celluloid/supervisor.rb
102
+ - lib/vendor/celluloid/lib/celluloid/task.rb
103
+ - lib/vendor/celluloid/lib/celluloid/tcp_server.rb
104
+ - lib/vendor/celluloid/lib/celluloid/timers.rb
105
+ - lib/vendor/celluloid/lib/celluloid/version.rb
106
+ - lib/vendor/celluloid/lib/celluloid.rb
105
107
  - lib/vendor/dataflow/dataflow/actor.rb
106
108
  - lib/vendor/dataflow/dataflow/equality.rb
107
109
  - lib/vendor/dataflow/dataflow/future_queue.rb
@@ -327,40 +329,29 @@ files:
327
329
  - spec/support/integration.rb
328
330
  homepage: http://github.com/engineyard/engineyard-serverside
329
331
  licenses: []
330
-
331
332
  post_install_message:
332
333
  rdoc_options: []
333
-
334
- require_paths:
334
+ require_paths:
335
335
  - lib
336
- required_ruby_version: !ruby/object:Gem::Requirement
336
+ required_ruby_version: !ruby/object:Gem::Requirement
337
337
  none: false
338
- requirements:
339
- - - ">="
340
- - !ruby/object:Gem::Version
341
- hash: 3
342
- segments:
343
- - 0
344
- version: "0"
345
- required_rubygems_version: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - ! '>='
340
+ - !ruby/object:Gem::Version
341
+ version: '0'
342
+ required_rubygems_version: !ruby/object:Gem::Requirement
346
343
  none: false
347
- requirements:
348
- - - ">="
349
- - !ruby/object:Gem::Version
350
- hash: 23
351
- segments:
352
- - 1
353
- - 3
354
- - 6
344
+ requirements:
345
+ - - ! '>='
346
+ - !ruby/object:Gem::Version
355
347
  version: 1.3.6
356
348
  requirements: []
357
-
358
349
  rubyforge_project:
359
- rubygems_version: 1.8.10
350
+ rubygems_version: 1.8.15
360
351
  signing_key:
361
352
  specification_version: 3
362
353
  summary: A gem that deploys ruby applications on EY Cloud instances
363
- test_files:
354
+ test_files:
364
355
  - spec/basic_deploy_spec.rb
365
356
  - spec/bundler_deploy_spec.rb
366
357
  - spec/custom_deploy_spec.rb