Class: SinatraHelpers::SinatraApp

Inherits:
Object
  • Object
show all
Defined in:
lib/webapp_raketasks/sinatra_helpers/sinatra_app.rb

Direct Known Subclasses

BootstrapApp

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.invokeObject



4
5
6
7
8
9
10
# File 'lib/webapp_raketasks/sinatra_helpers/sinatra_app.rb', line 4

def self.invoke
  app = new
  app.create_webapp_rb
  app.create_config_ru
  app.create_index_haml
  app.create_layout_haml
end

Instance Method Details

#create_config_ruObject



14
15
16
# File 'lib/webapp_raketasks/sinatra_helpers/sinatra_app.rb', line 14

def create_config_ru
  create_file_with_content( "./config.ru", config_ru )
end

#create_index_haml(content = index_haml) ⇒ Object



17
18
19
# File 'lib/webapp_raketasks/sinatra_helpers/sinatra_app.rb', line 17

def create_index_haml content = index_haml
  create_file_with_content( "./views/index.haml", content )
end

#create_layout_haml(content = layout_haml) ⇒ Object



20
21
22
# File 'lib/webapp_raketasks/sinatra_helpers/sinatra_app.rb', line 20

def create_layout_haml content = layout_haml
  create_file_with_content( "./views/layout.haml", content )
end

#create_webapp_rbObject



11
12
13
# File 'lib/webapp_raketasks/sinatra_helpers/sinatra_app.rb', line 11

def create_webapp_rb
  create_file_with_content("./webapp.rb", webapp_rb)
end