gyoutube-dl 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d19f941a4b401f3a3068bada78e9470b20527df
4
- data.tar.gz: 12ca7fbc33fbc0046e47669bc42e8cd7958c8031
3
+ metadata.gz: 7181d5bc06f3daff8f5865049c741bd3b33db795
4
+ data.tar.gz: 9c8088b9c0f4ff40c27edb177296b2c565a5d3c9
5
5
  SHA512:
6
- metadata.gz: 4fccb59ebae2e421202f553a8d8399822612ed0d1a41bce229761728320d5d12710985e86c17bd983b4eea9bf2998496c2162e30605ea53229d407695ecd361b
7
- data.tar.gz: 0ec23c5d221d4bf8e9706496bd4bf691cdf0174bedf35e3be45f71f8c88b4a02b43d7a9d79e84243cff0bc87621d9012b3b09685e13d7f8725f6fc254a048fd2
6
+ metadata.gz: 406cfaa6cd60156b1cdbdbefc67512be2e208c8b4bc34fd562f7a515511e8dbce09829c9758f700e7eb59f6ad8de71cb93966baff681481f622e9d2571c15f95
7
+ data.tar.gz: c77cb8c4e5769f53c38be3a05ed28f184f0f59e5758eb51c150ec90a2d4f20247a5a46923b83b6015955557faf6dab959deeaab9cc8c335dd261b7eeca7ade98
data/src/Controller.rb CHANGED
@@ -5,41 +5,41 @@ class Controller #(change name)
5
5
 
6
6
 
7
7
  def baixar
8
- @builder['teOutput'].buffer.text = "Iniciando Download"
9
- cmd = (File::exists?( @builder["teDir"].text ) ? "cd \"#{@builder["teDir"].text}\" && " : " ") + "youtube-dl #{@builder["teLink"].text}"
8
+ cmd = "cd #{@path_dir} && youtube-dl #{@builder["teLink"].text}"
10
9
  `#{cmd}`
11
10
  end
12
11
 
13
12
  def before_show()
14
- #@button1 = "Hello World"
13
+ @path_dir = Dir.home
14
+ @lbDir = "Vai baixar em: \n" + @path_dir + "\n"
15
15
  end
16
16
 
17
17
  def btBaixar__clicked(*args)
18
- if @builder["teDir"].visible? && @builder["teDir"].text != "" && !File::exists?( @builder["teDir"].text )
19
- Dir.mkdir(@builder["teDir"].text)
20
- end
21
-
22
18
  if @builder["teLink"].text != ""
19
+ @builder['teOutput'].buffer.text = "Iniciando Download"
23
20
  fio = Thread.new{baixar}
24
21
  fio.join
25
22
  @builder['teOutput'].buffer.text = "Download Finalizado"
23
+ end
24
+ end
26
25
 
27
26
 
28
- end
27
+ def btDir__clicked(*args)
28
+ @builder['fcDir'].run
29
+ end
29
30
 
31
+ def btFcCancel__clicked(*args)
32
+ @builder['fcDir'].hide
33
+ end
34
+
35
+ def btFcOk__clicked(*args)
36
+ @path_dir = @builder['fcDir'].filename
37
+ @builder['fcDir'].hide
38
+ @builder['lbDir'].text = "Vai baixar em: \n" + @path_dir + "\n"
30
39
  end
31
40
 
32
41
 
33
- def cbDir__clicked(*args)
34
- if @builder["teDir"].visible?
35
- @builder["teDir"].visible = false
36
- @builder["lbDir"].visible = false
37
- else
38
- @builder["teDir"].visible = true
39
- @builder["lbDir"].visible = true
40
- end
41
42
 
42
- end
43
43
 
44
44
  end
45
45
 
@@ -2,6 +2,61 @@
2
2
  <!-- Generated with glade 3.20.0 -->
3
3
  <interface>
4
4
  <requires lib="gtk+" version="3.0"/>
