yardview_gtk3 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: 36ceb2195d70532047b8dc61b4955c99f179c04dc4e6b7b583bfa135098beec2
4
- data.tar.gz: be9eaf25195090bcbb4c42fba03a323cecaee16d9516de4b6ba299c2fcc83d20
3
+ metadata.gz: 8352cc578a2d92e778412e2109d4e597d1d3a29ed7f15465c3fa22c55866ac3a
4
+ data.tar.gz: d8b7f4d0f49de130fd7dead0c21a6b83b3630777f4d815eb9a1f19f74ed83379
5
5
  SHA512:
6
- metadata.gz: 4327cbdfe1fd82ee12ba182f88d6b0061993c8fc6c191d1783a8e3a0cbc569ce9f67a04cb19469a0e019319aa7611fb8bcd8f40baafa3f9aba67bc72e59b25d9
7
- data.tar.gz: 4b38000886a03c5bc903c5b6641c338bea3c302cc68d559761b62de8d3cd6d4642afbfee8f3675ca666b09621b9cb53f463f510af4ba8b098e0ef45e5531fae6
6
+ metadata.gz: 00065cecaf47e58f041fbfd91f279c9dc41ac712b2f27e5eb8d23cc6b4be7fcb4d37b33ac9f42396f52d6d9175da47dd3518d6aa8e5719ce294aaa6371bb95ee
7
+ data.tar.gz: adef1a3bcf5732468a7e17ecc91d801084f5d0b919f003b2e861affdce83e8bfa9ebb94aeb5c03e3fc9e9fa657e4174628840834cd17a2bb3c46d9ff0484b4ed
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yardview_gtk3 (0.3.0)
4
+ yardview_gtk3 (0.4.0)
5
5
  atk
6
6
  cairo
7
7
  cairo-gobject
@@ -19,7 +19,7 @@ GEM
19
19
  specs:
20
20
  atk (3.4.3)
21
21
  glib2 (= 3.4.3)
22
- cairo (1.16.5)
22
+ cairo (1.16.6)
23
23
  native-package-installer (>= 1.0.3)
24
24
  pkg-config (>= 1.2.2)
25
25
  cairo-gobject (3.4.3)
@@ -48,7 +48,7 @@ GEM
48
48
  pango (3.4.3)
49
49
  cairo-gobject (= 3.4.3)
50
50
  gobject-introspection (= 3.4.3)
51
- pkg-config (1.4.1)
51
+ pkg-config (1.4.2)
52
52
  rake (13.0.1)
53
53
  webkit2-gtk (3.4.3)
