class Oynx::Oynx_CLI

This class connects Oynx with Thor, to allow passing of CLI options. This is what the user will interact with.

Public Instance Methods

new() click to toggle source

If the user wants a default website, create one. Else, gather our options into a configuration and create the site from that.

# File lib/oynx.rb, line 38
def new
        if options[:default] then
Oynx_Back.new.create_site()
        else
                config["name"] = options[:name] if options[:name]
                config["charset"] = options[:charset] if options[:charset]
                config["css"] = options[:css] if not options[:css]
                config["js"] = options[:js] if not options[:js]
                config["img"] = options[:img] if not options[:img]

                Oynx_Back.new(config).create_site
        end
end
upload() click to toggle source

Uploads the site using the Oynx backend.

# File lib/oynx.rb, line 72
def upload
    Oynx_Back.upload(options, config["name"], File.join(Dir.pwd, config["name"]))
end

Private Instance Methods

config() click to toggle source

Due to a Thor quirk, this is the best way to have a class variable, so we can store our website configuration

# File lib/oynx.rb, line 81
def config
    @config ||= Web_Config.new
end