tk_inspect 0.1.0 → 0.2.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: 7f7377cade733dd797288129ec45fcb1481c05096df88cf18a42fefa0ae6329f
4
- data.tar.gz: 52aa4aa14cd64cdfd27034a436da29341fec08b00969cd6e9be280248f666c6a
3
+ metadata.gz: 0e270941309105cf1ea1e7a2eb9b0457f7db868c1a3a4f8fc02c9ba1b4885df3
4
+ data.tar.gz: c5bea0c56e356a83f29dfb534a183a2901851640a8556c70a0792e2b05bd35ba
5
5
  SHA512:
6
- metadata.gz: 419d81b4705568549fc788e1c34a7732cde280e6fb074cfb929128352201d6909f94106e14cefca2a6c05e6c945f486ec3a4fbd954d575a4305c2a54fe25496e
7
- data.tar.gz: b1ac46a63e8ddc81fc30ef535e4dfb50a4bf47454cf16a27f90076104837d49555582a5ae3ed2abcebaa73540da0fa4b2124bef0a9d9f9486de67cea26c148b4
6
+ metadata.gz: d8edfc8b464c9140c7f35c583c93a58839430b8c64a83246382d74c3fe1cec6de525d9cce284af27a474e68c9edec3659893a0b1ff1040885c7da78a59390353
7
+ data.tar.gz: 86af794b079c2ef753edc2d608dfcb469b55c37b7c7115a1836ad6c9bd7f86f2607ba1fc0a13588e3da3f0032e6904a4fc109bb9b2b67306531caf4f481d8569
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ # Gem projects shouldn't commit its Gemfile.lock
14
+ Gemfile.lock
@@ -3,10 +3,8 @@ module TkInspect
3
3
  class RootComponent < TkComponent::Base
4
4
  attr_accessor :canvas_window
5
5
 
6
- def generate(parent_component, options = {})
7
- parse_component(parent_component, options) do |p|
8
- @canvas = p.canvas(sticky: 'nwes', x_flex: 1, y_flex: 1)
9
- end
6
+ def render(p, parent_component)
7
+ @canvas = p.canvas(sticky: 'nwes', x_flex: 1, y_flex: 1)
10
8
  end
11
9
 
12
10
  def canvas
@@ -33,12 +33,10 @@ module TkInspect
33
33
  attr_accessor :method_name
34
34
  attr_accessor :method_line
35
35
 
36
- def generate(parent_component, options = {})
37
- parse_component(parent_component, options) do |p|
38
- p.vframe(padding: "0 0 0 0", sticky: 'nsew', x_flex: 1, y_flex: 1) do |vf|
39
- @filename_label = vf.label(font: 'TkSmallCaptionFont', sticky: 'ewn', x_flex: 1, y_flex: 0)
40
- @code_text = vf.text(sticky: 'nswe', x_flex: 1, y_flex: 1, wrap: 'none', scrollers: 'xy')
41
- end
36
+ def render(p, parent_component)
37
+ p.vframe(padding: "0 0 0 0", sticky: 'nsew', x_flex: 1, y_flex: 1) do |vf|
38
+ @filename_label = vf.label(font: 'TkSmallCaptionFont', sticky: 'ewn', x_flex: 1, y_flex: 0)
39
+ @code_text = vf.text(sticky: 'nswe', x_flex: 1, y_flex: 1, wrap: 'none', scrollers: 'xy')
42
40
  end
43
41
  end
44
42
 
@@ -5,39 +5,37 @@ module TkInspect
5
5
  class RootComponent < TkComponent::Base
6
6
  attr_accessor :class_browser
7
7
 
