Class: Unmacer
- Inherits:
-
Object
- Object
- Unmacer
- Defined in:
- lib/unmacer.rb
Constant Summary collapse
- SPOTLIGHT =
'.Spotlight-V100'
- FSEVENTS =
'.fseventsd'
- TRASHES =
'.Trashes'
- REVISIONS =
'.DocumentRevisions-V100'
- MBACKUPS =
'.MobileBackups'
- MACOSX =
'__MACOSX'
- DSSTORE =
'.DS_Store'
- ICON =
"Icon\cM"
Instance Attribute Summary collapse
-
#keep_apple_double ⇒ Object
Returns the value of attribute keep_apple_double.
-
#keep_apple_double_orphans ⇒ Object
Returns the value of attribute keep_apple_double_orphans.
-
#keep_custom_folder_icons ⇒ Object
Returns the value of attribute keep_custom_folder_icons.
-
#keep_document_revisions ⇒ Object
Returns the value of attribute keep_document_revisions.
-
#keep_dsstore ⇒ Object
Returns the value of attribute keep_dsstore.
-
#keep_fsevents ⇒ Object
Returns the value of attribute keep_fsevents.
-
#keep_macosx ⇒ Object
Returns the value of attribute keep_macosx.
-
#keep_mobile_backups ⇒ Object
Returns the value of attribute keep_mobile_backups.
-
#keep_spotlight ⇒ Object
Returns the value of attribute keep_spotlight.
-
#keep_trashes ⇒ Object
Returns the value of attribute keep_trashes.
-
#pretend ⇒ Object
Returns the value of attribute pretend.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #find_skipping_root(path) ⇒ Object
-
#initialize ⇒ Unmacer
constructor
A new instance of Unmacer.
- #unmac!(dirnames) ⇒ Object
Constructor Details
#initialize ⇒ Unmacer
Returns a new instance of Unmacer.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/unmacer.rb', line 27 def initialize self.verbose = false self.pretend = false self.keep_spotlight = false self.keep_fsevents = false self.keep_trashes = false self.keep_document_revisions = false self.keep_mobile_backups = false self.keep_macosx = false self.keep_dsstore = false self.keep_apple_double = false self.keep_apple_double_orphans = false self.keep_custom_folder_icons = false end |
Instance Attribute Details
#keep_apple_double ⇒ Object
Returns the value of attribute keep_apple_double.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_apple_double @keep_apple_double end |
#keep_apple_double_orphans ⇒ Object
Returns the value of attribute keep_apple_double_orphans.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_apple_double_orphans @keep_apple_double_orphans end |
#keep_custom_folder_icons ⇒ Object
Returns the value of attribute keep_custom_folder_icons.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_custom_folder_icons @keep_custom_folder_icons end |
#keep_document_revisions ⇒ Object
Returns the value of attribute keep_document_revisions.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_document_revisions @keep_document_revisions end |
#keep_dsstore ⇒ Object
Returns the value of attribute keep_dsstore.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_dsstore @keep_dsstore end |
#keep_fsevents ⇒ Object
Returns the value of attribute keep_fsevents.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_fsevents @keep_fsevents end |
#keep_macosx ⇒ Object
Returns the value of attribute keep_macosx.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_macosx @keep_macosx end |
#keep_mobile_backups ⇒ Object
Returns the value of attribute keep_mobile_backups.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_mobile_backups @keep_mobile_backups end |
#keep_spotlight ⇒ Object
Returns the value of attribute keep_spotlight.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_spotlight @keep_spotlight end |
#keep_trashes ⇒ Object
Returns the value of attribute keep_trashes.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def keep_trashes @keep_trashes end |
#pretend ⇒ Object
Returns the value of attribute pretend.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def pretend @pretend end |
#verbose ⇒ Object
Returns the value of attribute verbose.
5 6 7 |
# File 'lib/unmacer.rb', line 5 def verbose @verbose end |
Instance Method Details
#find_skipping_root(path) ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/unmacer.rb', line 51 def find_skipping_root(path) root_seen = false Find.find(path) do |f| if !root_seen root_seen = true else yield f end end end |
#unmac!(dirnames) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/unmacer.rb', line 42 def unmac!(dirnames) Array(dirnames).each do |dirname| unmac_root(dirname) find_skipping_root(dirname) do |f| unmac_folder(f) if File.directory?(f) end end end |