cognizant 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.travis.yml +17 -0
  4. data/Gemfile +4 -1
  5. data/{LICENSE → License.md} +4 -2
  6. data/Rakefile +5 -0
  7. data/Readme.md +95 -0
  8. data/bin/cognizant +76 -122
  9. data/bin/cognizantd +28 -61
  10. data/cognizant.gemspec +8 -4
  11. data/examples/apps/redis-server.cz +42 -0
  12. data/examples/apps/redis-server.yml +29 -0
  13. data/examples/apps/redis-server_dsl.cz +54 -0
  14. data/examples/apps/resque.cz +17 -0
  15. data/examples/apps/thin.cz +32 -0
  16. data/examples/apps/thin.yml +48 -0
  17. data/examples/cognizantd.yml +18 -47
  18. data/features/child_process.feature +62 -0
  19. data/features/commands.feature +65 -0
  20. data/features/cpu_usage.feature +45 -0
  21. data/features/daemon.feature +12 -0
  22. data/features/flapping.feature +39 -0
  23. data/features/memory_usage.feature +45 -0
  24. data/features/shell.feature +30 -0
  25. data/features/step_definitions/common_steps.rb +14 -0
  26. data/features/step_definitions/daemon_steps.rb +25 -0
  27. data/features/step_definitions/shell_steps.rb +96 -0
  28. data/features/support/env.rb +54 -0
  29. data/lib/cognizant.rb +1 -5
  30. data/lib/cognizant/application.rb +122 -0
  31. data/lib/cognizant/application/dsl_proxy.rb +23 -0
  32. data/lib/cognizant/client.rb +61 -0
  33. data/lib/cognizant/commands.rb +164 -0
  34. data/lib/cognizant/commands/actions.rb +30 -0
  35. data/lib/cognizant/commands/help.rb +10 -0
  36. data/lib/cognizant/commands/load.rb +10 -0
  37. data/lib/cognizant/commands/shutdown.rb +7 -0
  38. data/lib/cognizant/commands/status.rb +11 -0
  39. data/lib/cognizant/commands/use.rb +15 -0
  40. data/lib/cognizant/controller.rb +17 -0
  41. data/lib/cognizant/daemon.rb +279 -0
  42. data/lib/cognizant/interface.rb +17 -0
  43. data/lib/cognizant/log.rb +25 -0
  44. data/lib/cognizant/process.rb +138 -94
  45. data/lib/cognizant/process/actions.rb +30 -41
  46. data/lib/cognizant/process/actions/restart.rb +73 -17
  47. data/lib/cognizant/process/actions/start.rb +35 -12
  48. data/lib/cognizant/process/actions/stop.rb +38 -17
  49. data/lib/cognizant/process/attributes.rb +41 -10
  50. data/lib/cognizant/process/children.rb +36 -0
  51. data/lib/cognizant/process/{condition_check.rb → condition_delegate.rb} +11 -13
  52. data/lib/cognizant/process/conditions.rb +7 -4
  53. data/lib/cognizant/process/conditions/cpu_usage.rb +5 -6
  54. data/lib/cognizant/process/conditions/memory_usage.rb +2 -6
  55. data/lib/cognizant/process/dsl_proxy.rb +23 -0
  56. data/lib/cognizant/process/execution.rb +16 -9
  57. data/lib/cognizant/process/pid.rb +16 -6
  58. data/lib/cognizant/process/status.rb +14 -2
  59. data/lib/cognizant/process/trigger_delegate.rb +57 -0
  60. data/lib/cognizant/process/triggers.rb +19 -0
  61. data/lib/cognizant/process/triggers/flapping.rb +68 -0
  62. data/lib/cognizant/process/triggers/transition.rb +22 -0
  63. data/lib/cognizant/process/triggers/trigger.rb +15 -0
  64. data/lib/cognizant/shell.rb +142 -0
  65. data/lib/cognizant/system.rb +16 -0
  66. data/lib/cognizant/system/ps.rb +1 -1
  67. data/lib/cognizant/system/signal.rb +2 -2
  68. data/lib/cognizant/util/dsl_proxy_methods_handler.rb +25 -0
  69. data/lib/cognizant/util/fixnum_percent.rb +5 -0
  70. data/lib/cognizant/util/transform_hash_keys.rb +33 -0
  71. data/lib/cognizant/validations.rb +142 -142
  72. data/lib/cognizant/version.rb +1 -1
  73. metadata +131 -71
  74. data/README.md +0 -221
  75. data/examples/redis-server.rb +0 -28
  76. data/examples/resque.rb +0 -10
  77. data/images/logo-small.png +0 -0
  78. data/images/logo.png +0 -0
  79. data/images/logo.pxm +0 -0
  80. data/lib/cognizant/logging.rb +0 -33
  81. data/lib/cognizant/process/conditions/flapping.rb +0 -57
  82. data/lib/cognizant/process/conditions/trigger_condition.rb +0 -52
  83. data/lib/cognizant/server.rb +0 -14
  84. data/lib/cognizant/server/commands.rb +0 -80
  85. data/lib/cognizant/server/daemon.rb +0 -277
  86. data/lib/cognizant/server/interface.rb +0 -86
  87. data/lib/cognizant/util/symbolize_hash_keys.rb +0 -19