8
- def generate(parent_component, options = {})
9
- parse_component(parent_component, options) do |p|
10
- p.vframe(sticky: 'nsew', x_flex: 1, y_flex: 1) do |vf|
11
- vf.hframe(padding: "12", sticky: 'nsew', x_flex: 1, y_flex: 0) do |hf|
12
- hf.hframe(sticky: 'nw') do |f|
13
- f.label(text: "Browse by: ")
14
- f.radio_set(value: "hierarchy", on_change: :browse_by_changed) do |rs|
15
- rs.radio_button(text: "Class hierarchy", value: 'hierarchy')
16
- rs.radio_button(text: "Namespaces", value: 'namespaces')
17
- end
18
- end
19
- hf.hframe(sticky: 'ne', x_flex: 1) do |f|
20
- f.label(text: "Filter")
21
- f.entry(value: class_browser.class_data_source.class_filter, on_change: :filter_changed)
8
+ def render(p, parent_component)
9
+ p.vframe(sticky: 'nsew', x_flex: 1, y_flex: 1) do |vf|
10
+ vf.hframe(padding: "12", sticky: 'nsew', x_flex: 1, y_flex: 0) do |hf|
11
+ hf.hframe(sticky: 'nw') do |f|
12
+ f.label(text: "Browse by: ")
13
+ f.radio_set(value: "hierarchy", on_change: :browse_by_changed) do |rs|
14
+ rs.radio_button(text: "Class hierarchy", value: 'hierarchy')
15
+ rs.radio_button(text: "Namespaces", value: 'namespaces')
22
16
  end
23
17
  end
24
- vf.vpaned(sticky: 'nsew', x_flex: 1, y_flex: 1) do |vp|
25
- @class_browser_comp = vp.insert_component(TkComponent::BrowserComponent, self,
26
- data_source: class_browser.class_data_source,
27
- selected_path: class_browser.selected_class_path,
28
- paned: true,
29
- sticky: 'nsew', x_flex: 1, y_flex: 1) do |bc|
30
- bc.on_event'PathChanged', ->(e) { class_selected(e) }
31
- end
32
- @module_method_browser_component = vp.insert_component(TkComponent::RBrowserComponent, self,
33
- data_source: class_browser.module_method_data_source,
34
- paned: true,
35
- max_columns: 2,
36
- sticky: 'nsew', x_flex: 1, y_flex: 1) do |bc|
37
- bc.on_event'PathChanged', ->(e) { module_method_selected(e) }
38
- end
39
- @code = vp.insert_component(CodeComponent, self, sticky: 'nsew', x_flex: 1, y_flex: 1)
18
+ hf.hframe(sticky: 'ne', x_flex: 1) do |f|
19
+ f.label(text: "Filter")
20
+ f.entry(value: class_browser.class_data_source.class_filter, on_change: :filter_changed)
21
+ end
22
+ end
23
+ vf.vpaned(sticky: 'nsew', x_flex: 1, y_flex: 1) do |vp|
24
+ @class_browser_comp = vp.insert_component(TkComponent::BrowserComponent, self,
25
+ data_source: class_browser.class_data_source,
26
+ selected_path: class_browser.selected_class_path,
27
+ paned: true,
28
+ sticky: 'nsew', x_flex: 1, y_flex: 1) do |bc|
29
+ bc.on_event'PathChanged', ->(e) { class_selected(e) }
30
+ end
31
+ @module_method_browser_component = vp.insert_component(TkComponent::RBrowserComponent, self,
32
+ data_source: class_browser.module_method_data_source,
33
+ paned: true,
34
+ max_columns: 2,
35
+ sticky: 'nsew', x_flex: 1, y_flex: 1) do |bc|
36
+ bc.on_event'PathChanged', ->(e) { module_method_selected(e) }
40
37
  end
38
+ @code = vp.insert_component(CodeComponent, self, sticky: 'nsew', x_flex: 1, y_flex: 1)
41
39
  end
42
40
  end
43
41
  end
@@ -3,31 +3,29 @@ module TkInspect
3
3
  class RootComponent < TkComponent::Base
4
4
  attr_accessor :console
5
5
 
