
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Rubic is a Ruby REPL. Aside from behaving like IRB, it also borrows some concepts from older BASIC REPLs. Mainly, this involves writing programs by specifying line numbers. For information on commands, use help
. Otherwise, a basic example session lives below.
> 10 puts "what is your name?"
> 20 name = gets.chomp
> 30 puts "nice to meet you, #{name}!"
>
> list
10 puts "what is your name?"
20 name = gets.chomp
30 puts "nice to meet you, #{name}!"
> run
what is your name?
stephen
nice to meet you, stephen!
=> nil
> # but wouldn't it be nice if we printed the last line a few times?
=> nil
> 25 for _ in 0..5
> 35 end
> list
10 puts "what is your name?"
20 name = gets.chomp
25 for _ in 0..5
30 puts "nice to meet you, #{name}!"
35 end
> run
what is your name?
stephen
nice to meet you, stephen!
nice to meet you, stephen!
nice to meet you, stephen!
nice to meet you, stephen!
nice to meet you, stephen!
nice to meet you, stephen!
=> 0..5
> # but now our line numbers aren't equidistant anymore! let's clean them up
=> nil
> squish
> list
1 puts "what is your name?"
2 name = gets.chomp
3 for _ in 0..5
4 puts "nice to meet you, #{name}!"
5 end
> # or alternatively...
=> nil
> widen
> list
10 puts "what is your name?"
20 name = gets.chomp
30 for _ in 0..5
40 puts "nice to meet you, #{name}!"
50 end
> # alright, let's save our program
=> nil
> save greeter.rub
> # or if you just want a normal ruby file
=> nil
> export greeter.rb
> # with load/import you can also do the opposite (load an existing rub or rb file)
=> nil
Install the gem and add to the application's Gemfile by executing:
bundle add rubic-repl
If bundler is not being used to manage dependencies, install the gem by executing:
gem install rubic-repl
In your REPL or Ruby file, run Rubic::run
to start Rubic. Alternatively, run the CLI from your terminal with the rubic
command.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome at https://gitlab.scd31.com/stephen/rubic
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that rubic-repl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.