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
Returns a new instance of 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
47 48 49 50 |
# File 'lib/nu/project.rb', line 47 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
12 13 14 15 |
# File 'lib/nu/project.rb', line 12 def location opts = opts['lib'] end |
#location=(name) ⇒ Object
need to meta awesome this
18 19 20 21 22 23 |
# File 'lib/nu/project.rb', line 18 def location=(name) opts = opts['lib']=name save_file(opts) nil end |
#should_use_long_names? ⇒ Boolean
need to meta awesome this
26 27 28 29 |
# File 'lib/nu/project.rb', line 26 def should_use_long_names? opts = opts['uselongnames'] end |
#use_long_names ⇒ Object
need to meta awesome this
32 33 34 35 36 37 |
# File 'lib/nu/project.rb', line 32 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 |