Class: Picky::Generators::AllInOne::Sinatra

Inherits:
Base
  • Object
show all
Defined in:
lib/picky-generators/generators/all_in_one/sinatra.rb

Overview

Generates a new Picky Sinatra/Unicorn combined Client/Server Example.

Example:

> picky-generate all_in_one my_client_server_directory

Instance Attribute Summary

Attributes inherited from Base

#identifier, #name, #prototype_basedir

Instance Method Summary collapse

Methods inherited from Base

#all_prototype_files, #copy_all_files, #copy_single_file, #create_target_directory, #created, #exclaim, #exists, #expand_prototype_path, #generate_for, #smart_copy, #target_directory, #target_filename_for

Constructor Details

#initialize(identifier, name, *args) ⇒ Sinatra

Returns a new instance of Sinatra.



14
15
16
# File 'lib/picky-generators/generators/all_in_one/sinatra.rb', line 14

def initialize identifier, name, *args
  super identifier, name, 'all_in_one/sinatra', *args
end

Instance Method Details

#generateObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/picky-generators/generators/all_in_one/sinatra.rb', line 20

def generate
  generate_for "Sinatra Client/Server",
  [
    'shared/server',
    'shared/both',
    'shared/client'
  ],
  [
    "cd #{name}",
    "bundle install",
    "bundle exec rake index",
    "bundle exec unicorn -c unicorn.rb",
    "open http://localhost:8080/",
    "rake todo # (optional) Shows you where Picky needs input from you."
  ]
end