Module: App

Defined in:
lib/eworld.rb,
lib/core/opt.rb

Defined Under Namespace

Classes: Opt

Constant Summary collapse

GEM_NAME =
'eworld'
SCHEMA_FILE =
"#{App::Opt::get_base_path}#{App::Opt::OPT_PATH}/config/schema.yml"
TEMPLATE_FILE =
"#{App::Opt::get_base_path}#{App::Opt::OPT_PATH}/config/template.yml"
CONFIG_FILE =
'~/.eworld.yml'

Class Method Summary collapse

Class Method Details

.executeObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/eworld.rb', line 17

def self.execute

    begin

        unless ARGV[0] == 'config' || ARGV[0] == 'x'
            Blufin::Config::init(SCHEMA_FILE, TEMPLATE_FILE, CONFIG_FILE, GEM_NAME)
        end

        Convoy::App.create do |eworld|

            eworld.version EWORLD_VERSION
            eworld.summary " \\x1B[48;5;130m\\x1B[38;5;255m eWorld-CLI \\x1B[0m\\x1B[0m \\x1B[38;5;130m\\xe2\\x80\\x94 eWorld Commmand-Line Interface\\x1B[38;5;248m\n\n      _       ______  ____  __    ____        ________    ____\n  ___| |     / / __ \\\\/ __ \\\\/ /   / __ \\\\      / ____/ /   /  _/\n / _ \\\\ | /| / / / / / /_/ / /   / / / /_____/ /   / /    / /  \n/  __/ |/ |/ / /_/ / _, _/ /___/ /_/ /_____/ /___/ /____/ /   \n\\\\___/|__/|__/\\\\____/_/ |_/_____/_____/      \\\\____/_____/___/\\x1B[0m\n"
            eworld.description 'An internal tool intended for improving/automating development tasks.'

            # x - CONFIG
            eworld.command :config, :aliases => [:x] do |config|
                config.summary 'Setup your configuration file'
                config.action do
                    Blufin::Config::edit_config(App::CONFIG_FILE)
                end
            end

            # eworld - DEFAULT
            eworld.action do
                system("#{App::GEM_NAME} -h")
            end

        end

    rescue RuntimeError => e

        Blufin::Terminal::print_exception(e);

    end

end