base64_string 0.0.1 → 0.0.2

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: 7cab834389f46aa1f16ecaa964c92c978a127f87
4
- data.tar.gz: fc297e9517cb0e4bdcda6b545e44891edc768402
3
+ metadata.gz: 6d612a12694979e8aefe33606711c6f27a0d41c9
4
+ data.tar.gz: 4634b63793ea1093378ec8ff4c1afcd2e332a8aa
5
5
  SHA512:
6
- metadata.gz: d3b477d8bb070b9d95d6009c038a4c9d9bc248c4e49bf82cecee4e348013859203ed969938c716715cfb1f34b39d218638918870dbe53c20a605a8910885608b
7
- data.tar.gz: cd7b197f79da8f746c0b143ac043c0bd2a8d8e4c778f3022ef384ca296bd6bb4ed294098056e5b811ff44da4852f778e32566350485d722f60f39fee04fc24b1
6
+ metadata.gz: 2b28829467328cbffe1efb0d428e30df492ec19d4bb4c259d810947b1e9411fc1adebfaf05aa120a7a2b61a62926155a060e6573acb1c6684e69d078323f53a5
7
+ data.tar.gz: 7351cb270a8cf81a011ab793f3d31466a6dd663b7b1180f08cc9c5fff4dc65a7a37d7c911d58f79ac92867fe148db49ca202d5f5976fb77be93509dcba024cb7
data/README.md CHANGED
@@ -21,17 +21,29 @@ Or install it yourself as:
21
21
  ```ruby
22
22
  "hello world".encode64 # => "aGVsbG8gd29ybGQ=\n"
23
23
  "aGVsbG8gd29ybGQ=\n".decode64 # => "hello world"
24
+
25
+ s = "hello world"
26
+ s.encode64
27
+ s # => "hello world"
28
+ s.encode64!
29
+ s # => "aGVsbG8gd29ybGQ=\n"
24
30
  ```
25
31
 
26
32
  Adds all the same methods that [Base64](http://ruby-doc.org/stdlib-2.1.1/libdoc/base64/rdoc/Base64.html) class has:
27
33
 
28
34
  ```
29
35
  decode64
36
+ decode64!
30
37
  encode64
38
+ encode64!
31
39
  strict_decode64
40
+ strict_decode64!
32
41
  strict_encode64
42
+ strict_encode64!
33
43
  urlsafe_decode64
44
+ urlsafe_decode64!
34
45
  urlsafe_encode64
46
+ urlsafe_encode64!
35
47
  ```
36
48
 
37
49
  The only difference is that Base64's methods take an argument. The String version of the method will pass itself as the argment when it calls the Base64 method.
@@ -6,7 +6,7 @@ class String
6
6
  [nil, :strict, :urlsafe].each do |p|
7
7
  m = p.nil? ? s : "#{p}_#{s}"
8
8
  define_method(m) { Base64.send m, self }
9
- define_method("#{m}!") { replace m }
9
+ define_method("#{m}!") { replace self.send(m) }
10
10
  end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Base64String
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: base64_string
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Hammond