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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1de6fcc1bebb1578ad6110741b7d5edb084c307
4
- data.tar.gz: 2b21fc0a39cae00452ed4ef9fd709cfea10d51e1
3
+ metadata.gz: 18f1f9da189410e1683214e3227a873166251cd7
4
+ data.tar.gz: 9acef866d767505e18fe4dc7defa0cc0cb41727d
5
5
  SHA512:
6
- metadata.gz: ac2fd44e427fa6c0d91706b0243e4902ad66a402a1974e655e2e1cd2c6f882f083426f49ab8334d771748bb3e726d07eb25f3cd20a2b534bb8bc651dbfda1cd2
7
- data.tar.gz: bc6d0928ca21a6af0b7876b882c5b704b40a41e2f04e8e1784835cd3e100deade600360268240a367aa2f7b9a05d8cd3f9d8817d65a3ccfc942576da620471a4
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
@@ -1,3 +1,3 @@
1
1
  module MotionKit
2
- VERSION = '0.14.0'
2
+ VERSION = '0.14.1'
3
3
  end
@@ -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.0
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-09-17 00:00:00.000000000 Z
12
+ date: 2014-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dbt