crunchyroll 0.9.4 → 0.9.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 860c3244183bb1b0da8b44f0abd183c52a3ea62f
4
- data.tar.gz: 8e3fac0164466ac8382e14b7122960566322a7ab
3
+ metadata.gz: b4eab0bece63654e326b039bb58f8230feb5cb5e
4
+ data.tar.gz: a43f486a641e8e6a9d3cb3b449c5b1f6993c4604
5
5
  SHA512:
6
- metadata.gz: f8f5415c11af39150e4f00f3cb8988ecb82c0b0a41e92892de2fac6f1efb038f13fbca1012ed7c77070439c667897bbf585f562ddbf0462efaf4ebbc50468e21
7
- data.tar.gz: 41ff0f8d03ff9a82a448fe48d4bcfd5542e74a90c074cc2797330ae1628fc78b327d6fef936a294531cfe4df65060088ff59f786b829a3c68d09d7e620c27bb8
6
+ metadata.gz: eb1c8bf25ce3d2673afbd7809cdb6ffa96252ce79ab15c5aa9730b5dc6af43e964a66ed975136ff8ec2bc25bca1022d80d505571d387ccf39639a15fe370d9da
7
+ data.tar.gz: 5d598b94278b14f98408aa6cb5be997420a3864c0d2585164fff133bf91a25e29df75da1286763145431779de8fb3309a6de7b037f19725e84c3535878f4a6b6
@@ -12,6 +12,7 @@
12
12
  # 0. You just DO WHAT THE FUCK YOU WANT TO.
13
13
  ##
14
14
 
15
+
15
16
  using Utils
16
17
  Time.zone = 'MST'
17
18
  Chronic.time_class = Time.zone
@@ -51,7 +52,7 @@ class << self
51
52
  end
52
53
  alias_method :get, :find
53
54
 
54
- def today(time_zone = 'Rome', strict = false)
55
+ def today(time_zone = 'Rome')
55
56
  url = 'http://horriblesubs.info/release-schedule/'
56
57
  tomorrow = Date.tomorrow
57
58
  today = Time.now
@@ -60,15 +61,20 @@ class << self
60
61
  Nokogiri::HTML(open(url)).xpath('//div[@class="today-releases"]/div[@class="series-name"]').each { |r|
61
62
  title = r.at_xpath('.//child::text()').to_s.squeeze(' ')
62
63
  time = r.at_xpath('.//span').text
63
- date = Chronic.parse(time).in_time_zone time_zone
64
+ date = Chronic.parse("today at #{time}").in_time_zone time_zone
64
65
 
65
- next if strict && date.day == tomorrow.day
66
+ time_diff = TimeDifference.between(today, date).in_general
67
+ airs = if date.day == tomorrow.day && time_diff[:days] == 0
68
+ :tomorrow
69
+ else
70
+ time_diff[:days] == 0 ? :today : :aired
71
+ end
66
72
 
67
73
  releases << {
68
74
  :title => title,
69
75
  :where => 'Crunchyroll',
70
76
  :date => date,
71
- :aired => today.day != date.day,
77
+ :airs => airs,
72
78
  :day => date.strftime("%A"),
73
79
  :hour => date.hour,
74
80
  :min => date.min,
@@ -14,6 +14,6 @@
14
14
 
15
15
  module Crunchyroll
16
16
  def self.version
17
- '0.9.4'
17
+ '0.9.5'
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crunchyroll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano