teacup 2.2.0 → 2.2.2
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/lib/teacup/layout.rb +7 -21
- data/lib/teacup/merge_defaults.rb +3 -0
- data/lib/teacup/version.rb +1 -1
- data/spec/ios/child_controllers_spec.rb +8 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d908853bb431306cc83a100710414f0ec8c06c0
|
4
|
+
data.tar.gz: f727586d4aa2f2b0c0d8723f69d7b8b09b55b643
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4677483dc33b8a921e5f9f524b3d5d9551c986b296c859b3d927152cdab7aec821e617111b1a7f673663f676f8796146bee0b3e43a5ad8657889fe76cb4ef503
|
7
|
+
data.tar.gz: f17d8e8c76f28c73b70b0ef5725c716a9d848989b679171f7e522cde37e185b192ddab5e8e9b4ddb2ff5386871a7e81b778f0306a8191993dc220cb0ae476386
|
data/lib/teacup/layout.rb
CHANGED
@@ -58,32 +58,16 @@ module Teacup
|
|
58
58
|
@stylesheet = val
|
59
59
|
end
|
60
60
|
|
61
|
-
# Returns
|
62
|
-
#
|
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
|
-
|
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
|
data/lib/teacup/version.rb
CHANGED
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.
|
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-
|
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
|