@@ -0,0 +1,25 @@
1
+ module Cognizant
2
+ module Util
3
+ module DSLProxyMethodsHandler
4
+ attr_accessor :attributes
5
+
6
+ def initialize(entity, &dsl_block)
7
+ @attributes = Hash.new
8
+ end
9
+
10
+ def method_missing(name, *args, &block)
11
+ if args.size == 1 and name.to_s =~ /^(.*)=$/
12
+ @attributes[$1.to_sym] = args.first
13
+ elsif args.size == 1
14
+ @attributes[name.to_sym] = args.first
15
+ elsif args.size == 0 and name.to_s =~ /^(.*)!$/
16
+ @attributes[$1.to_sym] = true
17
+ elsif args.empty? and @attributes.key?(name.to_sym)
18
+ @attributes[name.to_sym]
19
+ else
20
+ super
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,5 @@
1
+ class Fixnum
2
+ def percent
3
+ self
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ class Hash
2
+ # Destructively convert all keys by using the block operation.
3
+ # This includes the keys from the root hash and from all
4
+ # nested hashes.
5
+ def deep_transform_keys!(&block)
6
+ keys.each do |key|
7
+ value = delete(key)
8
+ self[yield(key)] = value.is_a?(Hash) ? value.deep_transform_keys!(&block) : value
9
+ end
10
+ self
11
+ end
12
+
13
+ # Destructively convert all keys to strings, as long as they respond
14
+ # to `to_s`. This includes the keys from the root hash and from all
15
+ # nested hashes.
16
+ def deep_stringify_keys!
17
+ deep_transform_keys!{ |key| key.to_s rescue key }
18
+ end
19
+
20
+ # Destructively convert all keys to symbols, as long as they respond
21
+ # to `to_sym`. This includes the keys from the root hash and from all
22
+ # nested hashes.
23
+ def deep_symbolize_keys!
24
+ deep_transform_keys!{ |key| key.to_sym rescue key }
25
+ end
26
+
27
+ # Destructively convert all dashes in keys to underscores and then
28
+ # the keys to symbols, as long as they respond to `to_sym`.
29
+ # This includes the keys from the root hash and from all nested hashes.
30
+ def deep_flatten_dashes_and_symbolize_keys!
31
+ deep_transform_keys!{ |key| key.gsub("-", "_").to_sym rescue key }
32
+ end
33
+ end
@@ -1,142 +1,142 @@
1
- module Cognizant
2
- module Validations
3
- class ValidationError < StandardError; end
4
-
5
- # Validations the user/group ownership to the given file. Attempts to
6
- # create the directory+file if it doesn't already exist.
7
- # @param [String] file Path to a file
8
- def self.validate_file_writable(file, type = "file")
9
- file = File.expand_path(file)
10
-
11
- begin
12
- filetype = File.ftype(file)
13
-
14
- unless filetype.eql?(type)
15
- raise ValidationError, "\"#{file}\" is a #{filetype}. File required."
16
- end
17
- rescue Errno::ENOENT
18
- self.validate_directory_writable(File.dirname(file))
19
-
20
- begin
21
- unless File.open(file, "w")
22
- raise ValidationError, "The file \"#{file}\" is not writable."
23
- end
24
- rescue Errno::EACCES
25
- raise ValidationError, "The file \"#{file}\" could not be created due to the lack of privileges."
26
- end
27
- end
28
-
29
- unless File.owned?(file) or File.grpowned?(file)
30
- raise ValidationError, "The file \"#{file}\" is not owned by the process user."
31
- end
32
-
33
- begin
34
- unless File.open(file, "w")
35
- raise ValidationError, "The file \"#{file}\" is not writable."
36
- end
37
- rescue Errno::EACCES
38
- raise ValidationError, "The file \"#{file}\" is not accessible due to the lack of privileges."
39
- rescue
40
- raise ValidationError, "The file \"#{file}\" is not writable."
41
- end
42
- end
43
-
44
- # Validations the user/group ownership to the given directory. Attempts to
45
- # create the directory if it doesn't already exist.
46
- # @param [String] directory Path to a directory
47
- def self.validate_directory_writable(directory)
48
- directory = File.expand_path(directory)
49
-
50
- begin
51
- filetype = File.ftype(directory)
52
-
53
- unless filetype.eql?("directory")
54
- raise ValidationError, "\"#{directory}\" is a #{filetype}. Directory required."
55
- end
56
- rescue Errno::ENOENT
57
- begin
58
- FileUtils.mkdir_p(directory)
59
- rescue Errno::EACCES
60
- raise ValidationError, "The directory \"#{directory}\" could not be created due to the lack of privileges."
61
- end
62
- end
63
-
64
- unless File.owned?(directory) or File.grpowned?(directory)
65
- raise ValidationError, "The directory \"#{directory}\" is not owned by the process user."
66
- end
67
-
68
- begin
69
- unless File.open(File.join(directory, ".testfile"), "w")
70
- raise ValidationError, "The directory \"#{directory}\" is not writable."
71
- end
72
- rescue Errno::EACCES
73
- raise ValidationError, "The directory \"#{directory}\" is not accessible due to the lack of privileges."
74
- rescue
75
- raise ValidationError, "The directory \"#{directory}\" is not writable."
76
- ensure
77
- File.delete(directory, ".testfile") rescue nil
78
- end
79
- end
80
-
81
- # Validates the inclusion of a value in an array.
82
- # @param [Object] value The value to validate.
83
- # @param [Array] array The array of allowed values.
84
- def self.validate_includes(value, array)
85
- unless [*array].include?(value)
86
- raise ValidationError, "#{value} is an invalid option type. It must be one of the following: #{[*array].join(', ')}."
87
- end
88
- end
89
-
90
- # Validates the env variable to be a hash.
91
- # @param [Object] env The value to validate.
92
- def self.validate_env(env)
93
- return unless env
94
- if not env.respond_to?(:is_a?) or not env.is_a?(Hash)
95
- raise Validations::ValidationError, %{"env" needs to be a hash. e.g. { "PATH" => "/usr/local/bin" }}
96
- end
97
- end
98
-
99
- # Validates the umask variable to be a number.
100
- # @param [Object] umask The value to validate.
101
- def self.validate_umask(umask)
102
- return unless umask
103
- Float(umask) rescue raise Validations::ValidationError, %{The umask "#{umask}" is invalid.}
104
- end
105
-
106
- # Validates the existence of the user in the system.
107
- # @param [String, Integer] user The user ID or name to validate.
108
- def self.validate_user(user)
109
- return unless user
110
- begin
111
- if self.is_number?(user)
112
- Etc.getpwuid(user)
113
- else
114
- Etc.getpwnam(user)
115
- end
116
- rescue ArgumentError
117
- raise Validations::ValidationError, %{The user "#{user}" does not exist.}
118
- end
119
- end
120
-
121
- # Validates the existence of the user group in the system.
122
- # @param [String, Integer] group The user group ID or name to validate.
123
- def self.validate_user_group(group)
124
- return unless group
125
- begin
126
- if self.is_number?(group)
127
- Etc.getgrgid(group)
128
- else
129
- Etc.getgrname(group)
130
- end
131
- rescue ArgumentError
132
- raise Validations::ValidationError, %{The group "#{group}" does not exist.}
133
- end
134
- end
135
-
136
- private
137
-
138
- def self.is_number?(value)
139
- true if Float(value) rescue false
140
- end
141
- end
142
- end
1
+ # module Cognizant
2
+ # module Validations
3
+ # class ValidationError < StandardError; end
4
+ #
5
+ # # Validations the user/group ownership to the given file. Attempts to
6
+ # # create the directory+file if it doesn't already exist.
7
+ # # @param [String] file Path to a file
8
+ # def self.validate_file_writable(file, type = "file")
9
+ # file = File.expand_path(file)
10
+ #
11
+ # begin
12
+ # filetype = File.ftype(file)
13
+ #
14
+ # unless filetype.eql?(type)
15
+ # raise ValidationError, "\"#{file}\" is a #{filetype}. File required."
16
+ # end
17
+ # rescue Errno::ENOENT
18
+ # self.validate_directory_writable(File.dirname(file))
19
+ #
20
+ # begin
21
+ # unless File.open(file, "w")
22
+ # raise ValidationError, "The file \"#{file}\" is not writable."
23
+ # end
24
+ # rescue Errno::EACCES
25
+ # raise ValidationError, "The file \"#{file}\" could not be created due to the lack of privileges."
26
+ # end
27
+ # end
28
+ #
29
+ # unless File.owned?(file) or File.grpowned?(file)
30
+ # raise ValidationError, "The file \"#{file}\" is not owned by the process user."
31
+ # end
32
+ #
33
+ # begin
34
+ # unless File.open(file, "w")
35
+ # raise ValidationError, "The file \"#{file}\" is not writable."
36
+ # end
37
+ # rescue Errno::EACCES
38
+ # raise ValidationError, "The file \"#{file}\" is not accessible due to the lack of privileges."
39
+ # rescue
40
+ # raise ValidationError, "The file \"#{file}\" is not writable."
41
+ # end
42
+ # end
43
+ #
44
+ # # Validations the user/group ownership to the given directory. Attempts to
45
+ # # create the directory if it doesn't already exist.
46
+ # # @param [String] directory Path to a directory
47
+ # def self.validate_directory_writable(directory)
48
+ # directory = File.expand_path(directory)
49
+ #
50
+ # begin
51
+ # filetype = File.ftype(directory)
52
+ #
53
+ # unless filetype.eql?("directory")
54
+ # raise ValidationError, "\"#{directory}\" is a #{filetype}. Directory required."
55
+ # end
56
+ # rescue Errno::ENOENT
57
+ # begin
58
+ # FileUtils.mkdir_p(directory)
59
+ # rescue Errno::EACCES
60
+ # raise ValidationError, "The directory \"#{directory}\" could not be created due to the lack of privileges."
61
+ # end
62
+ # end
63
+ #
64
+ # unless File.owned?(directory) or File.grpowned?(directory)
65
+ # raise ValidationError, "The directory \"#{directory}\" is not owned by the process user."
66
+ # end
67
+ #
68
+ # begin
69
+ # unless File.open(File.join(directory, ".testfile"), "w")
70
+ # raise ValidationError, "The directory \"#{directory}\" is not writable."
71
+ # end
72
+ # rescue Errno::EACCES
73
+ # raise ValidationError, "The directory \"#{directory}\" is not accessible due to the lack of privileges."
74
+ # rescue
75
+ # raise ValidationError, "The directory \"#{directory}\" is not writable."
76
+ # ensure
77
+ # File.delete(directory, ".testfile") rescue nil
78
+ # end
79
+ # end
80
+ #
81
+ # # Validates the inclusion of a value in an array.
82
+ # # @param [Object] value The value to validate.
83
+ # # @param [Array] array The array of allowed values.
84
+ # def self.validate_includes(value, array)
85
+ # unless [*array].include?(value)
86
+ # raise ValidationError, "#{value} is an invalid option type. It must be one of the following: #{[*array].join(', ')}."
87
+ # end
88
+ # end
89
+ #
90
+ # # Validates the env variable to be a hash.
91
+ # # @param [Object] env The value to validate.
92
+ # def self.validate_env(env)
93
+ # return unless env
94
+ # if not env.respond_to?(:is_a?) or not env.is_a?(Hash)
95
+ # raise Validations::ValidationError, %{"env" needs to be a hash. e.g. { "PATH" => "/usr/local/bin" }}
96
+ # end
97
+ # end
98
+ #
99
+ # # Validates the umask variable to be a number.
100
+ # # @param [Object] umask The value to validate.
101
+ # def self.validate_umask(umask)
102
+ # return unless umask
103
+ # Float(umask) rescue raise Validations::ValidationError, %{The umask "#{umask}" is invalid.}
104
+ # end
105
+ #
106
+ # # Validates the existence of the user in the system.
107
+ # # @param [String, Integer] user The user ID or name to validate.
108
+ # def self.validate_user(user)
109
+ # return unless user
110
+ # begin
111
+ # if self.is_number?(user)
112
+ # Etc.getpwuid(user)
113
+ # else
114
+ # Etc.getpwnam(user)
115
+ # end
116
+ # rescue ArgumentError
117
+ # raise Validations::ValidationError, %{The user "#{user}" does not exist.}
118
+ # end
119
+ # end
120
+ #
121
+ # # Validates the existence of the user group in the system.
122
+ # # @param [String, Integer] group The user group ID or name to validate.
123
+ # def self.validate_user_group(group)
124
+ # return unless group
125
+ # begin
126
+ # if self.is_number?(group)
127
+ # Etc.getgrgid(group)
128
+ # else
129
+ # Etc.getgrname(group)
130
+ # end
131
+ # rescue ArgumentError
132
+ # raise Validations::ValidationError, %{The group "#{group}" does not exist.}
133
+ # end
134
+ # end
135
+ #
136
+ # private
137
+ #
138
+ # def self.is_number?(value)
139
+ # true if Float(value) rescue false
140
+ # end
141
+ # end
142
+ # end
@@ -1,3 +1,3 @@
1
1
  module Cognizant
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,146 +1,171 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cognizant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gurpartap Singh
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-24 00:00:00.000000000 Z
11
+ date: 2013-03-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
- name: redcarpet
28
+ name: ruby-graphviz
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: yard
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: kramdown
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: aruba
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
60
81
  - !ruby/object:Gem::Version
