Class: Oynx::Oynx_CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/oynx.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#newObject

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



38
39
40
41
42
43
44
45
46
47
48
49
50
# 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

#uploadObject

Uploads the site using the Oynx backend.



72
73
74
# File 'lib/oynx.rb', line 72

def upload
    Oynx_Back.upload(options, config["name"], File.join(Dir.pwd, config["name"]))
end