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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2dcd95bb0d9ce654a01807e958cfe8d435b1a51
4
- data.tar.gz: 824f81e996e95f8685c89aa9b8e747ef5d1f6746
3
+ metadata.gz: e703c1006804a0b9cecfe2aa98d85a2e24526b4d
4
+ data.tar.gz: 6b6c134a4534555c24d00ce917e183d34e458d56
5
5
  SHA512:
6
- metadata.gz: 3c7358ac4198825d52ce6c0976485161132da83c62cbb7188e6276c7dce61dcf6691a1a8ac0adc6af4a98274b8555870198c022a8b195d6b45991e3873bc07b5
7
- data.tar.gz: bbcbb59c5a29223b5bcb71d4bce2f7cbda27bb0ebe19c04bd3c75083a4fd5c13ff63d757f835f5cb39c2a34ee8a6d5b0130a212153ad771189df5b1b0795365e
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
- @dir = "/home/j/Downloads"
14
- def lang
15
- []
16
- ["eng", "por", "spa", "ger"]
17
- # ["eng"]
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
@@ -1,3 +1,3 @@
1
1
  module Legendario
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legendario
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evandro Junior