Class: Nu::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/nu/project.rb

Instance Method Summary collapse

Constructor Details

#initializeProject



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

#locationObject

need to meta awesome this



14
15
16
17
# File 'lib/nu/project.rb', line 14

def location
  opts = get_options
  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 = get_options
    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 = get_options
  opts['uselongnames']
end

#use_long_namesObject

need to meta awesome this



33
34
35
36
37
38
# File 'lib/nu/project.rb', line 33

def use_long_names
  opts = get_options
  opts['uselongnames']=true
  save_file(opts)
  nil
end

#use_short_namesObject

need to meta awesome this



40
41
42
43
44
45
# File 'lib/nu/project.rb', line 40

def use_short_names
  opts = get_options
  opts['uselongnames']=false
  save_file(opts)
  nil
end