teacup 2.2.0 → 2.2.2

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: 78d2c2affd8f6c85eb542169ac6f9e355ef5774e
4
- data.tar.gz: 9d7e6c1ac113248c7259ea2eddd303f4e2a1c3e7
3
+ metadata.gz: 9d908853bb431306cc83a100710414f0ec8c06c0
4
+ data.tar.gz: f727586d4aa2f2b0c0d8723f69d7b8b09b55b643
5
5
  SHA512:
6
- metadata.gz: fb517a21e621a6dc268fd12df22c4966c64e8c70e8cd63459f8170fe96f4cc9eb283148f575ae357477fcad29f552117b531b1ad8a1a05d03ff8876327db1765
7
- data.tar.gz: 6c8237dfb7bf6620716544793ef556e7ddf7ca16a1491bd2b0b78f3b5b65f6fdb8b942e882e9eda3be2db8d3078c0e2e9b6bbb28503aba0a4d6cd8c4bc16380e
6
+ metadata.gz: 4677483dc33b8a921e5f9f524b3d5d9551c986b296c859b3d927152cdab7aec821e617111b1a7f673663f676f8796146bee0b3e43a5ad8657889fe76cb4ef503
7
+ data.tar.gz: f17d8e8c76f28c73b70b0ef5725c716a9d848989b679171f7e522cde37e185b192ddab5e8e9b4ddb2ff5386871a7e81b778f0306a8191993dc220cb0ae476386
@@ -58,32 +58,16 @@ module Teacup
58
58
  @stylesheet = val
59
59
  end
60
60
 
61
- # Returns a stylesheet to use to style the contents of this controller's
62
- # view. You can also assign a stylesheet to {stylesheet=}, which will in
63
- # turn call {restyle!}.
64
- #
65
- # This method will be queried each time {restyle!} is called, and also
66
- # implicitly whenever Teacup needs to draw your layout (currently only at
67
- # view load time).
61
+ # Returns the stylesheet. If the stylesheet was assigned by name, the
62
+ # stylesheet object with this name is returned.
68
63
  #
69
64
  # @return Teacup::Stylesheet
70
- #
71
- # @example
72
- #
73
- # def stylesheet
74
- # if [UIInterfaceOrientationLandscapeLeft,
75
- # UIInterfaceOrientationLandscapeRight].include?(UIInterface.currentDevice.orientation)
76
- # Teacup::Stylesheet[:ipad]
77
- # else
78
- # Teacup::Stylesheet[:ipadvertical]
79
- # end
80
- # end
81
65
  def stylesheet
82
66
  if @stylesheet.is_a? Symbol
83
67
  @stylesheet = Teacup::Stylesheet[@stylesheet]
84
68
  end
85
69
 
86
- @stylesheet || self.class.stylesheet
70
+ return @stylesheet || self.class.stylesheet
87
71
  end
88
72
 
89
73
  # Alter the layout of a view
@@ -162,8 +146,10 @@ module Teacup
162
146
  end
163
147
 
164
148
  # assign the 'teacup_next_responder', which is queried for a stylesheet if
165
- # one is not explicitly assigned to the view
166
- if view.is_a? Layout
149
+ # one is not explicitly assigned to the view. If the view already has a
150
+ # teacup_next_responder assigned, it's because another object is already
151
+ # responsible for managing the view's stylesheet.
152
+ if view.teacup_next_responder.nil? && view.is_a?(Layout)
167
153
  view.teacup_next_responder = WeakRef.new(self)
168
154
  end
169
155
 
@@ -39,6 +39,9 @@ module Teacup
39
39
  # constraints are a special case because when we merge an array of constraints
40
40
  # we need to make sure not to add more than one constraint for a given attribute
41
41
  def merge_constraints(left, right)
42
+ # Return early if there are no constraints to merge.
43
+ return right unless left
44
+
42
45
  left = left.map do |constraint|
43
46
  convert_constraints(constraint)
44
47
  end.flatten
@@ -1,5 +1,5 @@
1
1
  module Teacup
2
2
 
3
- VERSION = '2.2.0'
3
+ VERSION = '2.2.2'
4
4
 
5
5
  end
@@ -0,0 +1,8 @@
1
+ describe 'Child view controllers' do
2
+ tests RootViewController
3
+
4
+ it 'should have the correct color' do
5
+ @controller.child_controller.view.backgroundColor.should == UIColor.yellowColor
6
+ end
7
+
8
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teacup
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - the rubymotion community
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Teacup is a community-driven DSL for RubyMotion. It has CSS-like styling, and
@@ -58,6 +58,7 @@ files:
58
58
  - lib/teacup.rb
59
59
  - spec/ios/appearance_spec.rb
60
60
  - spec/ios/calculations_spec.rb
61
+ - spec/ios/child_controllers_spec.rb
61
62
  - spec/ios/constraints_spec.rb
62
63
  - spec/ios/custom_class_spec.rb
63
64
  - spec/ios/dependencies.rb
@@ -103,6 +104,7 @@ summary: A community-driven DSL for creating user interfaces on iOS and OS X.
103
104
  test_files:
104
105
  - spec/ios/appearance_spec.rb
105
106
  - spec/ios/calculations_spec.rb
107
+ - spec/ios/child_controllers_spec.rb
106
108
  - spec/ios/constraints_spec.rb
107
109
  - spec/ios/custom_class_spec.rb
108
110
  - spec/ios/dependencies.rb