Class: Crafti::Root
- Inherits:
-
Object
- Object
- Crafti::Root
- Includes:
- FileUtilsExtension
- Defined in:
- lib/crafti.rb
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
-
#appname ⇒ Object
readonly
Returns the value of attribute appname.
Class Method Summary collapse
Instance Method Summary collapse
- #create_root_directory ⇒ Object
- #evaluate(&block) ⇒ Object
-
#initialize(appname) ⇒ Root
constructor
A new instance of Root.
Methods included from FileUtilsExtension
#chmod, #chmod_r, #copy, #mkdir, #mkdirs, #run, #sudo, #template, #touch
Constructor Details
#initialize(appname) ⇒ Root
Returns a new instance of Root.
131 132 133 134 |
# File 'lib/crafti.rb', line 131 def initialize(appname) @appname = appname @app_path = ::Pathname.new(appname). end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
129 130 131 |
# File 'lib/crafti.rb', line 129 def app_path @app_path end |
#appname ⇒ Object (readonly)
Returns the value of attribute appname.
129 130 131 |
# File 'lib/crafti.rb', line 129 def appname @appname end |
Class Method Details
Instance Method Details
#create_root_directory ⇒ Object
140 141 142 |
# File 'lib/crafti.rb', line 140 def create_root_directory ::FileUtils.mkdir_p(app_path) end |
#evaluate(&block) ⇒ Object
136 137 138 |
# File 'lib/crafti.rb', line 136 def evaluate(&block) instance_eval &block end |