eye 0.10.0 → 0.10.1.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 218cd6084aa8cbf64bd9c2323c06653567047f36
4
- data.tar.gz: f92a56120accad129155024f088d945e34a5fa2e
3
+ metadata.gz: 5256bf0fc1122a7987c0bbb82d6880b660cde729
4
+ data.tar.gz: 8935783bf1db9a8f4516928d4840f166701448ef
5
5
  SHA512:
6
- metadata.gz: 251fd65a3db9eb5c15a4863a84f27491470a6b86e2a202e304ffe63220808df98097c7c4ee049e4b828cb340e5ec301f4a3e2f8bc3d6465c2a40b22dcddb314e
7
- data.tar.gz: 4dea2cc62a3a5a3f8f5f97bbbd016d91d86eab0749a4f8eeb71b2b1e5a9fc8b2466e2cdf1ea12b9073998df1939ae0e53be349e553380cfa62ef6fa2af7d1a33
6
+ metadata.gz: a4c9b5df0ef036fe1acc6eff78185a9097648e534cf21eaaa27d7fd1b228971cd6cfc18ab331b97dda44517567de1676a139a4acb06b41f294ecb9b8c849140a
7
+ data.tar.gz: 227d6f61fa25a9a3fd87b0561b29296c4ce555f9fa32dbae484247cfd89c4bb6476965fb08c87c5dd263b3e423e28a1cf4fad87838c61ef756acebf5151a19bc
@@ -2,7 +2,6 @@ AllCops:
2
2
  Include:
3
3
  - '**/*.eye'
4
4
  Exclude:
5
- - 'spec/**/*'
6
5
  - 'lib/eye/utils/mini_active_support.rb'
7
6
 
8
7
  Performance/RedundantBlockCall:
@@ -43,7 +42,7 @@ Style/RegexpLiteral:
43
42
  Layout/AccessModifierIndentation:
44
43
  EnforcedStyle: outdent
45
44
 
46
- Lint/EndAlignment:
45
+ Layout/EndAlignment:
47
46
  EnforcedStyleAlignWith: variable
48
47
 
49
48
  Layout/IndentHash:
data/bin/leye CHANGED
@@ -28,9 +28,7 @@ unless Eye::Local.eyefile || ENV['EYE_HOME']
28
28
  exit 1
29
29
  end
30
30
 
31
- unless ENV.key?('EYE_HOME')
32
- ENV['EYE_HOME'] = File.dirname(Eye::Local.eyefile)
33
- end
31
+ ENV['EYE_HOME'] = File.dirname(Eye::Local.eyefile) unless ENV.key?('EYE_HOME')
34
32
 
35
33
  Eye::Local.local_runner = true
36
34
  Eye::Cli.start
@@ -16,7 +16,7 @@ end
16
16
 
17
17
  Eye.app :bla do
18
18
  process :a do
19
- start_command "ruby -e 'sleep 10; $0 = %{HAHA}.downcase; sleep'"
19
+ start_command "ruby -e 'sleep 10; $0 = %q{HAHA}.downcase; sleep'"
20
20
  daemonize true
21
21
  pid_file '/tmp/1.pid'
22
22
  check :my_check, every: 1.second, fires: -> { send_signal(:TERM) }
@@ -5,16 +5,14 @@ class Eye::Trigger::FixCrash < Eye::Trigger::Custom
5
5
  param :times, Integer, nil, 1
6
6
  param_default :to, :up
7
7
 
8
- def check(_)
8
+ def check(*)
9
9
  # process states here like this: [..., :starting, :down, :starting, :down, :starting, :up]
10
10
  states = process.states_history.states
11
11
 
12
12
  # states to compare with
13
13
  compare = [:starting, :down] * times + [:starting, :up]
14
14
 
15
- if states[-compare.length..-1] == compare
16
- process.notify(:info, 'yahho, process up')
17
- end
15
+ process.notify(:info, 'yahho, process up') if states[-compare.length..-1] == compare
18
16
  end
19
17
 
20
18
  end
data/lib/eye.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Eye
2
- VERSION = '0.10.0'
3
- ABOUT = "Eye v#{VERSION} (c) 2012-2017 @kostya"
2
+ VERSION = '0.10.1.pre'
3
+ ABOUT = "Eye v#{VERSION} (c) 2012-2018 @kostya"
4
4
  PROCLINE = "eye monitoring v#{VERSION}"
5
5
 
6
6
  autoload :Process, 'eye/process'
@@ -33,17 +33,19 @@ module Eye::Controller::Helpers
33
33
  return process_by_full_name(name) if name.include?(':')
34
34
 
35
35
  if app_name
36
- app = application_by_name(app_name)
37
- app.groups.each do |gr|
38
- p = gr.processes.detect { |c| c.name == name }
39
- return p if p
36
+ if app = application_by_name(app_name)
37
+ app.groups.each do |gr|
38
+ p = gr.processes.detect { |c| c.name == name }
39
+ return p if p
40
+ end
40
41
  end
41
42
  end
42
43
 
43
44
  if group_name
44
- gr = group_by_name(group_name)
45
- p = gr.processes.detect { |c| c.name == name }
46
- return p if p
45
+ if gr = group_by_name(group_name)
46
+ p = gr.processes.detect { |c| c.name == name }
47
+ return p if p
48
+ end
47
49
  end
48
50
 
49
51
  process_by_name(name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Makarchev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-22 00:00:00.000000000 Z
11
+ date: 2019-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid
@@ -469,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
469
469
  version: 1.3.6
470
470
  requirements: []
471
471
  rubyforge_project:
472
- rubygems_version: 2.6.6
472
+ rubygems_version: 2.4.5
473
473
  signing_key:
474
474
  specification_version: 4
475
475
  summary: Process monitoring tool. Inspired from Bluepill and God. Requires Ruby(MRI)