{wip: flavored modifications & extensions for increased quality of Ruby coding life}


Keywords
c, config-as-code, discord, docker, github-actions, monorepo, nginx, node-js, postgresql, rabbitmq, rails6, rpc, ruby, webgl, webhooks
License
MIT
Install
gem install ruuuby -v 0.1.0.pre.5

Documentation

Ruuuby Gem Version

flavored modifications & extensions for increased quality of Ruby coding life

Usage

for use
Gemfile gem 'ruuuby', '~> 0.0.37'
ruby scripts require 'ruuuby'
gem url https://rubygems.org/gems/ruuuby
changelog https://github.com/utarsuno/ruuuby/blob/master/CHANGELOG.md

Example

# true, true
โˆš(1787569)      == 1337
โˆš(โˆš(-1337.0^โด)) == 1337

# true, true, true
๐šฝ == 1 + (๐šฝ^โปยน)
๐šฝ == 2 * sin(ฮธยฐ(54))
๐šฝ == (ฮธ๐žฝ(1) - แ‚ด) / แ‚ด

# true, true
ฮธยฐ(180) == ฮธ๐žฝ(0.5)
ฮธแต(200) == ฮธสณ(ฯ€)

# true, true, false
'b'.โˆˆ? 'abc'
'abc'.โˆŒ? 'd'
'd'.โˆˆ? 'abc'

# true, false
elements_a = [1, 'a', 2, nil, [], 2]
elements_b = [nil, 2, 2, 'a', 1, []]
[elements_a.โ‰ˆโ‰ˆ(elements_b), elements_a == elements_b]

# true, true, true, true
['snake_case'.๐Ÿ?, 'AHHH_CAPITALS'.๐Ÿโฌ†?, 'UpperCaseCamel'.๐Ÿซ?, 'lowerCaseCamel'.๐Ÿซโฌ‡?]

# [false, true, false, true]
[โ„•.โˆ‹?(-5), โ„ค.โˆ‹?(7.0), โ„.โˆ‹?(โˆž), โ„š.โˆ‹?(Rational(2, 3))]

# [1, 4, 2]
[1, 2, 3].โŠ• [3, 4]

# [4]
[2, 3, 4].โˆ– [1, 2, 3] 

# [true, false]
data = {haaallo: 'wooorld', ye: 'ee'}
[data.โˆƒ๐Ÿ”‘?(:haaallo), data.โˆƒ๐Ÿ”‘?(:๐Ÿ‘๏ธ๐Ÿ‘…๐Ÿ‘๏ธ)]

# stdout ->
#          'world'
#          'hello'
['world', 1337, 'hello', 'abc'.โ„๏ธ].โˆ€{|x| puts x if x.str? && !x.โ„๏ธ?}

# stdout ->
#          'hello'
#          'world'
['world', 1337, 'hello', 'abc'.โ„๏ธ].โ†ฉโˆ€{|x| puts x if x.str? && !x.โ„๏ธ?}

โš ๏ธ: documentation & test-coverage not fully synced atm


Language Changes:

Operations Supported (patched in)

(โš ๏ธ wip): raising to powers(via-superscripts: โปโน...โปยน, โฐ, ยน...โน) with operator(^)

class(es)/obj example (at least partially) utilizing C-extension?
(java-wip)
notes
Integer 1337^ยฒ โœ… -coexists with Integer's pre-existing bitwise XOR functionality
-performance penalties: up to 80% slower than using operator(**)
Float 1337.1337^ยฒ โœ… performance penalties: up to 90% slower than using operator(**)
Rational 3/4r^ยฒ โœ… performance penalties: up to 105% slower than using operator(**)
Complex 1337i^ยฒ โœ… performance penalties: up to 85% slower than using operator(**)
BigDecimal inc inc inc
ThetaAngle inc inc outputs to unit: steradian (depending on input)
Quaternion inc inc
โ„ฎ inc inc

TOPLEVEL_BINDING Modifications:

(global) func(s) added notes as C-extension?
(java-wip)
โ„ฎ, logโ‚‘, logโ‚‚, logโ‚โ‚€
โˆš, โˆ›, ฯ€, แ‚ด
ยผ, ยฝ, ยพ, โ…“, โ…•, โ…•,โ…–,โ…—,โ…˜,โ…™,โ…, โ…›, โ…œ, โ…, โ…ž, โ…‘, โ…’
โˆž, โˆžโ„‚, ฮณ
sin, cos, tan, arcsin, arccos, arctan, cot, csc, sec, sinยฒ, cosยฒ
(f10, f17) โŒ/โœ…
๐ŸŒฝ (f10): aliases Kernel โŒ
๐Ÿ“, ๐Ÿ“‚, ๐Ÿ—„๏ธ - (f12) aliases to:
File, Dir
โŒ
๐Ÿ“…, ๐Ÿ•’, ๐Ÿ“…๐Ÿ•’ - (f26) aliases to:
Date, Time, DateTime
โŒ
ฮธยฐ, ฮธสณ, ฮธแต, ฮธ๐žฝ f27 โœ…

Module Modifications:

instance methods for Kernel will act as 'globally-scoped functions'; meaning they can essentially can be called from anywhere with caller of the method ignored for all contextes

module(s) func(s) added as C-extension?
(java-wip)
notes
Kernel ๐”  โŒ (f03)
Kernel ๐ŸŒฝ_previous_โจ โŒ (f10)
Kernel โˆƒmodule?, โˆƒclass?
{static}โˆƒโจ_alias?, โˆƒโจ?
โŒ
Module {static}โจ_add_aliases โœ…
Math {static}relative_ฮ”, ฯ„ยณ_is_pythagorean?, ฯ„ยฒ_in_golden_ratio?, ฯ„ยฒ_in_super_golden_ratio? โŒ (f17)
Math {static}
cot, csc, sec, sinยฒ, cosยฒ
โŒ (f17)

Class Modifications:

class(es) func(s) added as C-extension?
(java-wip)
notes
File, Dir {static}โˆƒ? โŒ (f12)
File {static} dirnameยฒ, dirnameยณ, dirnameโด
replace_expr_with, replace_expr_with!, insert_line_before_expr
โŒ (f12)
Dir ฮทฬ‚_paths โŒ (f12)
File, Dir, ENV โˆ…? โŒ (f04)
Object ary?, bool?, hsh?, int?, flt?, num?, str?, chr?, sym?, ฮธ?
class?, module?, nucleotide?
โœ… (f06)
Object singleton?, โ“‰
๐Ÿ›‘boolโ“, ๐Ÿ›‘intโ“, ๐Ÿ›‘aryโ“, ๐Ÿ›‘strโ“, ๐Ÿ›‘symโ“, ๐Ÿ›‘ฮธโ“
โŒ (f06)
Array, Set remove_empty! โŒ/โœ… (f07)
String โ™ป๏ธโŸต, โ™ป๏ธโŸถ, โ™ป๏ธโŸถโˆž
downcase?{โฌ‡?}
upcase?{โฌ†?}
โŒ (f08)
String ๐Ÿซ?, ๐Ÿซโฌ‡?, to_๐Ÿซ
๐Ÿโฌ†?, ๐Ÿ?, to_๐Ÿ
โŒ (f24)
String as_utf8, iso8601?, to_iso8601, as_iso8601 โŒ
Array, String ฮทฬ‚! โŒ (f08)
Array [frequency_counts, ๐Ÿ“Š]
[equal_contents?, โ‰ˆโ‰ˆ]
[disjunctive_union, โŠ•]
โˆ–
โœ… (f09)
Module, String โˆ‹?, โˆŒ?, โˆˆ?, โˆ‰? โŒ (f09)
Enumerable โˆŒ?, โˆ€ฯ„ยฒโˆˆฮป๐‘“โ‚แตขุŒแตขโ‚Šโ‚โ‚Ž โŒ (f09, f10)
Array, String >> โœ… (f05)
String digit?, to_num, to_num? โŒ (f21)
Array end_with?, start_with? โŒ (f08)
String, Array ensure_start!, ensure_ending! โŒ (f08)
NilClass empty? โœ… - โš ๏ธ: philosophically debatable
- (f04)
Integer finite?, infinite? โœ… (f11)
Numeric โˆž? โŒ (f11)
Float โ‰ˆโ‰ˆ, โˆžโ„‚? โŒ (f17)

Aliases:

