vector2d 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a0bb10792ca5679d63353bdef7fe70e7d8536857
4
+ data.tar.gz: 54765d086661047a0f994c097ceaf4d1e1bb4177
5
+ SHA512:
6
+ metadata.gz: ef5cd08262c55704ac738f773f04a65c3028553c561c994b4f6e35a84b7cf1b8b628785518c0ce4f469c75d1b55edd7f2b5482cc794765d094ce93dcea53e9bb
7
+ data.tar.gz: 4e668d7c16c6ed462501a9381d83b8cf1b1df3a7903f9d6a4d753006cb591ce2bf20e2392783d722b7a332780da79c793266cd4fd2b8976a395b08f1cf721912
data/.gitignore CHANGED
@@ -1,5 +1,2 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
1
  rdoc
5
2
  pkg
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,26 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ vector2d (1.1.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.5)
10
+ rake (10.3.2)
11
+ rspec (2.14.1)
12
+ rspec-core (~> 2.14.0)
13
+ rspec-expectations (~> 2.14.0)
14
+ rspec-mocks (~> 2.14.0)
15
+ rspec-core (2.14.8)
16
+ rspec-expectations (2.14.5)
17
+ diff-lcs (>= 1.1.3, < 2.0)
18
+ rspec-mocks (2.14.6)
19
+
20
+ PLATFORMS
21
+ ruby
22
+
23
+ DEPENDENCIES
24
+ rake (~> 10.3)
25
+ rspec (~> 2.1)
26
+ vector2d!
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Inge Jørgensen
1
+ Copyright (c) 2006 Inge Jørgensen
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -6,21 +6,14 @@ or Vector2d objects.
6
6
 
7
7
  == Installation
8
8
 
9
- Install from RubyForge:
10
-
11
- sudo gem install vector2d
12
-
13
- Install from GitHub:
14
-
15
- gem sources -a http://gems.github.com
16
- sudo gem install elektronaut-vector2d
9
+ gem install vector2d
17
10
 
18
11
  == Usage examples
19
12
 
20
13
  require 'vector2d'
21
14
 
22
15
  # These are equal
23
- v = Vector2d.new(50, 70)
16
+ v = Vector2d.new(50, 70)
24
17
  v = Vector2d.new('50x70')
25
18
 
26
19
  v.aspect_ratio # => 0.714285714285714
@@ -34,7 +27,7 @@ Install from GitHub:
34
27
 
35
28
  == API Documentation
36
29
 
37
- Is available at http://vector2d.rubyforge.org/
30
+ Is available at http://vector2d.rubyforge.org
38
31
 
39
32
  == Source code
40
33
 
@@ -44,8 +37,8 @@ Is available at http://github.com/elektronaut/vector2d
44
37
 
45
38
  (The MIT License)
46
39
 
47
- Copyright (c) 2006-2009 Inge Jørgensen
48
-
40
+ Copyright (c) 2006 Inge Jørgensen
41
+
49
42
  Permission is hereby granted, free of charge, to any person
50
43
  obtaining a copy of this software and associated documentation
51
44
  files (the "Software"), to deal in the Software without
@@ -54,10 +47,10 @@ copy, modify, merge, publish, distribute, sublicense, and/or sell
54
47
  copies of the Software, and to permit persons to whom the
55
48
  Software is furnished to do so, subject to the following
56
49
  conditions:
57
-
50
+
58
51
  The above copyright notice and this permission notice shall be
59
52
  included in all copies or substantial portions of the Software.
60
-
53
+
61
54
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
62
55
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
63
56
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -65,4 +58,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
65
58
  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
66
59
  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
