suby 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/suby.rb CHANGED
@@ -1,9 +1,7 @@
1
- require 'epath'
1
+ require 'path'
2
2
  require 'zip/zip'
3
3
 
4
- require_relative 'suby/filename_parser'
5
- require_relative 'suby/downloader'
6
- require_relative 'suby/interface'
4
+ Path.require_tree 'suby', except: %w[downloader/]
7
5
 
8
6
  module Suby
9
7
  NotFoundError = Class.new StandardError
@@ -108,5 +108,8 @@ module Suby
108
108
  end
109
109
  end
110
110
 
111
- require_relative 'downloader/tvsubtitles'
112
- require_relative 'downloader/addic7ed'
111
+ # Defines downloader order
112
+ %w[
113
+ tvsubtitles
114
+ addic7ed
115
+ ].each { |downloader| require_relative "downloader/#{downloader}" }
@@ -3,9 +3,11 @@ module Suby
3
3
  SITE = 'www.addic7ed.com'
4
4
  FORMAT = :file
5
5
  LANG_IDS = {
6
- en: 1,
7
- es: 5,
8
- fr: 8
6
+ en: 1, es: 5, it: 7, fr: 8, pt: 10, de: 11, ca: 12, eu: 13, cs: 14,
7
+ gl: 15, tr: 16, nl: 17, sv: 18, ru: 19, hu: 20, pl: 21, sl: 22, he: 23,
8
+ zh: 24, sk: 25, ro: 26, el: 27, fi: 28, no: 29, da: 30, hr: 31, ja: 32,
9
+ bg: 35, sr: 36, id: 37, ar: 38, ms: 40, ko: 42, fa: 43, bs: 44, vi: 45,
10
+ th: 46, bn: 47
9
11
  }
10
12
  FILTER_IGNORED = "Couldn't find any subs with the specified language. " +
11
13
  "Filter ignored"
@@ -96,9 +96,9 @@ module Suby
96
96
  # clean_show_name("an.example.1.0.test") # => "an example 1.0 test"
97
97
  # clean_show_name("an_example_1.0_test") # => "an example 1.0 test"
98
98
  def clean_show_name show
99
- show.gsub! /(?<!\d)[.]|[.](?!\d)/, ' '
100
- show.tr! '_', ' '
101
- show.chomp! '-'
99
+ show.gsub!(/(?<!\d)[.]|[.](?!\d)/, ' ')
100
+ show.tr!('_', ' ')
101
+ show.chomp!('-')
102
102
  show.strip!
103
103
  show
104
104
  end
data/suby.gemspec CHANGED
@@ -10,10 +10,10 @@ Gem::Specification.new do |s|
10
10
  s.executables = ['suby']
11
11
 
12
12
  s.required_ruby_version = '>= 1.9.2'
13
- s.add_dependency 'epath', '>= 0.1.0'
13
+ s.add_dependency 'path', '>= 1.3.0'
14
14
  s.add_dependency 'nokogiri'
15
15
  s.add_dependency 'rubyzip'
16
16
  s.add_dependency 'term-ansicolor'
17
17
 
18
- s.version = '0.1.4'
18
+ s.version = '0.2.0'
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,27 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-03 00:00:00.000000000 Z
12
+ date: 2012-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: epath
16
- requirement: &2152477380 !ruby/object:Gem::Requirement
15
+ name: path
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.1.0
21
+ version: 1.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152477380
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.3.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: nokogiri
27
- requirement: &2152476880 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *2152476880
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rubyzip
38
- requirement: &2152476000 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *2152476000
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: term-ansicolor
49
- requirement: &2152475540 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,7 +69,12 @@ dependencies:
54
69
  version: '0'
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *2152475540
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  description: Find and download subtitles
59
79
  email: eregontp@gmail.com
60
80
  executables:
@@ -92,8 +112,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
112
  version: '0'
93
113
  requirements: []
94
114
  rubyforge_project:
95
- rubygems_version: 1.8.11
115
+ rubygems_version: 1.8.23
96
116
  signing_key:
97
117
  specification_version: 3
98
118
  summary: Subtitles' downloader
99
119
  test_files: []
120
+ has_rdoc: