Class: Swiftly::CreateProject
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Swiftly::CreateProject
show all
- Includes:
- Helpers, Thor::Actions
- Defined in:
- lib/swiftly/create_project.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Helpers
#find_and_replace, #find_and_replace_all, #fix_serialization, #fix_text, #mina, #return_cmd, #swiftly_shell, #unzip, #update_setting, #verifiy_mina_credentials, #zip
Class Method Details
.source_root ⇒ Object
20
21
22
23
24
|
# File 'lib/swiftly/create_project.rb', line 20
def self.source_root
File.dirname(__FILE__)
end
|
Instance Method Details
#allow_project_creation ⇒ Object
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/swiftly/create_project.rb', line 28
def allow_project_creation
if Swiftly::Project.exists?(@project_name)
say say_status "#{APP_NAME}:", "There is already a project named #{@project_path}", :red
abort
end
end
|
#create_assets ⇒ Object
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/swiftly/create_project.rb', line 40
def create_assets()
allow_project_creation
['architecture', 'doc', 'emails', 'fonts', 'images', 'raster', 'vector'].each do |path|
empty_directory( File.join( @project_path ,"_resources", "assets", path ) )
end
end
|
#create_dump_directories ⇒ Object
51
52
53
54
55
56
57
58
59
|
# File 'lib/swiftly/create_project.rb', line 51
def create_dump_directories
['local','production','staging','temp'].each do |path|
empty_directory( File.join( @project_path , "_backups", "dumps", path ) )
end
end
|
#create_project_config ⇒ Object
61
62
63
64
65
|
# File 'lib/swiftly/create_project.rb', line 61
def create_project_config
ConfigProjectGenerator.new.create(@project_path)
end
|
#no_commands ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/swiftly/create_project.rb', line 26
def no_commands
def allow_project_creation
if Swiftly::Project.exists?(@project_name)
say say_status "#{APP_NAME}:", "There is already a project named #{@project_path}", :red
abort
end
end
end
|