miyuki 0.5.7 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,22 +1,22 @@
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
- require 'libnotify'
15
-
16
- module Miyuki
17
- class Libnotify
18
- def notify(title, message)
19
- ::Libnotify.show(body: message, summary: title)
20
- end
21
- end
22
- end
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
+ require 'libnotify'
15
+
16
+ module Miyuki
17
+ class Libnotify
18
+ def notify(title, message)
19
+ ::Libnotify.show(body: message, summary: title)
20
+ end
21
+ end
22
+ end
@@ -1,22 +1,22 @@
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
- require 'rb-notifu'
15
-
16
- module Miyuki
17
- class Notifu
18
- def notify(title, message)
19
- ::Notifu.show(title: message, message: title, type: :info, time: 3)
20
- end
21
- end
22
- end
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
+ require 'rb-notifu'
15
+
16
+ module Miyuki
17
+ class Notifu
18
+ def notify(title, message)
19
+ ::Notifu.show(title: message, message: title, type: :info, time: 3)
20
+ end
21
+ end
22
+ end
@@ -1,22 +1,22 @@
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
- require 'terminal-notifier'
15
-
16
- module Miyuki
17
- class TerminalNotifier
18
- def notify(title, message)
19
- ::TerminalNotifier.notify(message, title: title, sound: 'default')
20
- end
21
- end
22
- end
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
+ require 'terminal-notifier'
15
+
16
+ module Miyuki
17
+ class TerminalNotifier
18
+ def notify(title, message)
19
+ ::TerminalNotifier.notify(message, title: title, sound: 'default')
20
+ end
21
+ end
22
+ end
data/lib/miyuki/parser.rb CHANGED
@@ -1,55 +1,55 @@
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
-
15
- module Miyuki
16
- module Parser
17
- class << self
18
- def parse(series)
19
- pattern = series.fetch('pattern', '[$fansub] $name')
20
-
21
- pattern.scan(/\$[a-zA-Z_]*/).each do |var|
22
- pattern.gsub!(var, series[var[1..-1]]) if series.has_key?(var[1..-1])
23
- end
24
-
25
- pattern
26
- end
27
-
28
- def filter_episodes!(torrents, from_episode, keep = true)
29
- range = from_episode..1.0/0
30
-
31
- if range
32
- torrents.select! do |torrent|
33
- return keep unless torrent.title
34
-
35
- episode = torrent.title.scan(/- [0-9]*\.?[0-9]+/).last
36
- episode = episode.scan(/[0-9]*\.?[0-9]+/).last if episode
37
- episode = episode[1..-1] if episode && episode[0] == '0'
38
-
39
- if episode
40
- is_integer?(episode) ? range.include?(episode.to_i) : keep
41
- else
42
- keep
43
- end
44
- end
45
- end
46
- end
47
-
48
- private
49
-
50
- def is_integer?(string)
51
- string.to_i.to_s == string
52
- end
53
- end
54
- end
55
- end
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
+
15
+ module Miyuki
16
+ module Parser
17
+ class << self
18
+ def parse(series)
19
+ pattern = series.fetch('pattern', '[$fansub] $name')
20
+
21
+ pattern.scan(/\$[a-zA-Z_]*/).each do |var|
22
+ pattern.gsub!(var, series[var[1..-1]]) if series.has_key?(var[1..-1])
23
+ end
24
+
25
+ pattern
26
+ end
27
+
28
+ def filter_episodes!(torrents, from_episode, keep = true)
29
+ range = from_episode..1.0/0
30
+
31
+ if range
32
+ torrents.select! do |torrent|
33
+ return keep unless torrent.title
34
+
35
+ episode = torrent.title.scan(/- [0-9]*\.?[0-9]+/).last
36
+ episode = episode.scan(/[0-9]*\.?[0-9]+/).last if episode
37
+ episode = episode[1..-1] if episode && episode[0] == '0'
38
+
39
+ if episode
40
+ is_integer?(episode) ? range.include?(episode.to_i) : keep
41
+ else
42
+ keep
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ private
49
+
50
+ def is_integer?(string)
51
+ string.to_i.to_s == string
52
+ end
53
+ end
54
+ end
55
+ end
@@ -1,69 +1,76 @@
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
-
15
- module Miyuki
16
- class Tracker
17
- include Yamazaki::Core
18
-
19
- attr_reader :torrents
20
-
21
- def initialize(watch_dir, series, &callback)
22
- # TODO: This will raise a warning when the class is initializated twice
23
- Yamazaki.const_set(:WATCH_DIR, watch_dir)
24
-
25
- @series = series || []
26
- @callback = callback if block_given?
27
- end
28
-
29
- def for_every_torrent(&callback)
30
- if block_given?
31
- @callback = callback
32
- else
33
- yield
34
- end
35
- end
36
-
37
- def refresh!
38
- old_torrents = @torrents || []
39
-
40
- @torrents = []
41
-
42
- fetch_torrents!
43
- @torrents -= old_torrents
44
-
45
- @torrents.each do |torrent|
46
- downloaded = Yamazaki.download_torrent(torrent.title, torrent.link)
47
-
48
- @callback.call(torrent) if downloaded && @callback
49
- end
50
- end
51
-
52
- private
53
-
54
- def fetch_torrents!
55
- @series.each do |series|
56
- query = URI.encode_www_form_component(Parser.parse(series)) # TODO: move encode to yamazaki?
57
- torrents = search(query)
58
- torrents.each { |torrent| torrent.title.gsub!(/_/, ' ') }
59
-
60
- episodes = series['episodes']
61
- if episodes && episodes['from']
62
- Parser.filter_episodes!(torrents, episodes['from'], episodes['skipIfNotSure'] == true)
63
- end
64
-
65
- @torrents.concat(torrents.reverse)
66
- end
67
- end
68
- end
69
- end
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
+
15
+ module Miyuki
16
+ class Tracker
17
+ include Yamazaki::Core
18
+
19
+ attr_reader :torrents
20
+
21
+ def initialize(watch_dir, track_file, series, &callback)
22
+ Yamazaki.class.instance_eval do # breaking the rules is so funny sometimes w
23
+ remove_const(:WATCH_DIR) if const_defined?(:WATCH_DIR)
24
+ const_set(:WATCH_DIR, watch_dir)
25
+
26
+ remove_const(:TRACK_FILE) if const_defined?(:TRACK_FILE)
27
+ const_set(:TRACK_FILE, track_file)
28
+ end
29
+
30
+ Yamazaki.load_database
31
+
32
+ @series = series || []
33
+ @callback = callback if block_given?
34
+ end
35
+
36
+ def for_every_torrent(&callback)
37
+ if block_given?
38
+ @callback = callback
39
+ else
40
+ yield
41
+ end
42
+ end
43
+
44
+ def refresh!
45
+ old_torrents = @torrents || []
46
+
47
+ @torrents = []
48
+
49
+ fetch_torrents!
50
+ @torrents -= old_torrents
51
+
52
+ @torrents.each do |torrent|
53
+ downloaded = Yamazaki.download_torrent(torrent.title, torrent.link)
54
+
55
+ @callback.call(torrent) if downloaded && @callback
56
+ end
57
+ end
58
+
59
+ private
60
+
61
+ def fetch_torrents!
62
+ @series.each do |series|
63
+ query = URI.encode_www_form_component(Parser.parse(series)) # TODO: move encode to yamazaki?
64
+ torrents = search(query)
65
+ torrents.each { |torrent| torrent.title.gsub!(/_/, ' ') }
66
+
67
+ episodes = series['episodes']
68
+ if episodes && episodes['from']
69
+ Parser.filter_episodes!(torrents, episodes['from'], episodes['skipIfNotSure'] == true)
70
+ end
71
+
72
+ @torrents.concat(torrents.reverse)
73
+ end
74
+ end
75
+ end
76
+ end
@@ -1,17 +1,17 @@
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
-
15
- module Miyuki
16
- VERSION = '0.5.7'
17
- end
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
+
15
+ module Miyuki
16
+ VERSION = '0.5.10'
17
+ end
metadata CHANGED
@@ -1,139 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miyuki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roxas Shadow
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-25 00:00:00.000000000 Z
11
+ date: 2021-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yamazaki
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.3'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 0.3.3
19
+ version: '0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '0.3'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
- version: 0.3.3
26
+ version: '0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: rufus-scheduler
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - "~>"
31
+ - - ">="
38
32
  - !ruby/object:Gem::Version