61
82
  version: '0'
62
83
  - !ruby/object:Gem::Dependency
63
84
  name: eventmachine
64
85
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
86
  requirements:
67
- - - ! '>='
87
+ - - '>='
68
88
  - !ruby/object:Gem::Version
69
89
  version: '0'
70
90
  type: :runtime
71
91
  prerelease: false
72
92
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
93
  requirements:
75
- - - ! '>='
94
+ - - '>='
76
95
  - !ruby/object:Gem::Version
77
96
  version: '0'
78
97
  - !ruby/object:Gem::Dependency
79
98
  name: state_machine
80
99
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
100
  requirements:
83
- - - ! '>='
101
+ - - '>='
84
102
  - !ruby/object:Gem::Version
85
103
  version: '0'
86
104
  type: :runtime
87
105
  prerelease: false
88
106
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
107
  requirements:
91
- - - ! '>='
108
+ - - '>='
92
109
  - !ruby/object:Gem::Version
93
110
  version: '0'
94
111
  - !ruby/object:Gem::Dependency
95
112
  name: activesupport
96
113
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
114
  requirements:
99
- - - ! '>='
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: logging
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
100
130
  - !ruby/object:Gem::Version
101
131
  version: '0'
102
132
  type: :runtime
103
133
  prerelease: false
