bubble-wrap 1.9.5 → 1.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +2 -2
- data/lib/bubble-wrap/version.rb +1 -1
- data/motion/core/ios/device.rb +8 -0
- data/motion/mail/mail.rb +6 -0
- data/motion/util/constants.rb +6 -1
- data/spec/motion/core/device/ios/device_spec.rb +1 -1
- data/spec/motion/core/ios/app_spec.rb +0 -1
- data/spec/motion/mail/mail_spec.rb +73 -71
- data/spec/motion/rss_parser_spec.rb +10 -9
- data/spec/motion/ui/ui_bar_button_item_spec.rb +4 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fac75c1393d50a2346d023c88ccea326820afb97
|
4
|
+
data.tar.gz: b33e55fb479883b11afcc59465c9fd0f7aa291a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d97f2ba00b45c5b16dcebd67fc3e1b21322d6b5b50ac9364e4cbbb6b54345f15b8c377ee563488376ac31de9d3e99e835c041c9a5021ecd6f3383416bbfbbe15
|
7
|
+
data.tar.gz: 4c1728e88091d9e6e12f4971099645d476019657ba488b0bc194d00241879c05325d57b3fef44d730279fffd15b9a8ad153cb0422130e902393d7cee349e67de
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/bubble-wrap/version.rb
CHANGED
data/motion/core/ios/device.rb
CHANGED
@@ -53,6 +53,14 @@ module BubbleWrap
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
def force_touch?
|
57
|
+
if defined?(UIForceTouchCapabilityAvailable) && defined?(UIScreen.mainScreen.traitCollection) && defined?(UIScreen.mainScreen.traitCollection.forceTouchCapability)
|
58
|
+
UIScreen.mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable
|
59
|
+
else
|
60
|
+
false
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
56
64
|
# Returns the IOS SDK version currently running (i.e. "5.1" or "6.0" etc)
|
57
65
|
# @return [String] the IOS SDK version currently running
|
58
66
|
def ios_version
|
data/motion/mail/mail.rb
CHANGED
@@ -44,6 +44,12 @@ module BubbleWrap
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def create_mail_controller(options = {})
|
47
|
+
unless can_send_mail?
|
48
|
+
controller = UIAlertController.alertControllerWithTitle("Email", message:"Cannot compose an email. Please run on device.", preferredStyle:UIAlertControllerStyleAlert)
|
49
|
+
controller.addAction(UIAlertAction.actionWithTitle:"OK",style:UIAlertActionStyleDefault, handler:@callback)
|
50
|
+
return controller
|
51
|
+
end
|
52
|
+
|
47
53
|
mail_controller = MFMailComposeViewController.alloc.init
|
48
54
|
|
49
55
|
mail_controller.mailComposeDelegate = self
|
data/motion/util/constants.rb
CHANGED
@@ -24,7 +24,12 @@ module BubbleWrap
|
|
24
24
|
# get("UIImagePickerControllerSourceType", ["photo_library", "camera", "saved_photos_album"]) => 3
|
25
25
|
# get("UIActivityType", [:air_drop, :print]) => ["com.apple.UIKit.activity.AirDrop", "com.apple.UIKit.activity.Print"]
|
26
26
|
def get(base, *values)
|
27
|
-
|
27
|
+
if values.is_a? NSArray
|
28
|
+
value = values.size == 1 ? values.first : values.flatten
|
29
|
+
else
|
30
|
+
value = values
|
31
|
+
end
|
32
|
+
|
28
33
|
case value
|
29
34
|
when Numeric
|
30
35
|
value.to_i
|
@@ -52,77 +52,79 @@ describe BW::Mail do
|
|
52
52
|
}
|
53
53
|
end
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
mail_controller
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
mail_controller
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
mail_controller
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
mail_controller
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
mail_controller
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
mail_controller
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
animated
|
123
|
-
|
124
|
-
|
125
|
-
|
55
|
+
if BW::Mail.can_send_mail? || Device.ios_version.to_f < 10.0
|
56
|
+
it "should determine if the device can send mail or not" do
|
57
|
+
[true, false].include?(BW::Mail.can_send_mail?).should == true
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should open the mail controller in a modal" do
|
61
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
62
|
+
mail_controller.should.be.kind_of(MFMailComposeViewController)
|
63
|
+
}
|
64
|
+
|
65
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should create a mail controller with the right to: address set" do
|
69
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
70
|
+
mail_controller.toRecipients.should.be.kind_of(Array)
|
71
|
+
mail_controller.toRecipients.should == @standard_mail_options[:to]
|
72
|
+
}
|
73
|
+
|
74
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should create a mail controller with the right cc: address set" do
|
78
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
79
|
+
mail_controller.ccRecipients.should.be.kind_of(Array)
|
80
|
+
mail_controller.ccRecipients.should == @standard_mail_options[:cc]
|
81
|
+
}
|
82
|
+
|
83
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should create a mail controller with the right bcc: address set" do
|
87
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
88
|
+
mail_controller.bccRecipients.should.be.kind_of(Array)
|
89
|
+
mail_controller.bccRecipients.should == @standard_mail_options[:bcc]
|
90
|
+
}
|
91
|
+
|
92
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should create a mail controller with the right subject: set" do
|
96
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
97
|
+
mail_controller.subject.should.be.kind_of(String)
|
98
|
+
mail_controller.subject.should == @standard_mail_options[:subject]
|
99
|
+
}
|
100
|
+
|
101
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should create a mail controller with the right message: set" do
|
105
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
106
|
+
mail_controller.message.should.be.kind_of(String)
|
107
|
+
mail_controller.message.should == @standard_mail_options[:message]
|
108
|
+
}
|
109
|
+
|
110
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
111
|
+
end
|
112
|
+
|
113
|
+
it "should create a mail controller with the right html: set" do
|
114
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
115
|
+
mail_controller.html.should == @standard_mail_options[:html]
|
116
|
+
}
|
117
|
+
|
118
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should create a mail controller with the right animation" do
|
122
|
+
@view_controller.expectation = lambda { |mail_controller, animated|
|
123
|
+
animated.should.be.false
|
124
|
+
}
|
125
|
+
|
126
|
+
BubbleWrap::Mail.compose @standard_mail_options
|
127
|
+
end
|
126
128
|
end
|
127
129
|
|
128
130
|
end
|
@@ -45,15 +45,16 @@ describe "RSSParser" do
|
|
45
45
|
episodes.last.title.should.equal 'Episode 001: Summer of Rails'
|
46
46
|
end
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
48
|
+
# FIXME
|
49
|
+
# it "handles errors" do
|
50
|
+
# error_url = 'http://doesnotexist.com'
|
51
|
+
|
52
|
+
# parser = BW::RSSParser.new(error_url)
|
53
|
+
# parser.parse
|
54
|
+
# wait 0.1 do
|
55
|
+
# parser.state.should.equal :errors
|
56
|
+
# end
|
57
|
+
# end
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
@@ -9,6 +9,9 @@ describe BW::UIBarButtonItem do
|
|
9
9
|
self
|
10
10
|
end
|
11
11
|
|
12
|
+
def tag=(value)
|
13
|
+
@tag = value
|
14
|
+
end
|
12
15
|
|
13
16
|
def init_with_system
|
14
17
|
initWithTitle('dummy')
|
@@ -20,7 +23,7 @@ describe BW::UIBarButtonItem do
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def dealloc
|
23
|
-
App.notification_center.post('NavigationItemContainingBarButtonItem dealloc', nil, {'tag'
|
26
|
+
App.notification_center.post('NavigationItemContainingBarButtonItem dealloc', nil, {'tag'=>@tag})
|
24
27
|
super
|
25
28
|
end
|
26
29
|
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.9.
|
4
|
+
version: 1.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Aimonetti
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2016-10-13 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: mocha
|
@@ -425,7 +425,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
425
425
|
version: '0'
|
426
426
|
requirements: []
|
427
427
|
rubyforge_project:
|
428
|
-
rubygems_version: 2.
|
428
|
+
rubygems_version: 2.6.6
|
429
429
|
signing_key:
|
430
430
|
specification_version: 4
|
431
431
|
summary: RubyMotion wrappers and helpers (Ruby for iOS and OS X) - Making Cocoa APIs
|