Class: Guard::KonachaRails

Inherits:
Plugin
  • Object
show all
Defined in:
lib/guard/konacha-rails.rb,
lib/guard/konacha-rails/runner.rb,
lib/guard/konacha-rails/server.rb,
lib/guard/konacha-rails/formatter.rb

Defined Under Namespace

Classes: Formatter, Runner, Server

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ KonachaRails

Returns a new instance of KonachaRails.



13
14
15
16
17
# File 'lib/guard/konacha-rails.rb', line 13

def initialize(options = {})
  super

  @runner = Guard::KonachaRails::Runner.new(options)
end

Instance Attribute Details

#runnerObject

Returns the value of attribute runner.



11
12
13
# File 'lib/guard/konacha-rails.rb', line 11

def runner
  @runner
end

Class Method Details

.template(plugin_location) ⇒ Object



31
32
33
# File 'lib/guard/konacha-rails.rb', line 31

def self.template(plugin_location)
  File.read(template_path(plugin_location))
end

.template_path(plugin_location) ⇒ Object



35
36
37
38
# File 'lib/guard/konacha-rails.rb', line 35

def self.template_path(plugin_location)
  # workaround because Guard discards the '-' when detecting template path
  File.join(plugin_location, 'lib', 'guard', 'konacha-rails', 'templates', 'Guardfile')
end

Instance Method Details

#run_allObject



23
24
25
# File 'lib/guard/konacha-rails.rb', line 23

def run_all
  runner.run
end

#run_on_changes(paths = []) ⇒ Object



27
28
29
# File 'lib/guard/konacha-rails.rb', line 27

def run_on_changes(paths = [])
  runner.run(paths)
end

#startObject



19
20
21
# File 'lib/guard/konacha-rails.rb', line 19

def start
  runner.start
end