cmon 0.0.1.alpha3 → 0.0.1.alpha4

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.
Files changed (3) hide show
  1. data/lib/cmon.rb +7 -9
  2. data/lib/cmon/version.rb +1 -1
  3. metadata +19 -3
@@ -1,7 +1,11 @@
1
1
  require 'cmon/version'
2
2
  require 'rspec/expectations'
3
+ require 'active_support/core_ext/module/delegation'
3
4
 
4
5
  module CMon
6
+
7
+ SPEC_OPERATORS = ['==', '===', '=~', '>', '>=', '<', '<=']
8
+
5
9
  class Command
6
10
  def initialize(cmd)
7
11
  @command = cmd
@@ -9,16 +13,10 @@ module CMon
9
13
  end
10
14
  attr_reader :command, :output
11
15
 
12
- def include?(text)
13
- self.output.include?(text)
14
- end
15
-
16
- def =~(regexp)
17
- self.output =~ regexp
18
- end
16
+ delegate :include?, :to => :output
19
17
 
20
- def ==(value)
21
- self.output == value
18
+ SPEC_OPERATORS.each do |operator|
19
+ delegate operator, :to => :output
22
20
  end
23
21
 
24
22
  def to_s
@@ -1,3 +1,3 @@
1
1
  module CMon
2
- VERSION = "0.0.1.alpha3"
2
+ VERSION = "0.0.1.alpha4"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmon
3
3
  version: !ruby/object:Gem::Version
4
- hash: -3702664366
4
+ hash: -3702664356
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 1
10
10
  - alpha
11
- - 3
12
- version: 0.0.1.alpha3
11
+ - 4
12
+ version: 0.0.1.alpha4
13
13
  platform: ruby
14
14
  authors:
15
15
  - Matthew Rudy Jacobs
@@ -35,6 +35,22 @@ dependencies:
35
35
  version: 2.0.0
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ name: activesupport
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ hash: 7
47
+ segments:
48
+ - 3
49
+ - 0
50
+ - 0
51
+ version: 3.0.0
52
+ type: :runtime
53
+ version_requirements: *id002
38
54
  description: Write a simple monitoring script to be executed by cron, using an rspec-like assertion syntax
39
55
  email:
40
56
  - matthewrudyjacobs+cmon@gmail.com