motion-kit 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/motion-kit-cocoa/constraints/constraint.rb +0 -8
- data/lib/motion-kit-ios/helpers/uiview_autoresizing_helpers.rb +4 -0
- data/lib/motion-kit-osx/helpers/nsview_autoresizing_helpers.rb +4 -0
- data/lib/motion-kit/version.rb +1 -1
- data/spec/ios/autoresizing_helper_spec.rb +16 -0
- data/spec/ios/constraints_helpers/simple_constraints_spec.rb +0 -9
- data/spec/osx/autoresizing_helper_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18f1f9da189410e1683214e3227a873166251cd7
|
4
|
+
data.tar.gz: 9acef866d767505e18fe4dc7defa0cc0cb41727d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be182328f8a528833582295c4d189c6985755742165e3d708f7f9aca15532bfb7fc7c15c70285e018c0edf57c515a8637abb1658e06b1db25b70c71205a32edb
|
7
|
+
data.tar.gz: 749585a9301994dea5f870876dd2fa9980eee29cfaf2d6e3a1a9f274d0f3ca2a8be820acfd82785b5fa878915d130003a71aad76ca3baafffda4d14be3f21196
|
@@ -85,10 +85,6 @@ module MotionKit
|
|
85
85
|
|
86
86
|
def >=(compare)
|
87
87
|
if @compare_flag
|
88
|
-
if @relationship && Constraint.relationship_lookup(@relationship) != NSLayoutRelationGreaterThanOrEqual
|
89
|
-
raise InvalidRelationshipError.new("You cannot use `.is >=` on a constraint that is already defined as #{@relationship}")
|
90
|
-
end
|
91
|
-
|
92
88
|
gte(compare)
|
93
89
|
|
94
90
|
self
|
@@ -99,10 +95,6 @@ module MotionKit
|
|
99
95
|
|
100
96
|
def <=(compare)
|
101
97
|
if @compare_flag
|
102
|
-
if @relationship && Constraint.relationship_lookup(@relationship) != NSLayoutRelationLessThanOrEqual
|
103
|
-
raise InvalidRelationshipError.new("You cannot use `.is <=` on a constraint that is already defined as #{@relationship}")
|
104
|
-
end
|
105
|
-
|
106
98
|
lte(compare)
|
107
99
|
|
108
100
|
self
|
@@ -38,10 +38,14 @@ module MotionKit
|
|
38
38
|
value |= UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin
|
39
39
|
when :fill_bottom
|
40
40
|
value |= UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin
|
41
|
+
when :fill_width
|
42
|
+
value |= UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin
|
41
43
|
when :fill_left
|
42
44
|
value |= UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleRightMargin
|
43
45
|
when :fill_right
|
44
46
|
value |= UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin
|
47
|
+
when :fill_height
|
48
|
+
value |= UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleRightMargin
|
45
49
|
|
46
50
|
when :pin_to_top_left
|
47
51
|
value |= UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin
|
@@ -38,10 +38,14 @@ module MotionKit
|
|
38
38
|
value |= NSViewWidthSizable | NSViewMinYMargin
|
39
39
|
when :fill_bottom
|
40
40
|
value |= NSViewWidthSizable | NSViewMaxYMargin
|
41
|
+
when :fill_width
|
42
|
+
value |= NSViewMinYMargin | NSViewWidthSizable | NSViewMaxXMargin
|
41
43
|
when :fill_left
|
42
44
|
value |= NSViewHeightSizable | NSViewMaxXMargin
|
43
45
|
when :fill_right
|
44
46
|
value |= NSViewHeightSizable | NSViewMinXMargin
|
47
|
+
when :fill_height
|
48
|
+
value |= NSViewMinXMargin | NSViewHeightSizable | NSViewMaxXMargin
|
45
49
|
|
46
50
|
when :pin_to_top_left
|
47
51
|
value |= NSViewMaxXMargin | NSViewMinYMargin
|
data/lib/motion-kit/version.rb
CHANGED
@@ -125,6 +125,14 @@ describe 'Autoresize helpers' do
|
|
125
125
|
mask.should == UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin
|
126
126
|
end
|
127
127
|
|
128
|
+
it 'should support :fill_width' do
|
129
|
+
mask = nil
|
130
|
+
@layout.context(@view) do
|
131
|
+
mask = @layout.autoresizing_mask :fill_width
|
132
|
+
end
|
133
|
+
mask.should == UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
|
134
|
+
end
|
135
|
+
|
128
136
|
it 'should support :fill_left' do
|
129
137
|
mask = nil
|
130
138
|
@layout.context(@view) do
|
@@ -141,6 +149,14 @@ describe 'Autoresize helpers' do
|
|
141
149
|
mask.should == UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin
|
142
150
|
end
|
143
151
|
|
152
|
+
it 'should support :fill_height' do
|
153
|
+
mask = nil
|
154
|
+
@layout.context(@view) do
|
155
|
+
mask = @layout.autoresizing_mask :fill_height
|
156
|
+
end
|
157
|
+
mask.should == UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin
|
158
|
+
end
|
159
|
+
|
144
160
|
it 'should support :pin_to_top_left' do
|
145
161
|
mask = nil
|
146
162
|
@layout.context(@view) do
|
@@ -92,15 +92,6 @@ describe 'Constraints - Simple helpers' do
|
|
92
92
|
@constraint.attribute.should == :left
|
93
93
|
@constraint.attribute2.should == :left
|
94
94
|
end
|
95
|
-
it 'should NOT support `min_x.is >= 10`' do
|
96
|
-
-> do
|
97
|
-
@layout.context(@view) do
|
98
|
-
@layout.constraints do
|
99
|
-
p @layout.min_x.is <= 10
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end.should.raise(MotionKit::InvalidRelationshipError)
|
103
|
-
end
|
104
95
|
it 'should support `(x.is >= 10).priority(:low)`' do
|
105
96
|
@layout.context(@view) do
|
106
97
|
@layout.constraints do
|
@@ -125,6 +125,14 @@ describe 'Autoresize helpers' do
|
|
125
125
|
mask.should == NSViewWidthSizable | NSViewMaxYMargin
|
126
126
|
end
|
127
127
|
|
128
|
+
it 'should support :fill_width' do
|
129
|
+
mask = nil
|
130
|
+
@layout.context(@view) do
|
131
|
+
mask = @layout.autoresizing_mask :fill_width
|
132
|
+
end
|
133
|
+
mask.should == NSViewWidthSizable | NSViewMinYMargin | NSViewMaxYMargin
|
134
|
+
end
|
135
|
+
|
128
136
|
it 'should support :fill_left' do
|
129
137
|
mask = nil
|
130
138
|
@layout.context(@view) do
|
@@ -141,6 +149,14 @@ describe 'Autoresize helpers' do
|
|
141
149
|
mask.should == NSViewHeightSizable | NSViewMinXMargin
|
142
150
|
end
|
143
151
|
|
152
|
+
it 'should support :fill_height' do
|
153
|
+
mask = nil
|
154
|
+
@layout.context(@view) do
|
155
|
+
mask = @layout.autoresizing_mask :fill_height
|
156
|
+
end
|
157
|
+
mask.should == NSViewHeightSizable | NSViewMinXMargin | NSViewMaxXMargin
|
158
|
+
end
|
159
|
+
|
144
160
|
it 'should support :pin_to_top_left' do
|
145
161
|
mask = nil
|
146
162
|
@layout.context(@view) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin T.A. Gray
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dbt
|