motion-kit 0.9.3 → 0.9.4
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/motion-kit/calculate.rb +2 -2
- data/lib/motion-kit/version.rb +1 -1
- data/spec/ios/relative_layout.spec.rb +31 -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: ff9ff05dc542edf1cf722b6959a0d52d4a16d34c
|
4
|
+
data.tar.gz: f9afc6aa8839fb471bfe7dcb8ac44766260b4ddd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aabf1ad8ebf3a7a231d314823048c9b87d08e5a1b06a87a8c3fe60f7f87398073a136bbdd58985d974276b3b1f0d2e66d669125a158f0d87a675c76c64eb0cd3
|
7
|
+
data.tar.gz: 58c9e0bcf282924128803765e8cf2fede6620f6bf2360bc643429e1704fa4abfb2fd4e9b71683294badb1042004b0fc8e0f3b858771546375baef47103f26165
|
data/lib/motion-kit/calculate.rb
CHANGED
@@ -34,9 +34,9 @@ module MotionKit
|
|
34
34
|
|
35
35
|
return case dimension
|
36
36
|
when :width
|
37
|
-
return (
|
37
|
+
return (full_view.frame.size.width * factor + constant).round
|
38
38
|
when :height
|
39
|
-
return (
|
39
|
+
return (full_view.frame.size.height * factor + constant).round
|
40
40
|
else
|
41
41
|
raise "Unknown dimension #{dimension}"
|
42
42
|
end
|
data/lib/motion-kit/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
describe MotionKit::Layout do
|
2
|
+
before do
|
3
|
+
@subject = TestRelativeLayout.new
|
4
|
+
end
|
5
|
+
|
6
|
+
it "should have two subviews" do
|
7
|
+
@subject.view.subviews.count.should == 2
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "should have a test view" do
|
11
|
+
it "with origin x = y = 0" do
|
12
|
+
@subject.get(:test).frame.origin.x.should == 0
|
13
|
+
@subject.get(:test).frame.origin.y.should == 0
|
14
|
+
end
|
15
|
+
it "with frame w = h = 100" do
|
16
|
+
@subject.get(:test).frame.size.width.should == 320 # how do I best set this to 100% of the screen, in case future simulators have higher resolution?
|
17
|
+
@subject.get(:test).frame.size.height.should == 100
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "should have a test2 view below test view" do
|
22
|
+
it "with origin x = 0, y = 100" do
|
23
|
+
@subject.get(:test2).frame.origin.x.should == 0
|
24
|
+
@subject.get(:test2).frame.origin.y.should == 100
|
25
|
+
end
|
26
|
+
it "with frame w = 100, h = 50" do
|
27
|
+
@subject.get(:test2).frame.size.width.should == 320 # how do I best set this to 100% of the screen, in case future simulators have higher resolution?
|
28
|
+
@subject.get(:test2).frame.size.height.should == 50
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
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.9.
|
4
|
+
version: 0.9.4
|
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-05-
|
12
|
+
date: 2014-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dbt
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- spec/ios/orientation_helper_specs.rb
|
108
108
|
- spec/ios/parent_layout_spec.rb
|
109
109
|
- spec/ios/parent_spec.rb
|
110
|
+
- spec/ios/relative_layout.spec.rb
|
110
111
|
- spec/ios/remove_layout_spec.rb
|
111
112
|
- spec/ios/root_layout_spec.rb
|
112
113
|
- spec/ios/setters_spec.rb
|
@@ -180,6 +181,7 @@ test_files:
|
|
180
181
|
- spec/ios/orientation_helper_specs.rb
|
181
182
|
- spec/ios/parent_layout_spec.rb
|
182
183
|
- spec/ios/parent_spec.rb
|
184
|
+
- spec/ios/relative_layout.spec.rb
|
183
185
|
- spec/ios/remove_layout_spec.rb
|
184
186
|
- spec/ios/root_layout_spec.rb
|
185
187
|
- spec/ios/setters_spec.rb
|