Class: Linner::Command

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/linner/command.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



9
10
11
# File 'lib/linner/command.rb', line 9

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#buildObject



19
20
21
22
23
# File 'lib/linner/command.rb', line 19

def build
  Linner.compile = true
  clean
  Notifier.profile { Linner.perform }
end

#cleanObject



36
37
38
# File 'lib/linner/command.rb', line 36

def clean
  FileUtils.rm_rf Dir.glob("#{env.public_folder}/*")
end

#new(name) ⇒ Object



41
42
43
44
# File 'lib/linner/command.rb', line 41

def new(name)
  directory('templates', name)
  chmod("#{name}/bin/server", 0755)
end

#versionObject



14
15
16
# File 'lib/linner/command.rb', line 14

def version
  puts Linner::VERSION
end

#watchObject



26
27
28
29
30
31
32
33
# File 'lib/linner/command.rb', line 26

def watch
  trap(:INT) { exit! }
  clean
  perform_proc.call
  watch_for_perform
  watch_for_reload
  sleep
end