shoes-core 4.0.0.pre3 → 4.0.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/shoes +1 -1
- data/bin/shoes-picker +5 -1
- data/bin/shoes-stub +1 -1
- data/ext/install/shoes.bat +2 -0
- data/lib/rubygems_plugin.rb +2 -2
- data/lib/shoes/app.rb +18 -19
- data/lib/shoes/arc.rb +8 -8
- data/lib/shoes/background.rb +4 -8
- data/lib/shoes/border.rb +4 -8
- data/lib/shoes/builtin_methods.rb +2 -2
- data/lib/shoes/button.rb +2 -9
- data/lib/shoes/check_button.rb +0 -12
- data/lib/shoes/color.rb +29 -34
- data/lib/shoes/common/background_element.rb +4 -0
- data/lib/shoes/common/fill.rb +9 -0
- data/lib/shoes/common/initialization.rb +59 -0
- data/lib/shoes/common/inspect.rb +20 -2
- data/lib/shoes/common/rotate.rb +10 -0
- data/lib/shoes/common/stroke.rb +9 -0
- data/lib/shoes/common/style.rb +21 -7
- data/lib/shoes/common/style_normalizer.rb +1 -3
- data/lib/shoes/common/ui_element.rb +10 -0
- data/lib/shoes/common/visibility.rb +4 -4
- data/lib/shoes/configuration.rb +4 -2
- data/lib/shoes/core/version.rb +1 -1
- data/lib/shoes/dialog.rb +2 -2
- data/lib/shoes/dimension.rb +78 -68
- data/lib/shoes/dimensions.rb +22 -10
- data/lib/shoes/download.rb +26 -10
- data/lib/shoes/dsl.rb +32 -51
- data/lib/shoes/gradient.rb +6 -13
- data/lib/shoes/image.rb +4 -9
- data/lib/shoes/input_box.rb +6 -9
- data/lib/shoes/internal_app.rb +16 -36
- data/lib/shoes/line.rb +29 -10
- data/lib/shoes/link.rb +13 -2
- data/lib/shoes/list_box.rb +33 -11
- data/lib/shoes/logger.rb +12 -13
- data/lib/shoes/mock/arc.rb +2 -0
- data/lib/shoes/mock/common_methods.rb +9 -0
- data/lib/shoes/mock/shape.rb +1 -1
- data/lib/shoes/mock/slot.rb +1 -0
- data/lib/shoes/oval.rb +13 -8
- data/lib/shoes/packager.rb +7 -1
- data/lib/shoes/point.rb +26 -3
- data/lib/shoes/progress.rb +6 -8
- data/lib/shoes/rect.rb +14 -10
- data/lib/shoes/shape.rb +28 -14
- data/lib/shoes/slot.rb +33 -24
- data/lib/shoes/slot_contents.rb +4 -4
- data/lib/shoes/star.rb +7 -16
- data/lib/shoes/text.rb +5 -3
- data/lib/shoes/text_block.rb +17 -16
- data/lib/shoes/text_block_dimensions.rb +1 -1
- data/lib/shoes/ui/cli.rb +12 -3
- data/lib/shoes/ui/picker.rb +64 -19
- data/lib/shoes/version.rb +1 -1
- data/shoes-core.gemspec +2 -2
- data/spec/shoes/animation_spec.rb +1 -1
- data/spec/shoes/app_spec.rb +4 -23
- data/spec/shoes/color_spec.rb +16 -1
- data/spec/shoes/common/style_normalizer_spec.rb +3 -3
- data/spec/shoes/common/style_spec.rb +42 -5
- data/spec/shoes/dimension_spec.rb +5 -7
- data/spec/shoes/dimensions_spec.rb +7 -7
- data/spec/shoes/download_spec.rb +49 -8
- data/spec/shoes/flow_spec.rb +1 -1
- data/spec/shoes/helpers/fake_element.rb +7 -0
- data/spec/shoes/helpers/sample17_helper.rb +3 -3
- data/spec/shoes/integration_spec.rb +1 -1
- data/spec/shoes/internal_app_spec.rb +8 -0
- data/spec/shoes/line_spec.rb +35 -3
- data/spec/shoes/link_spec.rb +24 -12
- data/spec/shoes/list_box_spec.rb +14 -2
- data/spec/shoes/point_spec.rb +28 -0
- data/spec/shoes/renamed_delegate_spec.rb +2 -2
- data/spec/shoes/shape_spec.rb +15 -2
- data/spec/shoes/shared_examples/changeable.rb +1 -1
- data/spec/shoes/shared_examples/common_methods.rb +1 -1
- data/spec/shoes/shared_examples/dsl/style.rb +1 -1
- data/spec/shoes/shared_examples/dsl/text_elements.rb +3 -3
- data/spec/shoes/shared_examples/dsl/video.rb +1 -1
- data/spec/shoes/shared_examples/dsl_app_context.rb +0 -1
- data/spec/shoes/shared_examples/parent.rb +1 -1
- data/spec/shoes/shared_examples/slot.rb +11 -5
- data/spec/shoes/shared_examples/state.rb +2 -2
- data/spec/shoes/shared_examples/style.rb +1 -1
- data/spec/shoes/spec_helper.rb +1 -1
- data/spec/shoes/text_block_spec.rb +20 -3
- data/spec/shoes/ui/picker_spec.rb +70 -0
- metadata +8 -2
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'shoes/spec_helper'
|
2
|
+
require 'shoes/ui/picker'
|
3
|
+
|
4
|
+
describe Shoes::UI::Picker do
|
5
|
+
|
6
|
+
let(:swt_backend) { "/gems/lib/shoes/swt/generate-backend.rb" }
|
7
|
+
let(:faux_backend) { "/gems/lib/shoes/faux/generate-backend.rb" }
|
8
|
+
|
9
|
+
let(:output) { StringIO.new }
|
10
|
+
let(:input) { StringIO.new }
|
11
|
+
|
12
|
+
subject { Shoes::UI::Picker.new(input, output) }
|
13
|
+
|
14
|
+
it "selects single backend generator" do
|
15
|
+
allow(Gem).to receive(:find_files) { [ swt_backend ] }
|
16
|
+
expect(subject.select_generator).to eq(swt_backend)
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "with multiple backend generators" do
|
20
|
+
before do
|
21
|
+
allow(Gem).to receive(:find_files) { [ faux_backend, swt_backend ] }
|
22
|
+
end
|
23
|
+
|
24
|
+
it "prompts with multiple backend generators" do
|
25
|
+
select("1")
|
26
|
+
subject.select_generator
|
27
|
+
|
28
|
+
output.rewind
|
29
|
+
result = output.read
|
30
|
+
|
31
|
+
expect(result).to include("shoes-faux")
|
32
|
+
expect(result).to include("shoes-swt")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "selects from multiple backend generators" do
|
36
|
+
select("2")
|
37
|
+
expect(subject.select_generator).to eq(swt_backend)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "retries for index past bounds" do
|
41
|
+
select("3\n1")
|
42
|
+
expect(subject.select_generator).to eq(faux_backend)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "retries for index before bounds" do
|
46
|
+
select("0\n1")
|
47
|
+
expect(subject.select_generator).to eq(faux_backend)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "retries for junk" do
|
51
|
+
select("junk\n1")
|
52
|
+
expect(subject.select_generator).to eq(faux_backend)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "fails if no matches" do
|
56
|
+
allow(Gem).to receive(:find_files) { [ ] }
|
57
|
+
expect { subject.select_generator }.to raise_error(ArgumentError)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "selects by name" do
|
61
|
+
allow(Gem).to receive(:find_files) { [ swt_backend ] }
|
62
|
+
expect(subject.select_generator("swt")).to eq(swt_backend)
|
63
|
+
end
|
64
|
+
|
65
|
+
def select(typed_input)
|
66
|
+
input.write(typed_input)
|
67
|
+
input.rewind
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoes-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.pre4
|
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-
|
11
|
+
date: 2015-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Shoes is the best little GUI toolkit for Ruby. Shoes makes building for Mac, Windows, and Linux super simple. This is the DSL for writing your app. You'll need a backend to run it.
|
14
14
|
email:
|
@@ -45,11 +45,15 @@ files:
|
|
45
45
|
- lib/shoes/common/background_element.rb
|
46
46
|
- lib/shoes/common/changeable.rb
|
47
47
|
- lib/shoes/common/clickable.rb
|
48
|
+
- lib/shoes/common/fill.rb
|
49
|
+
- lib/shoes/common/initialization.rb
|
48
50
|
- lib/shoes/common/inspect.rb
|
49
51
|
- lib/shoes/common/positioning.rb
|
50
52
|
- lib/shoes/common/registration.rb
|
51
53
|
- lib/shoes/common/remove.rb
|
54
|
+
- lib/shoes/common/rotate.rb
|
52
55
|
- lib/shoes/common/state.rb
|
56
|
+
- lib/shoes/common/stroke.rb
|
53
57
|
- lib/shoes/common/style.rb
|
54
58
|
- lib/shoes/common/style_normalizer.rb
|
55
59
|
- lib/shoes/common/ui_element.rb
|
@@ -229,6 +233,7 @@ files:
|
|
229
233
|
- spec/shoes/star_spec.rb
|
230
234
|
- spec/shoes/text_block_dimensions_spec.rb
|
231
235
|
- spec/shoes/text_block_spec.rb
|
236
|
+
- spec/shoes/ui/picker_spec.rb
|
232
237
|
- spec/shoes/url_spec.rb
|
233
238
|
- spec/shoes/widget_spec.rb
|
234
239
|
- spec/shoes_spec.rb
|
@@ -359,6 +364,7 @@ test_files:
|
|
359
364
|
- spec/shoes/star_spec.rb
|
360
365
|
- spec/shoes/text_block_dimensions_spec.rb
|
361
366
|
- spec/shoes/text_block_spec.rb
|
367
|
+
- spec/shoes/ui/picker_spec.rb
|
362
368
|
- spec/shoes/url_spec.rb
|
363
369
|
- spec/shoes/widget_spec.rb
|
364
370
|
- spec/shoes_spec.rb
|