Class: Rag::Project
- Inherits:
-
Object
- Object
- Rag::Project
- Defined in:
- lib/rag/new.rb
Overview
== ERB support variables
- project # the name of your project, provided by `rag new
" - others from .ragrc
== Configrauton
- ~/.ragrc
- APP/.ragrc
- from cmdline
you can use arbitrary name in .ragrc, then you can use then in template file.
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(template, app_path, o = {}) ⇒ Project
constructor
A new instance of Project.
Constructor Details
#initialize(template, app_path, o = {}) ⇒ Project
Returns a new instance of Project.
28 29 30 31 32 33 34 |
# File 'lib/rag/new.rb', line 28 def initialize(template, app_path, o={}) @template = template @options = o o["name"] ||= Pa.absolute(app_path).fname o["class_name"] ||= o["name"].capitalize @app_path = Pa(app_path) end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
27 28 29 |
# File 'lib/rag/new.rb', line 27 def app_path @app_path end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
27 28 29 |
# File 'lib/rag/new.rb', line 27 def @options end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
27 28 29 |
# File 'lib/rag/new.rb', line 27 def template @template end |
Class Method Details
Instance Method Details
#create ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/rag/new.rb', line 36 def create create_project_directory if @app_path == "." copy_files else copy_files :overwrite => true end end |