nanite 0.4.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/LICENSE +201 -0
  2. data/README.rdoc +430 -0
  3. data/Rakefile +76 -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 +264 -0
  13. data/lib/nanite/amqp.rb +58 -0
  14. data/lib/nanite/cluster.rb +250 -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 +309 -0
  24. data/lib/nanite/mapper_proxy.rb +67 -0
  25. data/lib/nanite/nanite_dispatcher.rb +92 -0
  26. data/lib/nanite/packets.rb +365 -0
  27. data/lib/nanite/pid_file.rb +52 -0
  28. data/lib/nanite/reaper.rb +39 -0
  29. data/lib/nanite/security/cached_certificate_store_proxy.rb +24 -0
  30. data/lib/nanite/security/certificate.rb +55 -0
  31. data/lib/nanite/security/certificate_cache.rb +66 -0
  32. data/lib/nanite/security/distinguished_name.rb +34 -0
  33. data/lib/nanite/security/encrypted_document.rb +46 -0
  34. data/lib/nanite/security/rsa_key_pair.rb +53 -0
  35. data/lib/nanite/security/secure_serializer.rb +68 -0
  36. data/lib/nanite/security/signature.rb +46 -0
  37. data/lib/nanite/security/static_certificate_store.rb +35 -0
  38. data/lib/nanite/security_provider.rb +47 -0
  39. data/lib/nanite/serializer.rb +52 -0
  40. data/lib/nanite/state.rb +168 -0
  41. data/lib/nanite/streaming.rb +125 -0
  42. data/lib/nanite/util.rb +58 -0
  43. metadata +109 -0
@@ -0,0 +1,58 @@
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
+ end
31
+
32
+ class Object
33
+ unless defined? instance_exec # 1.9 and 1.8.7
34
+ module InstanceExecHelper; end
35
+ include InstanceExecHelper
36
+
37
+ # Evaluate the block with the given arguments within the context of
38
+ # this object, so self is set to the method receiver.
39
+ #
40
+ # From Mauricio's http://eigenclass.org/hiki/bounded+space+instance_exec
41
+ def instance_exec(*args, &block)
42
+ begin
43
+ old_critical, Thread.critical = Thread.critical, true
44
+ n = 0
45
+ n += 1 while respond_to?(method_name = "__instance_exec#{n}")
46
+ InstanceExecMethods.module_eval { define_method(method_name, &block) }
47
+ ensure
48
+ Thread.critical = old_critical
49
+ end
50
+
51
+ begin
52
+ send(method_name, *args)
53
+ ensure
54
+ InstanceExecMethods.module_eval { remove_method(method_name) } rescue nil
55
+ end
56
+ end
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nanite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Ezra Zygmuntowicz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-22 00:00:00 +13: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/actor.rb
43
+ - lib/nanite/actor_registry.rb
44
+ - lib/nanite/admin.rb
45
+ - lib/nanite/agent.rb
46
+ - lib/nanite/amqp.rb
47
+ - lib/nanite/cluster.rb
48
+ - lib/nanite/config.rb
49
+ - lib/nanite/console.rb
50
+ - lib/nanite/daemonize.rb
51
+ - lib/nanite/identity.rb
52
+ - lib/nanite/job.rb
53
+ - lib/nanite/local_state.rb
54
+ - lib/nanite/log/formatter.rb
55
+ - lib/nanite/log.rb
56
+ - lib/nanite/mapper.rb
57
+ - lib/nanite/mapper_proxy.rb
58
+ - lib/nanite/nanite_dispatcher.rb
59
+ - lib/nanite/packets.rb
60
+ - lib/nanite/pid_file.rb
61
+ - lib/nanite/reaper.rb
62
+ - lib/nanite/security/cached_certificate_store_proxy.rb
63
+ - lib/nanite/security/certificate.rb
64
+ - lib/nanite/security/certificate_cache.rb
65
+ - lib/nanite/security/distinguished_name.rb
66
+ - lib/nanite/security/encrypted_document.rb
67
+ - lib/nanite/security/rsa_key_pair.rb
68
+ - lib/nanite/security/secure_serializer.rb
69
+ - lib/nanite/security/signature.rb
70
+ - lib/nanite/security/static_certificate_store.rb
71
+ - lib/nanite/security_provider.rb
72
+ - lib/nanite/serializer.rb
73
+ - lib/nanite/state.rb
74
+ - lib/nanite/streaming.rb
75
+ - lib/nanite/util.rb
76
+ - lib/nanite.rb
77
+ - bin/nanite-admin
78
+ - bin/nanite-agent
79
+ - bin/nanite-mapper
80
+ has_rdoc: true
81
+ homepage: http://github.com/ezmobius/nanite
82
+ licenses: []
83
+
84
+ post_install_message:
85
+ rdoc_options: []
86
+
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: "0"
94
+ version:
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: "0"
100
+ version:
101
+ requirements: []
102
+
103
+ rubyforge_project:
104
+ rubygems_version: 1.3.5
105
+ signing_key:
106
+ specification_version: 3
107
+ summary: self assembling fabric of ruby daemons
108
+ test_files: []
109
+