java_to_base64 0.0.1-java → 0.0.2-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: eea44ec290c12573d17a0cc27bfb23313bec8f57
4
- data.tar.gz: 7a3b95256647b6083576d8e9f8550635ac288131
3
+ metadata.gz: 2fa451667295116d23951caa98b47a424565ec17
4
+ data.tar.gz: 709617ecd361b89696b742e5a6a9c68bbdbbf457
5
5
  SHA512:
6
- metadata.gz: 14968c00cd3493a4509601354c6f66a2b5e81a5da4bfc7b957264cd7bf807520d61b7e999d3135d9d933b8db80cf8ac7a26f1f3dc880ccf94a6e1532f61bde03
7
- data.tar.gz: 2245596941fba656e5419dcb5e6d8436520cafb467ce539b023c9c2ab6c28ab7390080270b3c203d01225219a773158aa8b77943a24c13d8eb52ad422d144186
6
+ metadata.gz: 76e14fb7ee5ed2c616a93c902b7fa6ef605ea84713617683878e8eebcca705466c2143317a59b1348490fae19a58f59403402570b0b261c7c25a39f4bcacb8e2
7
+ data.tar.gz: 89d8468750313c4faabe53116b835eb2fb09f693c31c63b383b948eb3b8aa91d9e79d961784c95dd075b0e4a9fa5b714cd4f58a1193bb17144ffb495ffbe19ff
@@ -8,7 +8,7 @@ end
8
8
 
9
9
  module JavaToBase64
10
10
  def self.included(klass)
11
- unless klass.java_kind_of?(::Java::JavaIo::Serializable)
11
+ unless java_instance_of?(klass, ::Java::JavaIo::Serializable)
12
12
  warn <<-SERIALIZABLE
13
13
  To include JavaToBase64 in a Java class you must implement java.io.Serializable
14
14
  SERIALIZABLE
@@ -20,6 +20,10 @@ module JavaToBase64
20
20
  end
21
21
  end
22
22
 
23
+ def self.java_instance_of?(klass, klass_or_module)
24
+ return klass.java_kind_of?(klass_or_module) || klass.included_modules.include?(klass_or_module)
25
+ end
26
+
23
27
  module InstanceMethods
24
28
  def to_base64
25
29
  byte_array_output_stream = java.io.ByteArrayOutputStream.new
@@ -1,3 +1,3 @@
1
1
  module JavaToBase64
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: java_to_base64
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: java
6
6
  authors:
7
7
  - Brandon Dewitt