jo 0.1.1-java → 0.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fb49f537a88d6b58dd0d0cc05a644c02b947556
4
- data.tar.gz: c1a2c6e26ae75765371de4fdaa40c0a5f480a2b4
3
+ metadata.gz: 559eb96d63fcb4376c64a03a82b5fb8084d542cc
4
+ data.tar.gz: 4bd7414fcdd8d13497624e786a1249125251c62b
5
5
  SHA512:
6
- metadata.gz: 2f840274dbe62e854d4493039fae60095edabbaf926c9f20d2257b1ee54b5d918b56595572f2b62242e92ee5290711f0e7943bce75b6c36c8b41eb57d15ff0f0
7
- data.tar.gz: e77f7f82bd7f057ced4f94a919eed36964be2c70da7b617a1c6b900e9496b5a072e9b86ecd8252be39699d5095c30e26bb1e799589b5edfd2d8fdbb891a0e254
6
+ metadata.gz: 4f43c6e0aa738dad708a9295dea968d10eb61bb0a5d292d730aebec78912d06abd8ea4a5ec68b69f9a656f92ec714d73be256171a26afcda901ac46057dd0b99
7
+ data.tar.gz: ceec90dfcb4763be3ab95501b67dfe06f55ee21ed99fec2fa806a47db0a6db653d0da7868e796f295b1f8d820f58c17c91b18f080211a8d11d3363ec3617ab9e
data/README.md CHANGED
@@ -18,6 +18,7 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
+ ```ruby
21
22
  require 'jo'
22
23
 
23
24
  include Jo
@@ -48,6 +49,7 @@ jo {ponger(c)}
48
49
  jo {printer(c)}
49
50
 
50
51
  gets # prevent exit
52
+ ```
51
53
 
52
54
  ## Contributing
53
55
 
@@ -1,3 +1,3 @@
1
1
  module Jo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <groupId>com.headius</groupId>
6
6
  <artifactId>jo</artifactId>
7
- <version>0.1.1</version>
7
+ <version>0.2.0</version>
8
8
  <packaging>jar</packaging>
9
9
 
10
10
  <name>jo</name>
@@ -2,6 +2,7 @@ package com.headius.jo;
2
2
 
3
3
  import java.io.IOException;
4
4
  import java.util.Set;
5
+ import java.util.concurrent.ArrayBlockingQueue;
5
6
  import java.util.concurrent.BlockingQueue;
6
7
  import java.util.concurrent.Callable;
7
8
  import java.util.concurrent.ExecutionException;
@@ -124,11 +125,18 @@ public class JoLibrary implements Library{
124
125
  }
125
126
 
126
127
  @JRubyMethod(module = true)
127
- public static IRubyObject chan(ThreadContext context, IRubyObject self, Block block) {
128
+ public static IRubyObject chan(ThreadContext context, IRubyObject self) {
128
129
  Ruby runtime = context.runtime;
129
130
  return new JoChannel(runtime, (RubyClass)runtime.getClassFromPath("Jo::Channel"), new SynchronousQueue<IRubyObject>(true));
130
131
  }
131
132
 
133
+ @JRubyMethod(module = true)
134
+ public static IRubyObject chan(ThreadContext context, IRubyObject self, IRubyObject size) {
135
+ Ruby runtime = context.runtime;
136
+ int capacity = (int)size.convertToInteger().getLongValue();
137
+ return new JoChannel(runtime, (RubyClass)runtime.getClassFromPath("Jo::Channel"), new ArrayBlockingQueue<IRubyObject>(capacity, true));
138
+ }
139
+
132
140
  @JRubyMethod(module = true)
133
141
  public static IRubyObject select(ThreadContext context, IRubyObject self, IRubyObject hash) {
134
142
  Ruby runtime = context.runtime;
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Charles Oliver Nutter
@@ -12,6 +12,7 @@ date: 2013-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  prerelease: false
15
+ type: :development
15
16
  version_requirements: !ruby/object:Gem::Requirement
16
17
  requirements:
17
18
  - - ~>
@@ -22,10 +23,10 @@ dependencies:
22
23
  - - ~>
23
24
  - !ruby/object:Gem::Version
24
25
  version: '1.3'
25
- type: :development
26
26
  name: bundler
27
27
  - !ruby/object:Gem::Dependency
28
28
  prerelease: false
29
+ type: :development
29
30
  version_requirements: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - '>='
@@ -36,7 +37,6 @@ dependencies:
36
37
  - - '>='
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
- type: :development
40
40
  name: rake
41
41
  description: An implementation of goroutines and channels for Ruby
42
42
  email:
@@ -56,7 +56,7 @@ files:
56
56
  - lib/jo/version.rb
57
57
  - pom.xml
58
58
  - src/main/java/com/headius/jo/JoLibrary.java
59
- - target/jo-0.1.1.jar
59
+ - target/jo-0.2.0.jar
60
60
  homepage: https://github.com/headius/jo
61
61
  licenses:
62
62
  - MIT
Binary file