67
60
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
68
- OTHER DEALINGS IN THE SOFTWARE.
61
+ OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,83 +1 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "vector2d"
8
- gem.summary = %Q{Vector2d allows for easy handling of two-dimensionals coordinates and vectors}
9
- gem.email = "inge@elektronaut.no"
10
- gem.homepage = "http://github.com/elektronaut/vector2d"
11
- gem.authors = ["Inge Jørgensen"]
12
- gem.rubyforge_project = 'vector2d'
13
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
- end
15
-
16
- rescue LoadError
17
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
18
- end
19
-
20
- require 'rake/testtask'
21
- Rake::TestTask.new(:test) do |test|
22
- test.libs << 'lib' << 'test'
23
- test.pattern = 'test/**/*_test.rb'
24
- test.verbose = true
25
- end
26
-
27
- begin
28
- require 'rcov/rcovtask'
29
- Rcov::RcovTask.new do |test|
30
- test.libs << 'test'
31
- test.pattern = 'test/**/*_test.rb'
32
- test.verbose = true
33
- end
34
- rescue LoadError
35
- task :rcov do
36
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
37
- end
38
- end
39
-
40
- begin
41
- require 'rake/contrib/sshpublisher'
42
- namespace :rubyforge do
43
-
44
- desc "Release gem and RDoc documentation to RubyForge"
45
- task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
46
-
47
- namespace :release do
48
- desc "Publish RDoc to RubyForge."
49
- task :docs => [:rdoc] do
50
- config = YAML.load(
51
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
52
- )
53
-
54
- host = "#{config['username']}@rubyforge.org"
55
- remote_dir = "/var/www/gforge-projects/vector2d/"
56
- local_dir = 'rdoc'
57
-
58
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
59
- end
60
- end
61
- end
62
- rescue LoadError
63
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
64
- end
65
-
66
- task :default => :test
67
-
68
- require 'rake/rdoctask'
69
- Rake::RDocTask.new do |rdoc|
70
- if File.exist?('VERSION.yml')
71
- config = YAML.load(File.read('VERSION.yml'))
72
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
73
- else
74
- version = ""
75
- end
76
-
77
- rdoc.rdoc_dir = 'rdoc'
78
- rdoc.title = "vector2d #{version}"
79
- rdoc.rdoc_files.include('README*')
80
- rdoc.rdoc_files.include('lib/**/*.rb')
81
- end
82
-
83
-
1
+ require "bundler/gem_tasks"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.1
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+
3
+ class Vector2d
4
+ VERSION = "1.1.1"
5
+ end
data/lib/vector2d.rb CHANGED
@@ -1,151 +1,231 @@
1
+ # encoding: utf-8
2
+
1
3
  # Vector2d allows for easy handling of two-dimensionals coordinates and vectors.
2
4
  # It's very flexible, most methods accepts arguments as strings, arrays, hashes
3
5
  # or Vector2d objects.
4
6
  class Vector2d
5
7
 
