gui_geometry 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -24,7 +24,7 @@ Rectangles consist of two point objects. One specifies the location of the recta
24
24
 
25
25
  ``` ruby
26
26
  require "gui_geometry"
27
- include GuiGeometry::Tools
27
+ include GuiGeometry
28
28
 
29
29
  # create point x == y == 0
30
30
  point
@@ -63,6 +63,24 @@ rect point(30,50)
63
63
 
64
64
  ```
65
65
 
66
+ To get access to min, max, bound, and minmax:
67
+
68
+ ```
69
+ include GuiGeometry::Tools
70
+
71
+ min(4,5)
72
+ # => 4
73
+
74
+ max(4,5)
75
+ # => 5
76
+
77
+ minmax(4,5)
78
+ # => [4,5]
79
+
80
+ bound(5,4,10)
81
+ # => 5
82
+ ```
83
+
66
84
  ## Contributing
67
85
 
68
86
  1. Fork it
@@ -7,3 +7,8 @@
7
7
  }.each do |file|
8
8
  require File.join(File.dirname(__FILE__),"gui_geometry",file)
9
9
  end
10
+
11
+ module GuiGeometry
12
+ def point(*args); GuiGeometry::Point.new *args end
13
+ def rect(*args); GuiGeometry::Rectangle.new *args end
14
+ end
@@ -1,5 +1,6 @@
1
1
  module GuiGeometry
2
2
  module Tools
3
+ include ::GuiGeometry
3
4
  def min(a,b) a < b ? a : b; end
4
5
  def max(a,b) a > b ? a : b; end
5
6
  def minmax(a,b)
@@ -10,8 +11,5 @@ module Tools
10
11
  end
11
12
  end
12
13
  def bound(a,bounded,c) max(a,min(bounded,c)); end
13
-
14
- def point(*args); GuiGeometry::Point.new *args end
15
- def rect(*args); GuiGeometry::Rectangle.new *args end
16
14
  end
17
15
  end
@@ -1,3 +1,3 @@
1
1
  module GuiGeometry
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  module GuiGeometry
4
4
  describe "Point" do
5
- include Tools
5
+ include ::GuiGeometry
6
6
 
7
7
  it "init" do
8
8
  point.should == point(0,0)
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  module GuiGeometry
4
4
  describe "Rectangle" do
5
- include Tools
5
+ include ::GuiGeometry
6
6
 
7
7
  it "defaults" do
8
8
  rect.should == rect(0,0,0,0)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gui_geometry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: