rubyhaze 0.0.4-jruby → 0.0.5-jruby
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +13 -9
- data/Rakefile +0 -1
- data/VERSION +1 -1
- data/lib/rubyhaze.rb +10 -5
- metadata +4 -15
data/README.rdoc
CHANGED
@@ -32,24 +32,28 @@ Let's open another console to check how this distributed hash works:
|
|
32
32
|
|
33
33
|
== Distributed Objects
|
34
34
|
|
35
|
-
|
35
|
+
Check out the [rubyhaze-persisted|http://github.com/aemadrid/rubyhaze-persisted] gem to get your own distributed ruby objects:
|
36
36
|
|
37
|
+
shell> rvm jruby
|
38
|
+
shell> gem install rubyhaze-persisted
|
37
39
|
shell> rubyhaze_console
|
38
40
|
|
41
|
+
require 'rubyhaze-persisted'
|
42
|
+
|
39
43
|
class Foo
|
40
|
-
include RubyHaze::
|
41
|
-
|
42
|
-
|
44
|
+
include RubyHaze::Persisted
|
45
|
+
attribute :name, :string
|
46
|
+
attribute :age, :int
|
43
47
|
end
|
44
48
|
|
45
|
-
a = Foo.create :name => "
|
46
|
-
b = Foo.create :name => "
|
47
|
-
c = Foo.create :name => "
|
49
|
+
a = Foo.create :name => "Raffaello", :age => 32
|
50
|
+
b = Foo.create :name => "Leonardo", :age => 45
|
51
|
+
c = Foo.create :name => "Michelangelo", :age => 65
|
48
52
|
|
49
|
-
found = Foo.find
|
53
|
+
found = Foo.find "age < 60 AND name LIKE '%lo'"
|
50
54
|
found.first.name
|
51
55
|
|
52
|
-
>> "
|
56
|
+
>> "Raffaello"
|
53
57
|
|
54
58
|
== Note on Patches/Pull Requests
|
55
59
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/rubyhaze.rb
CHANGED
@@ -7,11 +7,6 @@ module RubyHaze
|
|
7
7
|
class Exception < StandardError; end
|
8
8
|
class HazelcastException < StandardError; end
|
9
9
|
|
10
|
-
if $DEBUG
|
11
|
-
TMP_PATH = (ENV['RUBYHAZE_TMP_PATH'] || File.join(File.dirname(__FILE__), '..', 'TMP'))
|
12
|
-
$CLASSPATH << TMP_PATH
|
13
|
-
end
|
14
|
-
|
15
10
|
unless defined? MODE
|
16
11
|
require 'rubyhaze/' + (ENV['RUBYHAZE_MODE'] || 'node')
|
17
12
|
end
|
@@ -50,6 +45,16 @@ module RubyHaze
|
|
50
45
|
Hazelcast.cluster
|
51
46
|
end
|
52
47
|
|
48
|
+
def random_uuid
|
49
|
+
java.util.UUID.randomUUID.to_string
|
50
|
+
end
|
51
|
+
|
52
|
+
def valid_uuid?(uuid)
|
53
|
+
!!(uuid.is_a?(String) &&
|
54
|
+
uuid.size == 36 &&
|
55
|
+
uuid =~ %r{^([A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12})$}i)
|
56
|
+
end
|
57
|
+
|
53
58
|
# Proxying to Hazelcast class
|
54
59
|
def respond_to?(meth)
|
55
60
|
super || Hazelcast.respond_to?(meth)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: jruby
|
11
11
|
authors:
|
12
12
|
- Adrian Madrid
|
@@ -16,19 +16,8 @@ cert_chain: []
|
|
16
16
|
|
17
17
|
date: 2010-08-30 00:00:00 -06:00
|
18
18
|
default_executable: rubyhaze_console
|
19
|
-
dependencies:
|
20
|
-
|
21
|
-
name: bitescript
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
version: "0"
|
30
|
-
type: :runtime
|
31
|
-
version_requirements: *id001
|
19
|
+
dependencies: []
|
20
|
+
|
32
21
|
description: RubyHaze is a little gem that wraps the Java Hazelcast library into a more comfortable Ruby package (in JRuby, of course).
|
33
22
|
email: aemadrid@gmail.com
|
34
23
|
executables:
|