Class: HDIUtil::DMG
- Inherits:
-
Object
- Object
- HDIUtil::DMG
- Defined in:
- lib/iesd/utility/hdiutil.rb
Direct Known Subclasses
IESD::DMG::BaseSystem, IESD::DMG::InstallESD, IESD::DMG::InstallOSX
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #edit ⇒ Object
-
#initialize(url) ⇒ DMG
constructor
A new instance of DMG.
- #show(&block) ⇒ Object
- #update(&block) ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(url) ⇒ DMG
Returns a new instance of DMG.
73 74 75 |
# File 'lib/iesd/utility/hdiutil.rb', line 73 def initialize url @url = File.absolute_path url end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
71 72 73 |
# File 'lib/iesd/utility/hdiutil.rb', line 71 def url @url end |
Instance Method Details
#edit ⇒ Object
81 82 83 |
# File 'lib/iesd/utility/hdiutil.rb', line 81 def edit update end |
#show(&block) ⇒ Object
77 78 79 |
# File 'lib/iesd/utility/hdiutil.rb', line 77 def show &block HDIUtil.read(@url, &block) end |
#update(&block) ⇒ Object
85 86 87 88 89 90 91 92 |
# File 'lib/iesd/utility/hdiutil.rb', line 85 def update &block Dir.mktmpdir { |tmp| flags = `#{Utility::LS} -lO "#{@url}"`.split[4] HDIUtil.write(@url, (tmpfile = File.join(tmp, File.basename(@url))), &block) system(Utility::MV, tmpfile, @url) system(Utility::CHFLAGS, flags, @url) unless flags == "-" } end |