104
134
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
135
  requirements:
107
- - - ! '>='
136
+ - - '>='
108
137
  - !ruby/object:Gem::Version
109
138
  version: '0'
110
139
  - !ruby/object:Gem::Dependency
111
- name: gli
140
+ name: commander
112
141
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
142
  requirements:
115
- - - ! '>='
143
+ - - '>='
116
144
  - !ruby/object:Gem::Version
117
145
  version: '0'
118
146
  type: :runtime
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
149
  requirements:
123
- - - ! '>='
150
+ - - '>='
124
151
  - !ruby/object:Gem::Version
125
152
  version: '0'
126
153
  - !ruby/object:Gem::Dependency
127
154
  name: formatador
128
155
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
156
  requirements:
131
- - - ! '>='
157
+ - - '>='
132
158
  - !ruby/object:Gem::Version
133
159
  version: '0'
134
160
  type: :runtime
135
161
  prerelease: false
136
162
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
163
  requirements:
139
- - - ! '>='
164
+ - - '>='
140
165
  - !ruby/object:Gem::Version
141
166
  version: '0'
142
- description: Cognizant is a process management system utility that supervises your
143
- processes, ensuring their state based on a flexible criteria.
167
+ description: Cognizant is a process management framework inspired from God and Bluepill.
168
+ It supervises your processes, ensuring their state based on a flexible criteria.
144
169
  email:
145
170
  - contact@gurpartap.com
146
171
  executables:
@@ -150,80 +175,115 @@ extensions: []
150
175
  extra_rdoc_files: []
151
176
  files:
152
177
  - .gitignore
178
+ - .travis.yml
153
179
  - .yardopts
154
180
  - Gemfile
155
- - LICENSE
156
- - README.md
181
+ - License.md
157
182
  - Rakefile
183
+ - Readme.md
158
184
  - bin/cognizant
159
185
  - bin/cognizantd
160
186
  - cognizant.gemspec
187
+ - examples/apps/redis-server.cz
188
+ - examples/apps/redis-server.yml
189
+ - examples/apps/redis-server_dsl.cz
190
+ - examples/apps/resque.cz
191
+ - examples/apps/thin.cz
192
+ - examples/apps/thin.yml
161
193
  - examples/cognizantd.yml
162
- - examples/redis-server.rb
163
- - examples/resque.rb
164
- - images/logo-small.png
165
- - images/logo.png
166
- - images/logo.pxm
194
+ - features/child_process.feature
195
+ - features/commands.feature
196
+ - features/cpu_usage.feature
197
+ - features/daemon.feature
198
+ - features/flapping.feature
199
+ - features/memory_usage.feature
200
+ - features/shell.feature
201
+ - features/step_definitions/common_steps.rb
202
+ - features/step_definitions/daemon_steps.rb
203
+ - features/step_definitions/shell_steps.rb
204
+ - features/support/env.rb
167
205
  - lib/cognizant.rb
