hotplate 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/hotplate.gemspec +1 -0
  3. data/lib/hotplate/cli/main.rb +1 -7
  4. data/lib/hotplate/version.rb +1 -1
  5. metadata +16 -101
  6. data/lib/hotplate/gems/rubyzip-1.1.7/README.md +0 -271
  7. data/lib/hotplate/gems/rubyzip-1.1.7/Rakefile +0 -19
  8. data/lib/hotplate/gems/rubyzip-1.1.7/TODO +0 -15
  9. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/central_directory.rb +0 -208
  10. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/compressor.rb +0 -10
  11. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/constants.rb +0 -63
  12. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/crypto/encryption.rb +0 -11
  13. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/crypto/null_encryption.rb +0 -45
  14. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/crypto/traditional_encryption.rb +0 -99
  15. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/decompressor.rb +0 -13
  16. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/deflater.rb +0 -32
  17. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/dos_time.rb +0 -49
  18. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/entry.rb +0 -696
  19. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/entry_set.rb +0 -86
  20. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/errors.rb +0 -16
  21. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field/generic.rb +0 -43
  22. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field/ntfs.rb +0 -92
  23. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field/old_unix.rb +0 -45
  24. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field/universal_time.rb +0 -47
  25. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb +0 -38
  26. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field/zip64.rb +0 -67
  27. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field/zip64_placeholder.rb +0 -16
  28. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/extra_field.rb +0 -101
  29. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/file.rb +0 -436
  30. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/filesystem.rb +0 -626
  31. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/inflater.rb +0 -66
  32. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/input_stream.rb +0 -164
  33. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_input_stream.rb +0 -115
  34. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb +0 -45
  35. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/ioextras.rb +0 -38
  36. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/null_compressor.rb +0 -15
  37. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/null_decompressor.rb +0 -27
  38. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/null_input_stream.rb +0 -10
  39. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/output_stream.rb +0 -190
  40. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/pass_thru_compressor.rb +0 -23
  41. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/pass_thru_decompressor.rb +0 -41
  42. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/streamable_directory.rb +0 -15
  43. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/streamable_stream.rb +0 -56
  44. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip/version.rb +0 -3
  45. data/lib/hotplate/gems/rubyzip-1.1.7/lib/zip.rb +0 -63
  46. data/lib/hotplate/gems/rubyzip-1.1.7/samples/example.rb +0 -91
  47. data/lib/hotplate/gems/rubyzip-1.1.7/samples/example_filesystem.rb +0 -33
  48. data/lib/hotplate/gems/rubyzip-1.1.7/samples/example_recursive.rb +0 -48
  49. data/lib/hotplate/gems/rubyzip-1.1.7/samples/gtkRubyzip.rb +0 -86
  50. data/lib/hotplate/gems/rubyzip-1.1.7/samples/qtzip.rb +0 -101
  51. data/lib/hotplate/gems/rubyzip-1.1.7/samples/write_simple.rb +0 -13
  52. data/lib/hotplate/gems/rubyzip-1.1.7/samples/zipfind.rb +0 -74
  53. data/lib/hotplate/gems/rubyzip-1.1.7/test/basic_zip_file_test.rb +0 -64
  54. data/lib/hotplate/gems/rubyzip-1.1.7/test/central_directory_entry_test.rb +0 -73
  55. data/lib/hotplate/gems/rubyzip-1.1.7/test/central_directory_test.rb +0 -104
  56. data/lib/hotplate/gems/rubyzip-1.1.7/test/crypto/null_encryption_test.rb +0 -53
  57. data/lib/hotplate/gems/rubyzip-1.1.7/test/crypto/traditional_encryption_test.rb +0 -80
  58. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/WarnInvalidDate.zip +0 -0
  59. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/file1.txt +0 -46
  60. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/file1.txt.deflatedData +0 -0
  61. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/file2.txt +0 -1504
  62. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/globTest/foo/bar/baz/foo.txt +0 -0
  63. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/globTest/foo.txt +0 -0
  64. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/globTest/food.txt +0 -0
  65. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/globTest.zip +0 -0
  66. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/mimetype +0 -1
  67. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/notzippedruby.rb +0 -7
  68. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/ntfs.zip +0 -0
  69. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/rubycode.zip +0 -0
  70. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/rubycode2.zip +0 -0
  71. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/testDirectory.bin +0 -0
  72. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/zip64-sample.zip +0 -0
  73. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/zipWithDirs.zip +0 -0
  74. data/lib/hotplate/gems/rubyzip-1.1.7/test/data/zipWithEncryption.zip +0 -0
  75. data/lib/hotplate/gems/rubyzip-1.1.7/test/deflater_test.rb +0 -67
  76. data/lib/hotplate/gems/rubyzip-1.1.7/test/encryption_test.rb +0 -42
  77. data/lib/hotplate/gems/rubyzip-1.1.7/test/entry_set_test.rb +0 -138
  78. data/lib/hotplate/gems/rubyzip-1.1.7/test/entry_test.rb +0 -165
  79. data/lib/hotplate/gems/rubyzip-1.1.7/test/errors_test.rb +0 -36
  80. data/lib/hotplate/gems/rubyzip-1.1.7/test/extra_field_test.rb +0 -78
  81. data/lib/hotplate/gems/rubyzip-1.1.7/test/file_extract_directory_test.rb +0 -56
  82. data/lib/hotplate/gems/rubyzip-1.1.7/test/file_extract_test.rb +0 -90
  83. data/lib/hotplate/gems/rubyzip-1.1.7/test/file_split_test.rb +0 -60
  84. data/lib/hotplate/gems/rubyzip-1.1.7/test/file_test.rb +0 -559
  85. data/lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/dir_iterator_test.rb +0 -62
  86. data/lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/directory_test.rb +0 -131
  87. data/lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_mutating_test.rb +0 -100
  88. data/lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_nonmutating_test.rb +0 -514
  89. data/lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb +0 -66
  90. data/lib/hotplate/gems/rubyzip-1.1.7/test/gentestfiles.rb +0 -134
  91. data/lib/hotplate/gems/rubyzip-1.1.7/test/inflater_test.rb +0 -14
  92. data/lib/hotplate/gems/rubyzip-1.1.7/test/input_stream_test.rb +0 -170
  93. data/lib/hotplate/gems/rubyzip-1.1.7/test/ioextras/abstract_input_stream_test.rb +0 -103
  94. data/lib/hotplate/gems/rubyzip-1.1.7/test/ioextras/abstract_output_stream_test.rb +0 -106
  95. data/lib/hotplate/gems/rubyzip-1.1.7/test/ioextras/fake_io_test.rb +0 -18
  96. data/lib/hotplate/gems/rubyzip-1.1.7/test/local_entry_test.rb +0 -156
  97. data/lib/hotplate/gems/rubyzip-1.1.7/test/output_stream_test.rb +0 -129
  98. data/lib/hotplate/gems/rubyzip-1.1.7/test/pass_thru_compressor_test.rb +0 -31
  99. data/lib/hotplate/gems/rubyzip-1.1.7/test/pass_thru_decompressor_test.rb +0 -15
  100. data/lib/hotplate/gems/rubyzip-1.1.7/test/settings_test.rb +0 -92
  101. data/lib/hotplate/gems/rubyzip-1.1.7/test/test_helper.rb +0 -228
  102. data/lib/hotplate/gems/rubyzip-1.1.7/test/unicode_file_names_and_comments_test.rb +0 -52
  103. data/lib/hotplate/gems/rubyzip-1.1.7/test/zip64_full_test.rb +0 -53
  104. data/lib/hotplate/gems/rubyzip-1.1.7/test/zip64_support_test.rb +0 -15
