teacup 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,5 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ group :test, :development do
4
+ gem 'rake'
5
+ end
6
+
3
7
  gem 'motion-layout'
4
8
 
5
9
  gemspec
data/Gemfile.lock CHANGED
@@ -1,16 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- teacup (2.0.2)
4
+ teacup (2.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  motion-layout (0.0.1)
10
+ rake (0.9.2)
10
11
 
11
12
  PLATFORMS
12
13
  ruby
13
14
 
14
15
  DEPENDENCIES
15
16
  motion-layout
17
+ rake
16
18
  teacup!
@@ -1,5 +1,5 @@
1
1
  module Teacup
2
2
 
3
- VERSION = '2.0.3'
3
+ VERSION = '2.0.4'
4
4
 
5
5
  end
@@ -78,7 +78,7 @@ module Teacup
78
78
 
79
79
  def device_is?(this_device)
80
80
  this_device = self.send(this_device) if this_device.is_a? Symbol
81
- return device & this_device > 0
81
+ return self.device & this_device > 0
82
82
  end
83
83
 
84
84
  end
@@ -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.3
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-10 00:00:00.000000000 Z
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