Class: Kicker

Inherits:
Object
  • Object
show all
Defined in:
lib/kicker.rb,
lib/kicker/job.rb,
lib/kicker/utils.rb,
lib/kicker/options.rb,
lib/kicker/recipes.rb,
lib/kicker/version.rb,
lib/kicker/core_ext.rb,
lib/kicker/fsevents.rb,
lib/kicker/notification.rb,
lib/kicker/callback_chain.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ArrayExt, Notification, Options, Recipes, Utils Classes: CallbackChain, FSEvents, Job

Constant Summary collapse

VERSION =
"3.0.0"

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeKicker

Returns a new instance of Kicker.



19
20
21
# File 'lib/kicker.rb', line 19

def initialize
  finished_processing!
end

Class Attribute Details

.clear_consoleObject

Returns the value of attribute clear_console.



5
6
7
# File 'lib/kicker/options.rb', line 5

def clear_console
  @clear_console
end

.full_chainObject



36
37
38
# File 'lib/kicker/callback_chain.rb', line 36

def full_chain
  @full_chain ||= CallbackChain.new([pre_process_chain, process_chain, post_process_chain])
end

.latencyObject

Returns the value of attribute latency.



5
6
7
# File 'lib/kicker/options.rb', line 5

def latency
  @latency
end

.pathsObject

Returns the value of attribute paths.



5
6
7
# File 'lib/kicker/options.rb', line 5

def paths
  @paths
end

.post_process_chainObject



31
32
33
# File 'lib/kicker/callback_chain.rb', line 31

def post_process_chain
  @post_process_chain ||= CallbackChain.new
end

.pre_process_chainObject



21
22
23
# File 'lib/kicker/callback_chain.rb', line 21

def pre_process_chain
  @pre_process_chain ||= CallbackChain.new
end

.process_chainObject



26
27
28
# File 'lib/kicker/callback_chain.rb', line 26

def process_chain
  @process_chain ||= CallbackChain.new
end

.quietObject

Returns the value of attribute quiet.



5
6
7
# File 'lib/kicker/options.rb', line 5

def quiet
  @quiet
end

.silentObject

Returns the value of attribute silent.



5
6
7
# File 'lib/kicker/options.rb', line 5

def silent
  @silent
end

.startup_chainObject



16
17
18
# File 'lib/kicker/callback_chain.rb', line 16

def startup_chain
  @startup_chain ||= CallbackChain.new
end

Instance Attribute Details

#last_event_processed_atObject (readonly)

Returns the value of attribute last_event_processed_at.



17
18
19
# File 'lib/kicker.rb', line 17

def last_event_processed_at
  @last_event_processed_at
end

Class Method Details

.clear_console?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/kicker/options.rb', line 15

def clear_console?
  @clear_console
end

.osx?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/kicker/options.rb', line 20

def osx?
  RUBY_PLATFORM.downcase.include?("darwin")
end

.quiet?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/kicker/options.rb', line 11

def quiet?
  @quiet
end

.run(argv = ARGV) ⇒ Object



12
13
14
15
# File 'lib/kicker.rb', line 12

def self.run(argv = ARGV)
  Kicker::Options.parse(argv)
  new.start.loop!
end

.silent?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/kicker/options.rb', line 7

def silent?
  @silent
end

Instance Method Details

#full_chainObject



57
58
59
# File 'lib/kicker/callback_chain.rb', line 57

def full_chain
  self.class.full_chain
end

#loop!Object



39
40
41
# File 'lib/kicker.rb', line 39

def loop!
  (Thread.list - [Thread.current, Thread.main]).each(&:join)
end

#pathsObject



23
24
25
# File 'lib/kicker.rb', line 23

def paths
  @paths ||= Kicker.paths.map { |path| File.expand_path(path) }
end

#post_process_chainObject



53
54
55
# File 'lib/kicker/callback_chain.rb', line 53

def post_process_chain
  self.class.post_process_chain
end

#pre_process_chainObject



45
46
47
# File 'lib/kicker/callback_chain.rb', line 45

def pre_process_chain
  self.class.pre_process_chain
end

#process_chainObject



49
50
51
# File 'lib/kicker/callback_chain.rb', line 49

def process_chain
  self.class.process_chain
end

#startObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/kicker.rb', line 27

def start
  validate_options!

  log "Watching for changes on: #{paths.join(', ')}"
  log ''

  run_startup_chain
  run_watch_dog!

  self
end

#startup_chainObject



41
42
43
# File 'lib/kicker/callback_chain.rb', line 41

def startup_chain
  self.class.startup_chain
end