srt 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTIyZjMzZjI1NDZiMjQ2NDkxZGFlMWYzMTU5ZThjZWUzZmRiNzk1OA==
4
+ MjNjZmQyOWE3OTQzNjg5YzdlYjM4Zjk2ZGMzNzU2YzdiN2IyZjBlZQ==
5
5
  data.tar.gz: !binary |-
6
- N2IyMTZhOWQ4Zjc3NTEwNGJjYjFlMDZiYTRkNmY2NzQ0NmY0Y2U3Yw==
6
+ NWIwZDk0MDFjOTVlM2ZhZjMxNDE2NTdmYTUxYzJmZTgwZTI5MDRjNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjI0ZWFmYzkzMzliN2VmMDNjN2NkMjdkZWQyODkyNDA1ODY0MzFiODA2OGY4
10
- ZTdiNWVjMTFiNmQwZTJiN2E4ZmQ3NGRhMzA2YzI0MWY4ZmE5MGE2ZWFmNTU4
11
- ZjZhOGIzOTdiNGI5MWM3MmIzNzBmZjY4NzU4MjAwZDEwOTFhYmI=
9
+ NDlhNmM2NWMzNjhlMzIzODkxMDMxNDU2OTBiZDFmZGRiNjA0YWJlM2IzMzVi
10
+ ZjkwYzc4NmQ2NzJjOWE1OWIxODE0ZTE1ZGIxNmFmYTJkY2U4OGY4MjBjZmUz
11
+ ZTUwOWYzYTY3Yzc3NzYzNjQ4NjhhOTEzOGM0ZDE5N2U3N2M4MTQ=
12
12
  data.tar.gz: !binary |-
13
- MGY4NGYyMTE4NDRlYjk2NGM5MWVkOGU5ODMyZjE4NDZiNzI3MzQyZWNkMDE1
14
- NjZkYWYwMGU4YzhmMmZhMDQ4YmU3ODQ3NTk5YWY5ZDRiNDQwOWIzODA4ODc1
15
- MzA0YTllZTE5NzQ3YjZlMmFkODg4NmRmYmNlY2E4YWI0N2JhZGQ=
13
+ NzFiZDYxYWQwNzhkZjI4MzI2N2U0MjQ1NDU5NWY2YWI3ZGYyZjM0MzFiMGRk
14
+ NWVhMDA3YzY1OGU2ZGQ5MGFkY2ZiMjcxOTgwMDQxZTBiNDU5OTU5YTA0MWZk
15
+ ZTFlMzM3NmFkZGYzYTgyOTI5MDhlYTI1ZmI2MjA4YzA1MDc3NzQ=
@@ -1,2 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
1
5
  script:
2
6
  - bundle exec rake spec
@@ -67,6 +67,7 @@ module SRT
67
67
  srt_data.split(/\n/) + ["\n"]
68
68
  rescue
69
69
  begin
70
+ srt_data = srt_data.unpack("C*").pack("U*")
70
71
  srt_data.force_encoding('utf-8').split(/\n/) + ["\n"]
71
72
  rescue
72
73
  srt_data.force_encoding('iso-8859-1').split(/\n/) + ["\n"]
@@ -1,3 +1,3 @@
1
1
  module SRT
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'spec_helper'
2
3
  require 'srt'
3
4
 
@@ -72,6 +73,11 @@ describe SRT::File do
72
73
  it "should have no errors" do
73
74
  expect(file.errors).to be_empty
74
75
  end
76
+
77
+ it "should convert some dubious UTF-8 encodings" do
78
+ first_line = file.lines.first.text.join(" ")
79
+ expect(first_line).to eq("<i>Nadie habría creído en los primeros años del siglo 21...</i>")
80
+ end
75
81
  end
76
82
 
77
83
  context "when parsing a dummy SRT file containing display coordinates" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: srt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Petersen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-19 00:00:00.000000000 Z
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake