undertexter 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- undertexter (0.0.4)
4
+ undertexter (0.0.6)
5
5
  nokogiri
6
6
  rest-client
7
7
 
@@ -26,7 +26,5 @@ PLATFORMS
26
26
  ruby
27
27
 
28
28
  DEPENDENCIES
29
- nokogiri
30
- rest-client
31
29
  rspec
32
30
  undertexter!
data/lib/undertexter.rb CHANGED
@@ -1,6 +1,9 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'rest-client'
2
4
  require 'subtitle'
3
5
  require 'nokogiri'
6
+ require 'iconv'
4
7
 
5
8
  class Undertexter
6
9
  attr_accessor :raw_data, :base_details, :subtitles
@@ -47,7 +50,7 @@ class Undertexter
47
50
  @block = noko.css("table:nth-child(#{id}) td").to_a.reject do |inner|
48
51
  inner.content.empty? or ! inner.content.match(/Nedladdningar/i)
49
52
  end.map do |inner|
50
- inner.content.split("\n").map do |i|
53
+ inner.content.split(/\n/).map do |i|
51
54
  i.gsub(/"/, "").strip
52
55
  end
53
56
  end
@@ -88,5 +91,6 @@ class Undertexter
88
91
 
89
92
  def get(search_string)
90
93
  @raw_data = RestClient.get(@base_details + CGI.escape(search_string), :timeout => 10) rescue nil
94
+ @raw_data = Iconv.conv('utf-8','ISO-8859-1', @raw_data)
91
95
  end
92
96
  end
data/undertexter.gemspec CHANGED
@@ -1,10 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "undertexter/version"
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
  s.name = "undertexter"
7
- s.version = Undertexter::VERSION
6
+ s.version = "0.0.7"
8
7
  s.platform = Gem::Platform::RUBY
9
8
  s.authors = ["Linus Oleander"]
10
9
  s.email = ["linus@oleander.nu"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: undertexter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease: false
4
+ hash: 17
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Linus Oleander
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-25 00:00:00 +01:00
18
+ date: 2011-01-30 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -78,7 +78,6 @@ files:
78
78
  - Rakefile
79
79
  - lib/subtitle.rb
80
80
  - lib/undertexter.rb
81
- - lib/undertexter/version.rb
82
81
  - spec/spec_helper.rb
83
82
  - spec/undertexter_spec.rb
84
83
  - undertexter.gemspec
@@ -112,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
111
  requirements: []
113
112
 
114
113
  rubyforge_project: undertexter
115
- rubygems_version: 1.3.7
114
+ rubygems_version: 1.4.2
116
115
  signing_key:
117
116
  specification_version: 3
118
117
  summary: A subtitle search client for undertexter.se
@@ -1,3 +0,0 @@
1
- module Undertexter
2
- VERSION = "0.0.5"
3
- end