Class: Dojo::Commands::Dojofy
- Inherits:
-
Object
- Object
- Dojo::Commands::Dojofy
- Includes:
- Errors
- Defined in:
- lib/dojo-pkg.rb
Instance Attribute Summary collapse
-
#dojo_src ⇒ Object
readonly
Returns the value of attribute dojo_src.
-
#install_base ⇒ Object
readonly
Returns the value of attribute install_base.
-
#install_dir ⇒ Object
readonly
Returns the value of attribute install_dir.
Class Method Summary collapse
-
.install ⇒ Object
Setup and install dojo.
Instance Method Summary collapse
-
#copy ⇒ Object
Copy the dojo source files to the
install_dir
. -
#initialize ⇒ Dojofy
constructor
Constructor doesn’t do a whole lot :).
-
#install ⇒ Object
Setup and install dojo.
-
#setup ⇒ Object
Assert that we are installing into a rails app Assert that we are not overwritting a previous dojo install.
Constructor Details
#initialize ⇒ Dojofy
Constructor doesn’t do a whole lot :)
18 19 20 |
# File 'lib/dojo-pkg.rb', line 18 def initialize _init_self end |
Instance Attribute Details
#dojo_src ⇒ Object (readonly)
Returns the value of attribute dojo_src.
15 16 17 |
# File 'lib/dojo-pkg.rb', line 15 def dojo_src @dojo_src end |
#install_base ⇒ Object (readonly)
Returns the value of attribute install_base.
15 16 17 |
# File 'lib/dojo-pkg.rb', line 15 def install_base @install_base end |
#install_dir ⇒ Object (readonly)
Returns the value of attribute install_dir.
15 16 17 |
# File 'lib/dojo-pkg.rb', line 15 def install_dir @install_dir end |
Class Method Details
.install ⇒ Object
Setup and install dojo
58 59 60 61 |
# File 'lib/dojo-pkg.rb', line 58 def Dojofy.install cmd = new cmd.install end |
Instance Method Details
#copy ⇒ Object
Copy the dojo source files to the install_dir
23 24 25 |
# File 'lib/dojo-pkg.rb', line 23 def copy FileUtils.cp_r @dojo_src, @install_dir end |
#install ⇒ Object
Setup and install dojo
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/dojo-pkg.rb', line 43 def install begin setup rescue Exception => e raise DojofyError.new("setup failed: #{e.}") end begin copy rescue Exception => e raise DojofyError.new("copy failed: #{e.}") end end |
#setup ⇒ Object
Assert that we are installing into a rails app Assert that we are not overwritting a previous dojo install
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dojo-pkg.rb', line 29 def setup if !File.directory? @install_base # TODO: give user the option of another directory. # For now just blow up so we know something happened. raise Exception.new("Invalid install destination: #{@install_base}") end # Check to make sure that the installation directory doesn't already exist if File.exists? @install_dir raise Exception.new("Installation directory already exists: #{@install_dir}") end end |