5
+ <object class="GtkFileChooserDialog" id="fcDir">
6
+ <property name="can_focus">False</property>
7
+ <property name="type_hint">dialog</property>
8
+ <property name="action">select-folder</property>
9
+ <child internal-child="vbox">
10
+ <object class="GtkBox">
11
+ <property name="can_focus">False</property>
12
+ <property name="orientation">vertical</property>
13
+ <property name="spacing">2</property>
14
+ <child internal-child="action_area">
15
+ <object class="GtkButtonBox">
16
+ <property name="can_focus">False</property>
17
+ <property name="layout_style">end</property>
18
+ <child>
19
+ <object class="GtkButton" id="btFcCancel">
20
+ <property name="label" translatable="yes">Cancelar</property>
21
+ <property name="visible">True</property>
22
+ <property name="can_focus">True</property>
23
+ <property name="receives_default">True</property>
24
+ </object>
25
+ <packing>
26
+ <property name="expand">True</property>
27
+ <property name="fill">True</property>
28
+ <property name="position">0</property>
29
+ </packing>
30
+ </child>
31
+ <child>
32
+ <object class="GtkButton" id="btFcOk">
33
+ <property name="label" translatable="yes">Ok</property>
34
+ <property name="visible">True</property>
35
+ <property name="can_focus">True</property>
36
+ <property name="receives_default">True</property>
37
+ </object>
38
+ <packing>
39
+ <property name="expand">True</property>
40
+ <property name="fill">True</property>
41
+ <property name="position">1</property>
42
+ </packing>
43
+ </child>
44
+ </object>
45
+ <packing>
46
+ <property name="expand">False</property>
47
+ <property name="fill">False</property>
48
+ <property name="position">0</property>
49
+ </packing>
50
+ </child>
51
+ <child>
52
+ <placeholder/>
53
+ </child>
54
+ </object>
55
+ </child>
56
+ <child>
57
+ <placeholder/>
58
+ </child>
59
+ </object>
5
60
  <object class="GtkWindow" id="window1">
6
61
  <property name="can_focus">False</property>
7
62
  <property name="window_position">center</property>
@@ -49,53 +104,42 @@
49
104
  </packing>
50
105
  </child>
51
106
  <child>
52
- <object class="GtkCheckButton" id="cbDir">
53
- <property name="label" translatable="yes">Criar diretório para Download?</property>
54
- <property name="width_request">207</property>
55
- <property name="height_request">22</property>
107
+ <object class="GtkEntry" id="teOutput">
108
+ <property name="width_request">245</property>
109
+ <property name="height_request">96</property>
56
110
  <property name="visible">True</property>
57
- <property name="can_focus">True</property>
58
- <property name="receives_default">False</property>
59
- <property name="draw_indicator">True</property>
111
+ <property name="can_focus">False</property>
112
+ <property name="editable">False</property>
60
113
  </object>
61
114
  <packing>
62
- <property name="x">295</property>
115
+ <property name="x">260</property>
116
+ <property name="y">32</property>
63
117
  </packing>
64
118
  </child>
65
119
  <child>
66
- <object class="GtkEntry" id="teDir">
67
- <property name="width_request">228</property>
68
- <property name="height_request">30</property>
120
+ <object class="GtkButton" id="btDir">
121
+ <property name="label" translatable="yes">Diretório para Download</property>
122
+ <property name="width_request">129</property>
123
+ <property name="height_request">40</property>
124
+ <property name="visible">True</property>
69
125
  <property name="can_focus">True</property>
126
+ <property name="receives_default">True</property>
70
127
  </object>
71
128
  <packing>
72
129
  <property name="x">5</property>
73
- <property name="y">98</property>
130
+ <property name="y">144</property>
74
131
  </packing>
75
132
  </child>
76
133
  <child>
77
134
  <object class="GtkLabel" id="lbDir">
78
- <property name="width_request">64</property>
79
- <property name="height_request">20</property>
80
- <property name="can_focus">False</property>
81
- <property name="label" translatable="yes">Diretório:</property>
82
- </object>
83
- <packing>
84
- <property name="x">5</property>
85
- <property name="y">73</property>
86
- </packing>
87
- </child>
88
- <child>
89
- <object class="GtkEntry" id="teOutput">
90
- <property name="width_request">245</property>
91
- <property name="height_request">96</property>
135
+ <property name="width_request">100</property>
136
+ <property name="height_request">23</property>
92
137
  <property name="visible">True</property>
93
138
  <property name="can_focus">False</property>
94
- <property name="editable">False</property>
95
139
  </object>
96
140
  <packing>
97
- <property name="x">260</property>
98
- <property name="y">32</property>
141
+ <property name="x">7</property>
142
+ <property name="y">192</property>
99
143
  </packing>
100
144
  </child>
101
145
  </object>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gyoutube-dl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fábio Rezende
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir:
10
10
  - "."
11
11
  cert_chain: []
12
- date: 2017-05-04 00:00:00.000000000 Z
12
+ date: 2017-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: visualruby