legendario 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/legendario.rb +27 -6
- data/lib/legendario/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e703c1006804a0b9cecfe2aa98d85a2e24526b4d
|
4
|
+
data.tar.gz: 6b6c134a4534555c24d00ce917e183d34e458d56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be2bd49258560612bb62c5a8c0e950a7b263e6c8dfb0679bc05c46ff9e4fe89b9c2f0f4a6a901d8e385befe2ec21b9535b9942bb4bf3d5202482febd0dfb37c7
|
7
|
+
data.tar.gz: 5dc656f085118e047642ba656a1ea96870010adba41de642c4c28e0b437d33e459dbd4e122fd0c037dc3a3429364e40c030abaeccd8d7e3d150f387852efa4e1
|
data/lib/legendario.rb
CHANGED
@@ -10,11 +10,28 @@ module Legendario
|
|
10
10
|
$:.unshift lib_dir unless $:.include? lib_dir
|
11
11
|
|
12
12
|
class Legendario
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
|
14
|
+
if ARGV.size == 0
|
15
|
+
puts 'Error no folder defined. Try legendario.rb "folder-name" eng por for example'
|
16
|
+
puts 'default languages are: eng por spa ger '
|
17
|
+
exit 0
|
18
|
+
end
|
19
|
+
|
20
|
+
@dir = ARGV[0]
|
21
|
+
|
22
|
+
def self.lang
|
23
|
+
langs = ["eng", "por", "spa", "ger"]
|
24
|
+
if ARGV.size > 1
|
25
|
+
langs = []
|
26
|
+
c = 0
|
27
|
+
ARGV.each do|l|
|
28
|
+
langs << l if c > 0
|
29
|
+
c+=1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
puts "Will look for subtitles on these languages: "
|
33
|
+
puts langs.inspect
|
34
|
+
langs
|
18
35
|
end
|
19
36
|
|
20
37
|
def self.watch
|
@@ -50,7 +67,7 @@ module Legendario
|
|
50
67
|
se("rm \"#{path}\"")
|
51
68
|
end
|
52
69
|
symlinked = false
|
53
|
-
lang().each do |l|
|
70
|
+
self.lang().each do |l|
|
54
71
|
if /\.#{l}\.srt$/i =~ File.basename(path) and !symlinked
|
55
72
|
puts path
|
56
73
|
link = path.sub(/\.#{l}\.srt$/i, '.srt')
|
@@ -89,8 +106,12 @@ module Legendario
|
|
89
106
|
end
|
90
107
|
end
|
91
108
|
end
|
109
|
+
|
110
|
+
|
111
|
+
|
92
112
|
end
|
93
113
|
|
114
|
+
Legendario.lang
|
94
115
|
Legendario.watch
|
95
116
|
|
96
117
|
end
|
data/lib/legendario/version.rb
CHANGED