Module: ThemeJuice::Config
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #command(cmd, *args) ⇒ Object
- #commands ⇒ Object
- #deployment ⇒ Object
- #exist? ⇒ Boolean
- #project ⇒ Object
- #refresh! ⇒ Object
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
11 12 13 |
# File 'lib/theme-juice/config.rb', line 11 def path @path end |
Instance Method Details
#command(cmd, *args) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/theme-juice/config.rb', line 13 def command(cmd, *args) return if @project.no_config args.map { |arg| arg.reject! { |a| /^-/ =~ a } if arg.is_a?(Array) } commands.fetch("#{cmd}") { @io.error "Command '#{cmd}' not found in config", NotImplementedError } .each { |c| cmds = format_command(c, *args) @env.inside_vm ? run_inside_vm(cmds) : run(cmds) } rescue NoMethodError @io.say "Skipping...", :color => :yellow, :icon => :notice end |
#commands ⇒ Object
33 34 35 36 37 |
# File 'lib/theme-juice/config.rb', line 33 def commands config.commands rescue NoMethodError {} end |
#deployment ⇒ Object
39 40 41 42 43 |
# File 'lib/theme-juice/config.rb', line 39 def deployment config.deployment rescue NoMethodError @io.error("Deployment settings not found in config", NotImplementedError) end |
#exist? ⇒ Boolean
45 46 47 |
# File 'lib/theme-juice/config.rb', line 45 def exist? !capture { config }.nil? end |
#project ⇒ Object
27 28 29 30 31 |
# File 'lib/theme-juice/config.rb', line 27 def project config.project rescue NoMethodError {} end |
#refresh! ⇒ Object
49 50 51 |
# File 'lib/theme-juice/config.rb', line 49 def refresh! @config = read end |