@@ -1,62 +0,0 @@
1
- require 'test_helper'
2
- require 'zip/filesystem'
3
-
4
- class ZipFsDirIteratorTest < MiniTest::Test
5
-
6
- FILENAME_ARRAY = [ "f1", "f2", "f3", "f4", "f5", "f6" ]
7
-
8
- def setup
9
- @dirIt = ::Zip::FileSystem::ZipFsDirIterator.new(FILENAME_ARRAY)
10
- end
11
-
12
- def test_close
13
- @dirIt.close
14
- assert_raises(IOError, "closed directory") {
15
- @dirIt.each { |e| p e }
16
- }
17
- assert_raises(IOError, "closed directory") {
18
- @dirIt.read
19
- }
20
- assert_raises(IOError, "closed directory") {
21
- @dirIt.rewind
22
- }
23
- assert_raises(IOError, "closed directory") {
24
- @dirIt.seek(0)
25
- }
26
- assert_raises(IOError, "closed directory") {
27
- @dirIt.tell
28
- }
29
-
30
- end
31
-
32
- def test_each
33
- # Tested through Enumerable.entries
34
- assert_equal(FILENAME_ARRAY, @dirIt.entries)
35
- end
36
-
37
- def test_read
38
- FILENAME_ARRAY.size.times {
39
- |i|
40
- assert_equal(FILENAME_ARRAY[i], @dirIt.read)
41
- }
42
- end
43
-
44
- def test_rewind
45
- @dirIt.read
46
- @dirIt.read
47
- assert_equal(FILENAME_ARRAY[2], @dirIt.read)
48
- @dirIt.rewind
49
- assert_equal(FILENAME_ARRAY[0], @dirIt.read)
50
- end
51
-
52
- def test_tell_seek
53
- @dirIt.read
54
- @dirIt.read
55
- pos = @dirIt.tell
56
- valAtPos = @dirIt.read
57
- @dirIt.read
58
- @dirIt.seek(pos)
59
- assert_equal(valAtPos, @dirIt.read)
60
- end
61
-
62
- end
@@ -1,131 +0,0 @@
1
- require 'test_helper'
2
- require 'zip/filesystem'
3
-
4
- class ZipFsDirectoryTest < MiniTest::Test
5
- TEST_ZIP = "test/data/generated/zipWithDirs_copy.zip"
6
-
7
- def setup
8
- FileUtils.cp("test/data/zipWithDirs.zip", TEST_ZIP)
9
- end
10
-
11
- def test_delete
12
- ::Zip::File.open(TEST_ZIP) {
13
- |zf|
14
- assert_raises(Errno::ENOENT, "No such file or directory - NoSuchFile.txt") {
15
- zf.dir.delete("NoSuchFile.txt")
16
- }
17
- assert_raises(Errno::EINVAL, "Invalid argument - file1") {
18
- zf.dir.delete("file1")
19
- }
20
- assert(zf.file.exists?("dir1"))
21
- zf.dir.delete("dir1")
22
- assert(! zf.file.exists?("dir1"))
23
- }
24
- end
25
-
26
- def test_mkdir
27
- ::Zip::File.open(TEST_ZIP) {
28
- |zf|
29
- assert_raises(Errno::EEXIST, "File exists - dir1") {
30
- zf.dir.mkdir("file1")
31
- }
32
- assert_raises(Errno::EEXIST, "File exists - dir1") {
33
- zf.dir.mkdir("dir1")
34
- }
35
- assert(!zf.file.exists?("newDir"))
36
- zf.dir.mkdir("newDir")
37
- assert(zf.file.directory?("newDir"))
38
- assert(!zf.file.exists?("newDir2"))
39
- zf.dir.mkdir("newDir2", 3485)
40
- assert(zf.file.directory?("newDir2"))
41
- }
42
- end
43
-
44
- def test_pwd_chdir_entries
45
- ::Zip::File.open(TEST_ZIP) {
46
- |zf|
47
- assert_equal("/", zf.dir.pwd)
48
-
49
- assert_raises(Errno::ENOENT, "No such file or directory - no such dir") {
50
- zf.dir.chdir "no such dir"
51
- }
52
-
53
- assert_raises(Errno::EINVAL, "Invalid argument - file1") {
54
- zf.dir.chdir "file1"
55
- }
56
-
57
- assert_equal(["dir1", "dir2", "file1"].sort, zf.dir.entries(".").sort)
58
- zf.dir.chdir "dir1"
59
- assert_equal("/dir1", zf.dir.pwd)
60
- assert_equal(["dir11", "file11", "file12"], zf.dir.entries(".").sort)
61
-
62
- zf.dir.chdir "../dir2/dir21"
63
- assert_equal("/dir2/dir21", zf.dir.pwd)
64
- assert_equal(["dir221"].sort, zf.dir.entries(".").sort)
65
- }
66
- end
67
-
68
- def test_foreach
69
- ::Zip::File.open(TEST_ZIP) {
70
- |zf|
71
-
72
- blockCalled = false
73
- assert_raises(Errno::ENOENT, "No such file or directory - noSuchDir") {
74
- zf.dir.foreach("noSuchDir") { |e| blockCalled = true }
75
- }
76
- assert(! blockCalled)
77
-
78
- assert_raises(Errno::ENOTDIR, "Not a directory - file1") {
79
- zf.dir.foreach("file1") { |e| blockCalled = true }
80
- }
81
- assert(! blockCalled)
82
-
83
- entries = []
84
- zf.dir.foreach(".") { |e| entries << e }
85
- assert_equal(["dir1", "dir2", "file1"].sort, entries.sort)
86
-
87
- entries = []
88
- zf.dir.foreach("dir1") { |e| entries << e }
89
- assert_equal(["dir11", "file11", "file12"], entries.sort)
90
- }
91
- end
92
-
93
- def test_chroot
94
- ::Zip::File.open(TEST_ZIP) {
95
- |zf|
96
- assert_raises(NotImplementedError) {
97
- zf.dir.chroot
98
- }
99
- }
100
- end
101
-
102
- # Globbing not supported yet
103
- #def test_glob
104
- # # test alias []-operator too
105
- # fail "implement test"
106
- #end
107
-
108
- def test_open_new
109
- ::Zip::File.open(TEST_ZIP) {
110
- |zf|
111
-
112
- assert_raises(Errno::ENOTDIR, "Not a directory - file1") {
113
- zf.dir.new("file1")
114
- }
115
-
116
- assert_raises(Errno::ENOENT, "No such file or directory - noSuchFile") {
117
- zf.dir.new("noSuchFile")
118
- }
119
-
120
- d = zf.dir.new(".")
121
- assert_equal(["file1", "dir1", "dir2"].sort, d.entries.sort)
122
- d.close
123
-
124
- zf.dir.open("dir1") {
125
- |dir|
126
- assert_equal(["dir11", "file11", "file12"].sort, dir.entries.sort)
127
- }
128
- }
129
- end
130
-
131
- end
@@ -1,100 +0,0 @@
1
- require 'test_helper'
2
- require 'zip/filesystem'
3
-
4
- class ZipFsFileMutatingTest < MiniTest::Test
5
- TEST_ZIP = "test/data/generated/zipWithDirs_copy.zip"
6
- def setup
7
- FileUtils.cp("test/data/zipWithDirs.zip", TEST_ZIP)
8
- end
9
-
10
- def teardown
11
- end
12
-
13
- def test_delete
14
- do_test_delete_or_unlink(:delete)
15
- end
16
-
17
- def test_unlink
18
- do_test_delete_or_unlink(:unlink)
19
- end
20
-
21
- def test_open_write
22
- ::Zip::File.open(TEST_ZIP) {
23
- |zf|
24
-
25
- zf.file.open("test_open_write_entry", "w") {
26
- |f|
27
- f.write "This is what I'm writing"
28
- }
29
- assert_equal("This is what I'm writing",
30
- zf.file.read("test_open_write_entry"))
31
-
32
- # Test with existing entry
33
- zf.file.open("file1", "wb") { #also check that 'b' option is ignored
34
- |f|
35
- f.write "This is what I'm writing too"
36
- }
37
- assert_equal("This is what I'm writing too",
38
- zf.file.read("file1"))
39
- }
40
- end
41
-
42
- def test_rename
43
- ::Zip::File.open(TEST_ZIP) {
44
- |zf|
45
- assert_raises(Errno::ENOENT, "") {
46
- zf.file.rename("NoSuchFile", "bimse")
47
- }
48
- zf.file.rename("file1", "newNameForFile1")
49
- }
50
-
51
- ::Zip::File.open(TEST_ZIP) {
52
- |zf|
53
- assert(! zf.file.exists?("file1"))
54
- assert(zf.file.exists?("newNameForFile1"))
55
- }
56
- end
57
-
58
- def test_chmod
59
- ::Zip::File.open(TEST_ZIP) {
60
- |zf|
61
-
62
- zf.file.chmod(0765, "file1")
63
- }
64
-
65
- ::Zip::File.open(TEST_ZIP) {
66
- |zf|
67
- assert_equal(0100765, zf.file.stat("file1").mode)
68
- }
69
- end
70
-
71
- def do_test_delete_or_unlink(symbol)
72
- ::Zip::File.open(TEST_ZIP) {
73
- |zf|
74
- assert(zf.file.exists?("dir2/dir21/dir221/file2221"))
75
- zf.file.send(symbol, "dir2/dir21/dir221/file2221")
76
- assert(! zf.file.exists?("dir2/dir21/dir221/file2221"))
77
-
78
- assert(zf.file.exists?("dir1/file11"))
79
- assert(zf.file.exists?("dir1/file12"))
80
- zf.file.send(symbol, "dir1/file11", "dir1/file12")
81
- assert(! zf.file.exists?("dir1/file11"))
82
- assert(! zf.file.exists?("dir1/file12"))
83
-
84
- assert_raises(Errno::ENOENT) { zf.file.send(symbol, "noSuchFile") }
85
- assert_raises(Errno::EISDIR) { zf.file.send(symbol, "dir1/dir11") }
86
- assert_raises(Errno::EISDIR) { zf.file.send(symbol, "dir1/dir11/") }
87
- }
88
-
89
- ::Zip::File.open(TEST_ZIP) {
90
- |zf|
91
- assert(! zf.file.exists?("dir2/dir21/dir221/file2221"))
92
- assert(! zf.file.exists?("dir1/file11"))
93
- assert(! zf.file.exists?("dir1/file12"))
94
-
95
- assert(zf.file.exists?("dir1/dir11"))
96
- assert(zf.file.exists?("dir1/dir11/"))
97
- }
98
- end
99
-
100
- end