Class: New

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/mddb/commands/new.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



7
8
9
# File 'lib/mddb/commands/new.rb', line 7

def self.source_root
  File.expand_path('../../templates', __FILE__)
end

Instance Method Details

#configObject



15
16
17
# File 'lib/mddb/commands/new.rb', line 15

def config
  template "config.yml.tt", "#{name}/config.yml"
end

#frameObject



23
24
25
# File 'lib/mddb/commands/new.rb', line 23

def frame
  template "frame.rb.tt", "#{name}/models/frame.rb"
end

#modelsObject



19
20
21
# File 'lib/mddb/commands/new.rb', line 19

def models
  empty_directory "#{name}/models"
end

#READMEObject



11
12
13
# File 'lib/mddb/commands/new.rb', line 11

def README
  template "README.tt", "#{name}/README"
end

#specObject



27
28
29
# File 'lib/mddb/commands/new.rb', line 27

def spec
  empty_directory "#{name}/spec"
end