Module: Dotsync::Icons

Defined in:
lib/dotsync/icons.rb

Constant Summary collapse

INFO =

Log level icons

""
ERROR =
""
OPTIONS =

Configuration icon

""
ENV_VARS =
""
LEGEND =
""
CONFIG =
""
DIFF =
""
DEFAULT_FORCE =

Default Mappings Legend icons

"󰁪 "
DEFAULT_ONLY =
""
DEFAULT_IGNORE =
"󰈉 "
DEFAULT_INVALID =
"󱏏 "
DEFAULT_HOOK =
"󰜎 "
DEFAULT_DIFF_CREATED =

Default Mappings Differences icons

""
DEFAULT_DIFF_UPDATED =
""
DEFAULT_DIFF_REMOVED =
""
PULL =

Action icons

""
PUSH =
""
WATCH =
"󰛐 "
CONSOLE =
"󰆍 "
LISTEN =

TODO: review icons needed

""
SOURCE =

 "

""
DEST =

" "

""
BELL =
""
COPY =
""
SKIP =
""
DONE =
""
BACKUP =
""
MAPPINGS =
{
  info: INFO,
  error: ERROR,
  env_vars: ENV_VARS,
  options: OPTIONS,
  legend: LEGEND,
  config: CONFIG,
  diff: DIFF,
  force: -> { force },
  ignore: -> { ignore },
  hook: DEFAULT_HOOK,
  pull: PULL,
  push: PUSH,
  watch: WATCH,
  console: CONSOLE,
  listen: LISTEN,
  source: SOURCE,
  dest: DEST,
  bell: BELL,
  copy: COPY,
  skip: SKIP,
  done: DONE,
  backup: BACKUP
}

Class Method Summary collapse

Class Method Details

.diff_createdObject

Differences Legend methods



86
87
88
# File 'lib/dotsync/icons.rb', line 86

def self.diff_created
  @custom_icons[:diff_created] || DEFAULT_DIFF_CREATED
end

.diff_removedObject



94
95
96
# File 'lib/dotsync/icons.rb', line 94

def self.diff_removed
  @custom_icons[:diff_removed] || DEFAULT_DIFF_REMOVED
end

.diff_updatedObject



90
91
92
# File 'lib/dotsync/icons.rb', line 90

def self.diff_updated
  @custom_icons[:diff_updated] || DEFAULT_DIFF_UPDATED
end

.forceObject

Mappings Legend methods



64
65
66
# File 'lib/dotsync/icons.rb', line 64

def self.force
  @custom_icons[:force] || DEFAULT_FORCE
end

.hookObject



80
81
82
# File 'lib/dotsync/icons.rb', line 80

def self.hook
  @custom_icons[:hook] || DEFAULT_HOOK
end

.ignoreObject



72
73
74
# File 'lib/dotsync/icons.rb', line 72

def self.ignore
  @custom_icons[:ignore] || DEFAULT_IGNORE
end

.invalidObject



76
77
78
# File 'lib/dotsync/icons.rb', line 76

def self.invalid
  @custom_icons[:invalid] || DEFAULT_INVALID
end

.load_custom_icons(config) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/dotsync/icons.rb', line 46

def self.load_custom_icons(config)
  config ||= {}
  @custom_icons = {
    # Mappings Legend
    force: config.dig("icons", "force") || DEFAULT_FORCE,
    only: config.dig("icons", "only") || DEFAULT_ONLY,
    ignore: config.dig("icons", "ignore") || DEFAULT_IGNORE,
    invalid: config.dig("icons", "invalid") || DEFAULT_INVALID,
    hook: config.dig("icons", "hook") || DEFAULT_HOOK,
    # Differences Legend
    diff_created: config.dig("icons", "diff_created") || DEFAULT_DIFF_CREATED,
    diff_updated: config.dig("icons", "diff_updated") || DEFAULT_DIFF_UPDATED,
    diff_removed: config.dig("icons", "diff_removed") || DEFAULT_DIFF_REMOVED,
  }
end

.onlyObject



68
69
70
# File 'lib/dotsync/icons.rb', line 68

def self.only
  @custom_icons[:only] || DEFAULT_ONLY
end