examples/create-ucf in ucf-1.1.0 vs examples/create-ucf in ucf-2.0.0
- old
+ new
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
-# Copyright (c) 2013 The University of Manchester, UK.
+# Copyright (c) 2013-2015 The University of Manchester, UK.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -48,11 +48,11 @@
puts "File '#{ucffile}' already exists. Exiting."
exit 1
end
begin
- UCF::Container.create(ucffile) do |c|
+ UCF::File.create(ucffile) do |c|
# Add a cheery greeting file from a string.
c.file.open("greeting.txt", "w") do |f|
f.puts "Hello, World!"
end
@@ -64,9 +64,9 @@
c.add("dir/code.rb", __FILE__)
# Add a explanation of this file.
c.comment = "This is an example UCF file!"
end
-rescue ZipContainer::MalformedContainerError, Zip::ZipError => err
+rescue ZipContainer::MalformedContainerError, ZipContainer::Error => err
puts err.to_s
exit 1
end