ucf 1.1.0 → 2.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTcxNDgzZjJjNmQ1ZTg2ZmE5OTdhMGE2M2Y1YmVlZTdhNzc2MmVkMg==
4
+ ZDM5YTE4OGEzZTkwYTZjZGQ0ODNlZmRmYzI1ZjFhYzdmYmNjMDBiMA==
5
5
  data.tar.gz: !binary |-
6
- Zjc0YjZkMmVmYTU4NzAwMDA5NzNhNzQ2ZmRmNjEyNjAyOTg4MmZlNQ==
6
+ NTNiMmFkYWM3NmMxODY1MGQ2OTVlODNmZGIyYjFhNDk1YzRhYTI4Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzNiM2ViNGEwZWJjZmMyN2JjM2I1NjZlMWU1ZjY0OWFhNjMzODM5ZWJiNTU5
10
- ZGVhMTU0M2FiNWZjMzhiYzE0OGYzMTU2NTY1ZTEzNjA3MzI2YmVhOTgzNmUy
11
- YjVjNGQxZTJhM2NiYjU2YmRlNTU4Y2Q0ZDQ2YTUzOTc1OGIzNWE=
9
+ MDU2YTJlZDk0MGZjYjZiNDU5OTBjOWUyOThiYWZjMjZiYTUwYTI1MjZkOTYx
10
+ NjJlZGNhNDZjOTU3YjRjY2M2NjI2NDIzZDlmZDM0ZjM3MDI1NDJkODI4NWY1
11
+ N2M0NmIyZmE3MDIxOTc5ZDY1ZTBjMWMzMTBhM2ViNTZjMjY5NmI=
12
12
  data.tar.gz: !binary |-
13
- ZTExMjM0OGYyNWJhZGE2OWM4MDg4ZjMzMzAyM2I0N2YzMTNiMmI1NDkxZWFj
14
- OWFlNjA0M2YyMjY0YTVmY2ZlOWM0MTQ5YTkxMGM0OGIwNzNmMTg4ODI4YmI1
15
- NTcyYWZjY2E0NjM5NjUyZmFhMzAxNGRiOGNlOWUzMjU1ZmNjOWU=
13
+ ZDY0NjYzNTc2MzQyM2YxNTVkOGJhMDAzYzcwODIzYTg5M2VlNWM1OTM3Mjcy
14
+ MmQwNjUwYWE3Y2NlMmI3ODY4MjBiODQxZWIwODUzMmM4ZjJiNWM1NzAwZTg2
15
+ NGUyNTVmYTVlNGUwMjliODcwMTA4ODJkZmMyYTdmOWMwYmRlZmQ=
@@ -4,6 +4,7 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1.5
7
+ - 2.2.0
7
8
  - ruby-head
8
9
  - rbx-2
9
10
 
@@ -1,5 +1,12 @@
1
1
  = Changes log for the UCF Ruby Gem
2
2
 
3
+ == Version 2.0.0
4
+
5
+ * Add ruby 2.2.0 to the Travis test matrix.
6
+ * Update examples and tests to use the latest API.
7
+ * Add some usage information to the ReadMe.
8
+ * Update to version 3.0.1 of zip-container.
9
+
3
10
  == Version 1.1.0
4
11
 
5
12
  * Tidy up gemspec and update dependency versions.
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013, 2014 The University of Manchester, UK.
1
+ Copyright (c) 2013-2015 The University of Manchester, UK.
2
2
 
3
3
  All rights reserved.
4
4
 
@@ -5,12 +5,12 @@ Contact:: mailto:support@mygrid.org.uk
5
5
  Homepage:: http://mygrid.github.io/ruby-ucf
6
6
  Source code:: https://github.com/myGrid/ruby-ucf
7
7
  Licence:: BSD (See Licence file or http://www.opensource.org/licenses/bsd-license.php)
8
- Copyright:: (c) 2013, 2014 The University of Manchester, UK
8
+ Copyright:: (c) 2013-2015 The University of Manchester, UK
9
9
 
10
- {<img src="https://badge.fury.io/rb/ucf.png" alt="Gem Version" />}[http://badge.fury.io/rb/ucf]
11
- {<img src="https://codeclimate.com/github/myGrid/ruby-ucf.png" />}[https://codeclimate.com/github/myGrid/ruby-ucf]
10
+ {<img src="https://badge.fury.io/rb/ucf.svg" alt="Gem Version" />}[http://badge.fury.io/rb/ucf]
11
+ {<img src="https://codeclimate.com/github/myGrid/ruby-ucf.svg" />}[https://codeclimate.com/github/myGrid/ruby-ucf]
12
12
  {<img src="https://travis-ci.org/myGrid/ruby-ucf.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/myGrid/ruby-ucf]
13
- {<img src="https://coveralls.io/repos/myGrid/ruby-ucf/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/myGrid/ruby-ucf?branch=master]
13
+ {<img src="https://coveralls.io/repos/myGrid/ruby-ucf/badge.svg?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/myGrid/ruby-ucf?branch=master]
14
14
 
15
15
  == Synopsis
16
16
 
@@ -51,6 +51,25 @@ this API into closer alignment with the underlying
51
51
 
52
52
  UCF::Container is not available from version 1.0.0 onwards.
53
53
 
54
+ == Usage
55
+
56
+ This library has two entry points.
57
+
58
+ The main UCF::File class is a specialization of
59
+ {ZipContainer::File}[http://mygrid.github.io/ruby-zip-container/3.0.0/ZipContainer/File.html]
60
+ which largely mimics the rubyzip
61
+ {Zip::File}[http://www.rubydoc.info/gems/rubyzip/1.1.6/Zip/File] and
62
+ {Zip::FileSystem}[http://www.rubydoc.info/gems/rubyzip/1.1.6/Zip/FileSystem]
63
+ APIs.
64
+
65
+ The UCF::Dir class is a based upon the
66
+ {ZipContainer::Dir}[http://mygrid.github.io/ruby-zip-container/3.0.0/ZipContainer/Dir.html]
67
+ class which mimics, where possible, the core ruby
68
+ {Dir API}[http://ruby-doc.org/core-1.9.3/Dir.html].
69
+
70
+ There are some examples of how to use the library provided in the examples
71
+ directory. See the contents of the tests directory for even more.
72
+
54
73
  == What this library can not do yet
55
74
 
56
75
  The basic requirements of a UCF document are all implemented but there are a
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
3
3
  #
4
4
  # All rights reserved.
5
5
  #
@@ -50,7 +50,7 @@ if File.exists?(ucffile)
50
50
  end
51
51
 
52
52
  begin
53
- UCF::Container.create(ucffile) do |c|
53
+ UCF::File.create(ucffile) do |c|
54
54
 
55
55
  # Add a cheery greeting file from a string.
56
56
  c.file.open("greeting.txt", "w") do |f|
@@ -66,7 +66,7 @@ begin
66
66
  # Add a explanation of this file.
67
67
  c.comment = "This is an example UCF file!"
68
68
  end
69
- rescue ZipContainer::MalformedContainerError, Zip::ZipError => err
69
+ rescue ZipContainer::MalformedContainerError, ZipContainer::Error => err
70
70
  puts err.to_s
71
71
  exit 1
72
72
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
3
3
  #
4
4
  # All rights reserved.
5
5
  #
@@ -45,8 +45,8 @@ usage unless ARGV.length == 1
45
45
  ucffile = ARGV[0]
46
46
 
47
47
  begin
48
- ucf = UCF::Container.open(ucffile)
49
- rescue ZipContainer::MalformedContainerError, Zip::ZipError => err
48
+ ucf = UCF::File.open(ucffile)
49
+ rescue ZipContainer::MalformedContainerError, ZipContainer::Error => err
50
50
  puts err.to_s
51
51
  exit 1
52
52
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
3
3
  #
4
4
  # All rights reserved.
5
5
  #
@@ -45,8 +45,8 @@ usage unless ARGV.length == 1
45
45
  ucffile = ARGV[0]
46
46
 
47
47
  begin
48
- UCF::Container.verify!(ucffile)
49
- rescue ZipContainer::MalformedContainerError, Zip::ZipError => err
48
+ UCF::File.verify!(ucffile)
49
+ rescue ZipContainer::MalformedContainerError, ZipContainer::Error => err
50
50
  puts err.to_s
51
51
  exit 1
52
52
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013, 2014 The University of Manchester, UK.
1
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
2
2
  #
3
3
  # All rights reserved.
4
4
  #
@@ -50,7 +50,7 @@ class TestCreateFile < Test::Unit::TestCase
50
50
  end
51
51
  end
52
52
 
53
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
53
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::Error) do
54
54
  UCF::File.verify!(filename)
55
55
  end
56
56
  end
@@ -74,7 +74,7 @@ class TestCreateFile < Test::Unit::TestCase
74
74
  end
75
75
  end
76
76
 
77
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
77
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::Error) do
78
78
  UCF::File.verify!(filename)
79
79
  end
80
80
  end
@@ -117,7 +117,7 @@ class TestCreateFile < Test::Unit::TestCase
117
117
  end
118
118
  end
119
119
 
120
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
120
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::Error) do
121
121
  UCF::File.open(filename) do |ucf|
122
122
  assert(ucf.on_disk?)
123
123
  refute(ucf.in_memory?)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013, 2014 The University of Manchester, UK.
1
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
2
2
  #
3
3
  # All rights reserved.
4
4
  #
@@ -98,7 +98,7 @@ class TestManagedEntries < Test::Unit::TestCase
98
98
 
99
99
  # Check that the example UCF document does not validate as a ManagedUCF.
100
100
  def test_fail_verification
101
- refute(ManagedUCF.verify($ucf_example))
101
+ refute(ManagedUCF.verify?($ucf_example))
102
102
 
103
103
  assert_raises(ZipContainer::MalformedContainerError) do
104
104
  ManagedUCF.verify!($ucf_example)
@@ -107,7 +107,7 @@ class TestManagedEntries < Test::Unit::TestCase
107
107
 
108
108
  # Check that the example UCF document does validate as an ExampleUCF.
109
109
  def test_pass_verification
110
- assert(ExampleUCF.verify($ucf_example))
110
+ assert(ExampleUCF.verify?($ucf_example))
111
111
 
112
112
  assert_nothing_raised(ZipContainer::MalformedContainerError) do
113
113
  ExampleUCF.verify!($ucf_example)
@@ -116,7 +116,7 @@ class TestManagedEntries < Test::Unit::TestCase
116
116
 
117
117
  # Check that the example UCF document does validate as an ExampleUCF2.
118
118
  def test_pass_verification_2
119
- assert(ExampleUCF2.verify($ucf_example))
119
+ assert(ExampleUCF2.verify?($ucf_example))
120
120
 
121
121
  assert_nothing_raised(ZipContainer::MalformedContainerError) do
122
122
  ExampleUCF2.verify!($ucf_example)
@@ -125,7 +125,7 @@ class TestManagedEntries < Test::Unit::TestCase
125
125
 
126
126
  # Check that the example UCF directory validates.
127
127
  def test_pass_verification_dir
128
- assert(ExampleUCFDir.verify($dir_mngd))
128
+ assert(ExampleUCFDir.verify?($dir_mngd))
129
129
 
130
130
  assert_nothing_raised(ZipContainer::MalformedContainerError) do
131
131
  ExampleUCFDir.verify!($dir_mngd)
@@ -170,7 +170,7 @@ class TestManagedEntries < Test::Unit::TestCase
170
170
  end
171
171
  end
172
172
 
173
- refute(ManagedUCF.verify(filename))
173
+ refute(ManagedUCF.verify?(filename))
174
174
  assert_raises(ZipContainer::MalformedContainerError) do
175
175
  ManagedUCF.verify!(filename)
176
176
  end
@@ -191,7 +191,7 @@ class TestManagedEntries < Test::Unit::TestCase
191
191
  end
192
192
  end
193
193
 
194
- assert(ManagedUCF.verify(filename))
194
+ assert(ManagedUCF.verify?(filename))
195
195
  assert_nothing_raised(ZipContainer::MalformedContainerError) do
196
196
  ManagedUCF.verify!(filename)
197
197
  end
@@ -228,7 +228,7 @@ class TestManagedEntries < Test::Unit::TestCase
228
228
  end
229
229
  #end
230
230
 
231
- assert(ExampleUCF2.verify(filename))
231
+ assert(ExampleUCF2.verify?(filename))
232
232
  assert_nothing_raised(ZipContainer::MalformedContainerError) do
233
233
  ExampleUCF2.verify!(filename)
234
234
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014 The University of Manchester, UK.
1
+ # Copyright (c) 2014, 2015 The University of Manchester, UK.
2
2
  #
3
3
  # All rights reserved.
4
4
  #
@@ -41,7 +41,7 @@ class TestReadDir < Test::Unit::TestCase
41
41
  UCF::Dir.verify!($dir_null)
42
42
  end
43
43
 
44
- refute(UCF::Dir.verify($dir_null))
44
+ refute(UCF::Dir.verify?($dir_null))
45
45
  end
46
46
 
47
47
  # Check that the empty container directory does verify.
@@ -50,7 +50,7 @@ class TestReadDir < Test::Unit::TestCase
50
50
  UCF::Dir.verify!($dir_empty)
51
51
  end
52
52
 
53
- assert(UCF::Dir.verify($dir_empty))
53
+ assert(UCF::Dir.verify?($dir_empty))
54
54
  end
55
55
 
56
56
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013, 2014 The University of Manchester, UK.
1
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
2
2
  #
3
3
  # All rights reserved.
4
4
  #
@@ -37,29 +37,31 @@ class TestReadFile < Test::Unit::TestCase
37
37
 
38
38
  # Check that the null file does not verify.
39
39
  def test_verify_null_file
40
- assert_raise(Zip::ZipError) do
40
+ assert_raise(ZipContainer::Error) do
41
41
  UCF::File.verify!($file_null)
42
42
  end
43
43
 
44
- refute(UCF::File.verify($file_null))
44
+ assert_raise(ZipContainer::Error) do
45
+ UCF::File.verify?($file_null)
46
+ end
45
47
  end
46
48
 
47
49
  # Check that the empty ucf file does verify.
48
50
  def test_verify_empty_ucf
49
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
51
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::Error) do
50
52
  UCF::File.verify!($ucf_empty)
51
53
  end
52
54
 
53
- assert(UCF::File.verify($ucf_empty))
55
+ assert(UCF::File.verify?($ucf_empty))
54
56
  end
55
57
 
56
58
  # Check that the example ucf file does verify.
57
59
  def test_verify_example_ucf
58
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
60
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::Error) do
59
61
  UCF::File.verify!($ucf_example)
60
62
  end
61
63
 
62
- assert(UCF::File.verify($ucf_example))
64
+ assert(UCF::File.verify?($ucf_example))
63
65
  end
64
66
 
65
67
  # Check that the empty zip file does not verify.
@@ -68,7 +70,7 @@ class TestReadFile < Test::Unit::TestCase
68
70
  UCF::File.verify!($zip_empty)
69
71
  end
70
72
 
71
- refute(UCF::File.verify($zip_empty))
73
+ refute(UCF::File.verify?($zip_empty))
72
74
  end
73
75
 
74
76
  # Check that a compressed mimetype file is detected.
@@ -77,7 +79,7 @@ class TestReadFile < Test::Unit::TestCase
77
79
  UCF::File.verify!($ucf_compressed_mimetype)
78
80
  end
79
81
 
80
- refute(UCF::File.verify($ucf_compressed_mimetype))
82
+ refute(UCF::File.verify?($ucf_compressed_mimetype))
81
83
  end
82
84
 
83
85
  # Check the raw mimetype bytes
@@ -91,7 +93,7 @@ class TestReadFile < Test::Unit::TestCase
91
93
 
92
94
  # Check reading files out of a ucf file and make sure we don't change it.
93
95
  def test_read_files_from_ucf
94
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
96
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::Error) do
95
97
  UCF::File.open($ucf_example) do |ucf|
96
98
  assert(ucf.on_disk?)
97
99
  refute(ucf.in_memory?)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013 The University of Manchester, UK.
1
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
2
2
  #
3
3
  # All rights reserved.
4
4
  #
@@ -54,7 +54,7 @@ class TestReservedNames < Test::Unit::TestCase
54
54
 
55
55
  # Check that the reserved names verify correctly.
56
56
  def test_verify_reserved_name
57
- assert(NewUCF.verify($ucf_example))
57
+ assert(NewUCF.verify?($ucf_example))
58
58
 
59
59
  assert_nothing_raised(ZipContainer::MalformedContainerError) do
60
60
  NewUCF.verify!($ucf_example)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013, 2014 The University of Manchester, UK.
1
+ # Copyright (c) 2013-2015 The University of Manchester, UK.
2
2
  #
3
3
  # All rights reserved.
4
4
  #
@@ -62,5 +62,5 @@ Gem::Specification.new do |s|
62
62
  s.add_development_dependency "test-unit", "~> 3.0"
63
63
  s.add_development_dependency "coveralls"
64
64
  s.add_development_dependency "nokogiri", "~> 1.6"
65
- s.add_runtime_dependency "zip-container", "~> 2.2"
65
+ s.add_runtime_dependency "zip-container", "~> 3.0.1"
66
66
  end
@@ -1,4 +1,4 @@
1
1
  ---
2
- :major: 1
3
- :minor: 1
2
+ :major: 2
3
+ :minor: 0
4
4
  :patch: 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Haines
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: '2.2'
103
+ version: 3.0.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: '2.2'
110
+ version: 3.0.1
111
111
  description: A Ruby library for working with Universal Container Format files - a
112
112
  type of EPUB document. See the UCF specification (https://learn.adobe.com/wiki/display/PDFNAV/Universal+Container+Format)
113
113
  for details. They are very similar, although not as restrictive, as the EPUB Open