cinch-deploy 1.1.2 → 1.1.3

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. checksums.yaml +4 -4
  2. data/lib/cinch/plugins/deploy.rb +3 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 152fa9bf05e3b7cd36e014996ead13f2b6ff4160
4
- data.tar.gz: 1eba85557c6bd748bc181d9958b13b392d677377
3
+ metadata.gz: 89e43b3e1b6af44ee759fb4f7a00d8acacfcc76e
4
+ data.tar.gz: fef8d6ad1c086299cce99912579aaa15e9b05925
5
5
  SHA512:
6
- metadata.gz: 9a686714d1ce1a8466bc139ef184b47590848a25b49d4c8473fb488ebf088a932325a6b274c546293e7f5dd6e1a0aed2355555e1362b9a34baf5cc32d68176fb
7
- data.tar.gz: 47c0f240c896d66e6d39de3ab58c4a61d022c9857addd0bee37fdbd48552ffa340d6ee54163d28ebb45e6e2c92bc2aaa69b2a68027c8b12c0c05c6977e55a5a5
6
+ metadata.gz: 2f0f54c9fc28c0dafc9ba2e98e0ee467ad78dc75f247a759ddb671db22ca3268db65f105c333c674f57f9167e2906ee0ed32ce476a8062d672217900762d74b5
7
+ data.tar.gz: 526f96fa1947cf765a0c39b186ba67b6601a02517ee1aaed1a9af853db0a2d61e55f6d7822626b3e13deb2b105087df76ae25d83f73d165dd3fba4de32856af1
@@ -12,7 +12,7 @@ module Cinch
12
12
 
13
13
  def listen(m)
14
14
  config[:configurations].each do |config|
15
- deploy(m) if can_deploy?(m)
15
+ deploy(config[:command], m) if can_deploy?(config, m)
16
16
  end
17
17
  rescue StandardError => e
18
18
  m.reply "exception - #{e.message}", true
@@ -21,13 +21,13 @@ module Cinch
21
21
 
22
22
  private
23
23
 
24
- def can_deploy?(m)
24
+ def can_deploy?(config, m)
25
25
  config[:channels].include?(m.channel.to_s) &&
26
26
  config[:users].include?(m.user.nick) &&
27
27
  m.message =~ Regexp.new(config[:trigger])
28
28
  end
29
29
 
30
- def deploy(m)
30
+ def deploy(command, m)
31
31
  return if @running[command]
32
32
  @running[command] = true
33
33
  IO.popen("#{command} 2>&1") do |handle|
@@ -39,10 +39,6 @@ module Cinch
39
39
  @running.delete(command)
40
40
  end
41
41
 
42
- def command
43
- config[:command]
44
- end
45
-
46
42
  end
47
43
  end
48
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Papis