Class: Picky::Generators::Client::Sinatra

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

Overview

Generates a new Picky Sinatra Client Example.

Example:

> picky-generate sinatra_client my_lovely_sinatra

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/client/sinatra.rb', line 14

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

Instance Method Details

#generateObject



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

def generate
  generate_for "Sinatra Client",
  [
    'shared/both',
    'shared/client'
  ],
  [
    "cd #{name}",
    "bundle install",
    "unicorn -p 3000 # (optional) Or use your favorite web server.",
    "open http://localhost:3000/",
    "rake todo # (optional) Shows you where Picky needs input from you."
  ]
end