bubble-wrap 1.7.1 → 1.8.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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.travis.yml +1 -1
  4. data/GETTING_STARTED.md +1 -1
  5. data/Gemfile.lock +10 -10
  6. data/README.md +266 -122
  7. data/Rakefile +1 -1
  8. data/bubble-wrap.gemspec +7 -6
  9. data/lib/bubble-wrap.rb +0 -1
  10. data/lib/bubble-wrap/all.rb +13 -1
  11. data/lib/bubble-wrap/location.rb +1 -1
  12. data/lib/bubble-wrap/motion.rb +10 -0
  13. data/lib/bubble-wrap/rss_parser.rb +0 -1
  14. data/lib/bubble-wrap/test.rb +1 -0
  15. data/lib/bubble-wrap/version.rb +1 -1
  16. data/motion/core/device/ios/camera.rb +12 -1
  17. data/motion/core/ios/device.rb +7 -1
  18. data/motion/core/json.rb +1 -1
  19. data/motion/core/osx/app.rb +11 -1
  20. data/motion/core/time.rb +27 -4
  21. data/motion/location/location.rb +6 -2
  22. data/motion/mail/mail.rb +4 -0
  23. data/motion/media/player.rb +2 -1
  24. data/motion/motion/motion.rb +421 -0
  25. data/motion/reactor/deferrable.rb +29 -3
  26. data/motion/reactor/eventable.rb +3 -1
  27. data/motion/reactor/thread_aware_deferrable.rb +37 -0
  28. data/motion/rss_parser.rb +11 -21
  29. data/motion/sms/sms.rb +4 -0
  30. data/motion/ui/ui_alert_view.rb +3 -1
  31. data/motion/ui/ui_control_wrapper.rb +27 -0
  32. data/motion/ui/ui_view_wrapper.rb +1 -7
  33. data/motion/util/constants.rb +1 -1
  34. data/samples/alert/Gemfile +1 -0
  35. data/samples/alert/Gemfile.lock +16 -0
  36. data/samples/alert/Rakefile +1 -1
  37. data/samples/camera/Gemfile +2 -1
  38. data/samples/camera/Gemfile.lock +16 -0
  39. data/samples/camera/Rakefile +1 -1
  40. data/samples/gesture/Gemfile +2 -1
  41. data/samples/gesture/Gemfile.lock +9 -3
  42. data/samples/gesture/Rakefile +1 -1
  43. data/samples/location/Gemfile +3 -1
  44. data/samples/location/Gemfile.lock +18 -0
  45. data/samples/location/Rakefile +4 -2
  46. data/samples/location/app/controllers/{image_list_controller.rb → places_list_controller.rb} +0 -0
  47. data/samples/media/Gemfile +4 -0
  48. data/samples/media/Gemfile.lock +16 -0
  49. data/samples/media/Rakefile +1 -1
  50. data/samples/osx/Gemfile +3 -1
  51. data/samples/osx/Gemfile.lock +5 -1
  52. data/spec/lib/bubble-wrap/requirement_spec.rb +2 -2
  53. data/spec/motion/core/app_spec.rb +23 -0
  54. data/spec/motion/core/device/ios/camera_spec.rb +1 -1
  55. data/spec/motion/core/device/ios/device_spec.rb +6 -0
  56. data/spec/motion/core/ios/app_spec.rb +9 -24
  57. data/spec/motion/core/json_spec.rb +30 -10
  58. data/spec/motion/core/osx/app_spec.rb +2 -1
  59. data/spec/motion/core/time_spec.rb +34 -1
  60. data/spec/motion/location/location_spec.rb +6 -0
  61. data/spec/motion/mail/mail_spec.rb +20 -16
  62. data/spec/motion/motion/core_motion_spec.rb +231 -0
  63. data/spec/motion/reactor/deferrable_spec.rb +81 -0
  64. data/spec/motion/reactor/eventable_spec.rb +11 -0
  65. data/spec/motion/reactor/thread_aware_deferrable_spec.rb +85 -0
  66. data/spec/motion/rss_parser_spec.rb +11 -21
  67. data/spec/motion/sms/sms_spec.rb +11 -6
  68. data/spec/motion/ui/ui_alert_view_spec.rb +23 -0
  69. data/spec/motion/ui/ui_control_wrapper_spec.rb +24 -0
  70. metadata +58 -38
  71. data/lib/bubble-wrap/http.rb +0 -7