6
- def generate(parent_component, options = {})
7
- parse_component(parent_component, options) do |p|
8
- p.vframe(sticky: 'nsew', x_flex: 1, y_flex: 1) do |r|
9
- r.hframe(sticky: 'new', padding: '8', x_flex: 0) do |hf|
10
- hf.label(text: "Write Ruby code here", sticky: 'w')
11
- hf.hframe(sticky: 'ne', x_flex: 1) do |buttons|
12
- buttons.button(text: "Run selected", default: "active", on_click: :run_selected)
13
- buttons.button(text: "Return", on_click: :return_from_modal) if console.modal
14
- end
6
+ def render(p, parent_component)
7
+ p.vframe(sticky: 'nsew', x_flex: 1, y_flex: 1) do |r|
8
+ r.hframe(sticky: 'new', padding: '8', x_flex: 0) do |hf|
9
+ hf.label(text: "Write Ruby code here", sticky: 'w')
10
+ hf.hframe(sticky: 'ne', x_flex: 1) do |buttons|
11
+ buttons.button(text: "Run selected", default: "active", on_click: :run_selected)
12
+ buttons.button(text: "Return", on_click: :return_from_modal) if console.modal
15
13
  end
16
- r.vpaned(sticky: 'nswe', x_flex: 1, y_flex: 1) do |vp|
17
- @input = vp.text(sticky: 'nswe', scrollers: 'y',
18
- highlightthickness: 0,
19
- x_flex: 1, y_flex: 1)
20
- vp.vframe(padding: "0 0 0 0", sticky: 'nswe', x_flex: 1, y_flex: 1) do |vf|
21
- vf.hframe(sticky: 'new', padding: '8', x_flex: 0) do |hf|
22
- hf.label(text: "Output", padding: '8', sticky: 'w')
23
- hf.hframe(sticky: 'ne', x_flex: 1) do |buttons|
24
- buttons.button(text: "Clear", on_click: :clear_output)
25
- end
14
+ end
15
+ r.vpaned(sticky: 'nswe', x_flex: 1, y_flex: 1) do |vp|
16
+ @input = vp.text(sticky: 'nswe', scrollers: 'y',
17
+ highlightthickness: 0,
18
+ x_flex: 1, y_flex: 1)
19
+ vp.vframe(padding: "0 0 0 0", sticky: 'nswe', x_flex: 1, y_flex: 1) do |vf|
20
+ vf.hframe(sticky: 'new', padding: '8', x_flex: 0) do |hf|
21
+ hf.label(text: "Output", padding: '8', sticky: 'w')
22
+ hf.hframe(sticky: 'ne', x_flex: 1) do |buttons|
23
+ buttons.button(text: "Clear", on_click: :clear_output)
26
24
  end
27
- @output = vf.text(sticky: 'nswe', scrollers: 'y',
28
- background: 'systemSheetBackgroundOpaque', highlightthickness: 0,
29
- x_flex: 1, y_flex: 1)
30
25
  end
26
+ @output = vf.text(sticky: 'nswe', scrollers: 'y',
27
+ background: 'systemSheetBackgroundOpaque', highlightthickness: 0,
28
+ x_flex: 1, y_flex: 1)
31
29
  end
32
30
  end
33
31
  end
@@ -3,23 +3,21 @@ module TkInspect
3
3
  class RootComponent < TkComponent::Base
4
4
  attr_accessor :inspector
5
5
 