for base method(s) reference(s) alias(es) notes
Kernel raise, rand ๐Ÿ›‘, ๐ŸŽฒ (f10)
Object object_id, โ“ฃ, freeze, frozen?, define_singleton_function ๐Ÿ†”, class, [โ„๏ธ, โ„], [โ„๏ธ?, โ„?], define_singleton_โจ (f10)
Class new ๐Ÿ†• (f10)
Array, Set remove_empty! โ™ป๏ธโˆ…! (f10)
String, Symbol upcase, downcase โฌ†, โฌ‡ (f10)
String upcase!, downcase! โฌ†!, โฌ‡! (f10)
Object protected_instance_methods, private_methods ๐Ÿ›ก๏ธfuncs, ๐Ÿ™ˆfuncs (f01,f02)
Array frequency_counts, disjunctive_union, equal_contents?
โ†ฉโˆ€
๐Ÿ“Š, โŠ•, โ‰ˆโ‰ˆ
reverse_each
(f10)
Module const_defined?, private_method_defined? โˆƒconst?, โˆƒ๐Ÿ™ˆfunc?
Module private, private_constant
protected, protected_method_defined?
๐Ÿ™ˆ, ๐Ÿ™ˆconstantsโŸถ
๐Ÿ›ก๏ธ, โˆƒ๐Ÿ›ก๏ธfunc?
(f01)
(f02)
Array, Hash, Set each โˆ€ (f10)
Array, String reverse, reverse! โ†ฉ, โ†ฉ! (f10)
Enumerable map, each_with_index โจ, โˆ€โ‚“แตข (f10)
Hash key? โˆƒ๐Ÿ”‘? (f10)
NilClass, Hash, Array, String, Set empty? โˆ…? (f04)
String, Array, Set, Hash length ๐”  (f03)
Proc arity ๐”  (f03)

Code Base Statistics:

category attribute value desc.
QA unit 1009 # of tests (solely relating to core functionality)
QA performance 233 # of tests (solely relating to performance)
QA DB 176 # of tests (solely relating to the database)
CI audits 114 # of tests (solely relating to non-functionality based audits)
CI locale 28 # of tests (solely relating to local-dev-setup)
structure features ~35 # of distinct features (that are categorized & tracked) wip
coverage LOCs ??? wip
coverage runtime ??? wip
coverage documentation ??? wip

Gems:

gem version :development, :runtime category
tty-command 0.9.0 โœ…, โœ… CLI
rugged 1.0.0 โœ…, โŒ GIT
rdoc 6.2.1 โœ…, โŒ DOC
bundler 2.1.4 โœ…, โŒ CI
rspec 3.9.0 โœ…, โŒ QA
rspec-benchmark 0.5.1 โœ…, โŒ QA
rake 13.0.1 โœ…, โŒ EXT
rake-compiler 1.1.0 โœ…, โŒ EXT
sqlite3 1.4.2 โœ…, โŒ DB
activerecord 5.2.4.1 โœ…, โŒ DB
schema_plus_foreign_keys 0.1.8 โœ…, โŒ DB

Commands

General Tasks:

preface cmd description
bundle exec rake rdoc generate documentation coverage report
bundle exec rake install install gem onto local machine
bundle exec rake compile compile any native C-extensions with code changes
bundle exec rake release push git version tags and publish gem to Rubygems
bin/ audit general all-around build & health check
bin/ audit_db
audit_quick
audit_quickest
audit_all_but_performance
similar to above but for targeted portions
bin/ setup install dependencies
bin/ console interactive console for easier experimenting
gem server host interactive web-page at http://0.0.0.0:8808 to see documentation for currently installed gems

Testing Tasks:

preface cmd w/ warnings? description
bundle exec rake rspec_unit โŒ run all unit-tests except tags: {audit, performance, db}
bundle exec rake rspec_db โŒ run only db based unit-tests
bundle exec rake rspec_audit โŒ run only audit based unit-tests
bundle exec rake rspec_performance โŒ run only performance based unit-tests
bundle exec rake rspec_all โœ… run all unit-tests

Project Layout:

directory description of contents
app currently only holds ORM definitions
bin executable files
db database schema, seed, and migrations
ext C portion of this Gem's code
(and future location for JRuby-extensions)
help any helpful documentation & notes
lib Ruuuby portion of this Gem's code
spec RSpecs (unit tests + other QA and Audits)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/utarsuno/ruuuby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Ruuuby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.