@@ -1,7 +1,7 @@
1
1
  # Mocking the presentViewController
2
2
  class MessageViewController < UIViewController
3
3
  attr_accessor :expectation
4
-
4
+
5
5
  def presentModalViewController(modal, animated: animated)
6
6
  expectation.call modal, animated
7
7
  end
@@ -32,21 +32,26 @@ describe BW::SMS do
32
32
  animated: false
33
33
  }
34
34
  end
35
-
35
+
36
+ it "should determine if the device can send a text message" do
37
+ # False in simulator, but true on a device with SMS capability.
38
+ BW::SMS.can_send_sms?.should == (Device.iphone? && !Device.simulator?)
39
+ end
40
+
36
41
  it "should open the message controller in a modal" do
37
42
  @view_controller.expectation = lambda { |message_controller, animated|
38
43
  message_controller.should.be.kind_of(MFMessageComposeViewController)
39
44
  }
40
-
45
+
41
46
  BW::SMS.compose @standard_message_options
42
47
  end
43
-
48
+
44
49
  it "should create a message controller with the right recipient address set" do
45
50
  @view_controller.expectation = lambda { |message_controller, animated|
46
51
  message_controller.recipients.should.be.kind_of(Array)
47
52
  message_controller.recipients.should == @standard_message_options[:to]
48
53
  }
49
-
54
+
50
55
  BubbleWrap::SMS.compose @standard_message_options
51
56
  end
52
57
 
@@ -56,7 +61,7 @@ describe BW::SMS do
56
61
  message_controller.body.should.be.kind_of(String)
57
62
  message_controller.body.should == @standard_message_options[:message]
58
63
  }
59
-
64
+
60
65
  BubbleWrap::SMS.compose @standard_message_options
61
66
  end
62
67
 
@@ -185,6 +185,7 @@ describe BW::UIAlertView do
185
185
  :title => "title",
186
186
  :message => "message",
187
187
  :style => :plain_text_input,
188
+ :placeholder => "placeholder",
188
189
  :buttons => "button title",
189
190
  :cancel_button_index => 0,
190
191
  :will_present => -> { true },
@@ -312,6 +313,7 @@ describe BW::UIAlertView do
312
313
  :title => "title",
313
314
  :message => "message",
314
315
  :style => :plain_text_input,
316
+ :placeholder => "placeholder",
315
317
  :buttons => "button title",
316
318
  :cancel_button_index => 0,
317
319
  :will_present => -> { true },
@@ -403,6 +405,10 @@ describe BW::UIAlertView do
403
405
  @subject.plain_text_field.should.be.kind_of(UITextField)
404
406
  end
405
407
 
408
+ it "has no placeholder" do
409
+ @subject.plain_text_field.placeholder.should.be.nil
410
+ end
411
+
406
412
  it "has no secure text field" do
407
413
  @subject.secure_text_field.should.be.nil
408
414
  end
@@ -418,6 +424,20 @@ describe BW::UIAlertView do
418
424
 
419
425
  ###############################################################################################
420
426
 
427
+ describe "given a text placeholder" do
428
+ before do
429
+ @options = {placeholder: "placeholder"}
430
+ @subject = BW::UIAlertView.plain_text_input(@options)
431
+ end
432
+
433
+ behaves_like "an instance with no options"
434
+
435
+ it "has the correct placeholder" do
436
+ @subject.plain_text_field.placeholder.should == "placeholder"
437
+ end
438
+ end
439
+ ###############################################################################################
440
+
421
441
  describe "given no options with a block" do
422
442
  before do
423
443
  @options = {}
@@ -454,6 +474,7 @@ describe BW::UIAlertView do
454
474
  :title => "title",
455
475
  :message => "message",
456
476
  :style => :default,
477
+ :placeholder => "placeholder",
457
478
  :buttons => "button title",
458
479
  :cancel_button_index => 0,
459
480
  :will_present => -> { true },
@@ -596,6 +617,7 @@ describe BW::UIAlertView do
596
617
  :title => "title",
597
618
  :message => "message",
598
619
  :style => :default,
620
+ :placeholder => "placeholder",
599
621
  :buttons => "button title",
600
622
  :cancel_button_index => 0,
601
623
  :will_present => -> { true },
@@ -738,6 +760,7 @@ describe BW::UIAlertView do
738
760
  :title => "title",
739
761
  :message => "message",
740
762
  :style => :default,
763
+ :placeholder => "placeholder",
741
764
  :buttons => "button title",
742
765
  :cancel_button_index => 0,
743
766
  :will_present => -> { true },
@@ -23,6 +23,21 @@ describe BW::UIControlWrapper do
23
23
  @touched.should.equal ['touched']
24
24
  end
25
25
 
26
+ it "allows bitwise operators" do
27
+ @subject.when(UIControlEventTouchUpInside | UIControlEventTouchUpOutside) do
28
+ @touched << 'touched'
29
+ end
30
+
31
+ @subject.sendActionsForControlEvents(UIControlEventTouchUpInside)
32
+ @touched.should.equal ['touched']
33
+
34
+ @touched = []
35
+ @touched.should.equal []
36
+
37
+ @subject.sendActionsForControlEvents(UIControlEventTouchUpOutside)
38
+ @touched.should.equal ['touched']
39
+ end
40
+
26
41
  it "BubbleWrap.use_weak_callbacks=true removes cyclic references" do
27
42
  class ControlSuperView < UIView
28
43
  def initWithFrame(frame)
@@ -69,5 +84,14 @@ describe BW::UIControlWrapper do
69
84
  @subject.sendActionsForControlEvents(UIControlEventTouchUpInside)
70
85
  @touched.should.equal ['for the very first time', 'touched']
71
86
  end
87
+
88
+ it "allows symbols for actions" do
89
+ @subject.when(:touch_up_inside) do
90
+ @touched << 'touched'
91
+ end
92
+
93
+ @subject.sendActionsForControlEvents(UIControlEventTouchUpInside)
94
+ @touched.should.equal ['touched']
95
+ end
72
96
  end
73
97
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bubble-wrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Aimonetti
@@ -14,78 +14,78 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2014-08-29 00:00:00.000000000 Z
17
+ date: 2015-03-13 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
- name: bubble-wrap-http
20
+ name: mocha
21
21
  requirement: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - '='
23
+ - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 1.7.1
26
- type: :runtime
25
+ version: '0.11'
26
+ type: :development
27
27
  prerelease: false
28
28
  version_requirements: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - '='
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 1.7.1
32
+ version: '0.11'
33
33
  - !ruby/object:Gem::Dependency
34
- name: mocha
34
+ name: mocha-on-bacon
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '='
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.11.4
39
+ version: '0.2'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '='
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.11.4
46
+ version: '0.2'
47
47
  - !ruby/object:Gem::Dependency
48
- name: mocha-on-bacon
48
+ name: bacon
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '1.2'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0'
60
+ version: '1.2'
61
61
  - !ruby/object:Gem::Dependency
62
- name: bacon
62
+ name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0'
67
+ version: '10.0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '0'
74
+ version: '10.0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: rake
76
+ name: webstub
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0'
81
+ version: '1.1'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: '1.1'
89
89
  description: RubyMotion wrappers and helpers (Ruby for iOS and OS X) - Making Cocoa
90
90
  APIs more Ruby like, one API at a time. Fork away and send your pull request.
91
91
  email:
@@ -95,11 +95,12 @@ email:
95
95
  - clay.allsopp@gmail.com
96
96
  - dylan@dylanmarkow.com
97
97
  - jan@dreimannzelt.de
98
- - mneorr@gmail.com
98
+ - marin2211@gmail.com
99
99
  executables: []
100
100
  extensions: []
101
101
  extra_rdoc_files:
102
102
  - lib/bubble-wrap/ext/motion_project_app.rb
103
+ - lib/bubble-wrap/motion.rb
103
104
  - motion/core.rb
104
105
  - motion/core/app.rb
105
106
  - motion/core/device.rb
@@ -130,6 +131,7 @@ extra_rdoc_files:
130
131
  - motion/mail/result.rb
131
132
  - motion/media/media.rb
132
133
  - motion/media/player.rb
134
+ - motion/motion/motion.rb
133
135
  - motion/network-indicator/network-indicator.rb
