Class: Kicker
- Inherits:
-
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
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
#initialize ⇒ Kicker
Returns a new instance of Kicker.
19
20
21
|
# File 'lib/kicker.rb', line 19
def initialize
finished_processing!
end
|
Class Attribute Details
.clear_console ⇒ Object
Returns the value of attribute clear_console.
5
6
7
|
# File 'lib/kicker/options.rb', line 5
def clear_console
@clear_console
end
|
.full_chain ⇒ Object
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
|
.latency ⇒ Object
Returns the value of attribute latency.
5
6
7
|
# File 'lib/kicker/options.rb', line 5
def latency
@latency
end
|
.paths ⇒ Object
Returns the value of attribute paths.
5
6
7
|
# File 'lib/kicker/options.rb', line 5
def paths
@paths
end
|
.post_process_chain ⇒ Object
31
32
33
|
# File 'lib/kicker/callback_chain.rb', line 31
def post_process_chain
@post_process_chain ||= CallbackChain.new
end
|
.pre_process_chain ⇒ Object
21
22
23
|
# File 'lib/kicker/callback_chain.rb', line 21
def pre_process_chain
@pre_process_chain ||= CallbackChain.new
end
|
.process_chain ⇒ Object
26
27
28
|
# File 'lib/kicker/callback_chain.rb', line 26
def process_chain
@process_chain ||= CallbackChain.new
end
|
.quiet ⇒ Object
Returns the value of attribute quiet.
5
6
7
|
# File 'lib/kicker/options.rb', line 5
def quiet
@quiet
end
|
.silent ⇒ Object
Returns the value of attribute silent.
5
6
7
|
# File 'lib/kicker/options.rb', line 5
def silent
@silent
end
|
.startup_chain ⇒ Object
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_at ⇒ Object
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
15
16
17
|
# File 'lib/kicker/options.rb', line 15
def clear_console?
@clear_console
end
|
.osx? ⇒ Boolean
20
21
22
|
# File 'lib/kicker/options.rb', line 20
def osx?
RUBY_PLATFORM.downcase.include?("darwin")
end
|
.quiet? ⇒ 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
7
8
9
|
# File 'lib/kicker/options.rb', line 7
def silent?
@silent
end
|
Instance Method Details
#full_chain ⇒ Object
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
|
#paths ⇒ Object
23
24
25
|
# File 'lib/kicker.rb', line 23
def paths
@paths ||= Kicker.paths.map { |path| File.expand_path(path) }
end
|
#post_process_chain ⇒ Object
53
54
55
|
# File 'lib/kicker/callback_chain.rb', line 53
def post_process_chain
self.class.post_process_chain
end
|
#pre_process_chain ⇒ Object
45
46
47
|
# File 'lib/kicker/callback_chain.rb', line 45
def pre_process_chain
self.class.pre_process_chain
end
|
#process_chain ⇒ Object
49
50
51
|
# File 'lib/kicker/callback_chain.rb', line 49
def process_chain
self.class.process_chain
end
|
#start ⇒ Object
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_chain ⇒ Object
41
42
43
|
# File 'lib/kicker/callback_chain.rb', line 41
def startup_chain
self.class.startup_chain
end
|