texplay 0.2.3 → 0.2.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.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 15/9/09
2
+ version 0.2.4
3
+ * added lsystem
4
+ * made lsystem both 1.9.1 and 1.8.6 compatible
5
+
1
6
  11/9/09
2
7
  version 0.2.3
3
8
  * added Ruby 1.8.7 compatibility by modifying extconf.rb to define RUBY_19 macro
data/README.markdown CHANGED
@@ -5,7 +5,7 @@
5
5
  INSTRUCTIONS
6
6
  ============
7
7
 
8
- **TexPlay version 0.2.3**
8
+ **TexPlay version 0.2.4**
9
9
 
10
10
  Gem installation:
11
11
 
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rake/clean'
2
2
  require 'rake/gempackagetask'
3
3
 
4
- TEXPLAY_VERSION = "0.2.3"
4
+ TEXPLAY_VERSION = "0.2.4"
5
5
 
6
6
  $dlext = Config::CONFIG['DLEXT']
7
7
 
@@ -38,8 +38,8 @@ end
38
38
  class W < Gosu::Window
39
39
  def initialize
40
40
  super(1024, 768, false, 20)
41
- @img = TexPlay::create_blank_image(self, 800, 500)
42
- @img.lsystem(250, 250, Dragon, :order => 13, :line_length => 2)
41
+ @img = TexPlay::create_blank_image(self, 500, 500)
42
+ @img.lsystem(0, 250, Bush2, :order => 5, :line_length => 5)
43
43
  end
44
44
 
45
45
  def draw
@@ -5,13 +5,9 @@ end
5
5
 
6
6
  require 'texplay'
7
7
 
8
- # monkey-patches to core classes
9
- class String
10
- if !method_defined? :each_char
11
- alias_method :_each_char, :each_byte
12
- else
13
- alias_method :_each_char, :each_char
14
- end
8
+ # to bring in String#each_char for 1.8
9
+ if RUBY_VERSION =~ /1.8/
10
+ require 'jcode'
15
11
  end
16
12
 
17
13
  # setup will be executed straight after Gosu::Image instantiation
@@ -135,7 +131,8 @@ TexPlay::create_macro(:lsystem) do |x, y, system, options|
135
131
  move_to(x, y)
136
132
  line_length = options[:line_length] || 1
137
133
 
138
- system.produce_string(options)._each_char do |v|
134
+ system.produce_string(options).each_char do |v|
135
+
139
136
  case v
140
137
  when "F"
141
138
  forward(line_length, true)
data/lib/texplay.rb CHANGED
@@ -10,7 +10,7 @@ require 'rbconfig'
10
10
  require 'gosu'
11
11
 
12
12
  module TexPlay
13
- TEXPLAY_VERSION = "0.2.3"
13
+ TEXPLAY_VERSION = "0.2.4"
14
14
 
15
15
  def self::on_setup(&block)
16
16
  raise "need a block" if !block
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)