rightscale-nanite-dev 0.4.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/LICENSE +201 -0
  2. data/README.rdoc +430 -0
  3. data/Rakefile +78 -0
  4. data/TODO +24 -0
  5. data/bin/nanite-admin +65 -0
  6. data/bin/nanite-agent +79 -0
  7. data/bin/nanite-mapper +50 -0
  8. data/lib/nanite.rb +74 -0
  9. data/lib/nanite/actor.rb +71 -0
  10. data/lib/nanite/actor_registry.rb +26 -0
  11. data/lib/nanite/admin.rb +138 -0
  12. data/lib/nanite/agent.rb +274 -0
  13. data/lib/nanite/amqp.rb +58 -0
  14. data/lib/nanite/cluster.rb +256 -0
  15. data/lib/nanite/config.rb +111 -0
  16. data/lib/nanite/console.rb +39 -0
  17. data/lib/nanite/daemonize.rb +13 -0
  18. data/lib/nanite/identity.rb +16 -0
  19. data/lib/nanite/job.rb +104 -0
  20. data/lib/nanite/local_state.rb +38 -0
  21. data/lib/nanite/log.rb +66 -0
  22. data/lib/nanite/log/formatter.rb +39 -0
  23. data/lib/nanite/mapper.rb +315 -0
  24. data/lib/nanite/mapper_proxy.rb +75 -0
  25. data/lib/nanite/nanite_dispatcher.rb +92 -0
  26. data/lib/nanite/packets.rb +401 -0
  27. data/lib/nanite/pid_file.rb +52 -0
  28. data/lib/nanite/reaper.rb +39 -0
  29. data/lib/nanite/redis_tag_store.rb +141 -0
  30. data/lib/nanite/security/cached_certificate_store_proxy.rb +24 -0
  31. data/lib/nanite/security/certificate.rb +55 -0
  32. data/lib/nanite/security/certificate_cache.rb +66 -0
  33. data/lib/nanite/security/distinguished_name.rb +34 -0
  34. data/lib/nanite/security/encrypted_document.rb +46 -0
  35. data/lib/nanite/security/rsa_key_pair.rb +53 -0
  36. data/lib/nanite/security/secure_serializer.rb +68 -0
  37. data/lib/nanite/security/signature.rb +46 -0
  38. data/lib/nanite/security/static_certificate_store.rb +35 -0
  39. data/lib/nanite/security_provider.rb +47 -0
  40. data/lib/nanite/serializer.rb +52 -0
  41. data/lib/nanite/state.rb +135 -0
  42. data/lib/nanite/streaming.rb +125 -0
  43. data/lib/nanite/util.rb +78 -0
  44. metadata +111 -0
