sugarcube 1.5.5 → 1.5.6
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/sugarcube-events.rb +0 -5
- data/lib/sugarcube-factories/uiactionsheet.rb +4 -1
- data/lib/sugarcube-gestures.rb +0 -4
- data/lib/sugarcube-uikit/nsstring.rb +1 -5
- data/lib/sugarcube/version.rb +1 -1
- data/spec/uiactionsheet_spec.rb +49 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a55500123df09c7c936933927ec5c409d90b8f1
|
4
|
+
data.tar.gz: 82797a0f5287912218353408e62b5838d2489f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77c73ffdae08cea117e13c6e91194165ee56a8105ced60a7e78bb73ffb6acd9f6dab44955b6a27daeffbe5be2809fa189724ea7244254aebdb3182b08ca21b2e
|
7
|
+
data.tar.gz: 138fc138dd5d752051ffae176555ca48880898145076c0b122b33b52620bfd0feedb0194eef2f3485e16a1724be4a9aa7476bcc03de02192a45d8b48d34379a1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/sugarcube-events.rb
CHANGED
@@ -12,9 +12,4 @@ Motion::Project::App.setup do |app|
|
|
12
12
|
Dir.glob(File.join(File.dirname(__FILE__), 'sugarcube-events/**/*.rb')).reverse.each do |file|
|
13
13
|
app.files.insert(insert_point, file)
|
14
14
|
end
|
15
|
-
|
16
|
-
cleanup = File.join(File.dirname(__FILE__), 'sugarcube/sugarcube_cleanup.rb')
|
17
|
-
uicontrol = File.join(File.dirname(__FILE__), 'sugarcube-events/uicontrol.rb')
|
18
|
-
uitextview = File.join(File.dirname(__FILE__), 'sugarcube-events/uitextview.rb')
|
19
|
-
app.files_dependencies uicontrol => [cleanup], uitextview => [cleanup]
|
20
15
|
end
|
@@ -78,6 +78,7 @@ class UIActionSheet
|
|
78
78
|
|
79
79
|
alert = self.alloc
|
80
80
|
alert.send('initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:', *args)
|
81
|
+
|
81
82
|
if options.key?(:style)
|
82
83
|
style = options[:style]
|
83
84
|
if style.respond_to?(:uiactionstyle)
|
@@ -85,6 +86,7 @@ class UIActionSheet
|
|
85
86
|
end
|
86
87
|
alert.actionSheetStyle = style
|
87
88
|
end
|
89
|
+
|
88
90
|
if options.fetch(:show, true)
|
89
91
|
if options.key?(:from)
|
90
92
|
from = options[:from]
|
@@ -95,7 +97,7 @@ class UIActionSheet
|
|
95
97
|
case from
|
96
98
|
when CGRect
|
97
99
|
view = UIApplication.sharedApplication.windows[0]
|
98
|
-
alert.
|
100
|
+
alert.showFromRect(from, inView: view, animated: true)
|
99
101
|
when UIBarButtonItem
|
100
102
|
alert.showFromBarButtonItem(from)
|
101
103
|
when UIToolbar
|
@@ -108,6 +110,7 @@ class UIActionSheet
|
|
108
110
|
raise "Unknown :from option #{from.inspect}"
|
109
111
|
end
|
110
112
|
end
|
113
|
+
|
111
114
|
alert
|
112
115
|
end
|
113
116
|
|
data/lib/sugarcube-gestures.rb
CHANGED
@@ -12,8 +12,4 @@ Motion::Project::App.setup do |app|
|
|
12
12
|
Dir.glob(File.join(File.dirname(__FILE__), 'sugarcube-gestures/**/*.rb')).reverse.each do |file|
|
13
13
|
app.files.insert(insert_point, file)
|
14
14
|
end
|
15
|
-
|
16
|
-
cleanup = File.join(File.dirname(__FILE__), 'sugarcube/sugarcube_cleanup.rb')
|
17
|
-
gestures = File.join(File.dirname(__FILE__), 'sugarcube-gestures/gestures.rb')
|
18
|
-
app.files_dependencies gestures => [cleanup]
|
19
15
|
end
|
data/lib/sugarcube/version.rb
CHANGED
data/spec/uiactionsheet_spec.rb
CHANGED
@@ -49,6 +49,55 @@ describe 'UIActionSheet' do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
it 'should have :from option that accepts CGRect' do
|
53
|
+
alert = UIActionSheet.alert('test', from: CGRect.new([0, 0], [320, 0]))
|
54
|
+
proper_wait 0.6
|
55
|
+
alert.visible?.should == true
|
56
|
+
alert.dismissWithClickedButtonIndex(alert.firstOtherButtonIndex, animated: false)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should have :from option that accepts UIBarButtonItem' do
|
60
|
+
button = UIBarButtonItem.done
|
61
|
+
toolbar = UIToolbar.alloc.initWithFrame(UIScreen.mainScreen.bounds)
|
62
|
+
toolbar.items = [button]
|
63
|
+
window = UIApplication.sharedApplication.windows[0]
|
64
|
+
window << toolbar
|
65
|
+
alert = UIActionSheet.alert('test', from: button)
|
66
|
+
proper_wait 0.6
|
67
|
+
alert.visible?.should == true
|
68
|
+
alert.dismissWithClickedButtonIndex(alert.firstOtherButtonIndex, animated: false)
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'should have :from option that accepts UIToolbar' do
|
72
|
+
view = UIToolbar.alloc.initWithFrame(UIScreen.mainScreen.bounds)
|
73
|
+
window = UIApplication.sharedApplication.windows[0]
|
74
|
+
window << view
|
75
|
+
alert = UIActionSheet.alert('test', from: view)
|
76
|
+
proper_wait 0.6
|
77
|
+
alert.visible?.should == true
|
78
|
+
alert.dismissWithClickedButtonIndex(alert.firstOtherButtonIndex, animated: false)
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'should have :from option that accepts UITabBar' do
|
82
|
+
view = UITabBar.alloc.initWithFrame(UIScreen.mainScreen.bounds)
|
83
|
+
window = UIApplication.sharedApplication.windows[0]
|
84
|
+
window << view
|
85
|
+
alert = UIActionSheet.alert('test', from: view)
|
86
|
+
proper_wait 0.6
|
87
|
+
alert.visible?.should == true
|
88
|
+
alert.dismissWithClickedButtonIndex(alert.firstOtherButtonIndex, animated: false)
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should have :from option that accepts UIView' do
|
92
|
+
view = UIView.alloc.initWithFrame(UIScreen.mainScreen.bounds)
|
93
|
+
window = UIApplication.sharedApplication.windows[0]
|
94
|
+
window << view
|
95
|
+
alert = UIActionSheet.alert('test', from: view)
|
96
|
+
proper_wait 0.6
|
97
|
+
alert.visible?.should == true
|
98
|
+
alert.dismissWithClickedButtonIndex(alert.firstOtherButtonIndex, animated: false)
|
99
|
+
end
|
100
|
+
|
52
101
|
it 'should add a button with << method' do
|
53
102
|
alert = UIActionSheet.alert('test', show: false)
|
54
103
|
alert << 'title'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarcube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin T.A. Gray
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |
|
17
17
|
== Description
|