ffi-tk 2010.08.23 → 2018.02.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +7 -0
  4. data/.rubocop_todo.yml +371 -0
  5. data/AUTHORS +4 -2
  6. data/CHANGELOG +302 -262
  7. data/Gemfile +10 -0
  8. data/Gemfile.lock +45 -0
  9. data/MANIFEST +6 -6
  10. data/README.md +1 -1
  11. data/Rakefile +12 -11
  12. data/bin/rwish +6 -5
  13. data/example/choose_color.rb +5 -4
  14. data/example/choose_directory.rb +5 -4
  15. data/example/dialog.rb +9 -8
  16. data/example/hello.rb +2 -1
  17. data/example/message_box.rb +8 -5
  18. data/example/option_menu.rb +4 -3
  19. data/example/popup.rb +4 -3
  20. data/example/set_palette.rb +5 -4
  21. data/example/text.rb +30 -30
  22. data/example/tile/kroc_demo_small.rb +51 -55
  23. data/example/tile/kroc_rb_demo.rb +74 -83
  24. data/example/tile/notebook.rb +6 -9
  25. data/example/tile/theme_hello.rb +6 -8
  26. data/example/tile/themes.rb +4 -2
  27. data/example/tile/treeview.rb +16 -14
  28. data/example/tkgo.rb +120 -88
  29. data/example/various.rb +8 -7
  30. data/example/wait.rb +3 -2
  31. data/ffi-tk.gemspec +21 -20
  32. data/gemset.nix +134 -0
  33. data/lib/ffi-tk.rb +10 -11
  34. data/lib/ffi-tk/command.rb +3 -2
  35. data/lib/ffi-tk/command/after.rb +8 -7
  36. data/lib/ffi-tk/command/bell.rb +2 -1
  37. data/lib/ffi-tk/command/bind.rb +1 -0
  38. data/lib/ffi-tk/command/bindtags.rb +1 -0
  39. data/lib/ffi-tk/command/cget.rb +31 -24
  40. data/lib/ffi-tk/command/choose_color.rb +2 -1
  41. data/lib/ffi-tk/command/choose_directory.rb +2 -1
  42. data/lib/ffi-tk/command/clipboard.rb +6 -5
  43. data/lib/ffi-tk/command/configure.rb +23 -21
  44. data/lib/ffi-tk/command/destroy.rb +2 -1
  45. data/lib/ffi-tk/command/dialog.rb +4 -3
  46. data/lib/ffi-tk/command/event.rb +1 -0
  47. data/lib/ffi-tk/command/focus.rb +2 -1
  48. data/lib/ffi-tk/command/font.rb +12 -9
  49. data/lib/ffi-tk/command/get_open_file.rb +1 -0
  50. data/lib/ffi-tk/command/get_save_file.rb +1 -0
  51. data/lib/ffi-tk/command/grab.rb +2 -1
  52. data/lib/ffi-tk/command/grid.rb +7 -6
  53. data/lib/ffi-tk/command/image.rb +5 -4
  54. data/lib/ffi-tk/command/lower.rb +1 -0
  55. data/lib/ffi-tk/command/message_box.rb +2 -1
  56. data/lib/ffi-tk/command/option_menu.rb +3 -2
  57. data/lib/ffi-tk/command/pack.rb +5 -4
  58. data/lib/ffi-tk/command/place.rb +5 -4
  59. data/lib/ffi-tk/command/popup.rb +2 -1
  60. data/lib/ffi-tk/command/raise.rb +1 -0
  61. data/lib/ffi-tk/command/scrollable.rb +7 -10
  62. data/lib/ffi-tk/command/selection.rb +4 -3
  63. data/lib/ffi-tk/command/set_palette.rb +2 -1
  64. data/lib/ffi-tk/command/tk_cmd.rb +1 -0
  65. data/lib/ffi-tk/command/vars.rb +2 -1
  66. data/lib/ffi-tk/command/wait.rb +2 -1
  67. data/lib/ffi-tk/command/winfo.rb +9 -8
  68. data/lib/ffi-tk/command/wm.rb +11 -10
  69. data/lib/ffi-tk/core_extensions.rb +5 -4
  70. data/lib/ffi-tk/event/data.rb +32 -31
  71. data/lib/ffi-tk/event/handler.rb +4 -3
  72. data/lib/ffi-tk/ffi/tcl.rb +42 -31
  73. data/lib/ffi-tk/ffi/tcl/cmd_proc.rb +2 -1
  74. data/lib/ffi-tk/ffi/tcl/eval_result.rb +47 -8
  75. data/lib/ffi-tk/ffi/tcl/interp.rb +7 -4
  76. data/lib/ffi-tk/ffi/tcl/obj.rb +7 -32
  77. data/lib/ffi-tk/ffi/tcl/time.rb +2 -1
  78. data/lib/ffi-tk/ffi/tk.rb +8 -7
  79. data/lib/ffi-tk/geometry.rb +20 -17
  80. data/lib/ffi-tk/thread_sender.rb +1 -0
  81. data/lib/ffi-tk/tk.rb +23 -23
  82. data/lib/ffi-tk/variable.rb +25 -3
  83. data/lib/ffi-tk/version.rb +1 -1
  84. data/lib/ffi-tk/widget.rb +2 -1
  85. data/lib/ffi-tk/widget/button.rb +4 -1
  86. data/lib/ffi-tk/widget/canvas.rb +18 -15
  87. data/lib/ffi-tk/widget/canvas/arc.rb +2 -1
  88. data/lib/ffi-tk/widget/canvas/bitmap.rb +2 -1
  89. data/lib/ffi-tk/widget/canvas/image.rb +2 -1
  90. data/lib/ffi-tk/widget/canvas/item.rb +4 -4
  91. data/lib/ffi-tk/widget/canvas/line.rb +2 -1
  92. data/lib/ffi-tk/widget/canvas/oval.rb +2 -1
  93. data/lib/ffi-tk/widget/canvas/polygon.rb +2 -1
  94. data/lib/ffi-tk/widget/canvas/rectangle.rb +2 -1
  95. data/lib/ffi-tk/widget/canvas/text.rb +2 -1
  96. data/lib/ffi-tk/widget/canvas/window.rb +2 -1
  97. data/lib/ffi-tk/widget/checkbutton.rb +4 -1
  98. data/lib/ffi-tk/widget/entry.rb +4 -1
  99. data/lib/ffi-tk/widget/frame.rb +4 -1
  100. data/lib/ffi-tk/widget/label.rb +4 -1
  101. data/lib/ffi-tk/widget/labelframe.rb +4 -1
  102. data/lib/ffi-tk/widget/listbox.rb +5 -2
  103. data/lib/ffi-tk/widget/menu.rb +4 -1
  104. data/lib/ffi-tk/widget/menubutton.rb +4 -1
  105. data/lib/ffi-tk/widget/message.rb +4 -1
  106. data/lib/ffi-tk/widget/panedwindow.rb +5 -2
  107. data/lib/ffi-tk/widget/radiobutton.rb +4 -1
  108. data/lib/ffi-tk/widget/root.rb +1 -0
  109. data/lib/ffi-tk/widget/scale.rb +4 -1
  110. data/lib/ffi-tk/widget/scrollbar.rb +4 -1
  111. data/lib/ffi-tk/widget/spinbox.rb +4 -1
  112. data/lib/ffi-tk/widget/text.rb +20 -16
  113. data/lib/ffi-tk/widget/text/peer.rb +1 -0
  114. data/lib/ffi-tk/widget/tile.rb +2 -1
  115. data/lib/ffi-tk/widget/tile/button.rb +4 -1
  116. data/lib/ffi-tk/widget/tile/checkbutton.rb +4 -1
  117. data/lib/ffi-tk/widget/tile/combobox.rb +5 -2
  118. data/lib/ffi-tk/widget/tile/entry.rb +4 -1
  119. data/lib/ffi-tk/widget/tile/frame.rb +4 -1
  120. data/lib/ffi-tk/widget/tile/label.rb +4 -2
  121. data/lib/ffi-tk/widget/tile/labelframe.rb +4 -1
  122. data/lib/ffi-tk/widget/tile/menubutton.rb +4 -1
  123. data/lib/ffi-tk/widget/tile/notebook.rb +4 -1
  124. data/lib/ffi-tk/widget/tile/panedwindow.rb +4 -1
  125. data/lib/ffi-tk/widget/tile/progressbar.rb +4 -2
  126. data/lib/ffi-tk/widget/tile/radiobutton.rb +4 -1
  127. data/lib/ffi-tk/widget/tile/scale.rb +4 -1
  128. data/lib/ffi-tk/widget/tile/scrollbar.rb +7 -4
  129. data/lib/ffi-tk/widget/tile/separator.rb +4 -1
  130. data/lib/ffi-tk/widget/tile/sizegrip.rb +4 -1
  131. data/lib/ffi-tk/widget/tile/style.rb +16 -17
  132. data/lib/ffi-tk/widget/tile/treeview.rb +11 -5
  133. data/lib/ffi-tk/widget/toplevel.rb +4 -1
  134. data/shell.nix +19 -0
  135. data/spec/ffi-tk/command/bind.rb +5 -4
  136. data/spec/ffi-tk/command/bindtags.rb +2 -1
  137. data/spec/ffi-tk/command/clipboard.rb +4 -3
  138. data/spec/ffi-tk/command/font.rb +20 -19
  139. data/spec/ffi-tk/command/image.rb +13 -5
  140. data/spec/ffi-tk/command/pack.rb +3 -2
  141. data/spec/ffi-tk/command/place.rb +4 -3
  142. data/spec/ffi-tk/command/selection.rb +2 -1
  143. data/spec/ffi-tk/command/vars.rb +3 -2
  144. data/spec/ffi-tk/command/winfo.rb +10 -10
  145. data/spec/ffi-tk/command/wm.rb +23 -22
  146. data/spec/ffi-tk/event.rb +23 -21
  147. data/spec/ffi-tk/tile/button.rb +8 -8
  148. data/spec/ffi-tk/tile/checkbutton.rb +1 -1
  149. data/spec/ffi-tk/tile/combobox.rb +11 -12
  150. data/spec/ffi-tk/tile/entry.rb +18 -19
  151. data/spec/ffi-tk/tile/frame.rb +13 -13
  152. data/spec/ffi-tk/tile/label.rb +2 -2
  153. data/spec/ffi-tk/tile/labelframe.rb +1 -1
  154. data/spec/ffi-tk/tile/menubutton.rb +1 -1
  155. data/spec/ffi-tk/tile/notebook.rb +22 -20
  156. data/spec/ffi-tk/tile/panedwindow.rb +1 -1
  157. data/spec/ffi-tk/tile/progressbar.rb +1 -1
  158. data/spec/ffi-tk/tile/radiobutton.rb +1 -1
  159. data/spec/ffi-tk/tile/scale.rb +1 -1
  160. data/spec/ffi-tk/tile/scrollbar.rb +1 -16
  161. data/spec/ffi-tk/tile/separator.rb +2 -2
  162. data/spec/ffi-tk/tile/sizegrip.rb +1 -1
  163. data/spec/ffi-tk/tile/style.rb +63 -65
  164. data/spec/ffi-tk/tile/treeview.rb +11 -10
  165. data/spec/ffi-tk/variable.rb +5 -4
  166. data/spec/ffi-tk/widget/button.rb +3 -2
  167. data/spec/ffi-tk/widget/canvas.rb +59 -58
  168. data/spec/ffi-tk/widget/checkbutton.rb +6 -5
  169. data/spec/ffi-tk/widget/entry.rb +112 -103
  170. data/spec/ffi-tk/widget/frame.rb +2 -1
  171. data/spec/ffi-tk/widget/label.rb +2 -1
  172. data/spec/ffi-tk/widget/labelframe.rb +1 -0
  173. data/spec/ffi-tk/widget/listbox.rb +5 -4
  174. data/spec/ffi-tk/widget/menu.rb +3 -2
  175. data/spec/ffi-tk/widget/menubutton.rb +1 -0
  176. data/spec/ffi-tk/widget/message.rb +1 -0
  177. data/spec/ffi-tk/widget/panedwindow.rb +1 -0
  178. data/spec/ffi-tk/widget/radiobutton.rb +1 -0
  179. data/spec/ffi-tk/widget/root.rb +2 -1
  180. data/spec/ffi-tk/widget/scale.rb +1 -0
  181. data/spec/ffi-tk/widget/scrollbar.rb +1 -0
  182. data/spec/ffi-tk/widget/spinbox.rb +1 -0
  183. data/spec/ffi-tk/widget/text.rb +63 -54
  184. data/spec/ffi-tk/widget/toplevel.rb +1 -0
  185. data/spec/helper.rb +3 -1
  186. data/tasks/authors.rake +3 -2
  187. data/tasks/bacon.rake +13 -11
  188. data/tasks/changelog.rake +1 -0
  189. data/tasks/gem.rake +13 -11
  190. data/tasks/manifest.rake +2 -1
  191. data/tasks/release.rake +11 -32
  192. data/tasks/reversion.rake +2 -1
  193. metadata +52 -75
  194. data/spec/ffi-tk/command/grid.rb +0 -6
  195. data/tasks/gem_setup.rake +0 -113
  196. data/tasks/grancher.rake +0 -12
  197. data/tasks/rcov.rake +0 -17
  198. data/tasks/setup.rake +0 -12
  199. data/tasks/ycov.rake +0 -84
