Class: Prow::AppBuilder::Create
- Inherits:
-
Struct
- Object
- Struct
- Prow::AppBuilder::Create
- Defined in:
- lib/prow/app_builder/create.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #app_path ⇒ Object
- #copy(file_path) ⇒ Object
- #copy_pages_and_layouts ⇒ Object
- #copy_partials ⇒ Object
- #create_and_move_stylesheets ⇒ Object
- #mkdir(dir) ⇒ Object
- #perform ⇒ Object
- #templates_path ⇒ Object
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path
3 4 5 |
# File 'lib/prow/app_builder/create.rb', line 3 def path @path end |
Instance Method Details
#app_path ⇒ Object
47 48 49 |
# File 'lib/prow/app_builder/create.rb', line 47 def app_path path || `pwd`.chomp end |
#copy(file_path) ⇒ Object
39 40 41 |
# File 'lib/prow/app_builder/create.rb', line 39 def copy(file_path) FileUtils.cp(templates_path + "/" + file_path, app_path + "/" + file_path) end |
#copy_pages_and_layouts ⇒ Object
20 21 22 23 |
# File 'lib/prow/app_builder/create.rb', line 20 def copy_pages_and_layouts copy('templates/layouts/default.mustache') copy('templates/pages/index.mustache') end |
#copy_partials ⇒ Object
25 26 27 |
# File 'lib/prow/app_builder/create.rb', line 25 def copy_partials ShipdStyle::CopyDirectory.new(app_path + "/templates/partials", "templates").perform end |
#create_and_move_stylesheets ⇒ Object
29 30 31 32 33 |
# File 'lib/prow/app_builder/create.rb', line 29 def create_and_move_stylesheets copier = ShipdStyle::CopyStylesheets.new(app_path) copier.perform copier.remove_namespace end |
#mkdir(dir) ⇒ Object
35 36 37 |
# File 'lib/prow/app_builder/create.rb', line 35 def mkdir(dir) FileUtils.mkdir(app_path + "/" + dir) unless File.exist?(dir) end |
#perform ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/prow/app_builder/create.rb', line 4 def perform copy('config.ru') copy('Guardfile') mkdir('public') mkdir('templates') mkdir('config') mkdir('templates/layouts') mkdir('templates/pages') mkdir('templates/partials') copy('config/pages.json') copy_partials mkdir('sass') create_and_move_stylesheets copy_pages_and_layouts end |
#templates_path ⇒ Object
43 44 45 |
# File 'lib/prow/app_builder/create.rb', line 43 def templates_path File.dirname(__FILE__) + "/templates" end |