sugarcube 1.5.5 → 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5bd88350a86ee4e4bedb8382ae815b7a6f593f3
4
- data.tar.gz: bee437d228cd18da4bb87a69ded96ac42ae5c7fe
3
+ metadata.gz: 2a55500123df09c7c936933927ec5c409d90b8f1
4
+ data.tar.gz: 82797a0f5287912218353408e62b5838d2489f2a
5
5
  SHA512:
6
- metadata.gz: 08fc26e8d84dfd3a5b83f27f1da1f3fc349eb93b822efe693615164afe2e65c16c27402a1bc53f716db4d3dc153648e79ec088b8005358eeeaf82751b95d4fee
7
- data.tar.gz: 54b8fc6295e7bc12375a98e13291506bd6f368ef8e1964beacbfa6e91f9b0154f5b5bc1bb852a203492a3659da54b47c2b740a115f64120e4b4f1dde7269b6ff
6
+ metadata.gz: 77c73ffdae08cea117e13c6e91194165ee56a8105ced60a7e78bb73ffb6acd9f6dab44955b6a27daeffbe5be2809fa189724ea7244254aebdb3182b08ca21b2e
7
+ data.tar.gz: 138fc138dd5d752051ffae176555ca48880898145076c0b122b33b52620bfd0feedb0194eef2f3485e16a1724be4a9aa7476bcc03de02192a45d8b48d34379a1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sugarcube (1.5.5)
4
+ sugarcube (1.5.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -811,6 +811,7 @@ UIBarButtonItem.alloc.initWithImage('portrait'.uiimage, landscapeImagePhone:'lan
811
811
  ```
812
812
 
813
813
  Example Usage:
814
+
814
815
  ```ruby
815
816
  toolbar = UIToolbar.new
816
817
  toolbar.items = [
@@ -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.showInRect(from, inView: view, animated: true)
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
 
@@ -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
@@ -28,11 +28,7 @@ class NSString
28
28
 
29
29
  # @return [UIImageView]
30
30
  def uiimageview
31
- image = UIImage.imageNamed(self)
32
- unless image
33
- NSLog("No image named #{self}")
34
- end
35
- UIImageView.alloc.initWithImage(image)
31
+ self.uiimage.uiimageview
36
32
  end
37
33
 
38
34
  end
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '1.5.5'
2
+ Version = '1.5.6'
3
3
  end
@@ -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.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-03-18 00:00:00.000000000 Z
14
+ date: 2014-04-10 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: |
17
17
  == Description