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.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/bin/shoes +1 -1
  3. data/bin/shoes-picker +5 -1
  4. data/bin/shoes-stub +1 -1
  5. data/ext/install/shoes.bat +2 -0
  6. data/lib/rubygems_plugin.rb +2 -2
  7. data/lib/shoes/app.rb +18 -19
  8. data/lib/shoes/arc.rb +8 -8
  9. data/lib/shoes/background.rb +4 -8
  10. data/lib/shoes/border.rb +4 -8
  11. data/lib/shoes/builtin_methods.rb +2 -2
  12. data/lib/shoes/button.rb +2 -9
  13. data/lib/shoes/check_button.rb +0 -12
  14. data/lib/shoes/color.rb +29 -34
  15. data/lib/shoes/common/background_element.rb +4 -0
  16. data/lib/shoes/common/fill.rb +9 -0
  17. data/lib/shoes/common/initialization.rb +59 -0
  18. data/lib/shoes/common/inspect.rb +20 -2
  19. data/lib/shoes/common/rotate.rb +10 -0
  20. data/lib/shoes/common/stroke.rb +9 -0
  21. data/lib/shoes/common/style.rb +21 -7
  22. data/lib/shoes/common/style_normalizer.rb +1 -3
  23. data/lib/shoes/common/ui_element.rb +10 -0
  24. data/lib/shoes/common/visibility.rb +4 -4
  25. data/lib/shoes/configuration.rb +4 -2
  26. data/lib/shoes/core/version.rb +1 -1
  27. data/lib/shoes/dialog.rb +2 -2
  28. data/lib/shoes/dimension.rb +78 -68
  29. data/lib/shoes/dimensions.rb +22 -10
  30. data/lib/shoes/download.rb +26 -10
  31. data/lib/shoes/dsl.rb +32 -51
  32. data/lib/shoes/gradient.rb +6 -13
  33. data/lib/shoes/image.rb +4 -9
  34. data/lib/shoes/input_box.rb +6 -9
  35. data/lib/shoes/internal_app.rb +16 -36
  36. data/lib/shoes/line.rb +29 -10
  37. data/lib/shoes/link.rb +13 -2
  38. data/lib/shoes/list_box.rb +33 -11
  39. data/lib/shoes/logger.rb +12 -13
  40. data/lib/shoes/mock/arc.rb +2 -0
  41. data/lib/shoes/mock/common_methods.rb +9 -0
  42. data/lib/shoes/mock/shape.rb +1 -1
  43. data/lib/shoes/mock/slot.rb +1 -0
  44. data/lib/shoes/oval.rb +13 -8
  45. data/lib/shoes/packager.rb +7 -1
  46. data/lib/shoes/point.rb +26 -3
  47. data/lib/shoes/progress.rb +6 -8
  48. data/lib/shoes/rect.rb +14 -10
  49. data/lib/shoes/shape.rb +28 -14
  50. data/lib/shoes/slot.rb +33 -24
  51. data/lib/shoes/slot_contents.rb +4 -4
  52. data/lib/shoes/star.rb +7 -16
  53. data/lib/shoes/text.rb +5 -3
  54. data/lib/shoes/text_block.rb +17 -16
  55. data/lib/shoes/text_block_dimensions.rb +1 -1
  56. data/lib/shoes/ui/cli.rb +12 -3
  57. data/lib/shoes/ui/picker.rb +64 -19
  58. data/lib/shoes/version.rb +1 -1
  59. data/shoes-core.gemspec +2 -2
  60. data/spec/shoes/animation_spec.rb +1 -1
  61. data/spec/shoes/app_spec.rb +4 -23
  62. data/spec/shoes/color_spec.rb +16 -1
  63. data/spec/shoes/common/style_normalizer_spec.rb +3 -3
  64. data/spec/shoes/common/style_spec.rb +42 -5
  65. data/spec/shoes/dimension_spec.rb +5 -7
  66. data/spec/shoes/dimensions_spec.rb +7 -7
  67. data/spec/shoes/download_spec.rb +49 -8
  68. data/spec/shoes/flow_spec.rb +1 -1
  69. data/spec/shoes/helpers/fake_element.rb +7 -0
  70. data/spec/shoes/helpers/sample17_helper.rb +3 -3
  71. data/spec/shoes/integration_spec.rb +1 -1
  72. data/spec/shoes/internal_app_spec.rb +8 -0
  73. data/spec/shoes/line_spec.rb +35 -3
  74. data/spec/shoes/link_spec.rb +24 -12
  75. data/spec/shoes/list_box_spec.rb +14 -2
  76. data/spec/shoes/point_spec.rb +28 -0
  77. data/spec/shoes/renamed_delegate_spec.rb +2 -2
  78. data/spec/shoes/shape_spec.rb +15 -2
  79. data/spec/shoes/shared_examples/changeable.rb +1 -1
  80. data/spec/shoes/shared_examples/common_methods.rb +1 -1
  81. data/spec/shoes/shared_examples/dsl/style.rb +1 -1
  82. data/spec/shoes/shared_examples/dsl/text_elements.rb +3 -3
  83. data/spec/shoes/shared_examples/dsl/video.rb +1 -1
  84. data/spec/shoes/shared_examples/dsl_app_context.rb +0 -1
  85. data/spec/shoes/shared_examples/parent.rb +1 -1
  86. data/spec/shoes/shared_examples/slot.rb +11 -5
  87. data/spec/shoes/shared_examples/state.rb +2 -2
  88. data/spec/shoes/shared_examples/style.rb +1 -1
  89. data/spec/shoes/spec_helper.rb +1 -1
  90. data/spec/shoes/text_block_spec.rb +20 -3
  91. data/spec/shoes/ui/picker_spec.rb +70 -0
  92. 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.pre3
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-01-06 00:00:00.000000000 Z
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