descartes 0.6.3 → 0.6.4

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
  SHA1:
3
- metadata.gz: 42492dc1becf489c2776d17823950cdee6dd4e3c
4
- data.tar.gz: e7d26ecdaae23bbf4426f673f0861f9671ec267f
3
+ metadata.gz: c4d6b0c4e6f44a70599281de1f0eb577d76ad01c
4
+ data.tar.gz: 246713b26e8a96329b46f93f4f450bb69f0a9389
5
5
  SHA512:
6
- metadata.gz: 3e4b935631346f01e1f911d356d1f29955524b9618b28bb0b47ce9d4486db73a7486a6f36d23fd37d371d1fb2010862e7320024f208fd4c6bcc98a67d42810fb
7
- data.tar.gz: 16c8eb5ec2787700f9703e6c6cffe27b1f9b10f8348f7a328c448e7c612bff30525e4c01986de23e08209456e30835805a633d6f03c342e45fb5b5c124461c7c
6
+ metadata.gz: 8b501ef2a1ebfc5af3e6b21a2cb4c50186134cce1172fff673293eaa7344766adcaa2aa04b66ccb990c0857e703c2366b88b167b2402868ff91104ae89ed4b5a
7
+ data.tar.gz: dd1483e6dfa514f7455fd6a7c7740565937b3e822f73c2065c36e583116dbe6bc964d7e740c4a23324ab9caa9bcb40c314df89d1b1e875b1bcfc015685bb6ea2
@@ -18,6 +18,44 @@ class Descartes
18
18
  class Pigro
19
19
  include Cinch::Plugin
20
20
  match /show (.+)/
21
+ match /staff (.+)/, method: :by_staff
22
+
23
+ def by_staff(m, user)
24
+ user = user.split(' ')
25
+ role = user.last.to_sym.downcase
26
+ if [ :translator, :editor, :checker, :timer, :typesetter, :encoder, :qchecker ].include? role
27
+ user.pop
28
+ options = { user: user.join(' '), role: role }
29
+ else
30
+ options = { user: user.join(' ') }
31
+ end
32
+
33
+ host = get_host 'pigro.txt'
34
+ shows = Assonnato::Show.new host
35
+
36
+ series = shows.all!(:ongoing, options) + shows.all!(:dropped, options) + shows.all!(:finished, options)
37
+
38
+ if series.empty?
39
+ if options.has_key? :role
40
+ m.reply "#{options[:user].colorize} hasn't worked to any series as #{options[:role].colorize}."
41
+ else
42
+ m.reply "#{options[:user].colorize} hasn't worked to any series."
43
+ end
44
+ return
45
+ end
46
+
47
+ m.reply ''.tap { |str|
48
+ if options.has_key? :role
49
+ str << "#{options[:user].colorize} has worked as #{options[:role].colorize} at "
50
+ else
51
+ str << "#{options[:user].colorize} has worked a at "
52
+ end
53
+
54
+ series.each { |s|
55
+ str << "#{s.name.colorize}, "
56
+ }
57
+ }[0..-3]
58
+ end
21
59
 
22
60
  def execute(m, keyword)
23
61
  s = keyword.split
@@ -1,4 +1,17 @@
1
- # https://github.com/cinchrb/cinch/blob/master/examples/plugins/seen.rb
1
+ ##
2
+ # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3
+ # Version 2, December 2004
4
+ #
5
+ # Everyone is permitted to copy and distribute verbatim or modified
6
+ # copies of this license document, and changing it is allowed as long
7
+ # as the name is changed.
8
+ #
9
+ # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
10
+ # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
11
+ #
12
+ # 0. You just DO WHAT THE FUCK YOU WANT TO.
13
+ ##
14
+
2
15
  class Descartes
3
16
  class Seen
4
17
  include Cinch::Plugin
@@ -15,7 +15,6 @@
15
15
  class Descartes
16
16
  class Sindaco
17
17
  include Cinch::Plugin
18
-
19
18
  match /Sindaco/i
20
19
 
21
20
  def execute(m)
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.6.3'
17
+ '0.6.4'
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: descartes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano