nineteen-eighty-two 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/README.md +69 -9
- data/Rakefile +12 -0
- data/lib/nineteen/eighty/two/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1384a47de3860d571be0288ea9332d98b845ce1
|
4
|
+
data.tar.gz: 4e905b2f09a4861b5c6846eba01afacf46bac0b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43f553565a5e04a49cb893f49761525a47b6e012cb083fa93fedecc7d6fad35b000e9134cbdf5a4222ff6526b8e94237bf1acbb01d1ab8bce6eb2d3ffb4320fd
|
7
|
+
data.tar.gz: 0f6a9defcf79c788cc15f2fa42fad159a0f5725eb3e3df385e74d366a0f77e9bca0c58c6251f514c17a8007d1a481f5ef880b32173d1a9a3a07fa7681105f5fa
|
data/README.md
CHANGED
@@ -7,14 +7,21 @@
|
|
7
7
|
|
8
8
|
# 1982
|
9
9
|
|
10
|
-
## Sinclair Spectrum
|
10
|
+
## Sinclair Spectrum Stuff as a Rubygem
|
11
11
|
|
12
|
-
A massively over-engineered solution to a
|
12
|
+
A massively over-engineered solution to a set of problems that I'm almost 100% certain do not exist
|
13
|
+
|
14
|
+
* rendering text in the 1982 Sinclair Spectrum character set, in a variety of formats
|
15
|
+
* serving all of the Spectrum's 15 colours as HTML hex colours
|
16
|
+
* serving the complete set of Spectrum error messages
|
17
|
+
|
18
|
+
## Install
|
13
19
|
|
14
20
|
git clone https://github.com/pikesley/nineteen-eighty-two
|
15
21
|
cd nineteen-eighty-two
|
16
22
|
bundle
|
17
23
|
rake
|
24
|
+
rake install
|
18
25
|
|
19
26
|
Or just
|
20
27
|
|
@@ -22,11 +29,13 @@ Or just
|
|
22
29
|
|
23
30
|
## API
|
24
31
|
|
32
|
+
### Font
|
33
|
+
|
25
34
|
From the [specs](https://github.com/pikesley/nineteen-eighty-two/tree/master/spec/nineteen/eighty/two):
|
26
35
|
|
27
|
-
|
36
|
+
#### Just the data
|
28
37
|
|
29
|
-
|
38
|
+
##### Transform a string into an array-of-arrays of bits
|
30
39
|
|
31
40
|
require 'nineteen/eighty/two'
|
32
41
|
|
@@ -47,9 +56,9 @@ From the [specs](https://github.com/pikesley/nineteen-eighty-two/tree/master/spe
|
|
47
56
|
end
|
48
57
|
end
|
49
58
|
|
50
|
-
|
59
|
+
#### Specific output formats
|
51
60
|
|
52
|
-
|
61
|
+
##### HTML table
|
53
62
|
|
54
63
|
require 'nineteen/eighty/two'
|
55
64
|
|
@@ -75,7 +84,7 @@ From the [specs](https://github.com/pikesley/nineteen-eighty-two/tree/master/spe
|
|
75
84
|
end
|
76
85
|
end
|
77
86
|
|
78
|
-
|
87
|
+
##### JSON
|
79
88
|
|
80
89
|
require 'nineteen/eighty/two'
|
81
90
|
|
@@ -99,7 +108,7 @@ From the [specs](https://github.com/pikesley/nineteen-eighty-two/tree/master/spe
|
|
99
108
|
end
|
100
109
|
end
|
101
110
|
|
102
|
-
|
111
|
+
##### SVG
|
103
112
|
|
104
113
|
require 'nineteen/eighty/two'
|
105
114
|
|
@@ -134,7 +143,7 @@ From the [specs](https://github.com/pikesley/nineteen-eighty-two/tree/master/spe
|
|
134
143
|
end
|
135
144
|
end
|
136
145
|
|
137
|
-
|
146
|
+
##### Text
|
138
147
|
|
139
148
|
require 'nineteen/eighty/two'
|
140
149
|
|
@@ -173,6 +182,57 @@ From the [specs](https://github.com/pikesley/nineteen-eighty-two/tree/master/spe
|
|
173
182
|
end
|
174
183
|
end
|
175
184
|
|
185
|
+
### Colours
|
186
|
+
|
187
|
+
require 'nineteen/eighty/two'
|
188
|
+
|
189
|
+
module Nineteen::Eighty::Two
|
190
|
+
describe Colours do
|
191
|
+
it 'knows what red is' do
|
192
|
+
expect(described_class['red']).to eq 'bf0000'
|
193
|
+
end
|
194
|
+
|
195
|
+
it 'knows how to make magenta' do
|
196
|
+
expect(described_class['magenta']).to eq 'bf00bf'
|
197
|
+
end
|
198
|
+
|
199
|
+
context 'BRIGHT colours' do
|
200
|
+
specify 'primary colours' do
|
201
|
+
expect(described_class['GREEN']).to eq '00ff00'
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
context 'method-type access' do
|
206
|
+
it 'allows method-type access' do
|
207
|
+
expect(described_class.blue).to eq '0000bf'
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
### Error messages
|
214
|
+
|
215
|
+
require 'nineteen/eighty/two'
|
216
|
+
|
217
|
+
module Nineteen::Eighty::Two
|
218
|
+
describe Messages do
|
219
|
+
it 'has error messages' do
|
220
|
+
expect(described_class['R']).to eq 'R - Tape loading error'
|
221
|
+
end
|
222
|
+
|
223
|
+
it 'supports case-insensitive lookups' do
|
224
|
+
expect(described_class['c']).to eq 'C - Nonsense in BASIC'
|
225
|
+
end
|
226
|
+
|
227
|
+
it 'is polite about non-existent keys' do
|
228
|
+
expect { described_class['Z'] }.to raise_exception do |e|
|
229
|
+
expect(e).to be_an Exceptions::SpectrumException
|
230
|
+
expect(e.message).to eq 'Q - Parameter error'
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
176
236
|
## FAQ
|
177
237
|
|
178
238
|
Your questions, answered
|
data/Rakefile
CHANGED
@@ -6,3 +6,15 @@ Coveralls::RakeTask.new
|
|
6
6
|
RSpec::Core::RakeTask.new
|
7
7
|
|
8
8
|
task :default => [:spec, 'coveralls:push']
|
9
|
+
|
10
|
+
namespace :generate do
|
11
|
+
task :svg, [:text] do |t, args|
|
12
|
+
require_relative 'lib/nineteen/eighty/two'
|
13
|
+
if args[:text]
|
14
|
+
puts Nineteen::Eighty::Two::Formats::SVG.format args[:text]
|
15
|
+
else
|
16
|
+
puts 'Usage: rake generate:svg[text]'
|
17
|
+
exit 1
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nineteen-eighty-two
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pikesley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|