tween 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Rakefile +1 -1
  2. data/examples/demo.rb +8 -0
  3. data/lib/tween.rb +10 -1
  4. data/tween.gemspec +2 -2
  5. metadata +6 -2
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('tween', '0.1') do |p|
5
+ Echoe.new('tween', '0.1.1') do |p|
6
6
  p.description = "Fluid motion using tweens for Ruby"
7
7
  p.url = "http://ruby.about.com/"
8
8
  p.author = "Michael Morin"
data/examples/demo.rb CHANGED
@@ -52,6 +52,14 @@ class MyWindow < Gosu::Window
52
52
  @x, @y = width / 2, height / 2
53
53
  @tween = nil
54
54
  @easer = Tween::EASERS[0]
55
+
56
+ begin
57
+ require 'gl'
58
+
59
+ Gl.glEnable(Gl::GL_LINE_SMOOTH)
60
+ Gl.glHint(Gl::GL_LINE_SMOOTH_HINT, Gl::GL_NICEST)
61
+ rescue LoadError
62
+ end
55
63
  end
56
64
 
57
65
 
data/lib/tween.rb CHANGED
@@ -15,6 +15,14 @@ class Tween
15
15
  @start, @finish = start, finish
16
16
  @easer, @duration = easer, duration
17
17
 
18
+ unless @start.respond_to? :[]
19
+ @start = [@start]
20
+ end
21
+
22
+ unless @finish.respond_to? :[]
23
+ @finish = [@finish]
24
+ end
25
+
18
26
  @time = 0
19
27
  @done = false
20
28
  end
@@ -36,6 +44,7 @@ class Tween
36
44
  )
37
45
  end
38
46
 
47
+ def value; self[0]; end
39
48
  def x; self[0]; end
40
49
  def y; self[1]; end
41
50
  def z; self[2]; end
@@ -380,4 +389,4 @@ class Tween
380
389
  Elastic::Out
381
390
  ]
382
391
 
383
- end
392
+ end
data/tween.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{tween}
5
- s.version = "0.1"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Michael Morin"]
9
- s.date = %q{2010-10-01}
9
+ s.date = %q{2010-10-15}
10
10
  s.description = %q{Fluid motion using tweens for Ruby}
11
11
  s.email = %q{michael.c.morin@gmail.com}
12
12
  s.extra_rdoc_files = ["README.markdown", "lib/tween.rb"]
metadata CHANGED
@@ -1,11 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tween
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 25
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- version: "0.1"
9
+ - 1
10
+ version: 0.1.1
9
11
  platform: ruby
10
12
  authors:
11
13
  - Michael Morin
@@ -13,7 +15,7 @@ autorequire:
13
15
  bindir: bin
14
16
  cert_chain: []
15
17
 
16
- date: 2010-10-01 00:00:00 -04:00
18
+ date: 2010-10-15 00:00:00 -04:00
17
19
  default_executable:
18
20
  dependencies: []
19
21
 
@@ -52,6 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
54
  requirements:
53
55
  - - ">="
54
56
  - !ruby/object:Gem::Version
57
+ hash: 3
55
58
  segments:
56
59
  - 0
57
60
  version: "0"
@@ -60,6 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
63
  requirements:
61
64
  - - ">="
62
65
  - !ruby/object:Gem::Version
66
+ hash: 11
63
67
  segments:
64
68
  - 1
65
69
  - 2