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.
Files changed (5) hide show
  1. data/README.rdoc +13 -9
  2. data/Rakefile +0 -1
  3. data/VERSION +1 -1
  4. data/lib/rubyhaze.rb +10 -5
  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
- Now let's share our own objects:
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::Stored
41
- field :name, :string
42
- field :age, :int
44
+ include RubyHaze::Persisted
45
+ attribute :name, :string
46
+ attribute :age, :int
43
47
  end
44
48
 
45
- a = Foo.create :name => "Leonardo", :age => 65
46
- b = Foo.create :name => "Michelangelo", :age => 45
47
- c = Foo.create :name => "Raffaello", :age => 32
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 'age BETWEEN 40 AND 50'
53
+ found = Foo.find "age < 60 AND name LIKE '%lo'"
50
54
  found.first.name
51
55
 
52
- >> "Michelangelo"
56
+ >> "Raffaello"
53
57
 
54
58
  == Note on Patches/Pull Requests
55
59
 
data/Rakefile CHANGED
@@ -15,7 +15,6 @@ begin
15
15
  gem.files = FileList['bin/*', 'lib/**/*.rb', 'jars/**/*', 'test/**/*.rb', '[A-Z]*'].to_a
16
16
  gem.test_files = Dir["test/test*.rb"]
17
17
  gem.platform = "jruby"
18
- gem.add_dependency "bitescript"
19
18
  end
20
19
  Jeweler::GemcutterTasks.new
21
20
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
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
- - 4
9
- version: 0.0.4
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
- - !ruby/object:Gem::Dependency
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: