shoes-swt 4.0.0.pre4 → 4.0.0.pre5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/Guardfile +4 -0
  3. data/lib/shoes/swt/app.rb +11 -2
  4. data/lib/shoes/swt/button.rb +2 -4
  5. data/lib/shoes/swt/check_button.rb +2 -4
  6. data/lib/shoes/swt/color_factory.rb +1 -2
  7. data/lib/shoes/swt/common/painter.rb +8 -6
  8. data/lib/shoes/swt/common/resource.rb +14 -0
  9. data/lib/shoes/swt/download.rb +1 -1
  10. data/lib/shoes/swt/generate-backend.rb +1 -1
  11. data/lib/shoes/swt/gradient.rb +3 -2
  12. data/lib/shoes/swt/image.rb +3 -4
  13. data/lib/shoes/swt/input_box.rb +10 -11
  14. data/lib/shoes/swt/key_listener.rb +11 -5
  15. data/lib/shoes/swt/link.rb +2 -0
  16. data/lib/shoes/swt/list_box.rb +4 -9
  17. data/lib/shoes/swt/packager.rb +1 -0
  18. data/lib/shoes/swt/progress.rb +4 -5
  19. data/lib/shoes/swt/radio.rb +3 -3
  20. data/lib/shoes/swt/redrawing_aspect.rb +4 -13
  21. data/lib/shoes/swt/slot.rb +4 -1
  22. data/lib/shoes/swt/sound.rb +1 -1
  23. data/lib/shoes/swt/swt_button.rb +4 -4
  24. data/lib/shoes/swt/text_block/painter.rb +4 -1
  25. data/lib/shoes/swt/text_block/text_segment_collection.rb +14 -3
  26. data/lib/shoes/swt/text_block/text_style_factory.rb +1 -0
  27. data/lib/shoes/swt/text_block.rb +5 -1
  28. data/lib/shoes/swt/version.rb +1 -1
  29. data/lib/shoes/swt.rb +3 -3
  30. data/shoes-swt.gemspec +1 -1
  31. data/spec/shoes/swt/animation_spec.rb +6 -7
  32. data/spec/shoes/swt/app_spec.rb +56 -14
  33. data/spec/shoes/swt/arc_spec.rb +5 -5
  34. data/spec/shoes/swt/background_spec.rb +5 -5
  35. data/spec/shoes/swt/border_spec.rb +3 -3
  36. data/spec/shoes/swt/button_spec.rb +3 -7
  37. data/spec/shoes/swt/check_spec.rb +1 -1
  38. data/spec/shoes/swt/click_listener_spec.rb +2 -2
  39. data/spec/shoes/swt/color_factory_spec.rb +1 -1
  40. data/spec/shoes/swt/color_spec.rb +1 -1
  41. data/spec/shoes/swt/common/painter_spec.rb +13 -3
  42. data/spec/shoes/swt/common/remove_spec.rb +1 -1
  43. data/spec/shoes/swt/configuration_spec.rb +1 -2
  44. data/spec/shoes/swt/dialog_spec.rb +1 -4
  45. data/spec/shoes/swt/flow_spec.rb +4 -4
  46. data/spec/shoes/swt/font_spec.rb +1 -3
  47. data/spec/shoes/swt/gradient_spec.rb +1 -1
  48. data/spec/shoes/swt/image_pattern_spec.rb +1 -1
  49. data/spec/shoes/swt/image_spec.rb +3 -4
  50. data/spec/shoes/swt/input_box_spec.rb +6 -8
  51. data/spec/shoes/swt/integration_spec.rb +1 -1
  52. data/spec/shoes/swt/key_listener_spec.rb +44 -17
  53. data/spec/shoes/swt/line_spec.rb +2 -2
  54. data/spec/shoes/swt/link_segment_spec.rb +2 -3
  55. data/spec/shoes/swt/link_spec.rb +1 -1
  56. data/spec/shoes/swt/list_box_spec.rb +8 -9
  57. data/spec/shoes/swt/mouse_move_listener_spec.rb +6 -6
  58. data/spec/shoes/swt/oval_spec.rb +1 -1
  59. data/spec/shoes/swt/progress_spec.rb +3 -3
  60. data/spec/shoes/swt/radio_group_spec.rb +1 -2
  61. data/spec/shoes/swt/radio_spec.rb +4 -4
  62. data/spec/shoes/swt/rect_painter_spec.rb +6 -6
  63. data/spec/shoes/swt/rect_spec.rb +1 -1
  64. data/spec/shoes/swt/shape_spec.rb +2 -3
  65. data/spec/shoes/swt/shared_examples/button.rb +0 -2
  66. data/spec/shoes/swt/shared_examples/movable.rb +0 -1
  67. data/spec/shoes/swt/shared_examples/painter.rb +2 -3
  68. data/spec/shoes/swt/shared_examples/swt_app_context.rb +11 -9
  69. data/spec/shoes/swt/shell_control_listener_spec.rb +2 -2
  70. data/spec/shoes/swt/shoes_layout_spec.rb +6 -7
  71. data/spec/shoes/swt/slot_spec.rb +10 -4
  72. data/spec/shoes/swt/spec_helper.rb +11 -0
  73. data/spec/shoes/swt/star_spec.rb +4 -4
  74. data/spec/shoes/swt/text_block/centered_text_segment_spec.rb +1 -1
  75. data/spec/shoes/swt/text_block/cursor_painter_spec.rb +7 -7
  76. data/spec/shoes/swt/text_block/fitter_spec.rb +8 -9
  77. data/spec/shoes/swt/text_block/painter_spec.rb +15 -4
  78. data/spec/shoes/swt/text_block/text_font_factory_spec.rb +4 -4
  79. data/spec/shoes/swt/text_block/text_segment_collection_spec.rb +17 -18
  80. data/spec/shoes/swt/text_block/text_segment_spec.rb +5 -5
  81. data/spec/shoes/swt/text_block_spec.rb +13 -11
  82. data/spec/spec_helper.rb +2 -1
  83. metadata +14 -14
  84. data/lib/shoes/swt/common/child.rb +0 -16
@@ -1,4 +1,4 @@
1
- require 'shoes/swt/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Shoes::Swt::TextBlock do
4
4
  include_context "swt app"
@@ -7,9 +7,9 @@ describe Shoes::Swt::TextBlock do
7
7
  let(:width) { 200 }
8
8
  let(:margin) { 10 }
9
9
  let(:dsl) { double("dsl", app: shoes_app, text: "text",
10
- margin_left: 0, margin_right: 0,
11
- margin_top: 0, margin_bottom: 0,
12
- pass_coordinates?: nil).as_null_object }
10
+ margin_left: 0, margin_right: 0,
11
+ margin_top: 0, margin_bottom: 0,
12
+ pass_coordinates?: nil).as_null_object }
13
13
 
14
14
  subject { Shoes::Swt::TextBlock.new(dsl, swt_app) }
15
15
 
@@ -56,6 +56,7 @@ describe Shoes::Swt::TextBlock do
56
56
  allow(dsl).to receive(:absolute_left) { 50 }
57
57
  allow(dsl).to receive(:absolute_top) { 0 }
58
58
  allow(dsl).to receive(:absolute_bottom) { layout_height }
59
+ allow(dsl).to receive(:element_width) { nil }
59
60
  end
60
61
 
61
62
  it "positions single line of text" do
@@ -69,7 +70,7 @@ describe Shoes::Swt::TextBlock do
69
70
 
70
71
  it "positions single line with margin" do
71
72
  allow(dsl).to receive_messages(margin_left: margin, margin_right: margin,
72
- margin_top: margin, margin_bottom: margin)
73
+ margin_top: margin, margin_bottom: margin)
73
74
 
74
75
  expect(dsl).to receive(:absolute_right=).with(layout_width + 50 + margin - 1)
75
76
  expect(dsl).to receive(:absolute_bottom=).with(layout_height + 2 * margin - 1)
@@ -143,6 +144,7 @@ describe Shoes::Swt::TextBlock do
143
144
  before(:each) do
144
145
  allow(dsl).to receive(:parent) { double("dsl parent", absolute_left: 0) }
145
146
  allow(dsl).to receive(:absolute_bottom) { layout_height }
147
+ allow(dsl).to receive(:element_width) { nil }
146
148
 
147
149
  current_position.next_line_start = 0
148
150
 
@@ -163,7 +165,7 @@ describe Shoes::Swt::TextBlock do
163
165
 
164
166
  it "positions in two segments with margins" do
165
167
  allow(dsl).to receive_messages(margin_left: margin, margin_right: margin,
166
- margin_top: margin, margin_bottom: margin)
168
+ margin_top: margin, margin_bottom: margin)
167
169
 
168
170
  expect(dsl).to receive(:absolute_right=).with(layout_width + margin - 1)
169
171
  expect(dsl).to receive(:absolute_bottom=).with(layout_height + 2 * margin - 1)
@@ -193,13 +195,13 @@ describe Shoes::Swt::TextBlock do
193
195
  end
194
196
  end
195
197
 
196
- def create_segment(name="segment", width=layout_width,
197
- height=layout_height, line_height=line_height)
198
+ def create_segment(name = "segment", width = layout_width,
199
+ height = layout_height, line_height = line_height)
198
200
  bounds = double("bounds", width: width, height: height)
199
201
  double(name, disposed?: false, style_from: nil,
200
- width: width, height: height,
201
- last_line_width: width, last_line_height: line_height,
202
- bounds: bounds)
202
+ width: width, height: height,
203
+ last_line_width: width, last_line_height: line_height,
204
+ bounds: bounds)
203
205
  end
204
206
 
205
207
  def when_aligns_and_positions
data/spec/spec_helper.rb CHANGED
@@ -13,10 +13,11 @@ require 'shoes'
13
13
  require 'shoes/ui/cli'
14
14
  require 'fileutils'
15
15
  require 'shoes/helpers/fake_element'
16
+ require 'shoes/helpers/fake_absolute_element'
16
17
  require 'shoes/helpers/inspect_helpers'
17
18
 
18
19
  require 'webmock/rspec'
19
- WebMock.disable_net_connect!(:allow => "codeclimate.com")
20
+ WebMock.disable_net_connect!(allow: "codeclimate.com")
20
21
 
21
22
  shared_examples = File.join(SHOESSPEC_ROOT, '../../shoes-core/spec/shoes/shared_examples/**/*.rb')
22
23
  Dir[shared_examples].each { |f| require f }
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoes-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.pre4
4
+ version: 4.0.0.pre5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Shoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-16 00:00:00.000000000 Z
11
+ date: 2015-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ~>
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
18
  version: '4.4'
19
19
  name: swt
@@ -21,13 +21,13 @@ dependencies:
21
21
  type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - ~>
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0.3'
33
33
  name: after_do
@@ -35,7 +35,7 @@ dependencies:
35
35
  type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.3'
41
41
  - !ruby/object:Gem::Dependency
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - '='
45
45
  - !ruby/object:Gem::Version
46
- version: 4.0.0.pre4
46
+ version: 4.0.0.pre5
47
47
  name: shoes-core
48
48
  prerelease: false
49
49
  type: :runtime
@@ -51,13 +51,13 @@ dependencies:
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 4.0.0.pre4
54
+ version: 4.0.0.pre5
55
55
  - !ruby/object:Gem::Dependency
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '='
59
59
  - !ruby/object:Gem::Version
60
- version: 4.0.0.pre4
60
+ version: 4.0.0.pre5
61
61
  name: shoes-package
62
62
  prerelease: false
63
63
  type: :runtime
@@ -65,7 +65,7 @@ dependencies:
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 4.0.0.pre4
68
+ version: 4.0.0.pre5
69
69
  description: A JRuby and Swt backend for Shoes, the best little GUI toolkit for Ruby. Shoes makes building for Mac, Windows, and Linux super simple.
70
70
  email:
71
71
  - shoes@librelist.com
@@ -74,6 +74,7 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - Guardfile
77
78
  - LICENSE
78
79
  - README.md
79
80
  - Rakefile
@@ -90,7 +91,6 @@ files:
90
91
  - lib/shoes/swt/click_listener.rb
91
92
  - lib/shoes/swt/color.rb
92
93
  - lib/shoes/swt/color_factory.rb
93
- - lib/shoes/swt/common/child.rb
94
94
  - lib/shoes/swt/common/clickable.rb
95
95
  - lib/shoes/swt/common/container.rb
96
96
  - lib/shoes/swt/common/fill.rb
@@ -221,17 +221,17 @@ require_paths:
221
221
  - lib
222
222
  required_ruby_version: !ruby/object:Gem::Requirement
223
223
  requirements:
224
- - - '>='
224
+ - - ">="
225
225
  - !ruby/object:Gem::Version
226
226
  version: '0'
227
227
  required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  requirements:
229
- - - '>'
229
+ - - ">"
230
230
  - !ruby/object:Gem::Version
231
231
  version: 1.3.1
232
232
  requirements: []
233
233
  rubyforge_project:
234
- rubygems_version: 2.4.2
234
+ rubygems_version: 2.4.8
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: A JRuby and Swt backend for Shoes, the best little GUI toolkit for Ruby.
@@ -1,16 +0,0 @@
1
- class Shoes
2
- module Swt
3
- module Common
4
- # Behavior for elements that act as children of other elements
5
- module Child
6
- # Finds the current app by asking parent elements, all the way
7
- # up to the App
8
- #
9
- # @return [Shoes::Swt::App] The current app
10
- def app
11
- parent.app
12
- end
13
- end
14
- end
15
- end
16
- end