cinch-sudo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: cc1497b07ca294642789e83047b38cec6fdc94e3
4
- data.tar.gz: 40993134495d038efaf1082d620886e0de7319c9
3
+ metadata.gz: b7ec3d3ad9ee6250cfd01dcaf78851de529b1d59
4
+ data.tar.gz: 2c7a66722a0d78b89d6c6cfc2652da2c8e28e3cf
5
5
  SHA512:
6
- metadata.gz: 36ddb817ddbd465c68d082f7b42bc7e3edb9112e513ded64e20d6b6649b716bea08d7e31a397ee141103ecf49500257a254f18385e36523d821de2d1558d107c
7
- data.tar.gz: 79ac45b96436b4355e2e99dfdec2891325d4f1d60779c0eedf7a3eaa48c11a1cda14a6394984f6ceb5c186678d415cb662a4ba1e387b2e3cc9f86909d0bb2b1a
6
+ metadata.gz: 8869ac000214b6330f9316afa9b787c7ab65e5396175da6e783d2bbb36fa0eb1ca7ad3d3cba5de78879c558301831d3e22640bbc6b15338bdb8789fb4a24c48a
7
+ data.tar.gz: b7da03bb625ee9f6d178889ccc47b95c72398e2dde5a7fc67a0fda077644095abe850e13a97a37f0c6a6cc1dfca0552afbad5eda1181c463a77917106f4d69a9
@@ -10,7 +10,6 @@ rvm:
10
10
  - 1.8.7
11
11
  - jruby-18mode
12
12
  - jruby-19mode
13
- - rbx
14
13
  - ruby-head
15
14
  - jruby-head
16
15
  - ree
@@ -8,22 +8,19 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Cinch::Plugins::Sudo::VERSION
9
9
  gem.authors = ['Paul Visscher', 'Brian Haberer']
10
10
  gem.email = ['bhaberer@gmail.com']
11
- gem.description = %q{Cinch Plugin to report usage of Sudo to the channel}
12
- gem.summary = %q{Cinch Plugin for monitoring Sudo}
11
+ gem.description = %q(Cinch Plugin to report usage of Sudo to the channel)
12
+ gem.summary = %q(Cinch Plugin for monitoring Sudo)
13
13
  gem.homepage = 'https://github.com/canonical-hackers/cinch-sudo'
14
14
  gem.license = 'MIT'
15
-
16
15
  gem.files = `git ls-files`.split($/)
17
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.executables = gem.files.grep(/^bin\//).map { |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(/^(test|spec|features)\//)
19
18
  gem.require_paths = ['lib']
20
19
 
21
- gem.add_development_dependency 'rake'
22
- gem.add_development_dependency 'rspec-given'
23
- gem.add_development_dependency 'rspec'
24
- gem.add_development_dependency 'coveralls'
25
- gem.add_development_dependency 'cinch-test'
26
-
27
- gem.add_dependency 'cinch', '~> 2.0.12'
20
+ gem.add_development_dependency 'rake', '~> 10'
21
+ gem.add_development_dependency 'rspec', '~> 3'
22
+ gem.add_development_dependency 'coveralls', '~> 0.7'
23
+ gem.add_development_dependency 'cinch-test', '~> 0.1', '>= 0.1.0'
24
+ gem.add_dependency 'cinch', '~> 2'
28
25
  gem.add_dependency 'file-tail'
29
26
  end
@@ -3,6 +3,7 @@ require 'file-tail'
3
3
 
4
4
  module Cinch
5
5
  module Plugins
6
+ # Cinch plugin to report usage of Sudo on a machine
6
7
  class Sudo
7
8
  include Cinch::Plugin
8
9
 
@@ -14,7 +15,7 @@ module Cinch
14
15
  @channel = config[:channel]
15
16
  end
16
17
 
17
- def listen(m)
18
+ def listen(_m)
18
19
  if File.exist?(@logfile)
19
20
  start_tail
20
21
  else
@@ -1,10 +1,12 @@
1
1
  module Cinch
2
2
  module Plugins
3
3
  class Sudo
4
+ # Class for managing a line of sudo
4
5
  class Entry
5
6
  # Might need to clean these up, make them nested?
6
- SUDO_REGEX = /^\w{3}\s+\d+\s+\d{2}:\d{2}:\d{2}\s+[\w\.]+\s+sudo[\[\]\d]*:\s+(\w+)\s+:/
7
- DATE_REGEX = /^(\w{3}\s+\d+\s+\d{2}:\d{2}:\d{2})\s+/
7
+ DATE = /\w{3}\s+\d+\s+\d{2}:\d{2}:\d{2}/
8
+ SUDO_REGEX = /^#{DATE}\s+[\w\.]+\s+sudo[\[\]\d]*:\s+(\w+)\s+:/
9
+ DATE_REGEX = /^(#{DATE})\s+/
8
10
  USER_REGEX = /sudo[\[\]\d]*:\s+(\w+)\s+:\s/
9
11
  AUTH_REGEX = /sudo[\[\]\d]*:\s+\w+\s+:\sTTY=/
10
12
 
@@ -1,7 +1,8 @@
1
1
  module Cinch
2
2
  module Plugins
3
+ # Versioning info
3
4
  class Sudo
4
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
5
6
  end
6
7
  end
7
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-sudo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Visscher
@@ -9,92 +9,84 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-06 00:00:00.000000000 Z
12
+ date: 2014-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :development
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ! '>='
26
- - !ruby/object:Gem::Version
27
- version: '0'
28
- - !ruby/object:Gem::Dependency
29
- name: rspec-given
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ! '>='
18
+ - - ~>
33
19
  - !ruby/object:Gem::Version
34
- version: '0'
20
+ version: '10'
35
21
  type: :development
36
22
  prerelease: false
37
23
  version_requirements: !ruby/object:Gem::Requirement
38
24
  requirements:
39
- - - ! '>='
25
+ - - ~>
40
26
  - !ruby/object:Gem::Version
41
- version: '0'
27
+ version: '10'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: rspec
44
30
  requirement: !ruby/object:Gem::Requirement
45
31
  requirements:
46
- - - ! '>='
32
+ - - ~>
47
33
  - !ruby/object:Gem::Version
48
- version: '0'
34
+ version: '3'
49
35
  type: :development
50
36
  prerelease: false
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
- - - ! '>='
39
+ - - ~>
54
40
  - !ruby/object:Gem::Version
55
- version: '0'
41
+ version: '3'
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: coveralls
58
44
  requirement: !ruby/object:Gem::Requirement
59
45
  requirements:
60
- - - ! '>='
46
+ - - ~>
61
47
  - !ruby/object:Gem::Version
62
- version: '0'
48
+ version: '0.7'
63
49
  type: :development
64
50
  prerelease: false
65
51
  version_requirements: !ruby/object:Gem::Requirement
66
52
  requirements:
67
- - - ! '>='
53
+ - - ~>
68
54
  - !ruby/object:Gem::Version
69
- version: '0'
55
+ version: '0.7'
70
56
  - !ruby/object:Gem::Dependency
71
57
  name: cinch-test
72
58
  requirement: !ruby/object:Gem::Requirement
73
59
  requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '0.1'
74
63
  - - ! '>='
75
64
  - !ruby/object:Gem::Version
76
- version: '0'
65
+ version: 0.1.0
77
66
  type: :development
78
67
  prerelease: false
79
68
  version_requirements: !ruby/object:Gem::Requirement
80
69
  requirements:
70
+ - - ~>
71
+ - !ruby/object:Gem::Version
72
+ version: '0.1'
81
73
  - - ! '>='
82
74
  - !ruby/object:Gem::Version
83
- version: '0'
75
+ version: 0.1.0
84
76
  - !ruby/object:Gem::Dependency
85
77
  name: cinch
86
78
  requirement: !ruby/object:Gem::Requirement
87
79
  requirements:
88
80
  - - ~>
89
81
  - !ruby/object:Gem::Version
90
- version: 2.0.12
82
+ version: '2'
91
83
  type: :runtime
92
84
  prerelease: false
93
85
  version_requirements: !ruby/object:Gem::Requirement
94
86
  requirements:
95
87
  - - ~>
96
88
  - !ruby/object:Gem::Version
97
- version: 2.0.12
89
+ version: '2'
98
90
  - !ruby/object:Gem::Dependency
99
91
  name: file-tail
100
92
  requirement: !ruby/object:Gem::Requirement