Class: Coolstrap::Generator::CLI

Inherits:
Thor
  • Object
show all
Includes:
Utils
Defined in:
lib/coolstrap-generator/cli.rb

Constant Summary collapse

STATUS_TYPES =
{:success          => 0,
:general_error    => 1,
:not_supported    => 3,
:not_found        => 4,
:incorrect_usage  => 64,
}

Instance Method Summary collapse

Methods included from Utils

#base_location, #create_directories, #create_new_file, #create_with_template, #error, #get_app_name, #log, #remove_directories, #remove_files, #templates, #touch, #underscore

Instance Method Details

#buildObject



64
65
66
67
# File 'lib/coolstrap-generator/cli.rb', line 64

def build
  system "echo ::== COOLSTRAP BUILD =="
  system "middleman build"
end

#generate(type, name) ⇒ Object



48
49
50
51
52
53
# File 'lib/coolstrap-generator/cli.rb', line 48

def generate(type, name)
  case 
  when type =~ /view/i
    ::Coolstrap::Generator::Generate::View.create(name)
  end
end

#infoObject



23
24
25
# File 'lib/coolstrap-generator/cli.rb', line 23

def info
  say "Version #{::Coolstrap::Generator::VERSION}"
end

#new(name, device_id = 'org.mycompany.demo', platform = 'iphone') ⇒ Object



32
33
34
# File 'lib/coolstrap-generator/cli.rb', line 32

def new(name, device_id='org.mycompany.demo', platform='iphone')
  ::Coolstrap::Generator::Generate::Project.create(name, device_id, platform)
end

#scaffold(cs_type, domain, name) ⇒ Object



38
39
40
41
42
43
# File 'lib/coolstrap-generator/cli.rb', line 38

def scaffold(cs_type, domain, name)
  ::Coolstrap::Generator::Generate::View.create(name, { 
    :domain   => domain, 
    :cs_type  => cs_type, 
    :name     => name })
end

#serverObject



57
58
59
60
# File 'lib/coolstrap-generator/cli.rb', line 57

def server
  system "echo == :::COOLSTRAP STARTING::: =="
  system "bundle exec middleman server"
end