kaiser-ruby 0.4.2 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +3 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -0
- data/kaiser-ruby.gemspec +2 -1
- data/lib/kaiser_ruby/cli.rb +12 -10
- data/lib/kaiser_ruby/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fec1d393ae0367779ee0f751d01ba63a5900451e60577ddd5b22561f66d36f8
|
4
|
+
data.tar.gz: e82013bff9756f24aa4a4df025c18bfb847a769ae34afa177f8bdd694afbaea9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ad1c0bc40b029eb1c2fa44593bfb66140fbe8893b535723564948f7f4e0506cfb4015517413aa3e66d652d75cb84e21d47863c372db0cfb70dbbeaafb0d967
|
7
|
+
data.tar.gz: ccf85b08e73b29f02c69694bd56152ee62cd8609776ef04d0e67f866cf635c7086186680e1108f0a3d90c5e965f0df9f18399eaf0920c1444685b07975143422
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -50,3 +50,10 @@ Other stuff:
|
|
50
50
|
- [x] Suppressed warning about eval from Thor
|
51
51
|
- [x] Move nesting indentation from main module to transformer
|
52
52
|
- [x] Celsius to Fahrenheit example
|
53
|
+
|
54
|
+
0.5
|
55
|
+
|
56
|
+
Other stuff
|
57
|
+
|
58
|
+
- [x] Updated the REPL to work on Ruby versions earlier than 2.5 (2.3 is the minimum supported version)
|
59
|
+
- [x] Travis CI tests on all supported Ruby versions
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/marcinruszkiewicz/kaiser-ruby.svg?branch=master)](https://travis-ci.org/marcinruszkiewicz/kaiser-ruby)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/kaiser-ruby.svg)](https://badge.fury.io/rb/kaiser-ruby)
|
3
|
+
|
1
4
|
# KaiserRuby - a Rockstar to Ruby transpiler
|
2
5
|
|
3
6
|
This tool translates a file containing a program written in the [Rockstar language](https://github.com/dylanbeattie/rockstar) to Ruby code.
|
@@ -12,6 +15,10 @@ Install the gem by issuing the following command.
|
|
12
15
|
$ gem install kaiser-ruby
|
13
16
|
```
|
14
17
|
|
18
|
+
This gem works best on a current Ruby version and requires Ruby 2.3 at minimum. Running it on 2.3 has the downside of metal umlauts not being entirely correct as that Ruby version doesn't know how to `.downcase` a capital umlaut letter, which was fixed in 2.4.
|
19
|
+
|
20
|
+
If you're not using the umlauts, all should be fine otherwise.
|
21
|
+
|
15
22
|
## Usage
|
16
23
|
|
17
24
|
The most common usage of this gem is to transpile (or transpile and run immediately) Rockstar code into Ruby code.
|
data/kaiser-ruby.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
lib = File.expand_path("../lib", __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require "kaiser_ruby/version"
|
@@ -20,6 +19,8 @@ Gem::Specification.new do |spec|
|
|
20
19
|
spec.executables = ['kaiser-ruby']
|
21
20
|
spec.require_paths = ["lib"]
|
22
21
|
|
22
|
+
spec.required_ruby_version = '>= 2.3'
|
23
|
+
|
23
24
|
spec.add_development_dependency "bundler", "~> 1.16"
|
24
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
data/lib/kaiser_ruby/cli.rb
CHANGED
@@ -44,16 +44,18 @@ module KaiserRuby
|
|
44
44
|
b = binding
|
45
45
|
|
46
46
|
loop do
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
47
|
+
begin
|
48
|
+
input = ask('\m/>')
|
49
|
+
break if input == 'exit'
|
50
|
+
|
51
|
+
code = KaiserRuby.transpile(input)
|
52
|
+
say "\\m/> #{code}", :blue if options[:debug]
|
53
|
+
output = b.eval(code)
|
54
|
+
output = 'nil' if output.nil?
|
55
|
+
say " => #{output}\n"
|
56
|
+
rescue
|
57
|
+
say "THE STAGE IS ON FIRE!"
|
58
|
+
end
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
data/lib/kaiser_ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaiser-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Ruszkiewicz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -104,6 +104,7 @@ extra_rdoc_files: []
|
|
104
104
|
files:
|
105
105
|
- ".gitignore"
|
106
106
|
- ".rspec"
|
107
|
+
- ".ruby-version"
|
107
108
|
- ".travis.yml"
|
108
109
|
- CHANGELOG.md
|
109
110
|
- Gemfile
|
@@ -133,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
134
|
requirements:
|
134
135
|
- - ">="
|
135
136
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
137
|
+
version: '2.3'
|
137
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
139
|
requirements:
|
139
140
|
- - ">="
|