6
- def generate(parent_component, options = {})
7
- parse_component(parent_component, options) do |p|
8
- p.vframe(padding: "0 0 0 0", sticky: 'nsew', x_flex: 1, y_flex: 1) do |f|
9
- @table = f.insert_component(TkComponent::TableViewComponent, self,
10
- data_source: self,
11
- columns: [
12
- { key: :var, text: 'Variable', anchor: 'w' },
13
- { key: :value, text: 'Value', anchor: 'center' },
14
- { key: :klass, text: 'Class', anchor: 'center' }
15
- ],
16
- nested: true,
17
- lazy: true,
18
- sticky: 'nsew', x_flex: 1, y_flex: 1)
19
- f.hframe(sticky: 'se', padding: '8', x_flex: 1) do |hf|
20
- hf.button(text: "Browse selected class", on_click: :browse_class)
21
- hf.button(text: "Refresh", on_click: ->(e) { regenerate })
22
- end
6
+ def render(p, parent_component)
7
+ p.vframe(padding: "0 0 0 0", sticky: 'nsew', x_flex: 1, y_flex: 1) do |f|
8
+ @table = f.insert_component(TkComponent::TableViewComponent, self,
9
+ data_source: self,
10
+ columns: [
11
+ { key: :var, text: 'Variable', anchor: 'w' },
12
+ { key: :value, text: 'Value', anchor: 'center' },
13
+ { key: :klass, text: 'Class', anchor: 'center' }
14
+ ],
15
+ nested: true,
16
+ lazy: true,
17
+ sticky: 'nsew', x_flex: 1, y_flex: 1)
18
+ f.hframe(sticky: 'se', padding: '8', x_flex: 1) do |hf|
19
+ hf.button(text: "Browse selected class", on_click: :browse_class)
20
+ hf.button(text: "Refresh", on_click: ->(e) { regenerate })
23
21
  end
24
22
  end
25
23
  end
@@ -1,3 +1,3 @@
1
1
  module TkInspect
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tk_inspect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Egea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-28 00:00:00.000000000 Z
11
+ date: 2021-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tk_component
@@ -95,7 +95,6 @@ files:
95
95
  - ".travis.yml"
96
96
  - CODE_OF_CONDUCT.md
97
97
  - Gemfile
98
- - Gemfile.lock
99
98
  - LICENSE.txt
100
99
  - README.md
101
100
  - Rakefile
@@ -1,67 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- tk_inspect (0.1.0)
5
- rouge (~> 3.26)
6
- tk_component (~> 0.1.2)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activesupport (6.0.3.4)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- zeitwerk (~> 2.2, >= 2.2.2)
17
- byebug (11.1.3)
18
- coderay (1.1.3)
19
- concurrent-ruby (1.1.8)
20
- diff-lcs (1.4.4)
21
- i18n (1.8.7)
22
- concurrent-ruby (~> 1.0)
23
- method_source (1.0.0)
24
- minitest (5.14.3)
25
- pry (0.13.1)
26
- coderay (~> 1.1)
27
- method_source (~> 1.0)
28
- pry-byebug (3.9.0)
29
- byebug (~> 11.0)
30
- pry (~> 0.13.0)
31
- rake (10.5.0)
32
- rouge (3.26.0)
33
- rspec (3.10.0)
34
- rspec-core (~> 3.10.0)
35
- rspec-expectations (~> 3.10.0)
36
- rspec-mocks (~> 3.10.0)
37
- rspec-core (3.10.0)
38
- rspec-support (~> 3.10.0)
39
- rspec-expectations (3.10.0)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.10.0)
42
- rspec-mocks (3.10.0)
43
- diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.10.0)
45
- rspec-support (3.10.0)
46
- thread_safe (0.3.6)
47
- tk (0.3.0)
48
- tk_component (0.1.2)
49
- activesupport (~> 6.0.3)
50
- tk (~> 0.3.0)
51
- tzinfo (1.2.9)
52
- thread_safe (~> 0.1)
53
- zeitwerk (2.4.2)
54
-
55
- PLATFORMS
56
- ruby
57
-
58
- DEPENDENCIES
59
- bundler (~> 1.16)
60
- pry
61
- pry-byebug
62
- rake (~> 10.0)
63
- rspec (~> 3.0)
64
- tk_inspect!
65
-
66
- BUNDLED WITH
67
- 1.16.6