Class: Bashly::Commands::Add

Inherits:
Base
  • Object
show all
Defined in:
lib/bashly/commands/add.rb

Instance Method Summary collapse

Methods included from AssetHelper

#asset

Instance Method Details

#colors_commandObject



44
45
46
# File 'lib/bashly/commands/add.rb', line 44

def colors_command
  safe_copy_lib "colors.sh"
end

#comp_commandObject



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/bashly/commands/add.rb', line 52

def comp_command
  format = args['FORMAT']
  output = args['OUTPUT']
  
  case format
  when "function"
    save_comp_function output
  when "yaml"
    save_comp_yaml output
  when "script"
    save_comp_script output
  else
    raise Error, "Unrecognized format: #{format}"
  end

end

#config_commandObject



40
41
42
# File 'lib/bashly/commands/add.rb', line 40

def config_command
  safe_copy_lib "config.sh"
end

#lib_commandObject



36
37
38
# File 'lib/bashly/commands/add.rb', line 36

def lib_command
  safe_copy_lib "sample_function.sh"
end

#strings_commandObject



32
33
34
# File 'lib/bashly/commands/add.rb', line 32

def strings_command
  safe_copy asset("templates/strings.yml"), "#{Settings.source_dir}/bashly-strings.yml"
end

#yaml_commandObject



48
49
50
# File 'lib/bashly/commands/add.rb', line 48

def yaml_command
  safe_copy_lib "yaml.sh"
end