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.
84 85 86 |
# File 'lib/iesd/utility/hdiutil.rb', line 84 def initialize url @url = File.absolute_path url end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
82 83 84 |
# File 'lib/iesd/utility/hdiutil.rb', line 82 def url @url end |
Instance Method Details
#edit ⇒ Object
92 93 94 |
# File 'lib/iesd/utility/hdiutil.rb', line 92 def edit update end |
#show(&block) ⇒ Object
88 89 90 |
# File 'lib/iesd/utility/hdiutil.rb', line 88 def show &block HDIUtil.read(@url, &block) end |
#update(&block) ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'lib/iesd/utility/hdiutil.rb', line 96 def update &block Dir.mktmpdir { |tmp| flags = `/usr/bin/env ls -lO #{@url.shellescape}`.split[4] HDIUtil.write(@url, (tmpfile = File.join(tmp, File.basename(@url))), &block) system("/usr/bin/env", "mv", tmpfile, @url) system("/usr/bin/env", "chflags", flags, @url) unless flags == "-" } end |