tortoise 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,11 +12,7 @@ module Tortoise
12
12
 
13
13
  def to_ascii
14
14
  oriented_canvas.inject('') do |ascii, column|
15
- column.each do |pixel|
16
- char = pixel ? 'X' : '.'
17
- ascii += "#{char} "
18
- end
19
- ascii = ascii.strip + "\n"
15
+ ascii += column.map { |pixel| pixel ? 'X ' : '. ' }.join.strip + "\n"
20
16
  end
21
17
  end
22
18
 
@@ -93,12 +89,10 @@ module Tortoise
93
89
 
94
90
  def html_canvas
95
91
  @canvas.inject("<div id='canvas'>") do |html, column|
96
- html += "<div class='column'>"
97
- column.reverse.each do |pixel|
98
- pixel_class = pixel ? 'filled' : 'empty'
99
- html += "<div class='pixel #{pixel_class}'></div>"
100
- end
101
- html += "</div>"
92
+ html += "<div class='column'>" +
93
+ column.reverse.map do |pixel|
94
+ "<div class='pixel #{pixel ? 'filled' : 'empty'}'></div>"
95
+ end.join + "</div>"
102
96
  end + "</div>"
103
97
  end
104
98
  end
@@ -1,3 +1,3 @@
1
1
  module Tortoise
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tortoise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chunky_png
16
- requirement: &70094881402880 !ruby/object:Gem::Requirement
16
+ requirement: &70231598937120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70094881402880
24
+ version_requirements: *70231598937120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70094881400240 !ruby/object:Gem::Requirement
27
+ requirement: &70231598933780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70094881400240
35
+ version_requirements: *70231598933780
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70094881398500 !ruby/object:Gem::Requirement
38
+ requirement: &70231598931880 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70094881398500
46
+ version_requirements: *70231598931880
47
47
  description: Tortoise is a Logo interpreter for ruby.
48
48
  email:
49
49
  - huntca@gmail.com