class AppCommand::CreateUI

Public Instance Methods

execute() click to toggle source
# File lib/routes/create/create_ui.rb, line 5
def execute

    begin

        @opts = command_options
        @args = arguments

        @archetypes = get_archetypes

        opts_validate
        opts_routing

    rescue => e

        Blufin::Terminal::print_exception(e)

    end

end
opts_routing() click to toggle source
# File lib/routes/create/create_ui.rb, line 29
def opts_routing

    Blufin::Terminal::info('Create new UI', "You're about to create a new UI from an archetype.")

    # TODO - FINISH THIS...

    Blufin::Terminal::prompt_select('Select Archetype', @archetypes)

    raise RuntimeError, 'Not yet implemented!'

    # TODO - These are the steps I currently run manually...

    # $ cd /path/to/where/i/want/new/ui
    # $ cp -R ~/Repos/blufin-archetypes/nuxt/v1/* .
    # $ rm -rf .nuxt
    # $ rm -rf dist
    # $ rm -rf node_modules
    # $ rm static/sw.js
    # $ rm README.md
    # $ rm yarn.lock
    # $ yarn install
    # $ yarn link blufin-ui
    # $ yarn install
    # In IDE, ran string replace 'blufin-nuxt-v1' -> 'org.blufin' (the only occurrence was in package.json)
    # In IDE, ran string replace 'Blufin Nuxt (v1)' -> 'Blufin' (the only occurrence was in package.json)

end
opts_validate() click to toggle source
# File lib/routes/create/create_ui.rb, line 25
def opts_validate

end

Private Instance Methods

get_archetypes() click to toggle source

Gets an Array of available archetypes (with descriptions). @return Array (of Hashes)

# File lib/routes/create/create_ui.rb, line 61
def get_archetypes

    # TODO - This will need to eventually come from the configuration YML file.
    # TODO - This structure is only temporary.
    [
        {
            :value => 1,
            :text  => 'Blufin Nuxt (v1)'
        },
        {
            :value => 2,
            :text  => 'Blufin Electron (v1)'
        },
        {
            :value => 3,
            :text  => 'Blufin Electron (v2)'
        }
    ]

end