54
54
  gtk3 (= 3.4.3)
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  # Yardview
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/yardview_gtk3.svg)](https://badge.fury.io/rb/yardview_gtk3)
4
+
3
5
  simple GTK3 GUI `yard server -g` viewer.
4
6
 
5
7
  $ yardview
6
8
 
7
- ![Alt text](/resources/yardview_screenshot.png?raw=true "screenshot")
9
+ ![Screenshot](/resources/yardview_screenshot.png?raw=true "screenshot")
8
10
 
9
11
  ## Installation
10
12
 
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ require 'optparse'
4
5
  require 'yardview'
5
6
  require 'fileutils'
6
7
 
8
+ Version = Yardview::VERSION
9
+ opt = OptionParser.new
10
+ port_num ||= 8808
11
+ opt.on('-p', '--port VAL', Integer) { |v| port_num = v }
12
+ opt.parse!(ARGV)
13
+
7
14
  resource_xml = File.expand_path('../resources/gresources.xml', __dir__)
8
15
  resource_bin = File.expand_path('../gresource.bin', __dir__)
9
16
 
@@ -22,7 +29,7 @@ at_exit do
22
29
  end
23
30
 
24
31
  app.signal_connect :activate do |application|
25
- window = Yardview::ApplicationWindow.new application
32
+ window = Yardview::ApplicationWindow.new application, port: port_num
26
33
  window.present
27
34
  end
28
35
 
@@ -16,11 +16,14 @@ module Yardview
16
16
  end
17
17
  end
18
18
 
19
- def initialize(application)
19
+ attr_accessor :port
20
+
21
+ def initialize(application, port: port_num)
20
22
  super application: application
21
23
  set_title 'YardView'
22
24
  set_icon GdkPixbuf::Pixbuf.new resource: '/com/github/kojix2/yardview/ruby.png'
23
25
 
26
+ @port = port
24
27
  start_yard_server
25
28
  create_gui
26
29
  end
@@ -32,7 +35,7 @@ module Yardview
32
35
  end
33
36
  at_exit { Process.kill(:INT, @yard) unless @yard.nil? }
34
37
  @view = WebKit2Gtk::WebView.new
35
- @view.load_uri('http://localhost:8808')
38
+ @view.load_uri("http://localhost:#{port}")
36
39
  box.add @view, expand: true, fill: true
37
40
  @view.show
38
41
  end
@@ -42,7 +45,7 @@ module Yardview
42
45
  end
43
46
 
44
47
  def on_home_clicked
45
- @view.load_uri('http://localhost:8808')
48
+ @view.load_uri("http://localhost:#{port}")
46
49
  end
47
50
 
48
51
  def on_back_clicked
@@ -58,11 +61,11 @@ module Yardview
58
61
  end
59
62
 
60
63
  def start_yard_server
61
- if port_open? 8808
62
- @yard = spawn('yard server -g -p 8808 --reload')
64
+ if port_open? port
65
+ @yard = spawn("yard server -g -p #{port} --reload")
63
66
  sleep 1
64
67
  else
65
- raise 'port 8808 is in use!'
68
+ raise "port #{port} is in use!"
66
69
  end
67
70
  end
68
71
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yardview
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -1,9 +1,10 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!-- Generated with glade 3.22.1 -->
2
+ <!-- Generated with glade 3.22.2 -->
3
3
  <interface>
4
4
  <requires lib="gtk+" version="3.20"/>
5
5
  <template class="YardviewApplicationWindow" parent="GtkApplicationWindow">
6
6
  <property name="can_focus">False</property>
7
+ <property name="opacity">0.90</property>
7
8
  <property name="type">popup</property>
8
9
  <property name="default_width">800</property>
9
10
  <property name="default_height">600</property>
@@ -14,63 +15,80 @@
14
15
  <property name="can_focus">False</property>
15
16
  <property name="show_close_button">True</property>
16
17
  <child>
17
- <object class="GtkToolbar">
18
+ <object class="GtkButtonBox">
18
19
  <property name="visible">True</property>
19
20
  <property name="can_focus">False</property>
21
+ <property name="layout_style">expand</property>
20
22
  <child>
21
23
  <object class="GtkToolButton">
22
24
  <property name="visible">True</property>
23
25
  <property name="can_focus">False</property>
26
+ <property name="halign">start</property>
27
+ <property name="margin_left">3</property>
28
+ <property name="margin_right">3</property>
24
29
  <property name="label" translatable="yes">home</property>
25
30
  <property name="use_underline">True</property>
26
31
  <property name="stock_id">gtk-home</property>
27
32
  <signal name="clicked" handler="on_home_clicked" swapped="no"/>
28
33
  </object>
29
34
  <packing>
30
- <property name="expand">False</property>
31
- <property name="homogeneous">True</property>
35
+ <property name="expand">True</property>
36
+ <property name="fill">True</property>
37
+ <property name="position">0</property>
32
38
  </packing>
33
39
  </child>
34
40
  <child>
35
41
  <object class="GtkToolButton">
36
42
  <property name="visible">True</property>
37
43
  <property name="can_focus">False</property>
44
+ <property name="halign">start</property>
45
+ <property name="margin_left">3</property>
46
+ <property name="margin_right">3</property>
38
47
  <property name="label" translatable="yes">back</property>
39
48
  <property name="use_underline">True</property>
40
49
  <property name="stock_id">gtk-go-back</property>
41
50
  <signal name="clicked" handler="on_back_clicked" swapped="no"/>
42
51
  </object>
43
52
  <packing>
44
- <property name="expand">False</property>
45
- <property name="homogeneous">True</property>
53
+ <property name="expand">True</property>
54
+ <property name="fill">True</property>
55
+ <property name="position">1</property>
46
56
  </packing>
47
57
  </child>
48
58
  <child>
49
59
  <object class="GtkToolButton">
50
60
  <property name="visible">True</property>
51
61
  <property name="can_focus">False</property>
62
+ <property name="halign">start</property>
63
+ <property name="margin_left">3</property>
64
+ <property name="margin_right">3</property>
52
65
  <property name="label" translatable="yes">top</property>
53
66
  <property name="use_underline">True</property>
54
67
  <property name="stock_id">gtk-goto-top</property>
55
68
  <signal name="clicked" handler="on_top_clicked" swapped="no"/>
56
69
  </object>
57
70
  <packing>
58
- <property name="expand">False</property>
59
- <property name="homogeneous">True</property>
71
+ <property name="expand">True</property>
72
+ <property name="fill">True</property>
73
+ <property name="position">2</property>
60
74
  </packing>
61
75
  </child>
62
76
  <child>
63
77
  <object class="GtkToolButton">
64
78
  <property name="visible">True</property>
65
79
  <property name="can_focus">False</property>
80
+ <property name="halign">start</property>
81
+ <property name="margin_left">3</property>
82
+ <property name="margin_right">3</property>
66
83
  <property name="label" translatable="yes">refresh</property>
67
84
  <property name="use_underline">True</property>
68
85
  <property name="stock_id">gtk-refresh</property>
69
86
  <signal name="clicked" handler="on_refresh_clicked" swapped="no"/>
70
87
  </object>
71
88
  <packing>
72
- <property name="expand">False</property>
73
- <property name="homogeneous">True</property>
89
+ <property name="expand">True</property>
90
+ <property name="fill">True</property>
91
+ <property name="position">3</property>
74
92
  </packing>
75
93
  </child>
76
94
  </object>
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['kojix2']
11
11
  spec.email = ['2xijok@gmail.com']
12
12
 
13
- spec.summary = 'yard document viewer'
14
- spec.description = 'yard document viewer'
13
+ spec.summary = 'GUI Yard document viewer'
14
+ spec.description = 'Simple GUI application to show the yard documents of installed Gems.'
15
15
  spec.homepage = 'https://github.com/kojix2/yardview'
16
16
  spec.license = 'MIT'
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yardview_gtk3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: atk
@@ -192,7 +192,7 @@ dependencies:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
- description: yard document viewer
195
+ description: Simple GUI application to show the yard documents of installed Gems.
196
196
  email:
197
197
  - 2xijok@gmail.com
198
198
  executables:
@@ -240,5 +240,5 @@ requirements: []
240
240
  rubygems_version: 3.1.2
241
241
  signing_key:
242
242
  specification_version: 4
243
- summary: yard document viewer
243
+ summary: GUI Yard document viewer
244
244
  test_files: []