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.
80 81 82 |
# File 'lib/iesd/utility/hdiutil.rb', line 80 def initialize url @url = File.absolute_path url end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
78 79 80 |
# File 'lib/iesd/utility/hdiutil.rb', line 78 def url @url end |
Instance Method Details
#edit ⇒ Object
88 89 90 |
# File 'lib/iesd/utility/hdiutil.rb', line 88 def edit update end |
#show(&block) ⇒ Object
84 85 86 |
# File 'lib/iesd/utility/hdiutil.rb', line 84 def show &block HDIUtil.read(@url, &block) end |
#update(&block) ⇒ Object
92 93 94 95 96 97 98 99 |
# File 'lib/iesd/utility/hdiutil.rb', line 92 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 |