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



37
38
39
40
41
# File 'lib/linner/command.rb', line 37

def build
  Linner.compile = true
  clean
  perform
end

#checkObject



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

def check
  message = Linner::Bundler.new(env.bundles).check
  puts (message.first ? "🍵 :" : "👻 :") + message.last
end

#cleanObject



55
56
57
# File 'lib/linner/command.rb', line 55

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

#installObject



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

def install
  begin
    Linner::Bundler.new(env.bundles).perform
  rescue
    puts "👻 : Install failed!"
    puts $!
    return
  end
  puts "🍵 : Perfect installed all bundles!"
end

#new(name) ⇒ Object



60
61
62
63
# File 'lib/linner/command.rb', line 60

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



44
45
46
47
48
49
50
51
52
# File 'lib/linner/command.rb', line 44

def watch
  trap(:INT) { exit! }
  clean
  Linner::Bundler.new(env.bundles).perform
  perform
  watch_for_perform
  watch_for_reload
  sleep
end