168
- - lib/cognizant/logging.rb
206
+ - lib/cognizant/application.rb
207
+ - lib/cognizant/application/dsl_proxy.rb
208
+ - lib/cognizant/client.rb
209
+ - lib/cognizant/commands.rb
210
+ - lib/cognizant/commands/actions.rb
211
+ - lib/cognizant/commands/help.rb
212
+ - lib/cognizant/commands/load.rb
213
+ - lib/cognizant/commands/shutdown.rb
214
+ - lib/cognizant/commands/status.rb
215
+ - lib/cognizant/commands/use.rb
216
+ - lib/cognizant/controller.rb
217
+ - lib/cognizant/daemon.rb
218
+ - lib/cognizant/interface.rb
219
+ - lib/cognizant/log.rb
169
220
  - lib/cognizant/process.rb
170
221
  - lib/cognizant/process/actions.rb
171
222
  - lib/cognizant/process/actions/restart.rb
172
223
  - lib/cognizant/process/actions/start.rb
173
224
  - lib/cognizant/process/actions/stop.rb
174
225
  - lib/cognizant/process/attributes.rb
175
- - lib/cognizant/process/condition_check.rb
226
+ - lib/cognizant/process/children.rb
227
+ - lib/cognizant/process/condition_delegate.rb
176
228
  - lib/cognizant/process/conditions.rb
