From 32ab0d162a0fb2bac0d2da2d38825ba4b19295fc Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Tue, 24 Nov 2020 16:41:26 -0600 Subject: [PATCH] Fix Ruby style --- Gemfile | 2 +- bin/markdown_ast.rb | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 46eedf7..41c97a9 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } # Synchronize with https://pages.github.com/versions ruby '>=2.7.1' diff --git a/bin/markdown_ast.rb b/bin/markdown_ast.rb index c3fd0b5..4fdb684 100755 --- a/bin/markdown_ast.rb +++ b/bin/markdown_ast.rb @@ -1,11 +1,12 @@ #!/usr/bin/env ruby +# frozen_string_literal: true # Use Kramdown parser to produce AST for Markdown document. -require "kramdown" -require "json" +require 'kramdown' +require 'json' -markdown = STDIN.read() +markdown = $stdin.read doc = Kramdown::Document.new(markdown) tree = doc.to_hash_a_s_t puts JSON.pretty_generate(tree) -- 2.30.2