smalruby 0.0.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of smalruby might be problematic. Click here for more details.

@@ -0,0 +1,167 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe Smalruby::Color do
5
+ describe '.smalruby_to_dxruby' do
6
+ subject { described_class.smalruby_to_dxruby(color_name) }
7
+
8
+ name_to_code = {
9
+ "black" => [0x00, 0x00, 0x00],
10
+ "dimgray" => [0x69, 0x69, 0x69],
11
+ "gray" => [0x80, 0x80, 0x80],
12
+ "darkgray" => [0xa9, 0xa9, 0xa9],
13
+ "silver" => [0xc0, 0xc0, 0xc0],
14
+ "lightgrey" => [0xd3, 0xd3, 0xd3],
15
+ "gainsboro" => [0xdc, 0xdc, 0xdc],
16
+ "whitesmoke" => [0xf5, 0xf5, 0xf5],
17
+ "white" => [0xff, 0xff, 0xff],
18
+ "snow" => [0xff, 0xfa, 0xfa],
19
+ "ghostwhite" => [0xf8, 0xf8, 0xff],
20
+ "floralwhite" => [0xff, 0xfa, 0xf0],
21
+ "linen" => [0xfa, 0xf0, 0xe6],
22
+ "antiquewhite" => [0xfa, 0xeb, 0xd7],
23
+ "papayawhip" => [0xff, 0xef, 0xd5],
24
+ "blanchedalmond" => [0xff, 0xeb, 0xcd],
25
+ "bisque" => [0xff, 0xe4, 0xc4],
26
+ "moccasin" => [0xff, 0xe4, 0xb5],
27
+ "navajowhite" => [0xff, 0xde, 0xad],
28
+ "peachpuff" => [0xff, 0xda, 0xb9],
29
+ "mistyrose" => [0xff, 0xe4, 0xe1],
30
+ "lavenderblush" => [0xff, 0xf0, 0xf5],
31
+ "seashell" => [0xff, 0xf5, 0xee],
32
+ "oldlace" => [0xfd, 0xf5, 0xe6],
33
+ "ivory" => [0xff, 0xff, 0xf0],
34
+ "honeydew" => [0xf0, 0xff, 0xf0],
35
+ "mintcream" => [0xf5, 0xff, 0xfa],
36
+ "azure" => [0xf0, 0xff, 0xff],
37
+ "aliceblue" => [0xf0, 0xf8, 0xff],
38
+ "lavender" => [0xe6, 0xe6, 0xfa],
39
+ "lightsteelblue" => [0xb0, 0xc4, 0xde],
40
+ "lightslategray" => [0x77, 0x88, 0x99],
41
+ "slategray" => [0x70, 0x80, 0x90],
42
+ "steelblue" => [0x46, 0x82, 0xb4],
43
+ "royalblue" => [0x41, 0x69, 0xe1],
44
+ "midnightblue" => [0x19, 0x19, 0x70],
45
+ "navy" => [0x00, 0x00, 0x80],
46
+ "darkblue" => [0x00, 0x00, 0x8b],
47
+ "mediumblue" => [0x00, 0x00, 0xcd],
48
+ "blue" => [0x00, 0x00, 0xff],
49
+ "dodgerblue" => [0x1e, 0x90, 0xff],
50
+ "cornflowerblue" => [0x64, 0x95, 0xed],
51
+ "deepskyblue" => [0x00, 0xbf, 0xff],
52
+ "lightskyblue" => [0x87, 0xce, 0xfa],
53
+ "skyblue" => [0x87, 0xce, 0xeb],
54
+ "lightblue" => [0xad, 0xd8, 0xe6],
55
+ "powderblue" => [0xb0, 0xe0, 0xe6],
56
+ "paleturquoise" => [0xaf, 0xee, 0xee],
57
+ "lightcyan" => [0xe0, 0xff, 0xff],
58
+ "cyan" => [0x00, 0xff, 0xff],
59
+ "aqua" => [0x00, 0xff, 0xff],
60
+ "turquoise" => [0x40, 0xe0, 0xd0],
61
+ "mediumturquoise" => [0x48, 0xd1, 0xcc],
62
+ "darkturquoise" => [0x00, 0xce, 0xd1],
63
+ "lightseagreen" => [0x20, 0xb2, 0xaa],
64
+ "cadetblue" => [0x5f, 0x9e, 0xa0],
65
+ "darkcyan" => [0x00, 0x8b, 0x8b],
66
+ "teal" => [0x00, 0x80, 0x80],
67
+ "darkslategray" => [0x2f, 0x4f, 0x4f],
68
+ "darkgreen" => [0x00, 0x64, 0x00],
69
+ "green" => [0x00, 0x80, 0x00],
70
+ "forestgreen" => [0x22, 0x8b, 0x22],
71
+ "seagreen" => [0x2e, 0x8b, 0x57],
72
+ "mediumseagreen" => [0x3c, 0xb3, 0x71],
73
+ "mediumaquamarine" => [0x66, 0xcd, 0xaa],
74
+ "darkseagreen" => [0x8f, 0xbc, 0x8f],
75
+ "aquamarine" => [0x7f, 0xff, 0xd4],
76
+ "palegreen" => [0x98, 0xfb, 0x98],
77
+ "lightgreen" => [0x90, 0xee, 0x90],
78
+ "springgreen" => [0x00, 0xff, 0x7f],
79
+ "mediumspringgreen" => [0x00, 0xfa, 0x9a],
80
+ "lawngreen" => [0x7c, 0xfc, 0x00],
81
+ "chartreuse" => [0x7f, 0xff, 0x00],
82
+ "greenyellow" => [0xad, 0xff, 0x2f],
83
+ "lime" => [0x00, 0xff, 0x00],
84
+ "limegreen" => [0x32, 0xcd, 0x32],
85
+ "yellowgreen" => [0x9a, 0xcd, 0x32],
86
+ "darkolivegreen" => [0x55, 0x6b, 0x2f],
87
+ "olivedrab" => [0x6b, 0x8e, 0x23],
88
+ "olive" => [0x80, 0x80, 0x00],
89
+ "darkkhaki" => [0xbd, 0xb7, 0x6b],
90
+ "palegoldenrod" => [0xee, 0xe8, 0xaa],
91
+ "cornsilk" => [0xff, 0xf8, 0xdc],
92
+ "beige" => [0xf5, 0xf5, 0xdc],
93
+ "lightyellow" => [0xff, 0xff, 0xe0],
94
+ "lightgoldenrodyellow" => [0xfa, 0xfa, 0xd2],
95
+ "lemonchiffon" => [0xff, 0xfa, 0xcd],
96
+ "wheat" => [0xf5, 0xde, 0xb3],
97
+ "burlywood" => [0xde, 0xb8, 0x87],
98
+ "tan" => [0xd2, 0xb4, 0x8c],
99
+ "khaki" => [0xf0, 0xe6, 0x8c],
100
+ "yellow" => [0xff, 0xff, 0x00],
101
+ "gold" => [0xff, 0xd7, 0x00],
102
+ "orange" => [0xff, 0xa5, 0x00],
103
+ "sandybrown" => [0xf4, 0xa4, 0x60],
104
+ "darkorange" => [0xff, 0x8c, 0x00],
105
+ "goldenrod" => [0xda, 0xa5, 0x20],
106
+ "peru" => [0xcd, 0x85, 0x3f],
107
+ "darkgoldenrod" => [0xb8, 0x86, 0x0b],
108
+ "chocolate" => [0xd2, 0x69, 0x1e],
109
+ "sienna" => [0xa0, 0x52, 0x2d],
110
+ "saddlebrown" => [0x8b, 0x45, 0x13],
111
+ "maroon" => [0x80, 0x00, 0x00],
112
+ "darkred" => [0x8b, 0x00, 0x00],
113
+ "brown" => [0xa5, 0x2a, 0x2a],
114
+ "firebrick" => [0xb2, 0x22, 0x22],
115
+ "indianred" => [0xcd, 0x5c, 0x5c],
116
+ "rosybrown" => [0xbc, 0x8f, 0x8f],
117
+ "darksalmon" => [0xe9, 0x96, 0x7a],
118
+ "lightcoral" => [0xf0, 0x80, 0x80],
119
+ "salmon" => [0xfa, 0x80, 0x72],
120
+ "lightsalmon" => [0xff, 0xa0, 0x7a],
121
+ "coral" => [0xff, 0x7f, 0x50],
122
+ "tomato" => [0xff, 0x63, 0x47],
123
+ "orangered" => [0xff, 0x45, 0x00],
124
+ "red" => [0xff, 0x00, 0x00],
125
+ "crimson" => [0xdc, 0x14, 0x3c],
126
+ "mediumvioletred" => [0xc7, 0x15, 0x85],
127
+ "deeppink" => [0xff, 0x14, 0x93],
128
+ "hotpink" => [0xff, 0x69, 0xb4],
129
+ "palevioletred" => [0xdb, 0x70, 0x93],
130
+ "pink" => [0xff, 0xc0, 0xcb],
131
+ "lightpink" => [0xff, 0xb6, 0xc1],
132
+ "thistle" => [0xd8, 0xbf, 0xd8],
133
+ "magenta" => [0xff, 0x00, 0xff],
134
+ "fuchsia" => [0xff, 0x00, 0xff],
135
+ "violet" => [0xee, 0x82, 0xee],
136
+ "plum" => [0xdd, 0xa0, 0xdd],
137
+ "orchid" => [0xda, 0x70, 0xd6],
138
+ "mediumorchid" => [0xba, 0x55, 0xd3],
139
+ "darkorchid" => [0x99, 0x32, 0xcc],
140
+ "darkviolet" => [0x94, 0x00, 0xd3],
141
+ "darkmagenta" => [0x8b, 0x00, 0x8b],
142
+ "purple" => [0x80, 0x00, 0x80],
143
+ "indigo" => [0x4b, 0x00, 0x82],
144
+ "darkslateblue" => [0x48, 0x3d, 0x8b],
145
+ "blueviolet" => [0x8a, 0x2b, 0xe2],
146
+ "mediumpurple" => [0x93, 0x70, 0xdb],
147
+ "slateblue" => [0x6a, 0x5a, 0xcd],
148
+ "mediumslateblue" => [0x7b, 0x68, 0xee],
149
+ }
150
+
151
+ name_to_code.each do |name, code|
152
+ context "引数が #{ name.inspect } の場合" do
153
+ let(:color_name) { name }
154
+
155
+ it { should eq(code) }
156
+ end
157
+ end
158
+
159
+ context "引数がコードの場合" do
160
+ let(:color_name) { [255, 255, 255] }
161
+
162
+ it "引数をそのまま返す" do
163
+ should be(color_name)
164
+ end
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,14 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe Smalruby::World do
5
+ describe '.instance' do
6
+ subject { described_class.instance }
7
+
8
+ it { should be_kind_of(described_class) }
9
+
10
+ it '何度呼び出しても同じインスタンスを返す' do
11
+ should be(described_class.instance)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,19 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ require 'coveralls'
4
+ Coveralls.wear!
5
+
6
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
7
+ require 'smalruby'
8
+
9
+ Dir.glob(File.expand_path('../support/**/*.rb', __FILE__)).each do |path|
10
+ require path
11
+ end
12
+
13
+ RSpec.configure do |config|
14
+ config.treat_symbols_as_metadata_keys_with_true_values = true
15
+ config.run_all_when_everything_filtered = true
16
+ config.filter_run :focus
17
+
18
+ config.order = 'random'
19
+ end
metadata ADDED
@@ -0,0 +1,251 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smalruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: x86-mingw32
6
+ authors:
7
+ - Kouji Takao
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: redcarpet
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coveralls
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: travis-lint
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: guard-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: guard-rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: activesupport
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: dxruby
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ description: smalruby is a 2D game development library. This is part of "Smalruby"
182
+ project that is a learning ruby programming environment for kids.
183
+ email:
184
+ - kouji.takao@gmail.com
185
+ executables: []
186
+ extensions: []
187
+ extra_rdoc_files: []
188
+ files:
189
+ - .gitignore
190
+ - .rspec
191
+ - .rubocop.yml
192
+ - .travis.yml
193
+ - Gemfile
194
+ - LEGAL
195
+ - LICENSE
196
+ - README.md
197
+ - Rakefile
198
+ - assets/car1.png
199
+ - assets/car2.png
200
+ - assets/car3.png
201
+ - assets/car4.png
202
+ - assets/cat1.png
203
+ - assets/cat2.png
204
+ - assets/cat3.png
205
+ - assets/frog1.png
206
+ - lib/smalruby.rb
207
+ - lib/smalruby/canvas.rb
208
+ - lib/smalruby/character.rb
209
+ - lib/smalruby/color.rb
210
+ - lib/smalruby/console.rb
211
+ - lib/smalruby/event_handler.rb
212
+ - lib/smalruby/version.rb
213
+ - lib/smalruby/world.rb
214
+ - samples/.rubocop.yml
215
+ - samples/canvas.rb
216
+ - samples/car.rb
217
+ - samples/console.rb
218
+ - samples/finding_cars.rb
219
+ - smalruby.gemspec
220
+ - spec/lib/smalruby/color_spec.rb
221
+ - spec/lib/smalruby/world_spec.rb
222
+ - spec/spec_helper.rb
223
+ homepage: https://github.com/smalruby/smalruby
224
+ licenses:
225
+ - MIT
226
+ metadata: {}
227
+ post_install_message:
228
+ rdoc_options: []
229
+ require_paths:
230
+ - lib
231
+ required_ruby_version: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - '>='
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
236
+ required_rubygems_version: !ruby/object:Gem::Requirement
237
+ requirements:
238
+ - - '>='
239
+ - !ruby/object:Gem::Version
240
+ version: '0'
241
+ requirements: []
242
+ rubyforge_project:
243
+ rubygems_version: 2.0.3
244
+ signing_key:
245
+ specification_version: 4
246
+ summary: 2D game development library for kids.
247
+ test_files:
248
+ - spec/lib/smalruby/color_spec.rb
249
+ - spec/lib/smalruby/world_spec.rb
250
+ - spec/spec_helper.rb
251
+ has_rdoc: