sugarcube 0.18.0 → 0.18.1

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.
@@ -41,12 +41,18 @@ class UIView
41
41
  after_adjusted = nil
42
42
  end
43
43
 
44
- UIView.animateWithDuration( duration,
45
- delay: options[:delay] || 0,
46
- options: options[:options] || UIViewAnimationOptionCurveEaseInOut,
47
- animations: proc,
48
- completion: after_adjusted
49
- )
44
+ delay = options[:delay] || 0
45
+ if duration == 0 && delay == 0
46
+ animations.call
47
+ after_adjusted.call(true)
48
+ else
49
+ UIView.animateWithDuration( duration,
50
+ delay: delay,
51
+ options: options[:options] || UIViewAnimationOptionCurveEaseInOut,
52
+ animations: animations,
53
+ completion: after_adjusted
54
+ )
55
+ end
50
56
  nil
51
57
  end
52
58
 
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '0.18.0'
2
+ Version = '0.18.1'
3
3
  end
@@ -6,11 +6,18 @@ describe "UIView animation methods" do
6
6
  it 'should delta_to x:1 y:2' do
7
7
  @view.delta_to([1,2]).frame.should == CGRectMake(2,4,3,4)
8
8
  end
9
-
9
+
10
10
  it 'should rotate 45 degrees' do
11
11
  angle = 45*Math::PI/180
12
12
  @view.rotate_to(angle)
13
13
  current_angle = Math.atan2(@view.transform.b, @view.transform.a)
14
14
  current_angle.should == angle
15
15
  end
16
+
17
+ it 'should animate anything' do
18
+ UIView.animate {
19
+ @view.frame = [[0, 0], [0, 0]]
20
+ }
21
+ CGRectEqualToRect(@view.frame, [[0, 0], [0, 0]]).should == true
22
+ end
16
23
  end
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: 0.18.0
4
+ version: 0.18.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-02-15 00:00:00.000000000 Z
16
+ date: 2013-02-16 00:00:00.000000000 Z
17
17
  dependencies: []
18
18
  description: ! '== Description
19
19