@@ -0,0 +1,78 @@
1
+ class String
2
+ ##
3
+ # Convert to snake case.
4
+ #
5
+ # "FooBar".snake_case #=> "foo_bar"
6
+ # "HeadlineCNNNews".snake_case #=> "headline_cnn_news"
7
+ # "CNN".snake_case #=> "cnn"
8
+ #
9
+ # @return [String] Receiver converted to snake case.
10
+ #
11
+ # @api public
12
+ def snake_case
13
+ return self.downcase if self =~ /^[A-Z]+$/
14
+ self.gsub(/([A-Z]+)(?=[A-Z][a-z]?)|\B[A-Z]/, '_\&') =~ /_*(.*)/
15
+ return $+.downcase
16
+ end
17
+
18
+ ##
19
+ # Convert a constant name to a path, assuming a conventional structure.
20
+ #
21
+ # "FooBar::Baz".to_const_path # => "foo_bar/baz"
22
+ #
23
+ # @return [String] Path to the file containing the constant named by receiver
24
+ # (constantized string), assuming a conventional structure.
25
+ #
26
+ # @api public
27
+ def to_const_path
28
+ snake_case.gsub(/::/, "/")
29
+ end
30
+
31
+ # Convert constant name to constant
32
+ #
33
+ # "FooBar::Baz".to_const => FooBar::Baz
34
+ #
35
+ # @return [Constant] Constant corresponding to given name or nil if no
36
+ # constant with that name exists
37
+ #
38
+ # @api public
39
+ def to_const
40
+ names = split('::')
41
+ names.shift if names.empty? || names.first.empty?
42
+
43
+ constant = Object
44
+ names.each do |name|
45
+ # modified to return nil instead of raising an const_missing error
46
+ constant = constant && constant.const_defined?(name) ? constant.const_get(name) : nil
47
+ end
48
+ constant
49
+ end
50
+ end
51
+
52
+ class Object
53
+ unless defined? instance_exec # 1.9 and 1.8.7
54
+ module InstanceExecHelper; end
55
+ include InstanceExecHelper
56
+
57
+ # Evaluate the block with the given arguments within the context of
58
+ # this object, so self is set to the method receiver.
59
+ #
60
+ # From Mauricio's http://eigenclass.org/hiki/bounded+space+instance_exec
61
+ def instance_exec(*args, &block)
62
+ begin
63
+ old_critical, Thread.critical = Thread.critical, true
64
+ n = 0
65
+ n += 1 while respond_to?(method_name = "__instance_exec#{n}")
66
+ InstanceExecMethods.module_eval { define_method(method_name, &block) }
67
+ ensure
68
+ Thread.critical = old_critical
69
+ end
70
+
71
+ begin
72
+ send(method_name, *args)
73
+ ensure
74
+ InstanceExecMethods.module_eval { remove_method(method_name) } rescue nil
75
+ end
76
+ end
77
+ end
78
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rightscale-nanite-dev
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.1.10
5
+ platform: ruby
6
+ authors:
7
+ - Ezra Zygmuntowicz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-11-09 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: amqp
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.6.0
24
+ version:
25
+ description: self assembling fabric of ruby daemons
26
+ email: ezra@engineyard.com
27
+ executables:
28
+ - nanite-agent
29
+ - nanite-mapper
30
+ - nanite-admin
31
+ extensions: []
32
+
33
+ extra_rdoc_files:
34
+ - README.rdoc
35
+ - LICENSE
36
+ - TODO
37
+ files:
38
+ - LICENSE
39
+ - README.rdoc
40
+ - Rakefile
41
+ - TODO
42
+ - lib/nanite
43
+ - lib/nanite/actor.rb
44
+ - lib/nanite/actor_registry.rb
45
+ - lib/nanite/admin.rb
46
+ - lib/nanite/agent.rb
47
+ - lib/nanite/amqp.rb
48
+ - lib/nanite/cluster.rb
49
+ - lib/nanite/config.rb
50
+ - lib/nanite/console.rb
51
+ - lib/nanite/daemonize.rb
52
+ - lib/nanite/identity.rb
53
+ - lib/nanite/job.rb
54
+ - lib/nanite/local_state.rb
55
+ - lib/nanite/log
56
+ - lib/nanite/log/formatter.rb
57
+ - lib/nanite/log.rb
58
+ - lib/nanite/mapper.rb
59
+ - lib/nanite/mapper_proxy.rb
60
+ - lib/nanite/nanite_dispatcher.rb
61
+ - lib/nanite/packets.rb
62
+ - lib/nanite/pid_file.rb
63
+ - lib/nanite/reaper.rb
64
+ - lib/nanite/redis_tag_store.rb
65
+ - lib/nanite/security
66
+ - lib/nanite/security/cached_certificate_store_proxy.rb
67
+ - lib/nanite/security/certificate.rb
68
+ - lib/nanite/security/certificate_cache.rb
69
+ - lib/nanite/security/distinguished_name.rb
70
+ - lib/nanite/security/encrypted_document.rb
71
+ - lib/nanite/security/rsa_key_pair.rb
72
+ - lib/nanite/security/secure_serializer.rb
73
+ - lib/nanite/security/signature.rb
74
+ - lib/nanite/security/static_certificate_store.rb
75
+ - lib/nanite/security_provider.rb
76
+ - lib/nanite/serializer.rb
77
+ - lib/nanite/state.rb
78
+ - lib/nanite/streaming.rb
79
+ - lib/nanite/util.rb
80
+ - lib/nanite.rb
81
+ - bin/nanite-admin
82
+ - bin/nanite-agent
83
+ - bin/nanite-mapper
84
+ has_rdoc: true
85
+ homepage: http://github.com/ezmobius/nanite
86
+ post_install_message:
87
+ rdoc_options: []
88
+
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: "0"
96
+ version:
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: "0"
102
+ version:
103
+ requirements: []
104
+
105
+ rubyforge_project:
106
+ rubygems_version: 1.3.1
107
+ signing_key:
108
+ specification_version: 2
109
+ summary: self assembling fabric of ruby daemons
110
+ test_files: []
111
+