geomotion 0.12.1 → 0.12.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,2 +1,3 @@
1
1
  language: objective-c
2
2
  before_install: rvm use 1.9.3
3
+ before_script: sudo chown -R travis ~/Library/RubyMotion
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geomotion (0.11.0)
4
+ geomotion (0.12.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  $:.unshift("/Library/RubyMotion/lib")
2
- require 'motion/project'
2
+ require 'motion/project/template/ios'
3
3
  require "bundler/gem_tasks"
4
4
 
5
5
  $:.unshift("./lib/")
@@ -185,7 +185,11 @@ class CGRect
185
185
  end
186
186
 
187
187
  def below(margin = 0)
188
- CGRect.new([self.x, self.y + self.height + margin], self.size)
188
+ self.below(margin, height:self.height)
189
+ end
190
+
191
+ def below(margin, height:height)
192
+ CGRect.new([self.x, self.y + self.height + margin], [self.width, height])
189
193
  end
190
194
 
191
195
  def before(margin = 0)
@@ -1,3 +1,3 @@
1
1
  module Geomotion
2
- VERSION = "0.12.1"
2
+ VERSION = "0.12.2"
3
3
  end
data/spec/cg_rect_spec.rb CHANGED
@@ -347,57 +347,84 @@ describe "CGRect" do
347
347
  it "works with margins" do
348
348
  rect = CGRect.make(height: 50).above(20)
349
349
  rect.origin.y.should == -70
350
+ rect.size.height.should == 50
351
+ end
352
+
353
+ it "works with height" do
354
+ rect = CGRect.make(height: 50).above(20, height: 10)
355
+ rect.origin.y.should == -30
356
+ rect.size.height.should == 10
350
357
  end
351
358
 
352
359
  it "works without margins" do
353
360
  rect = CGRect.make(height: 50).above
354
361
  rect.origin.y.should == -50
362
+ rect.size.height.should == 50
355
363
  end
356
364
  end
357
365
 
358
366
  describe "#below" do
359
- it "works" do
367
+ it "works with margins" do
360
368
  rect = CGRect.make(height: 50).below(20)
361
369
  rect.origin.y.should == 70
370
+ rect.size.height.should == 50
371
+ end
372
+
373
+ it "works with height" do
374
+ rect = CGRect.make(height: 50).below(20, height: 10)
375
+ rect.origin.y.should == 70
376
+ rect.size.height.should == 10
377
+ end
378
+
379
+ it "works without margins" do
380
+ rect = CGRect.make(height: 50).below
381
+ rect.origin.y.should == 50
382
+ rect.size.height.should == 50
362
383
  end
363
384
  end
364
385
 
365
386
  describe "#before" do
366
- it "works" do
367
- rect = CGRect.make(x: 50).before(20)
368
- rect.origin.x.should == 30
387
+ it "works with margins" do
388
+ rect = CGRect.make(width: 50).before(20)
389
+ rect.origin.x.should == -70
390
+ rect.size.width.should == 50
369
391
  end
370
- end
371
392
 
372
- describe "#before:width:" do
373
- it "works" do
374
- rect = CGRect.make(x: 50).before(20, width: 50)
375
- rect.origin.x.should == -20
393
+ it "works with width" do
394
+ rect = CGRect.make(width: 50).before(20, width: 10)
395
+ rect.origin.x.should == -30
396
+ rect.size.width.should == 10
397
+ end
398
+
399
+ it "works without margins" do
400
+ rect = CGRect.make(width: 50).before
401
+ rect.origin.x.should == -50
402
+ rect.size.width.should == 50
376
403
  end
377
404
  end
378
405
 
379
406
  describe "#beside" do
380
407
  it "works with margins" do
381
- rect = CGRect.make(x: 50, width: 20).beside(10)
382
- rect.origin.x.should == 80
408
+ rect = CGRect.make(width: 50).beside(20)
409
+ rect.origin.x.should == 70
410
+ rect.size.width.should == 50
383
411
  end
384
412
 
385
- it "works without margins" do
386
- rect = CGRect.make(x: 50, width: 20).beside
413
+ it "works with width" do
414
+ rect = CGRect.make(width: 50).beside(20, width: 10)
387
415
  rect.origin.x.should == 70
416
+ rect.size.width.should == 10
388
417
  end
389
- end
390
418
 
391
- describe "#beside:width:" do
392
- it "works" do
393
- rect = CGRect.make(x: 50, width: 20).beside(10, width: 30)
394
- rect.origin.x.should == 80
395
- rect.size.width.should == 30
419
+ it "works without margins" do
420
+ rect = CGRect.make(width: 50).beside
421
+ rect.origin.x.should == 50
422
+ rect.size.width.should == 50
396
423
  end
397
424
  end
398
425
 
399
426
  describe "#top_left" do
400
- it "works" do
427
+ it "works with margins" do
401
428
  rect = CGRect.make(x: 10, y: 20, width: 100, height: 200)
402
429
  point = rect.top_left
403
430
  point.is_a?(CGPoint).should == true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geomotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-25 00:00:00.000000000 Z
13
+ date: 2013-08-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake