descartes 0.8.9 → 0.8.10

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: a792aad624fc67c9b2ae018cf147f50ed4342178
4
- data.tar.gz: bfb98c536ea54bc8046697a69f26644c36192a8a
3
+ metadata.gz: 712ac18974d907ed0dbf58bc8ea64f3c61a51eec
4
+ data.tar.gz: ccaed7f68e9e8940a815667e9f5e9517ce5d919a
5
5
  SHA512:
6
- metadata.gz: 96de17b2dea75493ebc0500bd7e8232575ccd6f87f29c9fccc2441f4319f55ac39e7a17e2c0a446dec103f4a50572c98bb3b51e9b90bfc4983f78462963d4715
7
- data.tar.gz: a8d863409ac7d74fcc2098681b37812fbf5d98e5f770f04790734d8182720aa0c59996fad433bdca86dab4439ecc5b96743dbd11765a006f014f2b556eda46fc
6
+ metadata.gz: 4136fa6c4a286e406459b4c997600f3464f738ddd7e0a248953267d901cd3442c166a19616ac7b8f2bb79a21ab159116801fdc79e395467a8cd7f2281090dd87
7
+ data.tar.gz: 1be400ed852a2f31c876393505e2052cba88e531f2bc18c2479eb52bb085db55e13c18e30767e5d3829a948a52ed25dbe6e6878a68b31a3a9d40cf0165dd219b
@@ -158,6 +158,56 @@ class Descartes
158
158
  end
159
159
  end
160
160
 
161
+ match /pigro (.+)/, method: :add_episode
162
+ def add_episode(m, things)
163
+ unless m.user.authed?
164
+ m.reply 'You are not authorized to do this.'
165
+ return
166
+ end
167
+
168
+ things = things.split ' '
169
+ len = things.length
170
+
171
+ if things.last.numeric?
172
+ episode = things.pop
173
+ show = things.join ' '
174
+ elsif len >= 4
175
+ status = things.pop
176
+ field = things.pop
177
+ episode = things.pop
178
+ show = things.join ' '
179
+ else
180
+ m.reply 'usage: !pigro SHOW ADD'
181
+ return
182
+ end
183
+
184
+ host = get_host
185
+ user = get_user m.user.nick
186
+ assonnato = Assonnato.new host
187
+
188
+ series = assonnato.show.search show
189
+ if series.length != 1
190
+ m.reply 'You should refine your search.'
191
+ return
192
+ else
193
+ show = series.first.name
194
+ end
195
+
196
+ if user
197
+ login = assonnato.user.login user['username'], user['password']
198
+ if login['status'] == 'error'
199
+ m.reply login['message']
200
+ else
201
+ ep = assonnato.episode.add show, episode.to_i
202
+ m.reply ep['message']
203
+
204
+ assonnato.user.logout
205
+ end
206
+ else
207
+ m.reply 'You are not recognized.'
208
+ end
209
+ end
210
+
161
211
  match /pigro (.+)/, method: :edit_episode
162
212
  def edit_episode(m, things)
163
213
  unless m.user.authed?
@@ -13,5 +13,5 @@
13
13
  ##
14
14
 
15
15
  class Descartes
16
- VERSION ||= '0.8.9'
16
+ VERSION ||= '0.8.10'
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: descartes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-28 00:00:00.000000000 Z
11
+ date: 2016-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cinch
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
211
  version: '0'
212
212
  requirements: []
213
213
  rubyforge_project:
214
- rubygems_version: 2.2.2
214
+ rubygems_version: 2.6.1
215
215
  signing_key:
216
216
  specification_version: 4
217
217
  summary: Codo ergo bot.