reli 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +14 -0
- data/Gemfile +2 -0
- data/README.md +115 -0
- data/Rakefile +8 -0
- data/lib/reli/abstract.rb +34 -0
- data/lib/reli/brainfuck.rb +72 -0
- data/lib/reli/malbolge.rb +88 -0
- data/lib/reli/monamona.rb +47 -0
- data/lib/reli/ook.rb +54 -0
- data/lib/reli/version.rb +4 -0
- data/lib/reli.rb +15 -0
- data/reli.gemspec +17 -0
- data/spec/fixtures/hello_world/brainfuck +1 -0
- data/spec/fixtures/hello_world/malbolge +1 -0
- data/spec/fixtures/hello_world/monamona +1 -0
- data/spec/fixtures/hello_world/ook +19 -0
- data/spec/reli_spec.rb +26 -0
- data/spec/spec_helper.rb +9 -0
- metadata +24 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86c2aa64f8ac2610503fc3da8449f1b1574b023e
|
4
|
+
data.tar.gz: 9e409081e0c9efeb720e4f6fca58212a0507d58f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da0b624c4dd332e08f66ef818ec300a608785a543f6d2b211b8bff5962386f66d74a0efdf2528cc60e6ef3f74410d02dd9d6de904ec2b9733bb20b210694345b
|
7
|
+
data.tar.gz: 54cd93702344a79a9a944f8895b33b8332a7ae737b0f6626bd94b0aea5e216c86ab09a3185d4ee17843095f9c8ee35eb40fbaf5bb31a5eba9857f8caa3431ae7
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
# RELI (Ruby Esoteric Language Implementation)
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/namusyaka/reli.png)](https://travis-ci.org/namusyaka/reli)
|
4
|
+
|
5
|
+
Generic interface for Esoteric Language Implementations which is written in Ruby.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your Gemfile.
|
10
|
+
|
11
|
+
`gem 'reli'`
|
12
|
+
|
13
|
+
Then execute.
|
14
|
+
|
15
|
+
`$ bundle`
|
16
|
+
|
17
|
+
Or execute this.
|
18
|
+
|
19
|
+
`$ gem install reli`
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### Basic
|
24
|
+
|
25
|
+
`type:` support `:brainfuck`, `:ook`, and `:monamona`.
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
require 'reli'
|
29
|
+
|
30
|
+
brainfuck = RELI.new(type: :brainfuck)
|
31
|
+
source = "+++++++++[>++++++++<-]>.<++++[>+++++++<-]>+.+++++++..+++.<++++++++[>----------<-]>+.<+++++++[>++++++++<-]>-.<+++++[>+++++<-]>-.+++.------.--------.<++++++++[>--------<-]>---."
|
32
|
+
brainfuck.run(source) #=> Hello World!
|
33
|
+
```
|
34
|
+
|
35
|
+
### only Brainf*ck
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
require 'reli/brainfuck'
|
39
|
+
|
40
|
+
brainfuck = RELI::Brainfuck.new
|
41
|
+
source = "+++++++++[>++++++++<-]>.<++++[>+++++++<-]>+.+++++++..+++.<++++++++[>----------<-]>+.<+++++++[>++++++++<-]>-.<+++++[>+++++<-]>-.+++.------.--------.<++++++++[>--------<-]>---."
|
42
|
+
brainfuck.run(source) #=> Hello World!
|
43
|
+
```
|
44
|
+
|
45
|
+
### Ook!
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
require 'reli/ook'
|
49
|
+
|
50
|
+
ook = RELI::Ook.new
|
51
|
+
source = <<OOK
|
52
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
53
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook?
|
54
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
55
|
+
Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
56
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
57
|
+
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook.
|
58
|
+
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook!
|
59
|
+
Ook. Ook? Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook.
|
60
|
+
Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
61
|
+
Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
|
62
|
+
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook! Ook.
|
63
|
+
Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
64
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
65
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.
|
66
|
+
Ook. Ook? Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.
|
67
|
+
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
|
68
|
+
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
|
69
|
+
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook.
|
70
|
+
Ook! Ook. Ook. Ook? Ook! Ook.
|
71
|
+
OOK
|
72
|
+
ook.run(source) #=> Hello World!
|
73
|
+
```
|
74
|
+
|
75
|
+
### MONAmona
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
require 'reli/monamona'
|
79
|
+
|
80
|
+
mona = RELI::Monamona.new
|
81
|
+
source = "NNNNNNNNNNnMNNNNNNNMNNNNNNNNNNMNNNMNOOOOAaMNNoMNoNNNNNNNooNNNoMNNoOONNNNNNNNNNNNNNNoMoNNNoAAAAAAoAAAAAAAAoMNo"
|
82
|
+
mona.run(source) #=> Hello World!
|
83
|
+
```
|
84
|
+
|
85
|
+
### Malbolge
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
require 'reli/malbolge'
|
89
|
+
|
90
|
+
malbolge = RELI::Malbolge.new
|
91
|
+
source = "(=<`#9]~6ZY32V6/S3,Pq)M'&Jk#Gh~De{z@>`v*;yKw%ut4Uqp0/ml>jibgIedFFaZB^{@[ZfXWV98Mqpo31kj.DCgT"
|
92
|
+
malbolge.run(source) #=> Hello World!
|
93
|
+
```
|
94
|
+
|
95
|
+
## TODO
|
96
|
+
|
97
|
+
* support other esoteric languages
|
98
|
+
* RSpec test is insufficient.
|
99
|
+
|
100
|
+
## Contributing
|
101
|
+
|
102
|
+
1. fork the project.
|
103
|
+
2. create your feature branch. (`git checkout -b my-feature`)
|
104
|
+
3. commit your changes. (`git commit -am 'commit message'`)
|
105
|
+
4. push to the branch. (`git push origin my-feature`
|
106
|
+
5. send pull request.
|
107
|
+
|
108
|
+
## Authors
|
109
|
+
|
110
|
+
* namusyaka
|
111
|
+
* pixie-grasper
|
112
|
+
|
113
|
+
## License
|
114
|
+
|
115
|
+
the MIT License
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
module RELI
|
3
|
+
class Abstract
|
4
|
+
def initialize(options = {})
|
5
|
+
@memory = []
|
6
|
+
@buffer = []
|
7
|
+
@pointer = 0; @memory[0] = 0
|
8
|
+
@size = 1
|
9
|
+
@break = 0
|
10
|
+
end
|
11
|
+
|
12
|
+
def run(code)
|
13
|
+
@code = code.split(//u)
|
14
|
+
@index = 0
|
15
|
+
code_length = @code.length
|
16
|
+
while @index < code_length do
|
17
|
+
method_name = "exec_#{@code[@index, @size].join}"
|
18
|
+
@index += @break
|
19
|
+
next unless respond_to?(method_name)
|
20
|
+
send(method_name)
|
21
|
+
end
|
22
|
+
@buffer.join
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.on(char, &block)
|
26
|
+
define_method "exec_#{char}", &block
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.change(new, old)
|
30
|
+
old_method = instance_method("exec_#{old}")
|
31
|
+
define_method("exec_#{new}", old_method)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'reli/abstract'
|
2
|
+
|
3
|
+
module RELI
|
4
|
+
class Brainfuck < Abstract
|
5
|
+
|
6
|
+
on(?+) do
|
7
|
+
@memory[@pointer] += 1
|
8
|
+
@index += @size
|
9
|
+
end
|
10
|
+
|
11
|
+
on(?-) do
|
12
|
+
@memory[@pointer] -= 1
|
13
|
+
@index += @size
|
14
|
+
end
|
15
|
+
|
16
|
+
on(?>) do
|
17
|
+
@pointer += 1
|
18
|
+
@index += @size
|
19
|
+
@memory[@pointer] = 0 unless @memory[@pointer]
|
20
|
+
end
|
21
|
+
|
22
|
+
on(?<) do
|
23
|
+
@pointer -= 1
|
24
|
+
@index += @size
|
25
|
+
raise "Error: Pointer received a negative number." if @pointer < 0
|
26
|
+
end
|
27
|
+
|
28
|
+
on(?.) do
|
29
|
+
@buffer[@buffer.length] = @memory[@pointer].chr
|
30
|
+
@index += @size
|
31
|
+
end
|
32
|
+
|
33
|
+
on(?,) do
|
34
|
+
str = $stdin.getc
|
35
|
+
@memory[@pointer] = str ? str.ord : 0;
|
36
|
+
@index += @size
|
37
|
+
end
|
38
|
+
|
39
|
+
on(?[) do
|
40
|
+
if @memory[@pointer] == 0
|
41
|
+
counter = 1
|
42
|
+
while counter != 0 do
|
43
|
+
@index += @size
|
44
|
+
current = @code[@index, @size].join
|
45
|
+
if current == ?[
|
46
|
+
counter += 1
|
47
|
+
elsif current == ?]
|
48
|
+
counter -= 1
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
@index += @size
|
53
|
+
end
|
54
|
+
|
55
|
+
on(?]) do
|
56
|
+
if @memory[@pointer] != 0
|
57
|
+
counter = 1
|
58
|
+
while 0 < counter do
|
59
|
+
@index -= @size
|
60
|
+
current = @code[@index, @size].join
|
61
|
+
if current == ?[
|
62
|
+
counter -= 1
|
63
|
+
elsif current == ?]
|
64
|
+
counter += 1
|
65
|
+
end
|
66
|
+
end
|
67
|
+
else
|
68
|
+
@index += @size
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module RELI
|
2
|
+
class Malbolge
|
3
|
+
def initialize(options = {})
|
4
|
+
end
|
5
|
+
|
6
|
+
def run(code_)
|
7
|
+
code = code_.split(//u).map(&:ord)
|
8
|
+
@a = 0
|
9
|
+
@c = 0
|
10
|
+
@d = 0
|
11
|
+
|
12
|
+
# load step
|
13
|
+
@buffer = []
|
14
|
+
@memory = []
|
15
|
+
for char in code
|
16
|
+
case crypt1 op char
|
17
|
+
when 42, 47, 60, 105, 106, 111, 112, 118
|
18
|
+
@memory[@c] = char
|
19
|
+
else
|
20
|
+
# error
|
21
|
+
next
|
22
|
+
end
|
23
|
+
@c += 1
|
24
|
+
end
|
25
|
+
|
26
|
+
while @c < 3**10
|
27
|
+
@memory[@c] = crz @memory[@c - 2], @memory[@c - 1]
|
28
|
+
@c += 1
|
29
|
+
end
|
30
|
+
|
31
|
+
# run
|
32
|
+
@c = 0
|
33
|
+
while (crypt1 op @memory[@c]) != 118
|
34
|
+
case crypt1 op @memory[@c]
|
35
|
+
when 106
|
36
|
+
@d = @memory[@d]
|
37
|
+
when 104
|
38
|
+
@c = @memory[@d]
|
39
|
+
when 42
|
40
|
+
rotr
|
41
|
+
@a = @memory[@d]
|
42
|
+
when 112
|
43
|
+
@a = @memory[@d] = crz(@memory[@d], @a)
|
44
|
+
when 60
|
45
|
+
@buffer[@buffer.length] = (@a.modulo 256).chr
|
46
|
+
when 47
|
47
|
+
@a = $stdin.getc.ord
|
48
|
+
end
|
49
|
+
@memory[@c] = crypt2 (@memory[@c] - 33).modulo 94
|
50
|
+
@c = inc(@c)
|
51
|
+
@d = inc(@d)
|
52
|
+
end
|
53
|
+
|
54
|
+
@buffer.join
|
55
|
+
end
|
56
|
+
|
57
|
+
def crypt1(m)
|
58
|
+
"+b(29e*j1VMEKLyC})8&m#~W>qxdRp0wkrUo[D7,XTcA\"lI.v%{gJh4G\\-=O@5`_3i<?Z';FNQuY]szf$!BS/|t:Pn6^Ha".split(//)[m].ord
|
59
|
+
end
|
60
|
+
|
61
|
+
def crypt2(m)
|
62
|
+
"5z]&gqtyfr$(we4{WP)H-Zn,[%\\3dL+Q;>U!pJS72FhOA1CB6v^=I_0/8|jsb9m<.TVac`uY*MK'X~xDl}REokN:#?G\"i@".split(//)[m].ord
|
63
|
+
end
|
64
|
+
|
65
|
+
def crz(a, b)
|
66
|
+
[a, b].map { |item|
|
67
|
+
sprintf("%010d", item.to_s(3).to_i).split(//).map { |char| char.ord - 0x30 }
|
68
|
+
}.transpose.map { |items|
|
69
|
+
([1, 0, 0, 1, 0, 2, 2, 2, 1][items[0] * 3 + items[1]] + 0x30).chr
|
70
|
+
}.join.to_i(3)
|
71
|
+
end
|
72
|
+
|
73
|
+
def rotr()
|
74
|
+
@memory[@d] += (@memory[@d].modulo 3) * (3 ** 10)
|
75
|
+
@memory[@d] /= 3
|
76
|
+
end
|
77
|
+
|
78
|
+
def op(c)
|
79
|
+
(c - 33 + @c).modulo 94
|
80
|
+
end
|
81
|
+
|
82
|
+
def inc(n)
|
83
|
+
n += 1
|
84
|
+
n = 0 if n == 3**10
|
85
|
+
return n
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'reli/brainfuck'
|
2
|
+
|
3
|
+
module RELI
|
4
|
+
class Monamona < Brainfuck
|
5
|
+
{
|
6
|
+
">" => "M",
|
7
|
+
"<" => "O",
|
8
|
+
"+" => "N",
|
9
|
+
"-" => "A",
|
10
|
+
"," => "m",
|
11
|
+
"." => "o"
|
12
|
+
}.each_pair{|key, value| change(value, key) }
|
13
|
+
|
14
|
+
on("n") do
|
15
|
+
if @memory[@pointer] == 0
|
16
|
+
counter = 1
|
17
|
+
while counter != 0 do
|
18
|
+
@index += @size
|
19
|
+
current = @code[@index, @size].join
|
20
|
+
if current == "n"
|
21
|
+
counter += 1
|
22
|
+
elsif current == "a"
|
23
|
+
counter -= 1
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
@index += @size
|
28
|
+
end
|
29
|
+
|
30
|
+
on("a") do
|
31
|
+
if @memory[@pointer] != 0
|
32
|
+
counter = 1
|
33
|
+
while 0 < counter do
|
34
|
+
@index -= @size
|
35
|
+
current = @code[@index, @size].join
|
36
|
+
if current == "n"
|
37
|
+
counter -= 1
|
38
|
+
elsif current == "a"
|
39
|
+
counter += 1
|
40
|
+
end
|
41
|
+
end
|
42
|
+
else
|
43
|
+
@index += @size
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/reli/ook.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'reli/brainfuck'
|
2
|
+
|
3
|
+
module RELI
|
4
|
+
class Ook < Brainfuck
|
5
|
+
{
|
6
|
+
">" => "Ook. Ook?",
|
7
|
+
"<" => "Ook? Ook.",
|
8
|
+
"+" => "Ook. Ook.",
|
9
|
+
"-" => "Ook! Ook!",
|
10
|
+
"," => "Ook. Ook!",
|
11
|
+
"." => "Ook! Ook."
|
12
|
+
}.each_pair{|key, value| change(value, key) }
|
13
|
+
|
14
|
+
def initialize(*)
|
15
|
+
super
|
16
|
+
@break = 1
|
17
|
+
@size = 9
|
18
|
+
end
|
19
|
+
|
20
|
+
on("Ook! Ook?") do
|
21
|
+
if @memory[@pointer] == 0
|
22
|
+
counter = 1
|
23
|
+
while counter != 0 do
|
24
|
+
@index += @size
|
25
|
+
current = @code[@index, @size].join
|
26
|
+
if current == "Ook! Ook?"
|
27
|
+
counter += 1
|
28
|
+
elsif current == "Ook? Ook!"
|
29
|
+
counter -= 1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
@index += @size
|
34
|
+
end
|
35
|
+
|
36
|
+
on("Ook? Ook!") do
|
37
|
+
if @memory[@pointer] != 0
|
38
|
+
counter = 1
|
39
|
+
@index -= @break
|
40
|
+
while 0 < counter do
|
41
|
+
@index -= @size + @break
|
42
|
+
current = @code[@index, @size].join
|
43
|
+
if current == "Ook! Ook?"
|
44
|
+
counter -= 1
|
45
|
+
elsif current == "Ook? Ook!"
|
46
|
+
counter += 1
|
47
|
+
end
|
48
|
+
end
|
49
|
+
else
|
50
|
+
@index += @size
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/reli/version.rb
ADDED
data/lib/reli.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'reli/brainfuck'
|
2
|
+
require 'reli/ook'
|
3
|
+
require 'reli/monamona'
|
4
|
+
require 'reli/malbolge'
|
5
|
+
|
6
|
+
module RELI
|
7
|
+
def self.new(options = {})
|
8
|
+
type = options.delete(:type) || :brainfuck
|
9
|
+
self[type].new(options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.[](key)
|
13
|
+
self.const_get(key.capitalize)
|
14
|
+
end
|
15
|
+
end
|
data/reli.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path("../lib/reli/version", __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new "reli", RELI::VERSION do |s|
|
4
|
+
s.summary = "RELI (Ruby Esoteric Language Implementation)"
|
5
|
+
s.description = "Generic interface for Esoteric Language Implementations which is written in Ruby."
|
6
|
+
s.authors = %w(namusyaka pixie-grasper)
|
7
|
+
s.email = "namusyaka@gmail.com"
|
8
|
+
s.homepage = "https://github.com/namusyaka/reli"
|
9
|
+
s.files = `git ls-files`.split("\n") - %w(.gitignore)
|
10
|
+
s.test_files = s.files.select { |path| path =~ /^spec\/.*_spec\.rb/ }
|
11
|
+
s.license = "MIT"
|
12
|
+
|
13
|
+
s.add_development_dependency "rake"
|
14
|
+
s.add_development_dependency "rspec"
|
15
|
+
end
|
16
|
+
|
17
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
+++++++++[>++++++++<-]>.<++++[>+++++++<-]>+.+++++++..+++.<++++++++[>----------<-]>+.<+++++++[>++++++++<-]>-.<+++++[>+++++<-]>-.+++.------.--------.<++++++++[>--------<-]>---.
|
@@ -0,0 +1 @@
|
|
1
|
+
(=<`#9]~6ZY32V6/S3,Pq)M'&Jk#Gh~De{z@>`v*;yKw%ut4Uqp0/ml>jibgIedFFaZB^{@[ZfXWV98Mqpo31kj.DCgT
|
@@ -0,0 +1 @@
|
|
1
|
+
NNNNNNNNNNnMNNNNNNNMNNNNNNNNNNMNNNMNOOOOAaMNNoMNoNNNNNNNooNNNoMNNoOONNNNNNNNNNNNNNNoMoNNNoAAAAAAoAAAAAAAAoMNo
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
2
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook?
|
3
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
4
|
+
Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
5
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
6
|
+
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook.
|
7
|
+
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook!
|
8
|
+
Ook. Ook? Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook.
|
9
|
+
Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
10
|
+
Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
|
11
|
+
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook! Ook.
|
12
|
+
Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
13
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
|
14
|
+
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.
|
15
|
+
Ook. Ook? Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.
|
16
|
+
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
|
17
|
+
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
|
18
|
+
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook.
|
19
|
+
Ook! Ook. Ook. Ook?
|
data/spec/reli_spec.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
module RELI
|
5
|
+
describe do
|
6
|
+
it "support brainfuck" do
|
7
|
+
bf = RELI.new(:type => :brainfuck)
|
8
|
+
expect(bf.run(hello_world(:brainfuck))).to eq("Hello World!")
|
9
|
+
end
|
10
|
+
|
11
|
+
it "support ook" do
|
12
|
+
bf = RELI.new(:type => :ook)
|
13
|
+
expect(bf.run(hello_world(:ook))).to eq("Hello World!")
|
14
|
+
end
|
15
|
+
|
16
|
+
it "support monamona" do
|
17
|
+
bf = RELI.new(:type => :monamona)
|
18
|
+
expect(bf.run(hello_world(:monamona))).to eq("Hello World!")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "support malbolge" do
|
22
|
+
bf = RELI.new(:type => :malbolge)
|
23
|
+
expect(bf.run(hello_world(:malbolge))).to eq("Hello World!")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- namusyaka
|
8
|
+
- pixie-grasper
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-06 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rake
|
@@ -44,7 +45,25 @@ email: namusyaka@gmail.com
|
|
44
45
|
executables: []
|
45
46
|
extensions: []
|
46
47
|
extra_rdoc_files: []
|
47
|
-
files:
|
48
|
+
files:
|
49
|
+
- .travis.yml
|
50
|
+
- Gemfile
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/reli.rb
|
54
|
+
- lib/reli/abstract.rb
|
55
|
+
- lib/reli/brainfuck.rb
|
56
|
+
- lib/reli/malbolge.rb
|
57
|
+
- lib/reli/monamona.rb
|
58
|
+
- lib/reli/ook.rb
|
59
|
+
- lib/reli/version.rb
|
60
|
+
- reli.gemspec
|
61
|
+
- spec/fixtures/hello_world/brainfuck
|
62
|
+
- spec/fixtures/hello_world/malbolge
|
63
|
+
- spec/fixtures/hello_world/monamona
|
64
|
+
- spec/fixtures/hello_world/ook
|
65
|
+
- spec/reli_spec.rb
|
66
|
+
- spec/spec_helper.rb
|
48
67
|
homepage: https://github.com/namusyaka/reli
|
49
68
|
licenses:
|
50
69
|
- MIT
|
@@ -69,5 +88,6 @@ rubygems_version: 2.0.2
|
|
69
88
|
signing_key:
|
70
89
|
specification_version: 4
|
71
90
|
summary: RELI (Ruby Esoteric Language Implementation)
|
72
|
-
test_files:
|
91
|
+
test_files:
|
92
|
+
- spec/reli_spec.rb
|
73
93
|
has_rdoc:
|