@@ -1,12 +0,0 @@
1
- begin
2
- require 'grancher/task'
3
-
4
- Grancher::Task.new do |g|
5
- g.branch = 'gh-pages'
6
- g.push_to = 'origin'
7
- g.message = 'Updated website'
8
- g.directory 'ydoc', 'doc'
9
- end
10
- rescue LoadError
11
- # oh well :)
12
- end
@@ -1,17 +0,0 @@
1
- desc 'code coverage'
2
- task :rcov => :clean do
3
- specs = Dir['spec/ffi-tk/**/*.rb']
4
-
5
- # we ignore adapter as this has extensive specs in rack already.
6
- ignore = %w[ gem bacon ]
7
-
8
- ignored = ignore.join(',')
9
-
10
- cmd = "rcov --aggregate coverage.data --sort coverage -t --%s -x '#{ignored}' %s"
11
-
12
- while spec = specs.shift
13
- puts '', "Gather coverage for #{spec} ..."
14
- html = specs.empty? ? 'html' : 'no-html'
15
- sh(cmd % [html, spec])
16
- end
17
- end
@@ -1,12 +0,0 @@
1
- desc 'install dependencies from gemspec'
2
- task :setup => [:gem_setup] do
3
- GemSetup.new :verbose => false do
4
- DEPENDENCIES.each do |name, options|
5
- gem(name, options)
6
- end
7
-
8
- DEVELOPMENT_DEPENDENCIES.each do |name, options|
9
- gem(name, options)
10
- end
11
- end
12
- end
@@ -1,84 +0,0 @@
1
- begin
2
- require 'yard'
3
-
4
- task 'Show Documentation coverage'
5
- task :ycov => ['.yardoc'] do
6
- YARD::Registry.load_yardoc
7
- code_objects = YARD::Registry.paths.map{|path| YARD::Registry.at(path) }
8
- code_objects.delete_if{|obj| obj.type == :root }
9
- without_doc, with_doc = code_objects.partition{|obj| obj.docstring.empty? }
10
-
11
- documented = with_doc.size
12
- undocumented = without_doc.size
13
- total = documented + undocumented
14
- percentage = (documented / 0.01) / total
15
-
16
- puts "Documentation coverage is %d/%d (%3.1f%%)" % [documented, total, percentage]
17
- end
18
-
19
- task 'ycov-full' => ['.yardoc'] do
20
- require 'builder'
21
-
22
- YARD::Registry.load_yardoc
23
- code_objects = YARD::Registry.paths.map{|path| YARD::Registry.at(path) }
24
- code_objects.delete_if{|obj| obj.type == :root }
25
- without_doc, with_doc = code_objects.partition{|obj| obj.docstring.empty? }
26
-
27
- list_objects = lambda{|body, list|
28
- body.table(:width => '100%') do |table|
29
- list.group_by{|obj| obj.type }.
30
- sort_by{|k,v| k.to_s }.each do |type, objects|
31
-
32
- table.tr do |tr|
33
- tr.th(type.to_s, :colspan => 2)
34
- end
35
-
36
- objects.sort_by{|obj| obj.path }.each do |obj|
37
- table.tr do |tr|
38
- tr.td obj.path
39
- tr.td "#{obj.file} +#{obj.line}"
40
- end
41
- end
42
- end
43
- end
44
- }
45
-
46
- File.open('ycov.html', 'w+') do |ycov|
47
- builder = Builder::XmlMarkup.new(:target => ycov, :indent=>2)
48
- builder.html do |html|
49
- html.head do |head|
50
- head.title 'YARD Coverage report'
51
- end
52
-
53
- html.body do |body|
54
- body.h1 'YARD Coverage report'
55
-
56
- body.h2 "#{without_doc.size} Undocumented objects"
57
- list_objects[body, without_doc]
58
-
59
- body.h2 "#{with_doc.size} Documented objects"
60
- list_objects[body, with_doc]
61
- end
62
- end
63
- end
64
- end
65
-
66
- file '.yardoc' => FileList['lib/**/*.rb'] do
67
- files = ['lib/**/*.rb']
68
- options = ['--no-output', '--private']
69
- YARD::CLI::Yardoc.run(*(options + files))
70
- end
71
-
72
- desc 'Generate YARD documentation'
73
- task :yardoc => ['.yardoc'] do
74
- files = ['lib/**/*.rb']
75
- options = [
76
- '--output-dir', 'ydoc',
77
- '--readme', PROJECT_README,
78
- '--db', '.yardoc',
79
- '--private']
80
- YARD::CLI::Yardoc.run(*(options + files))
81
- end
82
- rescue LoadError
83
- # you'll survive
84
- end