177
229
  - lib/cognizant/process/conditions/always_true.rb
178
230
  - lib/cognizant/process/conditions/cpu_usage.rb
179
- - lib/cognizant/process/conditions/flapping.rb
180
231
  - lib/cognizant/process/conditions/memory_usage.rb
181
232
  - lib/cognizant/process/conditions/poll_condition.rb
182
- - lib/cognizant/process/conditions/trigger_condition.rb
233
+ - lib/cognizant/process/dsl_proxy.rb
183
234
  - lib/cognizant/process/execution.rb
184
235
  - lib/cognizant/process/pid.rb
185
236
  - lib/cognizant/process/status.rb
186
- - lib/cognizant/server.rb
187
- - lib/cognizant/server/commands.rb
188
- - lib/cognizant/server/daemon.rb
189
- - lib/cognizant/server/interface.rb
237
+ - lib/cognizant/process/trigger_delegate.rb
238
+ - lib/cognizant/process/triggers.rb
239
+ - lib/cognizant/process/triggers/flapping.rb
240
+ - lib/cognizant/process/triggers/transition.rb
241
+ - lib/cognizant/process/triggers/trigger.rb
242
+ - lib/cognizant/shell.rb
190
243
  - lib/cognizant/system.rb
191
244
  - lib/cognizant/system/ps.rb
192
245
  - lib/cognizant/system/signal.rb
246
+ - lib/cognizant/util/dsl_proxy_methods_handler.rb
247
+ - lib/cognizant/util/fixnum_percent.rb
193
248
  - lib/cognizant/util/rotational_array.rb
194
- - lib/cognizant/util/symbolize_hash_keys.rb
249
+ - lib/cognizant/util/transform_hash_keys.rb
195
250
  - lib/cognizant/validations.rb
196
251
  - lib/cognizant/version.rb
197
252
  homepage: http://github.com/Gurpartap/cognizant
198
- licenses: []
253
+ licenses:
254
+ - MIT
255
+ metadata: {}
199
256
  post_install_message:
200
257
  rdoc_options: []
201
258
  require_paths:
202
259
  - lib
203
260
  required_ruby_version: !ruby/object:Gem::Requirement
204
- none: false
205
261
  requirements:
206
- - - ! '>='
262
+ - - '>='
207
263
  - !ruby/object:Gem::Version
208
264
  version: '0'
209
- segments:
210
- - 0
211
- hash: -687515942623630851
212
265
  required_rubygems_version: !ruby/object:Gem::Requirement
213
- none: false
214
266
  requirements:
215
- - - ! '>='
267
+ - - '>='
216
268
  - !ruby/object:Gem::Version
217
269
  version: '0'
218
- segments:
219
- - 0
220
- hash: -687515942623630851
221
270
  requirements: []
222
271
  rubyforge_project:
223
- rubygems_version: 1.8.24
272
+ rubygems_version: 2.0.3
224
273
  signing_key:
225
- specification_version: 3
226
- summary: Cognizant is a process management system utility that supervises your processes,
227
- ensuring their state based on a flexible criteria.
228
- test_files: []
274
+ specification_version: 4
275
+ summary: Cognizant is a process management framework inspired from God and Bluepill.
276
+ It supervises your processes, ensuring their state based on a flexible criteria.
277
+ test_files:
278
+ - features/child_process.feature
279
+ - features/commands.feature
280
+ - features/cpu_usage.feature
281
+ - features/daemon.feature
282
+ - features/flapping.feature
283
+ - features/memory_usage.feature
284
+ - features/shell.feature
285
+ - features/step_definitions/common_steps.rb
286
+ - features/step_definitions/daemon_steps.rb
287
+ - features/step_definitions/shell_steps.rb
288
+ - features/support/env.rb
229
289
  has_rdoc: