marshalize 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: baba1c50a99ed947a25b182e283a77654e8de3f2
4
+ data.tar.gz: 00cdf88144b02971f40f8ef232b80447aa541a63
5
+ SHA512:
6
+ metadata.gz: 6503b8c1be0cfb2f7cd3b58c75fbda6dd87ef5ab4783820bc4d2d31a3fc776e65ebb77f85b5bf4359ec9dd214d0fcb01ef20d1c9aa44c2d396bfaf6c0f8adfbe
7
+ data.tar.gz: 8a49818d476d8037464cd977fd7b95e1473aca189418ca6ddec211ea603cd1bd4919625fa8c724c798fe894f9a233621766152df78a9cfa571c5e6b9ef93177d
data/.DS_Store ADDED
Binary file
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ marshalize -i [input] -o [output];
2
+ unmarshalize -i [input] -o [output]
data/bin/.gitkeep ADDED
File without changes
data/bin/marshalize ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'marshalize'
4
+
5
+ if !ARGV.empty?
6
+ Marshalize.new(ARGV)
7
+ else
8
+ puts "marshalize -i [input] -o [output]"
9
+ end
data/bin/unmarshalize ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'unmarshalize'
4
+
5
+ if !ARGV.empty?
6
+ Unmarshalize.new(ARGV)
7
+ else
8
+ puts "unmarshalize -i [input] -o [output]"
9
+ end
data/lib/.DS_Store ADDED
Binary file
data/lib/marshalize.rb ADDED
@@ -0,0 +1,20 @@
1
+ class Marshalize
2
+ def initialize(args)
3
+ if args.size == 4
4
+ if args[0] == '-i' && args[2] == '-o'
5
+ @path_input = args[1]
6
+ @path_output = args[3]
7
+ begin
8
+ do_marshalize
9
+ rescue
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ private
16
+ def do_marshalize
17
+ File.open(@path_output, 'wb') {|f| f.write(Marshal.dump(File.read(@path_input)))}
18
+ puts @path_output
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ class Unmarshalize
2
+ def initialize(args)
3
+ if args.size == 4
4
+ if args[0] == '-i' && args[2] == '-o'
5
+ @path_input = args[1]
6
+ @path_output = args[3]
7
+ begin
8
+ do_unmarshalize
9
+ rescue
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ private
16
+ def do_unmarshalize
17
+ File.open(@path_output, 'w') {|f| f.write(Marshal.load(File.binread(@path_input)))}
18
+ puts @path_output
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'marshalize'
3
+ s.version = '0.0.2'
4
+ s.licenses = ['MIT']
5
+ s.summary = "Pack and unpack to marshal binary file."
6
+ s.description = <<-DESCRIPTION
7
+ marshalize -i [input] -o [output]; unmarshalize -i [input] -o [output]
8
+ DESCRIPTION
9
+ s.author = ["Łukasz Fuszara"]
10
+ s.email = 'opalizoid@gmail.com'
11
+ s.date = '2016-11-21'
12
+ s.homepage = 'https://rubygems.org/gems/marshalize'
13
+ s.required_ruby_version = '>= 2.3.1'
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.executables = ['marshalize', 'unmarshalize']
17
+ s.require_path = ['lib']
18
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: marshalize
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Łukasz Fuszara
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: " marshalize -i [input] -o [output]; unmarshalize -i [input] -o [output]\n"
14
+ email: opalizoid@gmail.com
15
+ executables:
16
+ - marshalize
17
+ - unmarshalize
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".DS_Store"
22
+ - README.md
23
+ - bin/.gitkeep
24
+ - bin/marshalize
25
+ - bin/unmarshalize
26
+ - lib/.DS_Store
27
+ - lib/marshalize.rb
28
+ - lib/unmarshalize.rb
29
+ - marshalize.gemspec
30
+ homepage: https://rubygems.org/gems/marshalize
31
+ licenses:
32
+ - MIT
33
+ metadata: {}
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.3.1
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubyforge_project:
50
+ rubygems_version: 2.6.8
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Pack and unpack to marshal binary file.
54
+ test_files: []