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



42
43
44
45
46
47
48
# File 'lib/linner/command.rb', line 42

def build
  Linner.compile = true
  Linner.strict = true if options[:strict]
  clean
  Bundler.new(env.bundles).perform
  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



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

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



67
68
69
70
# File 'lib/linner/command.rb', line 67

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



51
52
53
54
55
56
57
58
59
# File 'lib/linner/command.rb', line 51

def watch
  clean
  Bundler.new(env.bundles).perform
  perform
  watch_for_env
  watch_for_perform
  watch_for_reload rescue nil
  sleep
end