smalruby 0.0.6 → 0.0.7

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.

@@ -6,160 +6,160 @@ describe Smalruby::Color do
6
6
  subject { described_class.smalruby_to_dxruby(color_name) }
7
7
 
8
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],
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
149
  }
150
150
 
151
151
  name_to_code.each do |name, code|
152
- context "引数が #{ name.inspect } の場合" do
152
+ context '引数が #{ name.inspect } の場合' do
153
153
  let(:color_name) { name }
154
154
 
155
155
  it { should eq(code) }
156
156
  end
157
157
  end
158
158
 
159
- context "引数がコードの場合" do
159
+ context '引数がコードの場合' do
160
160
  let(:color_name) { [255, 255, 255] }
161
161
 
162
- it "引数をそのまま返す" do
162
+ it '引数をそのまま返す' do
163
163
  should be(color_name)
164
164
  end
165
165
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smalruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouji Takao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-15 00:00:00.000000000 Z
11
+ date: 2014-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -192,6 +192,20 @@ dependencies:
192
192
  - - '>='
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: dino
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
195
209
  description: smalruby is a 2D game development library. This is part of "Smalruby"
196
210
  project that is a learning ruby programming environment for kids.
197
211
  email:
@@ -237,6 +251,15 @@ files:
237
251
  - lib/smalruby/color.rb
238
252
  - lib/smalruby/console.rb
239
253
  - lib/smalruby/event_handler.rb
254
+ - lib/smalruby/hardware.rb
255
+ - lib/smalruby/hardware/dino/fix_gets.rb
256
+ - lib/smalruby/hardware/led.rb
257
+ - lib/smalruby/hardware/pin.rb
258
+ - lib/smalruby/hardware/rgb_led_anode.rb
259
+ - lib/smalruby/hardware/rgb_led_cathode.rb
260
+ - lib/smalruby/hardware/sensor.rb
261
+ - lib/smalruby/scene.rb
262
+ - lib/smalruby/util.rb
240
263
  - lib/smalruby/version.rb
241
264
  - lib/smalruby/world.rb
242
265
  - samples/.rubocop.yml
@@ -246,6 +269,10 @@ files:
246
269
  - samples/costume.rb
247
270
  - samples/extra_car.png
248
271
  - samples/finding_cars.rb
272
+ - samples/hardware_led.rb
273
+ - samples/hardware_rgb_led_anode.rb
274
+ - samples/hardware_rgb_led_cathode.rb
275
+ - samples/hardware_sensor.rb
249
276
  - samples/hit_car.rb
250
277
  - samples/piano.rb
251
278
  - smalruby.gemspec