39
- version: '3.0'
33
+ version: '0'
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - "~>"
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
- version: '3.0'
40
+ version: '0'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: foreverb
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - "~>"
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
- version: '0.3'
47
+ version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
- - - "~>"
52
+ - - ">="
59
53
  - !ruby/object:Gem::Version
60
- version: '0.3'
54
+ version: '0'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: filewatcher
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '0.3'
68
59
  - - ">="
69
60
  - !ruby/object:Gem::Version
70
- version: 0.3.6
61
+ version: '0'
71
62
  type: :runtime
72
63
  prerelease: false
73
64
  version_requirements: !ruby/object:Gem::Requirement
74
65
  requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '0.3'
78
66
  - - ">="
79
67
  - !ruby/object:Gem::Version
80
- version: 0.3.6
68
+ version: '0'
81
69
  - !ruby/object:Gem::Dependency
82
70
  name: ruby_deep_clone
83
71
  requirement: !ruby/object:Gem::Requirement
84
72
  requirements:
85
- - - "~>"
73
+ - - ">="
86
74
  - !ruby/object:Gem::Version
87
- version: '0.6'
75
+ version: '0'
88
76
  type: :runtime
89
77
  prerelease: false
90
78
  version_requirements: !ruby/object:Gem::Requirement
91
79
  requirements:
92
- - - "~>"
80
+ - - ">="
93
81
  - !ruby/object:Gem::Version
94
- version: '0.6'
82
+ version: '0'
95
83
  - !ruby/object:Gem::Dependency
96
- name: terminal-notifier
84
+ name: rb-notifu
97
85
  requirement: !ruby/object:Gem::Requirement
98
86
  requirements:
99
- - - "~>"
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
- version: '1.6'
89
+ version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
93
  requirements:
106
- - - "~>"
94
+ - - ">="
107
95
  - !ruby/object:Gem::Version
108
- version: '1.6'
96
+ version: '0'
109
97
  - !ruby/object:Gem::Dependency
110
98
  name: cucumber
111
99
  requirement: !ruby/object:Gem::Requirement
112
100
  requirements:
113
- - - "~>"
101
+ - - ">="
114
102
  - !ruby/object:Gem::Version
115
- version: '1.3'
103
+ version: '0'
116
104
  type: :development
117
105
  prerelease: false
118
106
  version_requirements: !ruby/object:Gem::Requirement
119
107
  requirements:
120
- - - "~>"
108
+ - - ">="
121
109
  - !ruby/object:Gem::Version
122
- version: '1.3'
110
+ version: '0'
123
111
  - !ruby/object:Gem::Dependency
124
112
  name: rspec
125
113
  requirement: !ruby/object:Gem::Requirement
126
114
  requirements:
127
- - - "~>"
115
+ - - ">="
128
116
  - !ruby/object:Gem::Version
129
- version: '3.2'
117
+ version: '0'
130
118
  type: :development
131
119
  prerelease: false
132
120
  version_requirements: !ruby/object:Gem::Requirement
133
121
  requirements:
134
- - - "~>"
122
+ - - ">="
135
123
  - !ruby/object:Gem::Version
136
- version: '3.2'
124
+ version: '0'
137
125
  description: Miyuki downloads automatically every episode of anime you're watching
138
126
  email: webmaster@giovannicapuano.net
139
127
  executables:
@@ -141,11 +129,7 @@ executables:
141
129
  extensions: []
142
130
  extra_rdoc_files: []
143
131
  files:
144
- - ".gitignore"
145
- - ".travis.yml"
146
- - CHANGELOG.md
147
132
  - Gemfile
148
- - Gemfile.lock
149
133
  - README.md
150
134
  - Rakefile
151
135
  - bin/miyuki
@@ -154,8 +138,10 @@ files:
154
138
  - features/step_definitions/load_config_step.rb
155
139
  - features/step_definitions/track_step.rb
156
140
  - features/step_definitions/tracker_step.rb
141
+ - features/support/changedtrackfile.db
157
142
  - features/support/env.rb
158
143
  - features/support/miyuki.conf
144
+ - features/support/turn_off_notifications.patch
159
145
  - features/track.feature
160
146
  - features/tracker.feature
161
147
  - lib/miyuki.rb
@@ -167,12 +153,11 @@ files:
167
153
  - lib/miyuki/parser.rb
168
154
  - lib/miyuki/tracker.rb
169
155
  - lib/miyuki/version.rb
170
- - miyuki.gemspec
171
156
  homepage: https://github.com/RoxasShadow/Miyuki
172
157
  licenses:
173
158
  - WTFPL
174
159
  metadata: {}
175
- post_install_message:
160
+ post_install_message:
176
161
  rdoc_options: []
177
162
  require_paths:
178
163
  - lib
@@ -187,9 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
172
  - !ruby/object:Gem::Version
188
173
  version: '0'
189
174
  requirements: []
190
- rubyforge_project:
191
- rubygems_version: 2.2.2
192
- signing_key:
175
+ rubygems_version: 3.1.6
176
+ signing_key:
193
177
  specification_version: 4
194
178
  summary: Miyuki allows you to not miss any episode of anime you're watching
195
179
  test_files: []