-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite in TypeScript #81
base: master
Are you sure you want to change the base?
Changes from all commits
ac4df96
591f4b2
39626fd
c39b54e
f805bca
c4ed31b
9e9dd5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier/@typescript-eslint', | ||
'plugin:prettier/recommended', | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
}; | ||
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
/node_modules | ||
/lib |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/src | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add line break to the end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
delimiter = ARGV[0] | ||
engine = ARGV[1] | ||
handler = case engine | ||
when 'erubi' | ||
require 'erubi' | ||
Erubi::Engine | ||
when 'erubis' | ||
require 'erubis' | ||
Erubis::Eruby | ||
when 'erb' | ||
require 'erb' | ||
ERB | ||
else raise "Unknown templating engine `#{engine}`" | ||
end | ||
begin | ||
delimiter = ARGV[0] | ||
engine = ARGV[1] | ||
handler = case engine | ||
when 'erubi' | ||
require 'erubi' | ||
Erubi::Engine | ||
when 'erubis' | ||
require 'erubis' | ||
Erubis::Eruby | ||
when 'erb' | ||
require 'erb' | ||
ERB | ||
else raise "Unknown templating engine `#{engine}`" | ||
end | ||
|
||
if engine == 'erubi' | ||
puts "#{delimiter}#{eval(handler.new(STDIN.read).src)}#{delimiter}" | ||
else | ||
puts "#{delimiter}#{handler.new(STDIN.read).result}#{delimiter}" | ||
end | ||
if engine == 'erubi' | ||
puts "#{delimiter}#{eval(handler.new(STDIN.read).src)}#{delimiter}" | ||
else | ||
puts "#{delimiter}#{handler.new(STDIN.read).result}#{delimiter}" | ||
end | ||
rescue => error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this required in "rewrite to TS"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey, I can't remember now. I probably just fixed this in testing as an attempt to capture error output. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yeah, I think this was to fix #63. |
||
STDERR.puts error | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add line break to the end |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add line break to the end