Class: New
- Inherits:
-
Object
show all
- Extended by:
- Dsl
- Defined in:
- lib/new.rb,
lib/new.rb
Defined Under Namespace
Modules: Dsl, Interpolate, Version
Classes: Cli, Project, Task, Template
Constant Summary
collapse
- VERSION =
'0.0.1'
- DEFAULT_DIR =
File.expand_path('../..', __FILE__)
- CUSTOM_DIR =
File.expand_path('~/.new')
- TASKS_DIR_NAME =
'tasks'
- TEMPLATES_DIR_NAME =
'templates'
- CONFIG_FILE =
'.new'
Class Method Summary
collapse
Methods included from Dsl
say
Class Method Details
.custom_config ⇒ Object
39
40
41
|
# File 'lib/new.rb', line 39
def self.custom_config
@custom_config ||= YAML.load(File.open(File.join(CUSTOM_DIR, CONFIG_FILE))).deep_symbolize_keys! rescue {}
end
|
.custom_tasks ⇒ Object
35
36
37
|
# File 'lib/new.rb', line 35
def self.custom_tasks
@custom_tasks ||= get_list TASKS_DIR_NAME, :custom
end
|
.custom_templates ⇒ Object
27
28
29
|
# File 'lib/new.rb', line 27
def self.custom_templates
@custom_templates ||= get_list TEMPLATES_DIR_NAME, :custom
end
|
.default_tasks ⇒ Object
31
32
33
|
# File 'lib/new.rb', line 31
def self.default_tasks
@default_tasks ||= get_list TASKS_DIR_NAME, :default
end
|
.default_templates ⇒ Object
23
24
25
|
# File 'lib/new.rb', line 23
def self.default_templates
@default_templates ||= get_list TEMPLATES_DIR_NAME, :default
end
|
.tasks ⇒ Object
List all the available tasks
13
14
15
|
# File 'lib/new.rb', line 13
def self.tasks
custom_tasks | default_tasks
end
|
.templates ⇒ Object
List all the available templates
19
20
21
|
# File 'lib/new.rb', line 19
def self.templates
custom_templates | default_templates
end
|