blood_ruby 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/blood_ruby.rb +31 -0
- metadata +65 -0
data/lib/blood_ruby.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class Serial
|
|
2
|
+
def self.unserialize(temp)
|
|
3
|
+
temp = temp.split('"')
|
|
4
|
+
size = temp.length
|
|
5
|
+
x = 0
|
|
6
|
+
unserial = []
|
|
7
|
+
while x < size do
|
|
8
|
+
if x % 2 == 1
|
|
9
|
+
name = temp[x]
|
|
10
|
+
unserial << name
|
|
11
|
+
end
|
|
12
|
+
x += 1
|
|
13
|
+
end
|
|
14
|
+
return unserial
|
|
15
|
+
end
|
|
16
|
+
def self.serialize(temp)
|
|
17
|
+
x = 0
|
|
18
|
+
size = temp.length
|
|
19
|
+
serialized = 'a:' + size.to_s + ':{'
|
|
20
|
+
while x <= size do
|
|
21
|
+
if x == size
|
|
22
|
+
serialized << '}'
|
|
23
|
+
else
|
|
24
|
+
len = temp[x].length
|
|
25
|
+
serialized << 'i:' + x.to_s + ';s:' + len.to_s + ':"' + temp[x] + '";'
|
|
26
|
+
end
|
|
27
|
+
x += 1
|
|
28
|
+
end
|
|
29
|
+
return serialized
|
|
30
|
+
end
|
|
31
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: blood_ruby
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 23
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 1
|
|
8
|
+
- 0
|
|
9
|
+
- 0
|
|
10
|
+
version: 1.0.0
|
|
11
|
+
platform: ruby
|
|
12
|
+
authors:
|
|
13
|
+
- Jason Colyer
|
|
14
|
+
autorequire:
|
|
15
|
+
bindir: bin
|
|
16
|
+
cert_chain: []
|
|
17
|
+
|
|
18
|
+
date: 2014-02-25 00:00:00 Z
|
|
19
|
+
dependencies: []
|
|
20
|
+
|
|
21
|
+
description: For serializing/de-serializing WordPress Active Plugin values
|
|
22
|
+
email: support@reyloc.com
|
|
23
|
+
executables: []
|
|
24
|
+
|
|
25
|
+
extensions: []
|
|
26
|
+
|
|
27
|
+
extra_rdoc_files: []
|
|
28
|
+
|
|
29
|
+
files:
|
|
30
|
+
- lib/blood_ruby.rb
|
|
31
|
+
homepage: http://rubygems.org/gems/blood_ruby
|
|
32
|
+
licenses:
|
|
33
|
+
- MIT
|
|
34
|
+
post_install_message:
|
|
35
|
+
rdoc_options: []
|
|
36
|
+
|
|
37
|
+
require_paths:
|
|
38
|
+
- lib
|
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
|
+
none: false
|
|
41
|
+
requirements:
|
|
42
|
+
- - ">="
|
|
43
|
+
- !ruby/object:Gem::Version
|
|
44
|
+
hash: 3
|
|
45
|
+
segments:
|
|
46
|
+
- 0
|
|
47
|
+
version: "0"
|
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
hash: 3
|
|
54
|
+
segments:
|
|
55
|
+
- 0
|
|
56
|
+
version: "0"
|
|
57
|
+
requirements: []
|
|
58
|
+
|
|
59
|
+
rubyforge_project:
|
|
60
|
+
rubygems_version: 1.8.25
|
|
61
|
+
signing_key:
|
|
62
|
+
specification_version: 3
|
|
63
|
+
summary: Blood Ruby
|
|
64
|
+
test_files: []
|
|
65
|
+
|