Module: Doing::Util
- Included in:
- CSVExport, CalendarImport, DayoneExport, DoingImport, HTMLExport, JSONExport, JSONImport, MarkdownExport, TaskPaperExport, TemplateExport, TimingImport, Backup
- Defined in:
- lib/doing/util.rb,
 lib/doing/util_backup.rb
Overview
Utilities
Defined Under Namespace
Modules: Backup
Class Method Summary collapse
- .args_for_editor(editor) ⇒ Object
- 
  
    
      .deep_merge_hashes(master_hash, other_hash)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Non-destructive version of deep_merge_hashes!. 
- 
  
    
      .deep_merge_hashes!(target, overwrite)  ⇒ Hash 
    
    
  
  
  
  
  
  
  
  
  
    Merges a master hash with another hash, recursively. 
- .default_editor ⇒ Object
- .duplicable?(obj) ⇒ Boolean
- .duplicate_frozen_values(target) ⇒ Object
- .editor_with_args ⇒ Object
- 
  
    
      .exec_available(cli)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Test if command line tool is available. 
- .find_default_editor(editor_for = 'default') ⇒ Object
- 
  
    
      .first_available_exec(*commands)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Return the first valid executable from a list of commands. 
- .mergable?(value) ⇒ Boolean
- .merge_default_proc(target, overwrite) ⇒ Object
- .merge_values(target, overwrite) ⇒ Object
- .safe_load_file(filename) ⇒ Object
- .user_home ⇒ Object
- 
  
    
      .write_to_file(file, content, backup: true)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Write content to a file. 
Class Method Details
.args_for_editor(editor) ⇒ Object
.deep_merge_hashes(master_hash, other_hash) ⇒ Object
Non-destructive version of deep_merge_hashes!
.deep_merge_hashes!(target, overwrite) ⇒ Hash
Merges a master hash with another hash, recursively.
This code was lovingly stolen from some random gem: http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html
Thanks to whoever made it.
.default_editor ⇒ Object
.duplicable?(obj) ⇒ Boolean
.duplicate_frozen_values(target) ⇒ Object
.editor_with_args ⇒ Object
.exec_available(cli) ⇒ Object
Test if command line tool is available
.find_default_editor(editor_for = 'default') ⇒ Object
.first_available_exec(*commands) ⇒ Object
Return the first valid executable from a list of commands
.mergable?(value) ⇒ Boolean
.merge_default_proc(target, overwrite) ⇒ Object
.merge_values(target, overwrite) ⇒ Object
.safe_load_file(filename) ⇒ Object
.user_home ⇒ Object
.write_to_file(file, content, backup: true) ⇒ Object
Write content to a file