134
136
  - motion/reactor.rb
135
137
  - motion/reactor/default_deferrable.rb
@@ -138,6 +140,7 @@ extra_rdoc_files:
138
140
  - motion/reactor/future.rb
139
141
  - motion/reactor/periodic_timer.rb
140
142
  - motion/reactor/queue.rb
143
+ - motion/reactor/thread_aware_deferrable.rb
141
144
  - motion/reactor/timer.rb
142
145
  - motion/rss_parser.rb
143
146
  - motion/shortcut.rb
@@ -178,8 +181,11 @@ extra_rdoc_files:
178
181
  - spec/motion/mail/mail_spec.rb
179
182
  - spec/motion/mail/result_spec.rb
180
183
  - spec/motion/media/player_spec.rb
184
+ - spec/motion/motion/core_motion_spec.rb
181
185
  - spec/motion/network-indicator/network_indicator_spec.rb
186
+ - spec/motion/reactor/deferrable_spec.rb
182
187
  - spec/motion/reactor/eventable_spec.rb
188
+ - spec/motion/reactor/thread_aware_deferrable_spec.rb
183
189
  - spec/motion/reactor_spec.rb
184
190
  - spec/motion/rss_parser_spec.rb
185
191
  - spec/motion/sms/result_spec.rb
@@ -194,9 +200,9 @@ extra_rdoc_files:
194
200
  - spec/motion/util/constants_spec.rb
195
201
  - spec/motion/util/deprecated_spec.rb
196
202
  files:
197
- - .gitignore
198
- - .travis.yml
199
- - .yardopts
203
+ - ".gitignore"
204
+ - ".travis.yml"
205
+ - ".yardopts"
200
206
  - CHANGELOG.md
201
207
  - GEM.md
202
208
  - GETTING_STARTED.md
@@ -214,11 +220,11 @@ files:
214
220
  - lib/bubble-wrap/ext.rb
215
221
  - lib/bubble-wrap/ext/motion_project_app.rb
216
222
  - lib/bubble-wrap/font.rb
217
- - lib/bubble-wrap/http.rb
218
223
  - lib/bubble-wrap/loader.rb
219
224
  - lib/bubble-wrap/location.rb
220
225
  - lib/bubble-wrap/mail.rb
221
226
  - lib/bubble-wrap/media.rb
227
+ - lib/bubble-wrap/motion.rb
222
228
  - lib/bubble-wrap/network-indicator.rb
223
229
  - lib/bubble-wrap/reactor.rb
224
230
  - lib/bubble-wrap/requirement.rb
@@ -258,6 +264,7 @@ files:
258
264
  - motion/mail/result.rb
259
265
  - motion/media/media.rb
260
266
  - motion/media/player.rb
267
+ - motion/motion/motion.rb
261
268
  - motion/network-indicator/network-indicator.rb
262
269
  - motion/reactor.rb
263
270
  - motion/reactor/default_deferrable.rb
@@ -266,6 +273,7 @@ files:
266
273
  - motion/reactor/future.rb
267
274
  - motion/reactor/periodic_timer.rb
268
275
  - motion/reactor/queue.rb
276
+ - motion/reactor/thread_aware_deferrable.rb
269
277
  - motion/reactor/timer.rb
270
278
  - motion/rss_parser.rb
271
279
  - motion/shortcut.rb
@@ -286,12 +294,14 @@ files:
286
294
  - resources/test.mp3
287
295
  - samples/alert/.gitignore
288
296
  - samples/alert/Gemfile
297
+ - samples/alert/Gemfile.lock
289
298
  - samples/alert/Rakefile
290
299
  - samples/alert/app/app_delegate.rb
291
300
  - samples/alert/app/controllers/alert_view_controller.rb
292
301
  - samples/alert/resources/Default-568h@2x.png
293
302
  - samples/alert/spec/main_spec.rb
294
303
  - samples/camera/Gemfile
304
+ - samples/camera/Gemfile.lock
295
305
  - samples/camera/README.md
296
306
  - samples/camera/Rakefile
297
307
  - samples/camera/app/app_delegate.rb
@@ -310,13 +320,16 @@ files:
310
320
  - samples/gesture/spec/main_spec.rb
311
321
  - samples/location/.gitignore
312
322
  - samples/location/Gemfile
323
+ - samples/location/Gemfile.lock
313
324
  - samples/location/README.md
314
325
  - samples/location/Rakefile
315
326
  - samples/location/app/app_delegate.rb
316
- - samples/location/app/controllers/image_list_controller.rb
327
+ - samples/location/app/controllers/places_list_controller.rb
317
328
  - samples/location/app/models/places.rb
318
329
  - samples/location/spec/main_spec.rb
319
330
  - samples/media/.gitignore
331
+ - samples/media/Gemfile
332
+ - samples/media/Gemfile.lock
320
333
  - samples/media/Rakefile
321
334
  - samples/media/app/app_delegate.rb
322
335
  - samples/media/app/controllers/play_controller.rb
@@ -358,8 +371,11 @@ files:
358
371
  - spec/motion/mail/mail_spec.rb
359
372
  - spec/motion/mail/result_spec.rb
360
373
  - spec/motion/media/player_spec.rb
374
+ - spec/motion/motion/core_motion_spec.rb
361
375
  - spec/motion/network-indicator/network_indicator_spec.rb
376
+ - spec/motion/reactor/deferrable_spec.rb
362
377
  - spec/motion/reactor/eventable_spec.rb
378
+ - spec/motion/reactor/thread_aware_deferrable_spec.rb
363
379
  - spec/motion/reactor_spec.rb
364
380
  - spec/motion/rss_parser_spec.rb
365
381
  - spec/motion/sms/result_spec.rb
@@ -374,7 +390,8 @@ files:
374
390
  - spec/motion/util/constants_spec.rb
375
391
  - spec/motion/util/deprecated_spec.rb
376
392
  homepage: http://rubymotion.github.io/BubbleWrap/
377
- licenses: []
393
+ licenses:
394
+ - MIT
378
395
  metadata: {}
379
396
  post_install_message:
380
397
  rdoc_options: []
@@ -382,17 +399,17 @@ require_paths:
382
399
  - lib
383
400
  required_ruby_version: !ruby/object:Gem::Requirement
384
401
  requirements:
385
- - - '>='
402
+ - - ">="
386
403
  - !ruby/object:Gem::Version
387
404
  version: '0'
388
405
  required_rubygems_version: !ruby/object:Gem::Requirement
389
406
  requirements:
390
- - - '>='
407
+ - - ">="
391
408
  - !ruby/object:Gem::Version
392
409
  version: '0'
393
410
  requirements: []
394
411
  rubyforge_project:
395
- rubygems_version: 2.0.3
412
+ rubygems_version: 2.2.0
396
413
  signing_key:
397
414
  specification_version: 4
398
415
  summary: RubyMotion wrappers and helpers (Ruby for iOS and OS X) - Making Cocoa APIs
@@ -426,8 +443,11 @@ test_files:
426
443
  - spec/motion/mail/mail_spec.rb
427
444
  - spec/motion/mail/result_spec.rb
428
445
  - spec/motion/media/player_spec.rb
446
+ - spec/motion/motion/core_motion_spec.rb
429
447
  - spec/motion/network-indicator/network_indicator_spec.rb
448
+ - spec/motion/reactor/deferrable_spec.rb
430
449
  - spec/motion/reactor/eventable_spec.rb
450
+ - spec/motion/reactor/thread_aware_deferrable_spec.rb
431
451
  - spec/motion/reactor_spec.rb
432
452
  - spec/motion/rss_parser_spec.rb
433
453
  - spec/motion/sms/result_spec.rb
@@ -1,7 +0,0 @@
1
- require 'bubble-wrap/version' unless defined?(BubbleWrap::VERSION)
2
- require 'bubble-wrap/loader'
3
- require 'bubble-wrap/network-indicator'
4
- require 'bubble-wrap-http'
5
- Motion::Project::App.warn "BubbleWrap::HTTP is deprecated and will be removed, see https://github.com/rubymotion/BubbleWrap/issues/308"
6
- Motion::Project::App.warn "Switch to a different networking library soon - consider AFNetworking: http://afnetworking.com/"
7
- Motion::Project::App.warn "You can use the 'bubble-wrap-http' gem if you need compatibility: https://github.com/rubymotion/BubbleWrap-HTTP"