Module: Whiteboard::CLI

Defined in:
lib/whiteboard/cli.rb

Instance Method Summary collapse

Instance Method Details

#file_stringObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/whiteboard/cli.rb', line 6

def file_string
"require \"whiteboard\"\ninclude Whiteboard\n\nWhiteboard.test_run! # Prints commands without actually running them\n\n# Generate app\nWhiteboard::App.new do |app|\napp.name 'TestApp'                          # the only required field\n# app.skip_bundle!                            # skip individual options\n# app.skip! ['git', 'test-unit']              # skip multiple things\napp.database 'postgresql'                   # defaults to sqlite, possible options are\n                                            # the rails defaults (not mongo, unfortunately)\napp.ruby_version '2.1.2'                    # generates .ruby-version file\napp.ruby_gemset 'testapp-gemset'            # generates .ruby-gemset file\napp.gems ['omniauth', 'omniauth-twitter']   # appends to Gemfile\napp.gems ['twitter', ['rack', '>=1.0']]     # appends gem with version specified\nend\n\n# Generate User model\nWhiteboard::Model.new do |m|\nm.name 'User'\nm.field :name,            :string\nm.field :email,           :string\nm.field :password_digest, :string\nend\n\n# Generate Post Model\nWhiteboard::Model.new do |m|\nm.name 'Post'\nm.field :title,           :string\nm.field :body,            :text\nm.field :user_id,         :references, :index\nend\n\n# User controller\nWhiteboard::Controller.new do |c|\nc.name 'Users'\nc.actions [:index, :new, :show]\nend\n"
end