teacup 2.0.3 → 2.0.4
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.
- data/.travis.yml +1 -1
- data/Gemfile +4 -0
- data/Gemfile.lock +3 -1
- data/lib/teacup/version.rb +1 -1
- data/lib/teacup-ios/stylesheet_extensions/device.rb +1 -1
- data/spec/ios/stylesheet_extensions/device_spec.rb +46 -0
- metadata +4 -2
data/.travis.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
language: objective-c
|
2
|
-
before_install: rvm use 1.9.3
|
2
|
+
before_install: rvm use ruby-1.9.3-p392
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/lib/teacup/version.rb
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
describe "Stylesheet - Device" do
|
2
|
+
|
3
|
+
it "should have device methods" do
|
4
|
+
stylesheet = Teacup::Stylesheet.new
|
5
|
+
stylesheet.iPhone.should.not == nil
|
6
|
+
stylesheet.iPhoneRetina.should.not == nil
|
7
|
+
stylesheet.iPhone4.should.not == nil
|
8
|
+
stylesheet.iPhone35.should.not == nil
|
9
|
+
stylesheet.iPad.should.not == nil
|
10
|
+
stylesheet.iPadRetina.should.not == nil
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return appropriate sizes" do
|
14
|
+
stylesheet = Teacup::Stylesheet.new
|
15
|
+
|
16
|
+
device = UIDevice.currentDevice.userInterfaceIdiom
|
17
|
+
case device
|
18
|
+
when UIUserInterfaceIdiomPhone
|
19
|
+
if UIScreen.mainScreen.respond_to?(:scale) && UIScreen.mainScreen.scale == 2
|
20
|
+
stylesheet.device_is?(:iPhoneRetina).should == true
|
21
|
+
else
|
22
|
+
stylesheet.device_is?(:iPhoneRetina).should == false
|
23
|
+
end
|
24
|
+
|
25
|
+
if UIScreen.mainScreen.bounds.size.height == 568
|
26
|
+
stylesheet.screen_size.height.should == 568
|
27
|
+
stylesheet.device_is?(:iPhone4).should == true
|
28
|
+
else
|
29
|
+
stylesheet.screen_size.height.should == 480
|
30
|
+
stylesheet.device_is?(:iPhone35).should == true
|
31
|
+
end
|
32
|
+
stylesheet.screen_size.width.should == 320
|
33
|
+
stylesheet.device_is?(:iPhone).should == true
|
34
|
+
when UIUserInterfaceIdiomPad
|
35
|
+
if UIScreen.mainScreen.respond_to?(:scale) && UIScreen.mainScreen.scale == 2
|
36
|
+
stylesheet.device_is?(:iPadRetina).should == true
|
37
|
+
else
|
38
|
+
stylesheet.device_is?(:iPadRetina).should == false
|
39
|
+
end
|
40
|
+
stylesheet.screen_size.width.should == 768
|
41
|
+
stylesheet.screen_size.height.should == 1024
|
42
|
+
stylesheet.device_is?(:iPad).should == true
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teacup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-11 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'Teacup is a community-driven DSL for making CSS-like styling, and
|
15
15
|
layouts for
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- spec/ios/present_modal_spec.rb
|
142
142
|
- spec/ios/style_spec.rb
|
143
143
|
- spec/ios/stylesheet_extensions/autoresize_spec.rb
|
144
|
+
- spec/ios/stylesheet_extensions/device_spec.rb
|
144
145
|
- spec/ios/stylesheet_spec.rb
|
145
146
|
- spec/ios/ui_view_getters_spec.rb
|
146
147
|
- spec/ios/uiswitch_spec.rb
|
@@ -183,6 +184,7 @@ test_files:
|
|
183
184
|
- spec/ios/present_modal_spec.rb
|
184
185
|
- spec/ios/style_spec.rb
|
185
186
|
- spec/ios/stylesheet_extensions/autoresize_spec.rb
|
187
|
+
- spec/ios/stylesheet_extensions/device_spec.rb
|
186
188
|
- spec/ios/stylesheet_spec.rb
|
187
189
|
- spec/ios/ui_view_getters_spec.rb
|
188
190
|
- spec/ios/uiswitch_spec.rb
|