6
- # X axis
7
- attr_accessor :x
8
- # Y axis
9
- attr_accessor :y
10
-
11
- # Creates a new vector.
12
- # The following examples are all valid:
13
- #
14
- # Vector2d.new(150, 100)
15
- # Vector2d.new(150.0, 100.0)
16
- # Vector2d.new("150x100")
17
- # Vector2d.new("150.0x100.0")
18
- # Vector2d.new([150,100})
19
- # Vector2d.new({:x => 150, :y => 100})
20
- # Vector2d.new({"x" => 150.0, "y" => 100.0})
21
- # Vector2d.new(Vector2d.new(150, 100))
22
- def initialize(*args)
23
- args.flatten!
24
- if (args.length == 1)
25
- if (args[0].kind_of?(String) && args[0].match(/^[\s]*[\d\.]*[\s]*x[\s]*[\d\.]*[\s]*$/))
26
- args = args[0].split("x")
27
- elsif args[0].kind_of?(Vector2d)
28
- args = [args[0].x, args[0].y]
29
- elsif args[0].kind_of?(Hash)
30
- args[0] = args[0][:x] if args[0][:x]
31
- args[0] = args[0]["x"] if args[0]["x"]
32
- args[1] = args[0][:y] if args[0][:y]
33
- args[1] = args[0]["y"] if args[0]["y"]
34
- else
35
- args = [args[0], args[0]]
36
- end
37
- end
38
- @x, @y = args[0].to_f, args[1].to_f
39
- end
40
-
41
- # Compares two vectors.
42
- def ==(comp)
43
- ( comp.x == @x && comp.y == y )
44
- end
45
-
46
- # Returns a string representation of the vector.
47
- #
48
- # Example:
49
- # Vector2d.new( 150, 100 ).to_s # "150x100"
50
- def to_s
51
- "#{@x}x#{@y}"
52
- end
53
-
54
- # Length of vector
55
- def length
56
- Math.sqrt((@x*@x)+(@y*@y))
57
- end
58
-
59
- # Set new length.
60
- def length=(new_length)
61
- v = self * (new_length/length)
62
- @x, @y = v.x, v.y
63
- end
64
-
65
- # Returns a normalized (length = 1.0) version of the vector.
66
- def normalize
67
- self.dup.normalize!
68
- end
69
-
70
- # In-place form of Vector2d.normalize.
71
- def normalize!
72
- self.length = 1.0
73
- self
74
- end
75
-
76
- # Rounds coordinates to nearest integer.
77
- def round
78
- self.dup.round!
79
- end
80
-
81
- # In-place form of Vector2d.round.
82
- def round!
83
- @x, @y = @x.round, @y.round
84
- self
85
- end
86
-
87
- # Returns the aspect ratio of the vector.
88
- def aspect_ratio
89
- (@x/@y).abs
90
- end
91
-
92
- # Multiply vectors. If args is a single Numeric, both axis will be multiplied.
93
- def *(*vector_or_number)
94
- v = Vector2d::new(vector_or_number)
95
- Vector2d.new(@x*v.x, @y*v.y)
96
- end
97
-
98
- # Divide vectors. If args is a single Numeric, both axis will be divided.
99
- def /(*vector_or_number)
100
- v = Vector2d::new(vector_or_number)
101
- Vector2d.new(@x/v.x, @y/v.y)
102
- end
103
-
104
- # Add vectors. If args is a single Numeric, it will be added to both axis.
105
- def +(*vector_or_number)
106
- v = Vector2d::new(vector_or_number)
107
- Vector2d.new(@x+v.x, @y+v.y)
108
- end
109
-
110
- # Subtract vectors. If args is a single Numeric, it will be subtracted from both axis.
111
- def -(*vector_or_number)
112
- v = Vector2d::new(vector_or_number)
113
- Vector2d.new(@x-v.x, @y-v.y)
114
- end
115
-
116
- # Constrain/expand so that both coordinates fit within (the square implied by) another vector.
117
- # This is useful for resizing images to fit a certain size while keeping aspect ratio.
118
- #
119
- # == Examples
120
- #
121
- # my_image = Vector2d.new("320x200") # Creates a new vector object
122
- # my_image.constrain_both(100) # Returns a new vector: x=100, y=63
123
- # my_image.constrain_both(150, 50) # Returns a new vector: x=80, y=50
124
- # my_image.constrain_both("150x50") # Equal to constrain_both( 150, 50 )
125
- # my_image.constrain_both("x100") # Returns a new vector: x=160, y=100
126
- #
127
- # == Note
128
- #
129
- # Either axis will be disregarded if zero or nil (see the last example). This is a feature, not a bug. ;)
130
- def constrain_both(*vector_or_number)
131
- scale = Vector2d::new(vector_or_number) / self
132
- (self * ((scale.y==0||(scale.x>0&&scale.x<scale.y)) ? scale.x : scale.y))
133
- end
134
-
135
- # Constrain/expand so that one of the coordinates fit within (the square implied by) another vector.
136
- #
137
- # == Example
138
- #
139
- # my_image = Vector2d.new("320x200") # Creates a new vector object
140
- # my_image.constrain_one(100, 100) # Returns a new vector: x=160, y=100
141
- def constrain_one( *vector_or_number )
142
- scale = Vector2d::new(vector_or_number) / self
143
- if (scale.x > 0 && scale.y > 0)
144
- scale = (scale.x<scale.y) ? scale.y : scale.x
145
- self * scale
146
- else
147
- constrain_both(args)
148
- end
149
- end
8
+ # X axis
9
+ attr_accessor :x
10
+ # Y axis
11
+ attr_accessor :y
12
+
13
+ # Creates a new vector.
14
+ # The following examples are all valid:
15
+ #
16
+ # Vector2d.new(150, 100)
17
+ # Vector2d.new(150.0, 100.0)
18
+ # Vector2d.new("150x100")
19
+ # Vector2d.new("150.0x100.0")
20
+ # Vector2d.new([150,100})
21
+ # Vector2d.new({:x => 150, :y => 100})
22
+ # Vector2d.new({"x" => 150.0, "y" => 100.0})
23
+ # Vector2d.new(Vector2d.new(150, 100))
24
+ def initialize(*args)
25
+ args.flatten!
26
+ if (args.length == 1)
27
+ if (args[0].kind_of?(String) && args[0].match(/^[\s]*[\d\.]*[\s]*x[\s]*[\d\.]*[\s]*$/))
28
+ args = args[0].split("x")
29
+ elsif args[0].kind_of?(Vector2d)
30
+ args = [args[0].x, args[0].y]
31
+ elsif args[0].kind_of?(Hash)
32
+ args[0] = args[0][:x] if args[0][:x]
33
+ args[0] = args[0]["x"] if args[0]["x"]
34
+ args[1] = args[0][:y] if args[0][:y]
35
+ args[1] = args[0]["y"] if args[0]["y"]
36
+ else
37
+ args = [args[0], args[0]]
38
+ end
39
+ end
40
+ @x, @y = args[0].to_f, args[1].to_f
41
+ end
42
+
43
+ # Compares two vectors.
44
+ def ==(comp)
45
+ comp.x == @x && comp.y == y
46
+ end
47
+
48
+ # Returns a string representation of the vector.
49
+ #
50
+ # Example:
51
+ # Vector2d.new( 150, 100 ).to_s # "150x100"
52
+ def to_s
53
+ "#{@x}x#{@y}"
54
+ end
55
+
56
+ # Length of vector
57
+ def length
58
+ Math.sqrt(length_squared)
59
+ end
60
+
61
+ # Returns the length of this vector before square root. Allows for a faster check.
62
+ def length_squared
63
+ @x * @x + @y * @y
64
+ end
65
+
66
+ # Set new length.
67
+ def length=(new_length)
68
+ v = self * (new_length/length)
69
+ @x, @y = v.x, v.y
70
+ end
71
+
72
+ # Returns a normalized (length = 1.0) version of the vector.
73
+ def normalize
74
+ self.dup.normalize!
75
+ end
76
+
77
+ # In-place form of Vector2d.normalize.
78
+ def normalize!
79
+ self.length = 1.0
80
+ self
81
+ end
82
+
83
+ def normalized?
84
+ end
85
+
86
+ # Rounds coordinates to nearest integer.
87
+ def round
88
+ self.dup.round!
89
+ end
90
+
91
+ # In-place form of Vector2d.round.
92
+ def round!
93
+ @x, @y = @x.round, @y.round
94
+ self
95
+ end
96
+
97
+ # Returns the aspect ratio of the vector.
98
+ def aspect_ratio
99
+ (@x/@y).abs
100
+ end
101
+
102
+ # Multiply vectors. If args is a single Numeric, both axis will be multiplied.
103
+ def *(*vector_or_number)
104
+ v = Vector2d::new(vector_or_number)
105
+ Vector2d.new(@x*v.x, @y*v.y)
106
+ end
107
+
108
+ # Divide vectors. If args is a single Numeric, both axis will be divided.
109
+ def /(*vector_or_number)
110
+ v = Vector2d::new(vector_or_number)
111
+ Vector2d.new(@x/v.x, @y/v.y)
112
+ end
113
+
114
+ # Add vectors. If args is a single Numeric, it will be added to both axis.
115
+ def +(*vector_or_number)
116
+ v = Vector2d::new(vector_or_number)
117
+ Vector2d.new(@x+v.x, @y+v.y)
118
+ end
119
+
120
+ # Subtract vectors. If args is a single Numeric, it will be subtracted from both axis.
121
+ def -(*vector_or_number)
122
+ v = Vector2d::new(vector_or_number)
123
+ Vector2d.new(@x-v.x, @y-v.y)
124
+ end
125
+
126
+ # return a new vector perpendicular to this one
127
+ def perpendicular
128
+ Vector2d.new(-@y, @x)
129
+ end
130
+
131
+ # distance between two vectors
132
+ def distance(vector2)
133
+ Math.sqrt(distance_sq(vector2))
134
+ end
135
+
136
+ # Calculate squared distance between vectors. Faster than standard distance.
137
+ # param vector2 The other vector.
138
+ # returns the squared distance between the vectors.
139
+ def distance_sq(vector2)
140
+ dx = vector2.x - @x
141
+ dy = vector2.y - @y
142
+ dx * dx + dy * dy
143
+ end
144
+
145
+ # angle of this vector
146
+ def angle
147
+ Math.atan2(@y, @x)
148
+ end
149
+
150
+ # sets the length under the given value. Nothing is done if
151
+ # the vector is already shorter.
152
+ def truncate(max)
153
+ length = Math.min(max, length)
154
+ self
155
+ end
156
+
157
+ # Makes the vector face the opposite way.
158
+ def reverse
159
+ @x = -@x
160
+ @y = -@y
161
+ self
162
+ end
163
+
164
+ # dot product of this vector and another vector
165
+ def dot_product(vector2)
166
+ self.class.dot_product(self, vector2)
167
+ end
168
+
169
+ # cross product of this vector and another vector
170
+ def cross_product(vector2)
171
+ self.class.cross_product(self, vector2)
172
+ end
173
+
174
+ # angle in radians between this vector and another
175
+ def angle_between(vector2)
176
+ self.class.angle_between(self, vector2)
177
+ end
178
+
179
+ # cross product of two vectors
180
+ def self.cross_product(vector1, vector2)
181
+ @x * vector2.y - @y * vector2.x
182
+ end
183
+
184
+ # dot product of two vectors
185
+ def self.dot_product(vector1, vector2)
186
+ vector1.x * vector2.x + vector1.y * vector2.y
187
+ end
188
+
189
+ # angle between two vectors in radians
190
+ def self.angle_between(vector1, vector2)
191
+ one = vector1.normalized? ? vector1 : vector1.normalize
192
+ two = vector2.normalized? ? vector2 : vector2.normalize
193
+ Math.acos(self.dot_product(one, two))
194
+ end
195
+
196
+ # Constrain/expand so that both coordinates fit within (the square implied by) another vector.
197
+ # This is useful for resizing images to fit a certain size while keeping aspect ratio.
198
+ #
199
+ # == Examples
200
+ #
201
+ # my_image = Vector2d.new("320x200") # Creates a new vector object
202
+ # my_image.constrain_both(100) # Returns a new vector: x=100, y=63
203
+ # my_image.constrain_both(150, 50) # Returns a new vector: x=80, y=50
204
+ # my_image.constrain_both("150x50") # Equal to constrain_both( 150, 50 )
205
+ # my_image.constrain_both("x100") # Returns a new vector: x=160, y=100
206
+ #
207
+ # == Note
208
+ #
209
+ # Either axis will be disregarded if zero or nil (see the last example). This is a feature, not a bug. ;)
210
+ def constrain_both(*vector_or_number)
211
+ scale = Vector2d::new(vector_or_number) / self
212
+ (self * ((scale.y==0||(scale.x>0&&scale.x<scale.y)) ? scale.x : scale.y))
213
+ end
214
+
215
+ # Constrain/expand so that one of the coordinates fit within (the square implied by) another vector.
216
+ #
217
+ # == Example
218
+ #
219
+ # my_image = Vector2d.new("320x200") # Creates a new vector object
220
+ # my_image.constrain_one(100, 100) # Returns a new vector: x=160, y=100
221
+ def constrain_one( *vector_or_number )
222
+ scale = Vector2d::new(vector_or_number) / self
223
+ if (scale.x > 0 && scale.y > 0)
224
+ scale = (scale.x<scale.y) ? scale.y : scale.x
225
+ self * scale
226
+ else
227
+ constrain_both(vector_or_number)
228
+ end
229
+ end
150
230
 
151
231
  end
data/vector2d.gemspec CHANGED
@@ -1,48 +1,27 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
1
4
  # -*- encoding: utf-8 -*-
2
5
 
6
+ $:.push File.expand_path("../lib", __FILE__)
7
+ require "vector2d/version"
8
+
3
9
  Gem::Specification.new do |s|
4
- s.name = %q{vector2d}
5
- s.version = "1.0.0"
10
+ s.name = %q{vector2d}
11
+ s.version = Vector2d::VERSION
12
+ s.authors = ["Inge Jørgensen"]
13
+ s.email = ["inge@elektronaut.no"]
14
+ s.homepage = %q{http://github.com/elektronaut/vector2d}
15
+ s.summary = %q{Library for handling two-dimensional vectors}
16
+ s.description = %q{Vector2d allows for easy handling of two-dimensionals coordinates and vectors}
17
+ s.license = "MIT"
6
18
 
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Inge J\303\270rgensen"]
9
- s.date = %q{2009-05-20}
10
- s.email = %q{inge@elektronaut.no}
11
- s.extra_rdoc_files = [
12
- "LICENSE",
13
- "README.rdoc"
14
- ]
15
- s.files = [
16
- ".document",
17
- ".gitignore",
18
- "LICENSE",
19
- "README.rdoc",
20
- "Rakefile",
21
- "VERSION",
22
- "lib/vector2d.rb",
23
- "test/test_helper.rb",
24
- "test/vector2d_test.rb",
25
- "vector2d.gemspec"
26
- ]
27
- s.has_rdoc = true
28
- s.homepage = %q{http://github.com/elektronaut/vector2d}
29
- s.rdoc_options = ["--charset=UTF-8"]
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
30
22
  s.require_paths = ["lib"]
31
- s.rubyforge_project = %q{vector2d}
32
- s.rubygems_version = %q{1.3.1}
33
- s.summary = %q{Vector2d allows for easy handling of two-dimensionals coordinates and vectors}
34
- s.test_files = [
35
- "test/test_helper.rb",
36
- "test/vector2d_test.rb"
37
- ]
38
-
39
- if s.respond_to? :specification_version then
40
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
- s.specification_version = 2
42
23
 
43
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
44
- else
45
- end
46
- else
47
- end
24
+ # specify any dependencies here; for example:
25
+ s.add_development_dependency "rake", "~> 10.3"
26
+ s.add_development_dependency "rspec", "~> 2.1"
48
27
  end
metadata CHANGED
@@ -1,64 +1,83 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: vector2d
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
5
5
  platform: ruby
6
- authors:
7
- - "Inge J\xC3\xB8rgensen"
6
+ authors:
7
+ - Inge Jørgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2009-05-20 00:00:00 +02:00
13
- default_executable:
14
- dependencies: []
15
-
16
- description:
17
- email: inge@elektronaut.no
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '10.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '10.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.1'
41
+ description: Vector2d allows for easy handling of two-dimensionals coordinates and
42
+ vectors
43
+ email:
44
+ - inge@elektronaut.no
18
45
  executables: []
19
-
20
46
  extensions: []
21
-
22
- extra_rdoc_files:
23
- - LICENSE
24
- - README.rdoc
25
- files:
26
- - .document
27
- - .gitignore
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - Gemfile.lock
28
52
  - LICENSE
29
53
  - README.rdoc
30
54
  - Rakefile
31
55
  - VERSION
32
56
  - lib/vector2d.rb
33
- - test/test_helper.rb
34
- - test/vector2d_test.rb
57
+ - lib/vector2d/version.rb
35
58
  - vector2d.gemspec
36
- has_rdoc: true
37
59
  homepage: http://github.com/elektronaut/vector2d
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
38
63
  post_install_message:
39
- rdoc_options:
40
- - --charset=UTF-8
41
- require_paths:
64
+ rdoc_options: []
65
+ require_paths:
42
66
  - lib
43
- required_ruby_version: !ruby/object:Gem::Requirement
44
- requirements:
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
45
69
  - - ">="
46
- - !ruby/object:Gem::Version
47
- version: "0"
48
- version:
49
- required_rubygems_version: !ruby/object:Gem::Requirement
50
- requirements:
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
51
74
  - - ">="
52
- - !ruby/object:Gem::Version
53
- version: "0"
54
- version:
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
55
77
  requirements: []
56
-
57
- rubyforge_project: vector2d
58
- rubygems_version: 1.3.1
78
+ rubyforge_project:
79
+ rubygems_version: 2.2.0
59
80
  signing_key:
60
- specification_version: 2
61
- summary: Vector2d allows for easy handling of two-dimensionals coordinates and vectors
62
- test_files:
63
- - test/test_helper.rb
64
- - test/vector2d_test.rb
81
+ specification_version: 4
82
+ summary: Library for handling two-dimensional vectors
83
+ test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/test/test_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
- require 'shoulda'
4
-
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
- $LOAD_PATH.unshift(File.dirname(__FILE__))
7
- require 'vector2d'
8
-
9
- class Test::Unit::TestCase
10
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class Vector2dTest < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end