Q1. Assume that the following code must have the stated execution result.
__(1)__
x.each_line { |line| puts line }
[Execution Result]
apple
#!/bin/sh | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "\033[31;1mWorking directory needs to be clean\033[0m"; | |
exit 1 | |
else | |
git checkout production && | |
git rebase develop && | |
npm run build && | |
git add -f dist && |
Looking for support tables for HTML/CSS/JavaScript features or details on their implementation status in major browsers?
And then there’s Can I use…?.
Benchmark Code: https://github.com/janlelis/paint/blob/main/benchmark.rb
# TERMINAL ANSI COLORS BENCHMARK
ruby: 3.1.2
paint: 2.3.0
rainbow: 3.1.1
term/ansicolor 1.7.1
pastel 0.8.0
require "benchmark/ips" | |
puts RUBY_DESCRIPTION | |
class Inherit < Struct.new(:id, :name, :age) | |
def name_and_age | |
"#{name}, #{age}" | |
end | |
end |
From 4787399d0ffc0c8e01747713e8da91de2257bcf5 Mon Sep 17 00:00:00 2001 | |
From: Jan Lelis <mail@janlelis.de> | |
Date: Tue, 28 Apr 2015 18:52:53 +0200 | |
Subject: [PATCH] activate goto in ruby | |
--- | |
vm_opts.h | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/vm_opts.h b/vm_opts.h |
#!/usr/bin/env ruby | |
require 'rdoc' | |
puts RDoc::Markup::ToMarkdown.new.convert File.read(ARGV[0] || 'README.rdoc') | |
# ./rdoc2md > README.md | |
# ./rdoc2md ABC.rdoc > abc.md | |
fn main() { | |
println!("Hello World!"); | |
} |