Class: BooticCli::Commands::Themes

Inherits:
BooticCli::Command show all
Defined in:
lib/bootic_cli/commands/themes.rb

Defined Under Namespace

Classes: Prompt

Constant Summary

Constants included from BooticCli::Connectivity

BooticCli::Connectivity::DEFAULT_ENV

Instance Method Summary collapse

Methods inherited from BooticCli::Command

declare, #help

Instance Method Details

#clone(dir = nil) ⇒ Object



18
19
20
21
22
23
# File 'lib/bootic_cli/commands/themes.rb', line 18

def clone(dir = nil)
  logged_in_action do
    local_theme, remote_theme = theme_selector.setup_theme_pair(options['shop'], dir, options['public'])
    workflows.pull(local_theme, remote_theme, destroy: options['destroy'])
  end
end

#compareObject



56
57
58
59
60
61
# File 'lib/bootic_cli/commands/themes.rb', line 56

def compare
  within_theme do
    local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
    workflows.compare(local_theme, remote_theme)
  end
end

#openObject



82
83
84
85
86
87
# File 'lib/bootic_cli/commands/themes.rb', line 82

def open
  within_theme do
    _, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
    Launchy.open remote_theme.path
  end
end

#pairObject



91
92
93
94
95
96
# File 'lib/bootic_cli/commands/themes.rb', line 91

def pair
  within_theme do
    local_theme = theme_selector.pair(options['shop'], current_dir)
    prompt.say "Directory #{local_theme.path} paired with shop #{options['shop']}", :green
  end
end

#publishObject



73
74
75
76
77
78
# File 'lib/bootic_cli/commands/themes.rb', line 73

def publish
  within_theme do
    local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, false)
    workflows.publish(local_theme, remote_theme)
  end
end

#pullObject



28
29
30
31
32
33
# File 'lib/bootic_cli/commands/themes.rb', line 28

def pull
  within_theme do
    local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
    workflows.pull(local_theme, remote_theme, destroy: options['destroy'])
  end
end

#pushObject



38
39
40
41
42
43
# File 'lib/bootic_cli/commands/themes.rb', line 38

def push
  within_theme do
    local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
    workflows.push(local_theme, remote_theme, destroy: options['destroy'])
  end
end

#syncObject



47
48
49
50
51
52
# File 'lib/bootic_cli/commands/themes.rb', line 47

def sync
  within_theme do
    local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
    workflows.sync(local_theme, remote_theme)
  end
end

#watchObject



65
66
67
68
69
70
# File 'lib/bootic_cli/commands/themes.rb', line 65

def watch
  within_theme do
    _, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
    workflows.watch(current_dir, remote_theme)
  end
end