Class: Oynx::Oynx_CLI
- Inherits:
-
Thor
- Object
- Thor
- Oynx::Oynx_CLI
- 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
-
#new ⇒ Object
If the user wants a
defaultwebsite, create one. -
#upload ⇒ Object
Uploads the site using the Oynx backend.
Instance Method Details
#new ⇒ Object
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 [:default] then Oynx_Back.new.create_site() else config["name"] = [:name] if [:name] config["charset"] = [:charset] if [:charset] config["css"] = [:css] if not [:css] config["js"] = [:js] if not [:js] config["img"] = [:img] if not [:img] Oynx_Back.new(config).create_site end end |
#upload ⇒ Object
Uploads the site using the Oynx backend.
72 73 74 |
# File 'lib/oynx.rb', line 72 def upload Oynx_Back.upload(, config["name"], File.join(Dir.pwd, config["name"])) end |