real_zip 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/a.rb +0 -3
- data/lib/real_zip/version.rb +1 -1
- data/lib/real_zip.rb +7 -28
- data/temp.zip +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6569b2ac88ccb33e74db0ccdad70b5f141ef862f
|
4
|
+
data.tar.gz: 1f337700dd47c6755bb7c1b3ac42c1b1b2c35f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c996ccafef21b403e5e9e475792b3ab2018ef6c18db0cbbd4a9ad02d8d0ab3ef6a92b6df34975ee4eba19856263f515d539d4997b8baada36c87bab26fd9797
|
7
|
+
data.tar.gz: 83c55940ce2b1b0239d95e3bb4895b9f51aa654cca2ec324815284414649978f17c476e6e644b4934938cbf9a439810b12c9905da032b53ae3be054b7881716f
|
data/README.md
CHANGED
@@ -8,8 +8,12 @@ require 'real_zip'
|
|
8
8
|
# create zip file with given file structure and transfer files to the directory of your choice within the zip file.
|
9
9
|
|
10
10
|
|
11
|
+
RealZip '/path/to/file/file.zip', {:dir1 => ["/path/tofile1/file1"], :dir2 => ["path/tofile2/file2"], 'dir2/dir3' => ["path/tofile3/file3"]}
|
12
|
+
|
13
|
+
|
11
14
|
## Use Cases
|
12
15
|
|
16
|
+
|
13
17
|
RealZip 'temp.zip', {:html => ["/home/Files/a.html"], :pdf => ["/home/Files/c.pdf"], :rb => ["/home/Files/b.rb"]}
|
14
18
|
|
15
19
|
# Results in
|
@@ -34,6 +38,9 @@ doc/pdf/rb/
|
|
34
38
|
doc/html/a.html
|
35
39
|
doc/pdf/c.pdf
|
36
40
|
doc/pdf/rb/b.rb
|
41
|
+
|
42
|
+
# Symlinks or Softlinks can also be used to reference files.
|
43
|
+
|
37
44
|
```
|
38
45
|
|
39
46
|
|
@@ -60,4 +67,5 @@ Or install it yourself as:
|
|
60
67
|
5. Create new Pull Request
|
61
68
|
|
62
69
|
## Acknowledgement
|
63
|
-
This software is built upon Alexander K's Fake_Zip gem. A hearty thanks to him for making it freely available. This project would not be possible without [Ravi Baghele](https://github.com/rbaghele)'s major input in implementing the core file tranfer functionality.I would also like to thank <a href="https://github.com/indermishra">Indrajeet Mishra</a> for his valuable insights about testing and debugging the gem.Our team leader <a href ="https://github.com/stormfire">Mr. Pankaj Gupta</a> has provided invaluable support and guidance throughout the project.
|
70
|
+
This software is built upon [Alexander K](https://github.com/sowcow)'s [Fake_Zip](https://github.com/sowcow/fake_zip) gem. A hearty thanks to him for making it freely available. This project would not be possible without [Ravi Baghele](https://github.com/rbaghele)'s major input in implementing the core file tranfer functionality. I would also like to thank <a href="https://github.com/indermishra">Indrajeet Mishra</a> for his valuable insights about testing and debugging the gem. Our team leader <a href ="https://github.com/stormfire">Mr. Pankaj Gupta</a> has provided invaluable support and guidance throughout the project.
|
71
|
+
|
data/lib/a.rb
CHANGED
data/lib/real_zip/version.rb
CHANGED
data/lib/real_zip.rb
CHANGED
@@ -58,17 +58,17 @@ module RealZip
|
|
58
58
|
end
|
59
59
|
|
60
60
|
hash = struct
|
61
|
-
puts "hash => #{hash}"
|
61
|
+
# puts "hash => #{hash}"
|
62
62
|
hash.each do |dir,file_arr|
|
63
|
-
puts "directory ======> #{dir}"
|
64
|
-
puts "file_array ======> #{file_arr.to_s}"
|
63
|
+
# puts "directory ======> #{dir}"
|
64
|
+
# puts "file_array ======> #{file_arr.to_s}"
|
65
65
|
|
66
66
|
new_files = files({dir => file_arr})
|
67
|
-
puts "new files ======> #{new_files.to_s}"
|
67
|
+
# puts "new files ======> #{new_files.to_s}"
|
68
68
|
new_files.each_with_index do |file, index|
|
69
|
-
puts "file ======> #{file} index => #{index}"
|
69
|
+
# puts "file ======> #{file} index => #{index}"
|
70
70
|
orignal_file_path = file_arr[index]
|
71
|
-
puts "orignal_file_path ==========> #{orignal_file_path}"
|
71
|
+
# puts "orignal_file_path ==========> #{orignal_file_path}"
|
72
72
|
string = File.open(orignal_file_path, 'r'){ |f| f.read }
|
73
73
|
file_name = file.split('/').last
|
74
74
|
new_file_name = ( files( {dir => [ "#{file_name}" ] } ) ).first
|
@@ -76,28 +76,7 @@ module RealZip
|
|
76
76
|
z.file.open(new_file_name, "w") { |f| f.write string }
|
77
77
|
end
|
78
78
|
end
|
79
|
-
|
80
|
-
|
81
|
-
# op1 = struct
|
82
|
-
# # arr = op1.values.first
|
83
|
-
# # op2 = files(op1)
|
84
|
-
# # res = op1.to_s + " ==== " + op2.to_s
|
85
|
-
# op2 = files(op1)
|
86
|
-
# puts "files(op1) ========> #{op2}"
|
87
|
-
# files(op1).each_with_index do |file,index|
|
88
|
-
# puts "file => #{file}"
|
89
|
-
# key = ( file.split("//").first ).to_sym
|
90
|
-
# puts "Key ====> #{key} "
|
91
|
-
# arr = op1[key]
|
92
|
-
# puts "arr of file => #{arr.to_s}"
|
93
|
-
# file_path = arr[0]
|
94
|
-
# puts "file_path ======> #{file_path}"
|
95
|
-
# # file_path = arr[index]
|
96
|
-
# # FileUtils.cp("/home/raw/Code/prasad/zip.rake", file)
|
97
|
-
# string = File.open(file_path, 'r'){ |f| f.read }
|
98
|
-
# puts "===== #{op1.to_s}"
|
99
|
-
# z.file.open(file, "w") { |f| f.write string }
|
100
|
-
# end
|
79
|
+
|
101
80
|
end
|
102
81
|
end
|
103
82
|
|
data/temp.zip
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: real_zip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prasad R.
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- spec/support/my_temp.rb
|
100
100
|
- spec/support/require.rb
|
101
101
|
- spec/support/zip_entries.rb.rb
|
102
|
+
- temp.zip
|
102
103
|
homepage: https://github.com/OskarSchindler/real_zip
|
103
104
|
licenses:
|
104
105
|
- MIT
|