sugarcube 2.4.2 → 2.5.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.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/ios/sugarcube-animations/uiview.rb +60 -0
- data/lib/ios/sugarcube-factories/nserror.rb +1 -4
- data/lib/ios/sugarcube-factories/uialertcontroller.rb +1 -2
- data/lib/ios/sugarcube-factories/uilabel.rb +25 -0
- data/lib/ios/sugarcube-uikit/uifont.rb +8 -1
- data/lib/version.rb +1 -1
- data/spec/all/anonymous_spec.rb +6 -6
- data/spec/ios/factories_spec.rb +35 -0
- data/spec/ios/pipes_spec.rb +20 -12
- data/spec/ios/symbol_constants_spec.rb +137 -137
- data/spec/ios/uifont_spec.rb +21 -0
- data/spec/ios/uiview_animation_tumble_spec.rb +22 -6
- data/spec/osx/symbol_constants_spec.rb +33 -33
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16ea6c47cae791a68ea713a9464b1b0230470d9e
|
4
|
+
data.tar.gz: 94efffbbdc277406a470e99dab8c08508f4c63e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3dbd9bb862ea60d4181c5191b5b74b48fee9d83a134975020312bb804c7867a299e2bbd0be9fb8cf11d1f13c55d28763304bf1f5177661af24e02db9d1e6a99
|
7
|
+
data.tar.gz: d09cbdc67385118f2b440303a8caebceee5895de9651bea8dddf790083a7657cf00d060b36e9f146fafd0f82eb844ae9960f499049535e95d10b539443958ad8
|
data/README.md
CHANGED
@@ -372,7 +372,7 @@ the prefix is "on" instead of "when" (e.g. "on_pan" instead of "when_panned")
|
|
372
372
|
|
373
373
|
```ruby
|
374
374
|
view.on_pan do |gesture|
|
375
|
-
location = gesture.
|
375
|
+
location = gesture.locationInView(view)
|
376
376
|
end
|
377
377
|
|
378
378
|
# other gesture methods, with common options:
|
@@ -989,6 +989,11 @@ view.shake # great for showing invalid form elements
|
|
989
989
|
view.tumble # great way to dismiss an alert-like-view
|
990
990
|
# tumbles in the other direction (towards the right side instead of left)
|
991
991
|
view.tumble(side: :right)
|
992
|
+
# wow, this is a SuperGoodDeleteWiggle! https://github.com/mxcl/SuperGoodDeleteWiggle
|
993
|
+
view.wiggle
|
994
|
+
view.dont_wiggle
|
995
|
+
# if you modify the AppDelegate to load the WiggleAnimationController you can
|
996
|
+
# see an example of this animation in action.
|
992
997
|
|
993
998
|
# the complement to 'tumble' is 'tumble_in' - the view starts above the window
|
994
999
|
# and drops in with the same kind of animation as 'tumble'. Before you call
|
@@ -560,4 +560,64 @@ class UIView
|
|
560
560
|
end
|
561
561
|
end
|
562
562
|
|
563
|
+
# and this "SuperGoodDeleteWiggle" is an aptly named animation care
|
564
|
+
# of mxcl (of PromiseKit, YOLOKit, and if he used RubyMotion I'm 99%
|
565
|
+
# sure he would be using SugarCube - see his "initWith...F**It' repo
|
566
|
+
# if you don't believe me)
|
567
|
+
# https://github.com/mxcl/SuperGoodDeleteWiggle
|
568
|
+
#
|
569
|
+
# Note: doesn't accept a "completion" block, because it's an ongoing animation
|
570
|
+
def wiggle
|
571
|
+
@wiggle_angle ||= 0.035
|
572
|
+
@wiggle_offset ||= 0
|
573
|
+
@wiggle_transform ||= -0.5
|
574
|
+
|
575
|
+
self.layer.transform = CATransform3DMakeRotation(@wiggle_angle, 0, 0, 1.0)
|
576
|
+
|
577
|
+
@wiggle_angle = -@wiggle_angle
|
578
|
+
|
579
|
+
@wiggle_offset += 0.03
|
580
|
+
if @wiggle_offset > 0.9
|
581
|
+
@wiggle_offset -= 0.9
|
582
|
+
end
|
583
|
+
|
584
|
+
@wiggle_transform = -@wiggle_transform
|
585
|
+
|
586
|
+
animation = CABasicAnimation.animationWithKeyPath('transform')
|
587
|
+
animation.toValue = NSValue.valueWithCATransform3D CATransform3DMakeRotation(@wiggle_angle, 0, 0, 1.0)
|
588
|
+
animation.repeatCount = Float::MAX
|
589
|
+
animation.duration = 0.12
|
590
|
+
animation.autoreverses = true
|
591
|
+
animation.timeOffset = @wiggle_offset
|
592
|
+
self.layer.addAnimation(animation, forKey: 'wiggle_rotate')
|
593
|
+
|
594
|
+
animation = CABasicAnimation.animationWithKeyPath('transform.translation.y')
|
595
|
+
animation.duration = 0.08
|
596
|
+
animation.repeatCount = Float::MAX
|
597
|
+
animation.autoreverses = true
|
598
|
+
animation.fromValue = @wiggle_transform
|
599
|
+
animation.toValue = -@wiggle_transform
|
600
|
+
animation.fillMode = KCAFillModeForwards
|
601
|
+
animation.timeOffset = @wiggle_offset
|
602
|
+
self.layer.addAnimation(animation, forKey: 'wiggle_translate_y')
|
603
|
+
|
604
|
+
animation = CABasicAnimation.animationWithKeyPath('transform.translation.x')
|
605
|
+
animation.duration = 0.09
|
606
|
+
animation.repeatCount = Float::MAX
|
607
|
+
animation.autoreverses = true
|
608
|
+
animation.fromValue = @wiggle_transform
|
609
|
+
animation.toValue = -@wiggle_transform
|
610
|
+
animation.fillMode = KCAFillModeForwards
|
611
|
+
animation.timeOffset = @wiggle_offset + 0.6
|
612
|
+
self.layer.addAnimation(animation, forKey: 'wiggle_translate_x')
|
613
|
+
end
|
614
|
+
alias super_good_delete_wiggle wiggle
|
615
|
+
|
616
|
+
def dont_wiggle
|
617
|
+
self.layer.removeAnimationForKey('wiggle_rotate')
|
618
|
+
self.layer.removeAnimationForKey('wiggle_translate_y')
|
619
|
+
self.layer.removeAnimationForKey('wiggle_translate_x')
|
620
|
+
self.layer.transform = CATransform3DIdentity
|
621
|
+
end
|
622
|
+
|
563
623
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class UIAlertController
|
2
|
-
|
3
2
|
attr_accessor :sugarcube_handler
|
4
3
|
|
5
4
|
# @example
|
@@ -12,7 +11,7 @@ class UIAlertController
|
|
12
11
|
options = title
|
13
12
|
title = options[:title]
|
14
13
|
message = options[:message]
|
15
|
-
elsif options.is_a?
|
14
|
+
elsif options.is_a?(String)
|
16
15
|
message = options
|
17
16
|
options = more_options
|
18
17
|
else
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class UILabel
|
2
|
+
|
3
|
+
# UILabel.new('test')
|
4
|
+
# UILabel.new('test', another_label.font)
|
5
|
+
# UILabel.new('test', 'Helvetica')
|
6
|
+
# UILabel.new('test', 'Helvetica', 20)
|
7
|
+
def self.new(text=nil, font=nil, size=nil)
|
8
|
+
return super() if text.nil?
|
9
|
+
|
10
|
+
font = font.uifont(size) if font.respond_to?(:uifont)
|
11
|
+
label = self.alloc.initWithFrame([[0, 0], [0, 0]])
|
12
|
+
if text.is_a?(NSAttributedString)
|
13
|
+
label.attributedText = text
|
14
|
+
else
|
15
|
+
label.text = text
|
16
|
+
end
|
17
|
+
if font
|
18
|
+
label.font = font
|
19
|
+
end
|
20
|
+
label.backgroundColor = :clear.uicolor
|
21
|
+
label.sizeToFit
|
22
|
+
label
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/lib/version.rb
CHANGED
data/spec/all/anonymous_spec.rb
CHANGED
@@ -38,9 +38,9 @@ describe "SugarCube::Anonymous" do
|
|
38
38
|
@h.falsey?.should == false
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
it 'should raise NoMethodError on non-existing keys' do
|
42
|
+
should.raise(NoMethodError) { @h.hoge }
|
43
|
+
end
|
44
44
|
|
45
45
|
end
|
46
46
|
|
@@ -80,9 +80,9 @@ describe "SugarCube::Anonymous" do
|
|
80
80
|
@h.falsey?.should == false
|
81
81
|
end
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
it 'should raise NoMethodError on non-existing keys' do
|
84
|
+
should.raise(NoMethodError) { @h.hoge.should == 'Hoge' }
|
85
|
+
end
|
86
86
|
|
87
87
|
end
|
88
88
|
|
data/spec/ios/factories_spec.rb
CHANGED
@@ -171,4 +171,39 @@ describe 'SugarCube Factories' do
|
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
174
|
+
describe UILabel do
|
175
|
+
|
176
|
+
describe 'new method' do
|
177
|
+
it 'should support UILabel.new' do
|
178
|
+
label = UILabel.new
|
179
|
+
label.should.be.kind_of(UILabel)
|
180
|
+
end
|
181
|
+
it 'should support UILabel.new(text)' do
|
182
|
+
label = UILabel.new('text')
|
183
|
+
label.should.be.kind_of(UILabel)
|
184
|
+
label.text.should == 'text'
|
185
|
+
end
|
186
|
+
it 'should support UILabel.new(text, font)' do
|
187
|
+
label = UILabel.new('text', UIFont.fontWithName('Helvetica', size: 10))
|
188
|
+
label.should.be.kind_of(UILabel)
|
189
|
+
label.text.should == 'text'
|
190
|
+
label.font.familyName.should == 'Helvetica'
|
191
|
+
label.font.pointSize.should == 10
|
192
|
+
end
|
193
|
+
it 'should support UILabel.new(text, font_name)' do
|
194
|
+
label = UILabel.new('text', 'Helvetica')
|
195
|
+
label.should.be.kind_of(UILabel)
|
196
|
+
label.text.should == 'text'
|
197
|
+
label.font.familyName.should == 'Helvetica'
|
198
|
+
end
|
199
|
+
it 'should support UILabel.new(text, font_name, size)' do
|
200
|
+
label = UILabel.new('text', 'Helvetica', 10)
|
201
|
+
label.should.be.kind_of(UILabel)
|
202
|
+
label.text.should == 'text'
|
203
|
+
label.font.familyName.should == 'Helvetica'
|
204
|
+
label.font.pointSize.should == 10
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
174
209
|
end
|
data/spec/ios/pipes_spec.rb
CHANGED
@@ -33,9 +33,11 @@ describe "Pipes" do
|
|
33
33
|
(@image | NSData).should.be.kind_of(NSData)
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
it "should not support arbitrary coercions" do
|
37
|
+
->{
|
38
|
+
(@image | ArbitraryCoercion)
|
39
|
+
}.should.raise
|
40
|
+
end
|
39
41
|
|
40
42
|
it "should apply CIFilter" do
|
41
43
|
filter = CIFilter.gaussian_blur
|
@@ -59,9 +61,11 @@ describe "Pipes" do
|
|
59
61
|
(@view | UIImage).should.be.kind_of(UIImage)
|
60
62
|
end
|
61
63
|
|
62
|
-
|
63
|
-
|
64
|
-
|
64
|
+
it "should not support arbitrary coercions" do
|
65
|
+
->{
|
66
|
+
(@view | ArbitraryCoercion)
|
67
|
+
}.should.raise
|
68
|
+
end
|
65
69
|
|
66
70
|
end
|
67
71
|
|
@@ -86,9 +90,11 @@ describe "Pipes" do
|
|
86
90
|
(@image | CIImage).should.be.kind_of(CIImage)
|
87
91
|
end
|
88
92
|
|
89
|
-
|
90
|
-
|
91
|
-
|
93
|
+
it "should not support arbitrary coercions" do
|
94
|
+
->{
|
95
|
+
(@image | ArbitraryCoercion)
|
96
|
+
}.should.raise
|
97
|
+
end
|
92
98
|
|
93
99
|
it "should apply CIFilter" do
|
94
100
|
filter = CIFilter.gaussian_blur
|
@@ -118,9 +124,11 @@ describe "Pipes" do
|
|
118
124
|
("My name is Mud" | "Bob").should == nil
|
119
125
|
end
|
120
126
|
|
121
|
-
|
122
|
-
|
123
|
-
|
127
|
+
it "should not support arbitrary coercions" do
|
128
|
+
->{
|
129
|
+
(@string | ArbitraryCoercion)
|
130
|
+
}.should.raise
|
131
|
+
end
|
124
132
|
|
125
133
|
end
|
126
134
|
|
@@ -725,187 +725,187 @@ describe "Symbol - constants" do
|
|
725
725
|
|
726
726
|
end
|
727
727
|
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
728
|
+
describe "not found" do
|
729
|
+
it 'should not find nonexistant `uidevice`' do
|
730
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uidevice }
|
731
|
+
end
|
732
732
|
|
733
|
-
|
734
|
-
|
735
|
-
|
733
|
+
it 'should not find nonexistant `uideviceorientation`' do
|
734
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uideviceorientation }
|
735
|
+
end
|
736
736
|
|
737
|
-
|
738
|
-
|
739
|
-
|
737
|
+
it 'should not find nonexistant `uiinterfaceorientation`' do
|
738
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiinterfaceorientation }
|
739
|
+
end
|
740
740
|
|
741
|
-
|
742
|
-
|
743
|
-
|
741
|
+
it 'should not find nonexistant `uiinterfacemask`' do
|
742
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiinterfacemask }
|
743
|
+
end
|
744
744
|
|
745
|
-
|
746
|
-
|
747
|
-
|
745
|
+
it 'should not find nonexistant `uiautoresizemask`' do
|
746
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiautoresizemask }
|
747
|
+
end
|
748
748
|
|
749
|
-
|
750
|
-
|
751
|
-
|
749
|
+
it 'should not find nonexistant `uireturnkey`' do
|
750
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uireturnkey }
|
751
|
+
end
|
752
752
|
|
753
|
-
|
754
|
-
|
755
|
-
|
753
|
+
it 'should not find nonexistant `uikeyboardtype`' do
|
754
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uikeyboardtype }
|
755
|
+
end
|
756
756
|
|
757
|
-
|
758
|
-
|
759
|
-
|
757
|
+
it 'should not find nonexistant `nstextalignment`' do
|
758
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nstextalignment }
|
759
|
+
end
|
760
760
|
|
761
|
-
|
762
|
-
|
763
|
-
|
761
|
+
it 'should not find nonexistant `uilinebreakmode`' do
|
762
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uilinebreakmode }
|
763
|
+
end
|
764
764
|
|
765
|
-
|
766
|
-
|
767
|
-
|
765
|
+
it 'should not find nonexistant `nslinebreakmode`' do
|
766
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nslinebreakmode }
|
767
|
+
end
|
768
768
|
|
769
|
-
|
770
|
-
|
771
|
-
|
769
|
+
it 'should not find nonexistant `uibaselineadjustment`' do
|
770
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uibaselineadjustment }
|
771
|
+
end
|
772
772
|
|
773
|
-
|
774
|
-
|
775
|
-
|
773
|
+
it 'should not find nonexistant `uibordertype`' do
|
774
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uibordertype }
|
775
|
+
end
|
776
776
|
|
777
|
-
|
778
|
-
|
779
|
-
|
777
|
+
it 'should not find nonexistant `nsdatestyle`' do
|
778
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsdatestyle }
|
779
|
+
end
|
780
780
|
|
781
|
-
|
782
|
-
|
783
|
-
|
781
|
+
it 'should not find nonexistant `nsnumberstyle`' do
|
782
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsnumberstyle }
|
783
|
+
end
|
784
784
|
|
785
|
-
|
786
|
-
|
787
|
-
|
785
|
+
it 'should not find nonexistant `uifontsize`' do
|
786
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uifontsize }
|
787
|
+
end
|
788
788
|
|
789
|
-
|
790
|
-
|
791
|
-
|
789
|
+
it 'should not find nonexistant `uistatusbarstyle`' do
|
790
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uistatusbarstyle }
|
791
|
+
end
|
792
792
|
|
793
|
-
|
794
|
-
|
795
|
-
|
793
|
+
it 'should not find nonexistant `uibarmetrics`' do
|
794
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uibarmetrics }
|
795
|
+
end
|
796
796
|
|
797
|
-
|
798
|
-
|
799
|
-
|
797
|
+
it 'should not find nonexistant `uibarbuttonitem`' do
|
798
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uibarbuttonitem }
|
799
|
+
end
|
800
800
|
|
801
|
-
|
802
|
-
|
803
|
-
|
801
|
+
it 'should not find nonexistant `uibarbuttonstyle`' do
|
802
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uibarbuttonstyle }
|
803
|
+
end
|
804
804
|
|
805
|
-
|
806
|
-
|
807
|
-
|
805
|
+
it 'should not find nonexistant `uibuttontype`' do
|
806
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uibuttontype }
|
807
|
+
end
|
808
808
|
|
809
|
-
|
810
|
-
|
811
|
-
|
809
|
+
it 'should not find nonexistant `uicontrolstate`' do
|
810
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uicontrolstate }
|
811
|
+
end
|
812
812
|
|
813
|
-
|
814
|
-
|
815
|
-
|
813
|
+
it 'should not find nonexistant `uicontrolevent`' do
|
814
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uicontrolevent }
|
815
|
+
end
|
816
816
|
|
817
|
-
|
818
|
-
|
819
|
-
|
817
|
+
it 'should not find nonexistant `uiactivityindicatorstyle`' do
|
818
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiactivityindicatorstyle }
|
819
|
+
end
|
820
820
|
|
821
|
-
|
822
|
-
|
823
|
-
|
821
|
+
it 'should not find nonexistant `uisegmentedstyle`' do
|
822
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uisegmentedstyle }
|
823
|
+
end
|
824
824
|
|
825
|
-
|
826
|
-
|
827
|
-
|
825
|
+
it 'should not find nonexistant `uidatepickermode`' do
|
826
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uidatepickermode }
|
827
|
+
end
|
828
828
|
|
829
|
-
|
830
|
-
|
831
|
-
|
829
|
+
it 'should not find nonexistant `uicontentmode`' do
|
830
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uicontentmode }
|
831
|
+
end
|
832
832
|
|
833
|
-
|
834
|
-
|
835
|
-
|
833
|
+
it 'should not find nonexistant `uianimationcurve`' do
|
834
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uianimationcurve }
|
835
|
+
end
|
836
836
|
|
837
|
-
|
838
|
-
|
839
|
-
|
837
|
+
it 'should not find nonexistant `uitablestyle`' do
|
838
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uitablestyle }
|
839
|
+
end
|
840
840
|
|
841
|
-
|
842
|
-
|
843
|
-
|
841
|
+
it 'should not find nonexistant `uitablerowanimation`' do
|
842
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uitablerowanimation }
|
843
|
+
end
|
844
844
|
|
845
|
-
|
846
|
-
|
847
|
-
|
845
|
+
it 'should not find nonexistant `uitablecellstyle`' do
|
846
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uitablecellstyle }
|
847
|
+
end
|
848
848
|
|
849
|
-
|
850
|
-
|
851
|
-
|
849
|
+
it 'should not find nonexistant `uitablecellaccessorytype`' do
|
850
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uitablecellaccessorytype }
|
851
|
+
end
|
852
852
|
|
853
|
-
|
854
|
-
|
855
|
-
|
853
|
+
it 'should not find nonexistant `uitablecellselectionstyle`' do
|
854
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uitablecellselectionstyle }
|
855
|
+
end
|
856
856
|
|
857
|
-
|
858
|
-
|
859
|
-
|
857
|
+
it 'should not find nonexistant `uitablecellseparatorstyle`' do
|
858
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uitablecellseparatorstyle }
|
859
|
+
end
|
860
860
|
|
861
|
-
|
862
|
-
|
863
|
-
|
861
|
+
it 'should not find nonexistant `uialertstyle`' do
|
862
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uialertstyle }
|
863
|
+
end
|
864
864
|
|
865
|
-
|
866
|
-
|
867
|
-
|
865
|
+
it 'should not find nonexistant `uiactionstyle`' do
|
866
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiactionstyle }
|
867
|
+
end
|
868
868
|
|
869
|
-
|
870
|
-
|
871
|
-
|
869
|
+
it 'should not find nonexistant `uialertcontrollerstyle`' do
|
870
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uialertcontrollerstyle }
|
871
|
+
end
|
872
872
|
|
873
|
-
|
874
|
-
|
875
|
-
|
873
|
+
it 'should not find nonexistant `uialertactionstyle`' do
|
874
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uialertactionstyle }
|
875
|
+
end
|
876
876
|
|
877
|
-
|
878
|
-
|
879
|
-
|
877
|
+
it 'should not find nonexistant `uiimagesource`' do
|
878
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiimagesource }
|
879
|
+
end
|
880
880
|
|
881
|
-
|
882
|
-
|
883
|
-
|
881
|
+
it 'should not find nonexistant `uiimagecapture`' do
|
882
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiimagecapture }
|
883
|
+
end
|
884
884
|
|
885
|
-
|
886
|
-
|
887
|
-
|
885
|
+
it 'should not find nonexistant `uiimagecamera`' do
|
886
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiimagecamera }
|
887
|
+
end
|
888
888
|
|
889
|
-
|
890
|
-
|
891
|
-
|
889
|
+
it 'should not find nonexistant `uiimagequality`' do
|
890
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uiimagequality }
|
891
|
+
end
|
892
892
|
|
893
|
-
|
894
|
-
|
895
|
-
|
893
|
+
it 'should not find nonexistant `catimingfunction`' do
|
894
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.catimingfunction }
|
895
|
+
end
|
896
896
|
|
897
|
-
|
898
|
-
|
899
|
-
|
897
|
+
it 'should not find nonexistant `cglinecap`' do
|
898
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.cglinecap }
|
899
|
+
end
|
900
900
|
|
901
|
-
|
902
|
-
|
903
|
-
|
901
|
+
it 'should not find nonexistant `cglinejoin`' do
|
902
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.cglinejoin }
|
903
|
+
end
|
904
904
|
|
905
|
-
|
906
|
-
|
907
|
-
|
905
|
+
it 'should not find nonexistant `uigesturerecognizerstate`' do
|
906
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uigesturerecognizerstate }
|
907
|
+
end
|
908
908
|
|
909
|
-
|
909
|
+
end
|
910
910
|
|
911
911
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
describe UIFont do
|
2
|
+
before do
|
3
|
+
@font = UIFont.systemFontOfSize(UIFont.systemFontSize)
|
4
|
+
end
|
5
|
+
it 'should return self on #uifont' do
|
6
|
+
@font.uifont.should.equal? @font
|
7
|
+
@font.uifont.should.be.kind_of(UIFont)
|
8
|
+
end
|
9
|
+
it 'should return a font with a different size on #uifont(size)' do
|
10
|
+
new_font = @font.uifont(12)
|
11
|
+
new_font.should.be.kind_of(UIFont)
|
12
|
+
new_font.pointSize.should == 12
|
13
|
+
new_font.familyName.should == @font.familyName
|
14
|
+
end
|
15
|
+
it 'should accept font-size symbols' do
|
16
|
+
new_font = @font.uifont(:label)
|
17
|
+
new_font.should.be.kind_of(UIFont)
|
18
|
+
new_font.pointSize.should == :label.uifontsize
|
19
|
+
new_font.familyName.should == @font.familyName
|
20
|
+
end
|
21
|
+
end
|
@@ -97,13 +97,17 @@ describe "UIView animation methods" do
|
|
97
97
|
@view.frame.origin.y.should == 2
|
98
98
|
end
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
|
100
|
+
it 'should have a tumble animation with invalid side option raising exception' do
|
101
|
+
-> do
|
102
|
+
@view.tumble(side: :this_is_silly)
|
103
|
+
end.should.raise
|
104
|
+
end
|
103
105
|
|
104
|
-
|
105
|
-
|
106
|
-
|
106
|
+
it 'should have a tumble_in animation with invalid side option raising exception' do
|
107
|
+
-> do
|
108
|
+
@view.tumble_in(side: :this_is_silly)
|
109
|
+
end.should.raise
|
110
|
+
end
|
107
111
|
|
108
112
|
it 'should have a tumble animation with duration and options' do
|
109
113
|
@done = false
|
@@ -133,4 +137,16 @@ describe "UIView animation methods" do
|
|
133
137
|
end
|
134
138
|
end
|
135
139
|
|
140
|
+
it 'should have a wiggle animation' do
|
141
|
+
-> do
|
142
|
+
@view.wiggle
|
143
|
+
end.should.not.raise
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'should have a dont_wiggle method' do
|
147
|
+
-> do
|
148
|
+
@view.dont_wiggle
|
149
|
+
end.should.not.raise
|
150
|
+
end
|
151
|
+
|
136
152
|
end
|
@@ -164,49 +164,49 @@ describe "Symbol - constants" do
|
|
164
164
|
end
|
165
165
|
|
166
166
|
describe "not found" do
|
167
|
-
|
168
|
-
|
169
|
-
|
167
|
+
it 'should not find nonexistant `nsautoresizingmask`' do
|
168
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsautoresizingmask }
|
169
|
+
end
|
170
170
|
|
171
|
-
|
172
|
-
|
173
|
-
|
171
|
+
it 'should not find nonexistant `nstextalignment`' do
|
172
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nstextalignment }
|
173
|
+
end
|
174
174
|
|
175
|
-
|
176
|
-
|
177
|
-
|
175
|
+
it 'should not find nonexistant `nsdatestyle`' do
|
176
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsdatestyle }
|
177
|
+
end
|
178
178
|
|
179
|
-
|
180
|
-
|
181
|
-
|
179
|
+
it 'should not find nonexistant `nsnumberstyle`' do
|
180
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsnumberstyle }
|
181
|
+
end
|
182
182
|
|
183
|
-
|
184
|
-
|
185
|
-
|
183
|
+
it 'should not find nonexistant `nsbuttontype`' do
|
184
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsbuttontype }
|
185
|
+
end
|
186
186
|
|
187
|
-
|
188
|
-
|
189
|
-
|
187
|
+
it 'should not find nonexistant `nsbezelstyle`' do
|
188
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsbezelstyle }
|
189
|
+
end
|
190
190
|
|
191
|
-
|
192
|
-
|
193
|
-
|
191
|
+
it 'should not find nonexistant `nsfocusringtype`' do
|
192
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nsfocusringtype }
|
193
|
+
end
|
194
194
|
|
195
|
-
|
196
|
-
|
197
|
-
|
195
|
+
it 'should not find nonexistant `nslinebreakmode`' do
|
196
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nslinebreakmode }
|
197
|
+
end
|
198
198
|
|
199
|
-
|
200
|
-
|
201
|
-
|
199
|
+
it 'should not find nonexistant `catimingfunction`' do
|
200
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.catimingfunction }
|
201
|
+
end
|
202
202
|
|
203
|
-
|
204
|
-
|
205
|
-
|
203
|
+
it 'should not find nonexistant `cglinecap`' do
|
204
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.cglinecap }
|
205
|
+
end
|
206
206
|
|
207
|
-
|
208
|
-
|
209
|
-
|
207
|
+
it 'should not find nonexistant `cglinejoin`' do
|
208
|
+
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.cglinejoin }
|
209
|
+
end
|
210
210
|
|
211
211
|
end
|
212
212
|
|
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: 2.
|
4
|
+
version: 2.5.0
|
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-09-
|
14
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |
|
17
17
|
== Description
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/ios/sugarcube-factories/uibarbuttonitem.rb
|
111
111
|
- lib/ios/sugarcube-factories/uiblureffect.rb
|
112
112
|
- lib/ios/sugarcube-factories/uibutton.rb
|
113
|
+
- lib/ios/sugarcube-factories/uilabel.rb
|
113
114
|
- lib/ios/sugarcube-factories/uisegmentedcontrol.rb
|
114
115
|
- lib/ios/sugarcube-factories/uitabbaritem.rb
|
115
116
|
- lib/ios/sugarcube-factories/uitableview.rb
|
@@ -252,6 +253,7 @@ files:
|
|
252
253
|
- spec/ios/uibarbuttonitem_spec.rb
|
253
254
|
- spec/ios/uicolor_spec.rb
|
254
255
|
- spec/ios/uicontrol_spec.rb
|
256
|
+
- spec/ios/uifont_spec.rb
|
255
257
|
- spec/ios/uiimage_spec.rb
|
256
258
|
- spec/ios/uilabel_spec.rb
|
257
259
|
- spec/ios/uitabbaritem_spec.rb
|
@@ -341,6 +343,7 @@ test_files:
|
|
341
343
|
- spec/ios/uibarbuttonitem_spec.rb
|
342
344
|
- spec/ios/uicolor_spec.rb
|
343
345
|
- spec/ios/uicontrol_spec.rb
|
346
|
+
- spec/ios/uifont_spec.rb
|
344
347
|
- spec/ios/uiimage_spec.rb
|
345
348
|
- spec/ios/uilabel_spec.rb
|
346
349
|
- spec/ios/uitabbaritem_spec.rb
|