jruby-base32 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/ext/java/base32/Base32Module.java +8 -2
- data/lib/base32.rb +1 -0
- data/lib/base32/version.rb +1 -1
- metadata +7 -16
data/Rakefile
CHANGED
@@ -21,10 +21,11 @@ SOFTWARE.
|
|
21
21
|
*/
|
22
22
|
package base32;
|
23
23
|
|
24
|
-
|
25
24
|
import org.jruby.Ruby;
|
25
|
+
import org.jruby.RubyClass;
|
26
26
|
import org.jruby.RubyModule;
|
27
27
|
import org.jruby.RubyString;
|
28
|
+
import org.jruby.internal.runtime.methods.DynamicMethod;
|
28
29
|
import org.jruby.runtime.Block;
|
29
30
|
import org.jruby.runtime.CallbackFactory;
|
30
31
|
import org.jruby.runtime.builtin.IRubyObject;
|
@@ -36,7 +37,12 @@ import org.jruby.runtime.builtin.IRubyObject;
|
|
36
37
|
*/
|
37
38
|
public class Base32Module {
|
38
39
|
public static IRubyObject encode(IRubyObject recv, IRubyObject plainText, Block unusedBlock) {
|
39
|
-
|
40
|
+
RubyClass rc = recv.getRuntime().getClass("String");
|
41
|
+
DynamicMethod method = rc.getMethods().get("to_java_bytes");
|
42
|
+
|
43
|
+
byte[] bytes = (byte[])method.call(recv.getRuntime().getCurrentContext(), plainText, rc, null).toJava(Object.class);
|
44
|
+
|
45
|
+
return RubyString.newString(recv.getRuntime(), Base32Encoder.encode(bytes));
|
40
46
|
}
|
41
47
|
|
42
48
|
public static IRubyObject decode(IRubyObject recv, IRubyObject encodedText, Block unusedBlock) {
|
data/lib/base32.rb
CHANGED
data/lib/base32/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby-base32
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
version: 0.1.1
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.2
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Chris Umbel
|
@@ -14,18 +10,16 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-04-
|
18
|
-
default_executable:
|
13
|
+
date: 2011-04-20 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: rspec
|
22
17
|
prerelease: false
|
23
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
24
20
|
requirements:
|
25
21
|
- - ">="
|
26
22
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
23
|
version: "0"
|
30
24
|
type: :development
|
31
25
|
version_requirements: *id001
|
@@ -52,7 +46,6 @@ files:
|
|
52
46
|
- lib/base32/version.rb
|
53
47
|
- spec/base32_spec.rb
|
54
48
|
- lib/base32.jar
|
55
|
-
has_rdoc: true
|
56
49
|
homepage: http://github.com/TheSkunkworx/jruby-base32
|
57
50
|
licenses: []
|
58
51
|
|
@@ -62,23 +55,21 @@ rdoc_options: []
|
|
62
55
|
require_paths:
|
63
56
|
- lib
|
64
57
|
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
65
59
|
requirements:
|
66
60
|
- - ">="
|
67
61
|
- !ruby/object:Gem::Version
|
68
|
-
segments:
|
69
|
-
- 0
|
70
62
|
version: "0"
|
71
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
72
65
|
requirements:
|
73
66
|
- - ">="
|
74
67
|
- !ruby/object:Gem::Version
|
75
|
-
segments:
|
76
|
-
- 0
|
77
68
|
version: "0"
|
78
69
|
requirements: []
|
79
70
|
|
80
71
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.
|
72
|
+
rubygems_version: 1.7.2
|
82
73
|
signing_key:
|
83
74
|
specification_version: 3
|
84
75
|
summary: jruby, java extension port of the base32 gem
|