Class: Nu::Project
- Inherits:
-
Object
- Object
- Nu::Project
- Defined in:
- lib/nu/project.rb
Instance Method Summary collapse
- #add_file(name, content) ⇒ Object
-
#initialize ⇒ Project
constructor
A new instance of Project.
-
#location ⇒ Object
need to meta awesome this.
-
#location=(name) ⇒ Object
need to meta awesome this.
-
#should_use_long_names? ⇒ Boolean
need to meta awesome this.
-
#use_long_names ⇒ Object
need to meta awesome this.
-
#use_short_names ⇒ Object
need to meta awesome this.
Constructor Details
#initialize ⇒ Project
6 7 8 9 |
# File 'lib/nu/project.rb', line 6 def initialize @config_file = ".nu/options.yaml" ensure_default_config end |
Instance Method Details
#add_file(name, content) ⇒ Object
48 49 50 51 |
# File 'lib/nu/project.rb', line 48 def add_file(name, content) FileUtils.mkdir_p(File.dirname(name)) File.open(name, 'w'){|f| f.write(content)} end |
#location ⇒ Object
need to meta awesome this
14 15 16 17 |
# File 'lib/nu/project.rb', line 14 def location opts = opts['lib'] end |
#location=(name) ⇒ Object
need to meta awesome this
19 20 21 22 23 24 |
# File 'lib/nu/project.rb', line 19 def location=(name) opts = opts['lib']=name save_file(opts) nil end |
#should_use_long_names? ⇒ Boolean
need to meta awesome this
27 28 29 30 |
# File 'lib/nu/project.rb', line 27 def should_use_long_names? opts = opts['uselongnames'] end |
#use_long_names ⇒ Object
need to meta awesome this
33 34 35 36 37 38 |
# File 'lib/nu/project.rb', line 33 def use_long_names opts = opts['uselongnames']=true save_file(opts) nil end |
#use_short_names ⇒ Object
need to meta awesome this
40 41 42 43 44 45 |
# File 'lib/nu/project.rb', line 40 def use_short_names opts = opts['uselongnames']=false save_file(opts) nil end |