suby 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/suby.rb +7 -6
  2. data/suby.gemspec +1 -1
  3. metadata +9 -9
data/lib/suby.rb CHANGED
@@ -16,9 +16,10 @@ module Suby
16
16
 
17
17
  def download_subtitles(files, options = {})
18
18
  files.each { |file|
19
- next if Dir.exist?(file) or SUB_EXTENSIONS.include?(File.extname(file))
19
+ next if File.directory?(file) or SUB_EXTENSIONS.include?(File.extname(file))
20
20
  next puts "Skipping: #{file}" if SUB_EXTENSIONS.any? { |ext|
21
- File.exist? File.basename(file, File.extname(file)) + ext
21
+ st = File.basename(file, File.extname(file)) + ext
22
+ File.exist? st and File.size(st) > 0
22
23
  }
23
24
  download_subtitles_for_file(file, options)
24
25
  }
@@ -31,11 +32,11 @@ module Suby
31
32
  success = Downloader::DOWNLOADERS.find { |downloader_class|
32
33
  try_downloader(downloader_class.new(file, show, season, episode, options[:lang]))
33
34
  }
34
- error "No downloader could find subtitles for #{file}" unless success
35
+ error "\nNo downloader could find subtitles for #{file}" unless success
35
36
  rescue
36
- error " The download of the subtitles failed for #{file}:"
37
- error " #{$!.class}: #{$!.message}"
38
- puts $!.backtrace.map { |line| line.prepend ' '*4 }
37
+ error "\nThe download of the subtitles failed for #{file}:"
38
+ error "#{$!.class}: #{$!.message}"
39
+ $stderr.puts $!.backtrace
39
40
  end
40
41
  end
41
42
 
data/suby.gemspec CHANGED
@@ -14,5 +14,5 @@ Gem::Specification.new do |s|
14
14
  s.add_dependency 'rubyzip2'
15
15
  s.add_dependency 'term-ansicolor'
16
16
 
17
- s.version = '0.1.2'
17
+ s.version = '0.1.3'
18
18
  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.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-20 00:00:00.000000000 Z
12
+ date: 2011-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &2153922380 !ruby/object:Gem::Requirement
16
+ requirement: &2151909200 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153922380
24
+ version_requirements: *2151909200
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rubyzip2
27
- requirement: &2153921780 !ruby/object:Gem::Requirement
27
+ requirement: &2151908380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153921780
35
+ version_requirements: *2151908380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: term-ansicolor
38
- requirement: &2153920880 !ruby/object:Gem::Requirement
38
+ requirement: &2151907540 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2153920880
46
+ version_requirements: *2151907540
47
47
  description: Find and download subtitles
48
48
  email: eregontp@gmail.com
49
49
  executables:
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 1.8.10
86
+ rubygems_version: 1.8.11
87
87
  signing_key:
88
88
  specification_version: 3
89
89
  summary: Subtitles' downloader