From b917baaf7883926b52b0413b4467f448f66b2d10 Mon Sep 17 00:00:00 2001 From: Uladzislau Tarsunou Date: Tue, 24 Nov 2020 11:54:05 -0600 Subject: [PATCH] v0.1.0.pre.4 --- .gitignore | 2 + CHANGELOG.md | 1146 ++++++++--------- Dockerfile | 13 +- Gemfile | 5 - History.txt | 11 + README.md | 80 +- Rakefile | 12 +- docker-compose.test.yml | 4 +- .../{c0_constants.h => 00_constants.h} | 48 +- .../{c1_typed_checks.h => 01_typed_checks.h} | 22 +- ...tension_memory.h => 02_extension_memory.h} | 6 +- ...macro_utilities.h => 03_macro_utilities.h} | 11 +- .../{c4_theta_angle.h => 04_theta_angle.h} | 2 +- ...6_feature_macros.h => 05_feature_macros.h} | 22 +- ...me_series_data.h => 06_time_series_data.h} | 8 +- .../{c8_graphs.h => 07_graphs.h} | 8 +- ext/ruby_class_mods/c5_internal_structs.h | 62 - ext/ruby_class_mods/extconf.rb | 54 +- ext/ruby_class_mods/optional/00_debugging.h | 94 ++ ext/ruby_class_mods/ruby_class_mods.c | 432 +++---- ext/ruby_class_mods/ruby_class_mods.h | 33 +- lib/ruuuby/class/io/dir.rb | 14 +- lib/ruuuby/class/io/file.rb | 16 +- lib/ruuuby/class/re.rb | 6 +- lib/ruuuby/configs.rb | 67 - lib/ruuuby/db/db_connection.rb | 25 +- lib/ruuuby/db/migrations/env_vars.rb | 84 ++ lib/ruuuby/db/migrations/migration_ext.rb | 10 +- .../db/migrations/rollback/00_ruuuby_gem.sql | 32 +- .../db/migrations/rollback/01_env_vars.sql | 13 + .../db/migrations/rollout/00_ruuuby_gem.sql | 152 ++- .../db/migrations/rollout/01_env_vars.sql | 33 + lib/ruuuby/db/migrations/ruuuby_gem.rb | 70 +- .../db/migrations/seed/00_ruuuby_gem.sql | 96 +- lib/ruuuby/db/migrations/seed/01_env_vars.sql | 54 + lib/ruuuby/db/seeds/ruuuby_dirs.rb | 14 - .../db/seeds/ruuuby_feature_behaviors.rb | 15 - lib/ruuuby/db/seeds/ruuuby_features.rb | 5 +- lib/ruuuby/env.rb | 15 +- lib/ruuuby/feature_lazy_loader.rb | 92 +- lib/ruuuby/math/stats/probability.rb | 11 +- lib/ruuuby/math/stats/stats.rb | 2 + lib/ruuuby/module/module.rb | 25 +- lib/ruuuby/ruuuby/api/api_locale.rb | 2 +- lib/ruuuby/ruuuby/api/f43_api_iconv.rb | 2 +- lib/ruuuby/ruuuby/api/git/api_git.rb | 2 + lib/ruuuby/ruuuby/engine/component/api.rb | 20 - lib/ruuuby/ruuuby/engine/component/api_cli.rb | 5 +- lib/ruuuby/ruuuby/ruuuby_api.rb | 2 +- lib/ruuuby/ruuuby/ruuuby_orm.rb | 2 +- lib/ruuuby/version.rb | 8 +- ruuuby.gemspec | 23 +- .../dev_configs/db/models/brew_version.rb | 5 + .../dev_configs/db/models/java_version.rb | 5 + .../dev_configs/db/models/js/node_version.rb | 5 + .../dev_configs/db/models/js/npm_version.rb | 5 + .../dev_configs/db/models/js/yarn_version.rb | 5 + services/dev_configs/db/models/php_version.rb | 5 + .../dev_configs/db/models/python_version.rb | 5 + .../dev_configs/db/models/ruby_version.rb | 5 + services/dev_configs/mac/lib/zsh_configs.rb | 2 + .../f40/f40_b00_docker_service_spec.rb | 7 +- .../f40/f40_b01_docker_service_spec.rb | 2 +- .../dev_configs/mac/spec/locale/f45_spec.rb | 2 +- .../dev_configs/mac/spec/locale/f47_spec.rb | 2 +- .../dev_configs/mac/spec/locale/f98_spec.rb | 28 +- .../locale/locale_full_verification_spec.rb | 21 +- .../mac/spec/locale/ruby_installation_spec.rb | 13 + services/ruuuby/Dockerfile | 3 +- services/ruuuby_db/bin/db | 5 +- services/ruuuby_db/init.sql | 52 +- services/ruuuby_db/spec/dev/migration_spec.rb | 4 + services/ruuuby_db/spec/migration_spec.rb | 71 +- .../ruuuby_db/spec/test/migration_spec.rb | 32 + services/web_assets/Dockerfile | 5 +- .../src/attribute/bitwise_flags/max_31.js | 51 +- .../f15/f15_spec.rb => audit/ruuuby_spec.rb} | 9 +- spec/class/nums/float_spec.rb | 21 +- spec/db/seed_data_spec.rb | 343 ----- spec/feature/f00/f00_b01_spec.rb | 102 ++ spec/feature/f00/f00_b02_spec.rb | 26 + .../{f03/f03_spec.rb => f00/f00_b03_spec.rb} | 11 +- spec/feature/f00/f00_b04_spec.rb | 19 + spec/feature/f00/f00_b05_spec.rb | 27 + spec/feature/f00/f00_db_orm_spec.rb | 20 - spec/feature/f00/f00_spec.rb | 9 - spec/feature/f03/f03_db_orm_spec.rb | 13 - spec/feature/f04/f04_b00_spec.rb | 81 -- spec/feature/f04/f04_b01_spec.rb | 48 - spec/feature/f04/f04_db_orm_spec.rb | 27 - spec/feature/f04/f04_spec.rb | 18 - spec/feature/f12/f12_db_orm_spec.rb | 3 - spec/feature/f12/f12_spec.rb | 22 - spec/feature/f12/file_spec.rb | 2 +- spec/feature/f13/f13_db_orm_spec.rb | 13 - spec/feature/f15/f15_db_orm_spec.rb | 13 - spec/feature/f17/f17_spec.rb | 111 +- spec/feature/f22/f22_b01_spec.rb | 5 +- spec/feature/f26/f26_spec.rb | 16 +- spec/feature/f27/f27_b01_spec.rb | 277 ++-- spec/feature/f28/f28_b00_spec.rb | 49 +- spec/feature/f28/f28_b02_spec.rb | 42 +- spec/feature/f28/f28_b05_spec.rb | 34 +- spec/feature/f29/f29_db_orm_spec.rb | 17 - spec/feature/f31/f31_b01_spec.rb | 5 - spec/feature/f35/f35_spec.rb | 67 - spec/feature/f98/f98_b00_spec.rb | 10 +- spec/helpers/db/autoload_me.rb | 282 +--- spec/helpers/locale/autoload_me.rb | 16 + spec/helpers/rng/autoload_me.rb | 1 + .../f15 => integration}/readme_spec.rb | 41 +- ...em_configs_spec.rb => gem_configs_spec.rb} | 29 +- spec/locale/locale_full_verification_spec.rb | 3 +- spec/spec_helper.rb | 36 +- spec/system/postgres_docker_service_spec.rb | 1 + 115 files changed, 2515 insertions(+), 2686 deletions(-) rename ext/ruby_class_mods/{c0_constants.h => 00_constants.h} (81%) rename ext/ruby_class_mods/{c1_typed_checks.h => 01_typed_checks.h} (95%) rename ext/ruby_class_mods/{c2_extension_memory.h => 02_extension_memory.h} (94%) rename ext/ruby_class_mods/{c3_macro_utilities.h => 03_macro_utilities.h} (96%) rename ext/ruby_class_mods/{c4_theta_angle.h => 04_theta_angle.h} (99%) rename ext/ruby_class_mods/{c6_feature_macros.h => 05_feature_macros.h} (95%) rename ext/ruby_class_mods/{c7_time_series_data.h => 06_time_series_data.h} (99%) rename ext/ruby_class_mods/{c8_graphs.h => 07_graphs.h} (98%) delete mode 100644 ext/ruby_class_mods/c5_internal_structs.h create mode 100644 ext/ruby_class_mods/optional/00_debugging.h create mode 100644 lib/ruuuby/db/migrations/env_vars.rb create mode 100644 lib/ruuuby/db/migrations/rollback/01_env_vars.sql create mode 100644 lib/ruuuby/db/migrations/rollout/01_env_vars.sql create mode 100644 lib/ruuuby/db/migrations/seed/01_env_vars.sql delete mode 100644 lib/ruuuby/db/seeds/ruuuby_dirs.rb delete mode 100644 lib/ruuuby/ruuuby/engine/component/api.rb create mode 100644 services/dev_configs/db/models/brew_version.rb create mode 100644 services/dev_configs/db/models/java_version.rb create mode 100644 services/dev_configs/db/models/js/node_version.rb create mode 100644 services/dev_configs/db/models/js/npm_version.rb create mode 100644 services/dev_configs/db/models/js/yarn_version.rb create mode 100644 services/dev_configs/db/models/php_version.rb create mode 100644 services/dev_configs/db/models/python_version.rb create mode 100644 services/dev_configs/db/models/ruby_version.rb create mode 100644 services/dev_configs/mac/lib/zsh_configs.rb rename {spec/feature => services/dev_configs/mac/spec/locale}/f40/f40_b00_docker_service_spec.rb (94%) rename {spec/feature => services/dev_configs/mac/spec/locale}/f40/f40_b01_docker_service_spec.rb (87%) create mode 100644 services/dev_configs/mac/spec/locale/ruby_installation_spec.rb rename spec/{feature/f15/f15_spec.rb => audit/ruuuby_spec.rb} (70%) delete mode 100644 spec/db/seed_data_spec.rb create mode 100644 spec/feature/f00/f00_b01_spec.rb create mode 100644 spec/feature/f00/f00_b02_spec.rb rename spec/feature/{f03/f03_spec.rb => f00/f00_b03_spec.rb} (80%) create mode 100644 spec/feature/f00/f00_b04_spec.rb create mode 100644 spec/feature/f00/f00_b05_spec.rb delete mode 100644 spec/feature/f00/f00_db_orm_spec.rb delete mode 100644 spec/feature/f00/f00_spec.rb delete mode 100644 spec/feature/f03/f03_db_orm_spec.rb delete mode 100644 spec/feature/f04/f04_b00_spec.rb delete mode 100644 spec/feature/f04/f04_b01_spec.rb delete mode 100644 spec/feature/f04/f04_db_orm_spec.rb delete mode 100644 spec/feature/f04/f04_spec.rb delete mode 100644 spec/feature/f13/f13_db_orm_spec.rb delete mode 100644 spec/feature/f15/f15_db_orm_spec.rb delete mode 100644 spec/feature/f29/f29_db_orm_spec.rb delete mode 100644 spec/feature/f35/f35_spec.rb create mode 100644 spec/helpers/rng/autoload_me.rb rename spec/{feature/f15 => integration}/readme_spec.rb (82%) rename spec/locale/{ag_gem_configs_spec.rb => gem_configs_spec.rb} (71%) diff --git a/.gitignore b/.gitignore index 026a1ad..35546e1 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,8 @@ vendor/ # wip services/ruuuby/f93/ +/services/ruuuby_server/ +/services/ruuuby_server/ruuuby_server/ services/temp/ # diff --git a/CHANGELOG.md b/CHANGELOG.md index 5127bbd..0667d96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ +# `v0.1.0.pre.4` + +* continue `DB` migrations +* apply miscellaneous clean ups +* (*unofficially*) add gems{`rails`, `keycutter`, `github-linguist`} +* remove `rng` tests among others while reviewing scope of needed `statistics formulas` and approaches +* start of (critically needed) migration for more formal `CICD` + * begin preparation for proper git branching w/ `git hooks` on both `client` and `server` side + * begin preparation for proper build pipelines w/ a hybrid of custom code + a (to be chosen) `CICD` framework(s) + * iterative refactor of mapping between features & code; `Ruuuby Dockerization` to resume following more cleanup + # `v0.1.0.pre.3` * add gem{`open3`} @@ -34,7 +45,7 @@ * add gem{`bunny`} and a `Docker service` to help monitor `RabbitMQ` * add gem{`finite-machine`}, apply some design cleanup (w/ lots more to be done) - * for `web-based services`: add `webmanifest` file and `JSON minification` to the existing single `node.js REST end-point` + * for `web-based services`: add `webmanifest` file and `JSON minification` to the existing `node.js REST end-point` * generating file & directory `checksums` also added (wip) w/ results cross-checked between `JS` and `Ruuuby` * iterative upgrade for being able to set & apply development preferences such as `OS level configurations` @@ -59,31 +70,31 @@ | ----: | :---: | :---- | | `docker-api` | `1.34.2` | `2.0.0.pre.1` | -| path added | reference | notes | feature(s) | -| ----: | ---- | ---- | ---- | -| `lib/ruuuby/module/bundler.rb` | `Bundler` | | `f10` | -| `lib/ruuuby/module/gem.rb` | `Gem` | | `f10` | -| `services/web_assets/*` | `multiple files & dirs` | code not directly relating to `ruuuby engine` will not normally be documented (until pending `DB` overhaul) | `f10` | -| `lib/ruuuby/api/docker/docker_service.rb` | `RuuubyService` | temp util | `f39` | -| `lib/ruuuby/api/docker/docker_service_set.rb` | `RuuubyServiceSet` | temp util | `f39` | -| `bin/console_docker` | `RuuubyServiceSetDev` | offers funcs like: `build_web_assets`, `build_js`, `build_html`, `build_css`, `run_dev` | `f39` | - -| context | method(s) added | feature(s) | -| ---: | :--- | ---: | -| `Object` | `attribute_versionable` | `f10` | -| `ENV` | `∀🔑∃_value?` | `f10` | -| `Hash` | `∄🔑?`, `∀🔑∃_value?` | `f10` | -| `Array` | `convert_to_json` | `f10` | -| `String` | `clean!` | `f10` | -| `Heuristics` | `clean` | `f10` | -| `Net::HTTPResponse` | `time_received`, `content_length` | `f10` | -| `💎.engine.api_zsh` | `run_script` | `f10` | -| `💎.engine` | `run_apple_script!`, `curl_get` | `f10` | -| `💎.engine.api_locale` | `healthy?`, `healthy_encoding?` | `f10` | -| `🍺` | `doctor`, `cleanup`, `healthy?`, `analytics?`, `analytics_disabled?`, `analytics_set_on`, `analytics_set_off` | `f10` | -| `💎.engine.api_git` | `∃index_conflicts?`, `∃fixable_syntax_errors?` | `f31` | -| ``🐋`/`💎.engine.api_locale.api_docker`` | `∀🐋`, `connected?`, `connect`, `connect!`, `disconnect`, `disconnect!`, `version_compose` | `f40` | -| `Docker::Container` | `alpine?`, `debian?`, `dev?`, `prod?`, `healthy?`, `env_vars`, `os`, `os_version`, `linux_kernel_version`, `os_architecture`, `mounts`, `∃mount?`, `file_create`, `cmd!` | `f40` | +| path added | reference | notes | +| ----: | ---- | ---- | +| `lib/ruuuby/module/bundler.rb` | `Bundler` | | +| `lib/ruuuby/module/gem.rb` | `Gem` | | +| `services/web_assets/*` | `multiple files & dirs` | code not directly relating to `ruuuby engine` will not normally be documented (until pending `DB` overhaul) | +| `lib/ruuuby/api/docker/docker_service.rb` | `RuuubyService` | temp util | +| `lib/ruuuby/api/docker/docker_service_set.rb` | `RuuubyServiceSet` | temp util | +| `bin/console_docker` | `RuuubyServiceSetDev` | offers funcs like: `build_web_assets`, `build_js`, `build_html`, `build_css`, `run_dev` | + +| for | method(s) added | +| ---: | :--- | +| `Object` | `attribute_versionable` | +| `ENV` | `∀🔑∃_value?` | +| `Hash` | `∄🔑?`, `∀🔑∃_value?` | +| `Array` | `convert_to_json` | +| `String` | `clean!` | +| `Heuristics` | `clean` | +| `Net::HTTPResponse` | `time_received`, `content_length` | +| `💎.engine.api_zsh` | `run_script` | +| `💎.engine` | `run_apple_script!`, `curl_get` | +| `💎.engine.api_locale` | `healthy?`, `healthy_encoding?` | +| `🍺` | `doctor`, `cleanup`, `healthy?`, `analytics?`, `analytics_disabled?`, `analytics_set_on`, `analytics_set_off` | +| `💎.engine.api_git` | `∃index_conflicts?`, `∃fixable_syntax_errors?` | +| ``🐋`/`💎.engine.api_locale.api_docker`` | `∀🐋`, `connected?`, `connect`, `connect!`, `disconnect`, `disconnect!`, `version_compose` | +| `Docker::Container` | `alpine?`, `debian?`, `dev?`, `prod?`, `healthy?`, `env_vars`, `os`, `os_version`, `linux_kernel_version`, `os_architecture`, `mounts`, `∃mount?`, `file_create`, `cmd!` | --- @@ -102,45 +113,43 @@ | `pg` | `N/A` | `1.2.3` | comparing (apples & oranges) use-cases against `ActiveRecord` | | `docker-api` | `N/A` | `1.34.2` | offers tons of functionality, way more to be utilized | -| path(s) added | reference | notes | feature(s) | -| ----: | ---- | ---- | ---- | -| `services/nginx/includes/*.nginx` | (multiple files & directories) | | `f39` | -| `services/web_assets/Dockerfile` | | file added early, will be utilizing various `JS` libs/environments | `f39` | -| `services/web_assets/ruuuby.html` | | same as above | `f39` | -| `services/web_assets/ruuuby.js` | | same as above | `f39` | - -| context | method(s) added | feature(s) | -| ----: | :---- | ----: | -| `Array` | `∀𝚡λ𝑓🖨️` | `f10` | -| `Hash` | `λ𝑓∀🔑:₍🔑∉₎`, `λ𝑓∀🔑:₍🔑∉₎!` | `f10` | -| `File::YAML` | `read` | `f12` | -| `💎.engine.os` | `windows?`, `unix?`, `mac?`, `linux?` | `f22` | -| `🐋`/`💎.engine.api_locale.api_docker` | `healthy?`, `∃🌐?`, `∃🐋?`, `find_🌐_by_name`, `find_🐋_by_name`, `find_🐋_by_id`, `♻️_🌐_by_name` | `f40` | +| path(s) added | reference | notes | +| ----: | ---- | ---- | +| `services/nginx/includes/*.nginx` | (multiple files & directories) | | +| `services/web_assets/Dockerfile` | | file added early, will be utilizing various `JS` libs/environments | +| `services/web_assets/ruuuby.html` | | same as above | +| `services/web_assets/ruuuby.js` | | same as above | + +| for | method(s) added | +| ----: | :---- | +| `Array` | `∀𝚡λ𝑓🖨️` | +| `Hash` | `λ𝑓∀🔑:₍🔑∉₎`, `λ𝑓∀🔑:₍🔑∉₎!` | +| `File::YAML` | `read` | +| `💎.engine.os` | `windows?`, `unix?`, `mac?`, `linux?` | +| `🐋`/`💎.engine.api_locale.api_docker` | `healthy?`, `∃🌐?`, `∃🐋?`, `find_🌐_by_name`, `find_🐋_by_name`, `find_🐋_by_id`, `♻️_🌐_by_name` | --- # `v0.0.47` - * add T e C h D e B t ♪~ ᕕ(ᐛ)ᕗ - | gem updated | version previous | version current | | ----: | :---: | :---- | | `rake-compiler` | `1.1.0` | `1.1.1` | | `rubygems-update` | `3.1.4` | `3.2.0.rc.1` | -| path added | reference | notes | feature(s) | -| ----: | ---- | ---- | ---- | -| `lib/ruuuby/math/finance/benchmarks.rb` | | not currently utilized, just file added early | `f10` | -| `lib/ruuuby/heuristics/heuristics.rb` | `Ruuuby::Heuristics` | same as above description | `f10` | +| path added | reference | notes | +| ----: | ---- | ---- | +| `lib/ruuuby/math/finance/benchmarks.rb` | | not currently utilized, just file added early | +| `lib/ruuuby/heuristics/heuristics.rb` | `Ruuuby::Heuristics` | same as above description | -| context | method(s) added | feature(s) | -| ---: | :--- | ---: | -| `Matrix` | `ᵀ` | `f10` | -| `File::CSV` | `read` | `f12` | -| `💎.engine.api` | `pid_terminate` | `f22` | -| `💎.engine.api_locale` | `iconv_version`, `iconv_supported_encodings` | `f22` | -| `PseudoGraph` | `[]`, `set_edge`, `set_edge_inverse`, `num_nodes`, `empty?`, `free_memory`, `print_debugging` | `f37` | -| `TimeSeriesData` | `Q₁`, `Q₃`, `IQR`, `outliers_lower`, `outliers_upper`, `boundary_outliers_min`, `boundary_outliers_max`, `sum_squared`, `sum_of_squares`, `sum_weighted`, `mean_weighted`, `mean_geometric`, `nᵗʰ_percent_rank`, `healthy?` | `f38` | +| for | method(s) added | +| ---: | :--- | +| `Matrix` | `ᵀ` | +| `File::CSV` | `read` | +| `💎.engine.api` | `pid_terminate` | +| `💎.engine.api_locale` | `iconv_version`, `iconv_supported_encodings` | +| `PseudoGraph` | `[]`, `set_edge`, `set_edge_inverse`, `num_nodes`, `empty?`, `free_memory`, `print_debugging` | +| `TimeSeriesData` | `Q₁`, `Q₃`, `IQR`, `outliers_lower`, `outliers_upper`, `boundary_outliers_min`, `boundary_outliers_max`, `sum_squared`, `sum_of_squares`, `sum_weighted`, `mean_weighted`, `mean_geometric`, `nᵗʰ_percent_rank`, `healthy?` | --- @@ -151,27 +160,27 @@ * ⚠️: greatly increase scope of upcoming wide-scale refactors > tech-debt will out-pace rate of implementation/testing for at least a few versions, then more effective code clean-up will be enabled and performed -| path added | reference | notes | feature(s) | -| ----: | ---- | ---- | ---- | -| `lib/ruuuby/math/physics/physics.rb` | `Math::Physics` | not currently utilized, just file added early | `f10` | -| `lib/ruuuby/math/physics/wave.rb` | `Math::Physics::Wave` | same as above desc. | `f10` | -| `lib/ruuuby/math/physics/harmonic_analysis.rb` | `Math::Physics::HarmonicAnalysis` | same as above desc. | `f10` | -| `lib/ruuuby/math/forex/forex.rb` | `Math::Forex` | same as above desc. | `f10` | -| `lib/ruuuby/math/forex/currency_matrix.rb` | `Math::Forex::CurrencyMatrix` | `wip` | `f10` | -| `lib/ruuuby/class/nums/vector.rb` | `Vector` | `Ruby` built-in Class (now loaded in) | `f10` | -| `lib/ruuuby/class/nums/matrix.rb` | `Matrix` | `Ruby` built-in Class (now loaded in) | `f37` | -| `lib/ruuuby/math/algebra/tropical.rb` | `Math::Algebra::Tropical` | | `f38` | -| `ext/ruby_class_mods/c8_graphs.h` | `PseudoGraph` | same creation style as `ThetaAngle` & `TimeSeriesData` | `f38` | -| `lib/ruuuby/protocol/unix_socket.rb` | `UNIXSocket` | `Ruby` built-in Class (now loaded in) | `f39` | -| `help/extensions/c/open_mp.md` | | `wip` | `f98` | - -| context | method(s) added | feature(s) | -| ---: | :--- | ---: | -| `Vector` | `∅?` | `f11` | -| `Matrix` | `▣?`, `∀ₓ↘`, `∀ₓᵢ↘`, `↘_to_a`, `∀ₓᵢⱼ`, `num_rows`, `num_cols` | `f38` | -| `Math::Forex::CurrencyMatrix` | `η̂!`,`algo_🌴_arbitrage`, `karps_algorithm` | `f38` | -| `Math::Algebra::Tropical::ContextNumeric` | `⨁`, `⨂` | `f38` | -| `Math::Algebra::Tropical::ContextMatrix` | `⨁`, `⨁!`, `⨂`, `⨂ⁿ` | `f38` | +| path added | reference | notes | +| ----: | ---- | ---- | +| `lib/ruuuby/math/physics/physics.rb` | `Math::Physics` | not currently utilized, just file added early | +| `lib/ruuuby/math/physics/wave.rb` | `Math::Physics::Wave` | same as above desc. | +| `lib/ruuuby/math/physics/harmonic_analysis.rb` | `Math::Physics::HarmonicAnalysis` | same as above desc. | +| `lib/ruuuby/math/forex/forex.rb` | `Math::Forex` | same as above desc. | +| `lib/ruuuby/math/forex/currency_matrix.rb` | `Math::Forex::CurrencyMatrix` | `wip` | +| `lib/ruuuby/class/nums/vector.rb` | `Vector` | `Ruby` built-in Class (now loaded in) | +| `lib/ruuuby/class/nums/matrix.rb` | `Matrix` | `Ruby` built-in Class (now loaded in) | +| `lib/ruuuby/math/algebra/tropical.rb` | `Math::Algebra::Tropical` | | +| `ext/ruby_class_mods/c8_graphs.h` | `PseudoGraph` | same creation style as `ThetaAngle` & `TimeSeriesData` | +| `lib/ruuuby/protocol/unix_socket.rb` | `UNIXSocket` | `Ruby` built-in Class (now loaded in) | +| `help/extensions/c/open_mp.md` | | | + +| for | method(s) added | +| ---: | :--- | +| `Vector` | `∅?` | +| `Matrix` | `▣?`, `∀ₓ↘`, `∀ₓᵢ↘`, `↘_to_a`, `∀ₓᵢⱼ`, `num_rows`, `num_cols` | +| `Math::Forex::CurrencyMatrix` | `η̂!`,`algo_🌴_arbitrage`, `karps_algorithm` | +| `Math::Algebra::Tropical::ContextNumeric` | `⨁`, `⨂` | +| `Math::Algebra::Tropical::ContextMatrix` | `⨁`, `⨁!`, `⨂`, `⨂ⁿ` | --- @@ -182,26 +191,26 @@ * fix various edge-case bugs w/ `ThetaAngle` bitwise flags; apply same design to `TimeSeriesData`; start creation of re-usable base code for `Bitwise Flags` in general * `ORM`: apply start of refactors for proper support of `RuuubyChangelog` and other automation-functionality; design still `wip` * and thus full `DB TDD` & `documentation` is still withheld - * **remove:** global{`$PRM_MANY`}, update funcs in{`f06`} as needed and slightly increase testing coverage + * **remove:** global{`$PRM_MANY`}, update funcs as needed and slightly increase testing coverage * move various math functions to better suited locations; more to be done | gem updated | version previous | version current | | ----: | :---: | :---- | | `bundler` | `2.1.4` | `2.2.0.rc.1` | -| path added | reference | notes | feature(s) | -| ----: | ---- | ---- | ---- | -| `lib/ruuuby/class/bitwise_flag.rb` | `Ruuuby::BitwiseFlag` | utility/helper, non-core class | `f10` | -| `.gitattributes` | | | `f22` | -| `lib/ruuuby/math/geometry/shape/sphere.rb` | `Math::Geometry::Sphere` | not currently utilized, just file added early | `f35` | +| path added | reference | notes | +| ----: | ---- | ---- | +| `lib/ruuuby/class/bitwise_flag.rb` | `Ruuuby::BitwiseFlag` | utility/helper, non-core class | +| `.gitattributes` | | | +| `lib/ruuuby/math/geometry/shape/sphere.rb` | `Math::Geometry::Sphere` | not currently utilized, just file added early | -| context | method(s) added | feature(s) | -| ---: | :--- | ---: | -| `ApplicationRecord` | `orm_Ⓣ_🐍`, `empty?` | `f15` | -| `Ruuuby::MetaData::RuuubyEngine` | `num_cpu_cores`, `current_user`, `get_compiled_code` | `f22` | -| `💎.engine.api_git` | `validate_attribute` | `f31` | -| `Math::Stats::Descriptive` | `percentage_error` | `f36` | -| `TimeSeriesData` | `ρ`, `flags`, `mape`, `normalize!`, `print_debugging`, `first`, `last`, `λ`, `Λ`, `has_zero?`, `has_negative?`, `normalized?`, `even?`, `strictly_increasing?`, `strictly_decreasing?`, `all_same?` | `f36` | +| for | method(s) added | +| ---: | :--- | +| `ApplicationRecord` | `orm_Ⓣ_🐍`, `empty?` | +| `Ruuuby::MetaData::RuuubyEngine` | `num_cpu_cores`, `current_user`, `get_compiled_code` | +| `💎.engine.api_git` | `validate_attribute` | +| `Math::Stats::Descriptive` | `percentage_error` | +| `TimeSeriesData` | `ρ`, `flags`, `mape`, `normalize!`, `print_debugging`, `first`, `last`, `λ`, `Λ`, `has_zero?`, `has_negative?`, `normalized?`, `even?`, `strictly_increasing?`, `strictly_decreasing?`, `all_same?` | --- @@ -217,40 +226,40 @@ * `TimeSeriesData` will eventually be able to be used for discovering optimal `GC-settings` * ex: finding optimal `heap-size` and `garbage-collection-frequency` depending on context of script -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/math/stats/time_series_data.rb` | `TimeSeriesData` | `wip` | `f34` | -| `ext/ruby_class_mods/c7_times_series_data.rb` | `TimeSeriesData` | `wip` | `f35` | -| `lib/ruuuby/ruuuby/engine/ruuuby_api_component.rb` | | `temp/wip` | `f97` | -| `bin/compilation_modes/build_w_debugging` | | `temp/wip` | `f97` | -| `bin/compilation_modes/build_simple` | | `temp/wip` | `f97` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/math/stats/time_series_data.rb` | `TimeSeriesData` | | +| `ext/ruby_class_mods/c7_times_series_data.rb` | `TimeSeriesData` | | +| `lib/ruuuby/ruuuby/engine/ruuuby_api_component.rb` | | | +| `bin/compilation_modes/build_w_debugging` | | | +| `bin/compilation_modes/build_simple` | | | -| context | method(s) added | feature(s) | -| --- | --- | --- | -| `Ruuuby::MetaData::RuuubyEngine::F22B00` | `percentage_protected_from_minor_marks`, `percentage_fragmentation`, `stats_bytes_per_object_slot`, `stats_slots_per_heap_page`, `perform_quick`, `perform_full` | `f23` | -| (Refinement) `String` | `ʳ?`, `ʳ`, `ᵍ?`, `ᵍ`, `𝞽?`, `𝞽` | `f28` | -| `TimeSeriesData` | `mem_size`, `free_memory`, `len`, `mean`, `sum`, `max`, `min`, `median`, `range`, `σ²`=>`variance`, `σ`=>`std_dev`, `percentile`, `mse` | `f36` | +| for | method(s) added | +| --- | --- | +| `Ruuuby::MetaData::RuuubyEngine::F22B00` | `percentage_protected_from_minor_marks`, `percentage_fragmentation`, `stats_bytes_per_object_slot`, `stats_slots_per_heap_page`, `perform_quick`, `perform_full` | +| (Refinement) `String` | `ʳ?`, `ʳ`, `ᵍ?`, `ᵍ`, `𝞽?`, `𝞽` | +| `TimeSeriesData` | `mem_size`, `free_memory`, `len`, `mean`, `sum`, `max`, `min`, `median`, `range`, `σ²`=>`variance`, `σ`=>`std_dev`, `percentile`, `mse` | --- # `v0.0.43` - * add{`f06_b04`} to provide normalizer{`∈𝕌`} for funcs{`flt?`, `🛑flt❓`} + * add normalizer{`∈𝕌`} for funcs{`flt?`, `🛑flt❓`} * start adding textual parsing for `ThetaAngle` via `Refinement` in{`ThetaAngle::ContextStrParsing`} * increase scope tested in some db_audit funcs -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/math/geometry/theta_angle/context_str.rb` | `ThetaAngle::ContextStrParsing` | Refinements onto `String` for parsing to and from `ThetaAngle` | `f27` | -| `lib/ruuuby/ruuuby/engine/ruuuby_engine_component.rb` | `Ruuuby::MetaData::RuuubyEngineComponent` | start of cleaner design w/ `RuuubyEngine` and relating objs | `f10` | -| `lib/ruuuby/ruuuby/api/api_locale.rb` | `Ruuuby::MetaData::LocaleAPI` | | `f10` | -| `bin/manually_execute/clean_up` | | delete any temporary/generated content, quick way to force a full re-compile | `f10` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/math/geometry/theta_angle/context_str.rb` | `ThetaAngle::ContextStrParsing` | Refinements onto `String` for parsing to and from `ThetaAngle` | +| `lib/ruuuby/ruuuby/engine/ruuuby_engine_component.rb` | `Ruuuby::MetaData::RuuubyEngineComponent` | start of cleaner design w/ `RuuubyEngine` and relating objs | +| `lib/ruuuby/ruuuby/api/api_locale.rb` | `Ruuuby::MetaData::LocaleAPI` | | +| `bin/manually_execute/clean_up` | | delete any temporary/generated content, quick way to force a full re-compile | -| context | method(s) added | feature(s) | -| --- | --- | --- | -| `Math::Stats::TimeSeries` | `aroon_up`, `aroon_down`, `aroon_oscillator`, `simple_moving_average` | `f35` | -| `Math::Combinatorics::𝕎¹` | `len_powerset` | `f33` | -| `Math::Combinatorics::𝕎²` | `len_ordered_with_replacement` | `f33` | -| (`Refinement`) `String` | `°?`, `°` | `f27` | +| for | method(s) added | +| --- | --- | +| `Math::Stats::TimeSeries` | `aroon_up`, `aroon_down`, `aroon_oscillator`, `simple_moving_average` | +| `Math::Combinatorics::𝕎¹` | `len_powerset` | +| `Math::Combinatorics::𝕎²` | `len_ordered_with_replacement` | +| (`Refinement`) `String` | `°?`, `°` | --- @@ -258,11 +267,11 @@ * change normalizer from{!∅} to{∉∅}; add{f06_b03} to provide this normalizer for funcs{ary?, 🛑ary❓} * provide function aliases{`wma`, `ema`} to `Math::Stats::TimeSeries` -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `ThetaAngle` | `octant?` | `f28` | -| `Math::Stats` | `median` | `f35` | -| `Math::Stats::TimeSeries` | `weighted_moving_average` | `f35` | +| for | method(s) added | +| --- | --- | +| `ThetaAngle` | `octant?` | +| `Math::Stats` | `median` | +| `Math::Stats::TimeSeries` | `weighted_moving_average` | --- @@ -277,32 +286,32 @@ * faster start-up time esp. for targeted scripts * ex: compare `rspec_locale{0.04s}` vs `rspec_locale_full{1.33s}` -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `ext/ruby_class_mods/c5_internal_structs.h` | | | `f98` | -| `ext/ruby_class_mods/c6_feature_macros.h` | | | `f98` | -| `lib/ruuuby/math/stats/stats.rb` | `Math::Stats` | | `f35` | -| `lib/ruuuby/math/stats/time_series.rb` | `Math::Stats::TimeSeries` | | `f35` | -| `lib/ruuuby/math/geometry/shape/shape.rb` | `Math::Geometry::Shape` | not currently utilized, just file added early | `f34` | -| `lib/ruuuby/math/geometry/shape/plane_figure.rb` | `Math::Geometry::PlaneFigure` | same as ↑ | `f34` | -| `lib/ruuuby/math/geometry/shape/quadrilateral.rb` | `Math::Geometry::Triangle` | same as ↑ | `f34` | -| `lib/ruuuby/math/geometry/shape/shape.rb` | `Math::Geometry::Quadrilateral` | same as ↑ | `f34` | -| `db/db_schema.rb` | | | `f15` | -| `lib/ruuuby/ruuuby/api/abstract_space.rb` | | not currently utilized, just file added early | `f02` | -| `lib/ruuuby/ruuuby/api/api_brew.rb` | | same as ↑ | `f02` | -| `lib/ruuuby/ruuuby/api/api_docker.rb` | | same as ↑ | `f02` | - -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `String` | `palindrome?` | `f10` | -| `ApplicationRecord` | `num_where` | `f11` | -| `GitCommit` | `num_release_tags` | `f11` | -| `RuuubyRelease` | `num_released` | `f11` | -| `Ruuuby::MetaData::RuuubyEngine` | `memory_peak_this_runtime` | `f22` | -| `Math::NumberTheory` | `semiprime?` | `f32` | -| `Math::Combinatorics` | `permutations` | `f33` | -| `Math::Stats` | `arithmetic_mean` | `f35` | -| `Math::Stats::TimeSeries` | `exponential_moving_average` | `f35` | +| path added | reference | notes | +| ---: | --- | --- | +| `ext/ruby_class_mods/c5_internal_structs.h` | | | +| `ext/ruby_class_mods/c6_feature_macros.h` | | | +| `lib/ruuuby/math/stats/stats.rb` | `Math::Stats` | | +| `lib/ruuuby/math/stats/time_series.rb` | `Math::Stats::TimeSeries` | | +| `lib/ruuuby/math/geometry/shape/shape.rb` | `Math::Geometry::Shape` | not currently utilized, just file added early | +| `lib/ruuuby/math/geometry/shape/plane_figure.rb` | `Math::Geometry::PlaneFigure` | same as ↑ | +| `lib/ruuuby/math/geometry/shape/quadrilateral.rb` | `Math::Geometry::Triangle` | same as ↑ | +| `lib/ruuuby/math/geometry/shape/shape.rb` | `Math::Geometry::Quadrilateral` | same as ↑ | +| `db/db_schema.rb` | | | +| `lib/ruuuby/ruuuby/api/abstract_space.rb` | | not currently utilized, just file added early | +| `lib/ruuuby/ruuuby/api/api_brew.rb` | | same as ↑ | +| `lib/ruuuby/ruuuby/api/api_docker.rb` | | same as ↑ | + +| for | method(s) added | +| --- | --- | +| `String` | `palindrome?` | +| `ApplicationRecord` | `num_where` | +| `GitCommit` | `num_release_tags` | +| `RuuubyRelease` | `num_released` | +| `Ruuuby::MetaData::RuuubyEngine` | `memory_peak_this_runtime` | +| `Math::NumberTheory` | `semiprime?` | +| `Math::Combinatorics` | `permutations` | +| `Math::Stats` | `arithmetic_mean` | +| `Math::Stats::TimeSeries` | `exponential_moving_average` | --- @@ -316,14 +325,14 @@ * add/track `gem 'rubygems-update', '~> 3.1.4'` * update version from{`3.1.2`} to{`3.1.4`} -| context | method(s) added | feature(s) | -| --- | --- | --- | -| (c) `Symbol` | `as_source_ruby` | `f10` | -| (v) `ENV` | `parse_feature_behaviors`, `validate_feature_behavior_syntax!` | `f10` | -| (c) `RuuubyGem` | `fetch_by_type` | `f15` | -| (m) `Math::NumberTheory::ℤ²` | `fast_gcd` | `f32` | -| (m) `Math::NumberTheory::ℤ³` | `congruent?` | `f32` | -| (Refinement) `Integer` | `≡` | `f32` | +| for | method(s) added | +| --- | --- | +| `Symbol` | `as_source_ruby` | +| `ENV` | `parse_feature_behaviors`, `validate_feature_behavior_syntax!` | +| `RuuubyGem` | `fetch_by_type` | +| `Math::NumberTheory::ℤ²` | `fast_gcd` | +| `Math::NumberTheory::ℤ³` | `congruent?` | +| (Refinement) `Integer` | `≡` | --- @@ -333,43 +342,41 @@ * add `RSpec` sections: `integration` & `tech_debt` * add the following `Sequence` objs to `Math::NumberTheory::𝕎¹`: `seq_pronic`, `seq_square`, `seq_fibonacci`, `seq_lucas`, `seq_triangle`, `seq_hexagonal` * remove some non-ASCII characters in `.h` and `.c` files while testing between compilers `clang` & `gcc` - * remove both (`f01`, `f02`), (`f10`) now covers these scenarios w/ feature-behaviors * fix typo for const{ANGLE_TAU}, it is now correctly referenced by{`𝞽`} and not{`τ`} * various edge-case bugs w/ `ThetaAngle` identified, some are fixed for this version -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/math/expr/seq/arithmetic.rb` | `Math::Expr::ArithmeticSequence` | (`Ruby` version{`2.7.1`} just added `Enumerator::ArithmeticSequence` which will be looked at prior to further modifications & clean-up of these `Sequence` classes) | `f10` | -| `lib/ruuuby/math/expr/seq/geometric.rb` | `Math::Expr::GeometricSequence` | | `f10` | -| `lib/ruuuby/math/expr/seq/recursive.rb` | `Math::Expr::RecursiveSequence` | | `f10` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/math/expr/seq/arithmetic.rb` | `Math::Expr::ArithmeticSequence` | (`Ruby` version{`2.7.1`} just added `Enumerator::ArithmeticSequence` which will be looked at prior to further modifications & clean-up of these `Sequence` classes) | +| `lib/ruuuby/math/expr/seq/geometric.rb` | `Math::Expr::GeometricSequence` | | +| `lib/ruuuby/math/expr/seq/recursive.rb` | `Math::Expr::RecursiveSequence` | | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Math::NumberTheory` | `digit_sum`, `digital_root`, `additive_persistence`, `almost_perfect?`, `nᵗʰ_cototient`, `nᵗʰ_euler_totient`, `friendly?` | `f31` | -| `Math::Combinatorics` | `n_choose_k` | `f32` | +| for | method(s) added | +| --- | --- | +| `Math::NumberTheory` | `digit_sum`, `digital_root`, `additive_persistence`, `almost_perfect?`, `nᵗʰ_cototient`, `nᵗʰ_euler_totient`, `friendly?` | +| `Math::Combinatorics` | `n_choose_k` | --- # `v0.0.38` - * (`f98`) replace all usages of c-ext-func{`rb_eval_string`} and others that were significantly slowing down `startup/initial-load time` - * (`f18`) moved to {`f98_b02`}, `f18` will now cover the math module `Space` + * replace all usages of c-ext-func{`rb_eval_string`} and others that were significantly slowing down `startup/initial-load time` * remove funcs{`class?`, `module?`, `singleton?`} from Class(`Object`); (functionality covered by `🧬`) - * remove func{`𝔠`} from `Kernel` (and thus remove `functional-style` support from (`f05`)) + * remove func{`𝔠`} from `Kernel` (and thus remove `functional-style` support from previously{`f05`}) * track `git tags` w/ related `ORMs` & `APIs`; however, version automation tasks paused until `TDD` catches up for `DB` and/or some event/queue-based logic is added (ex: `RabbitMQ`) * apply various misc cleanups w/ others `wip` -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/math/statistics/statistical_learning.rb` | `Math::Stats::StatisticalLearning` | not currently in use | `f30` | -| `lib/math/statistics/probability_theory.rb` | `Math::Stats::ProbabilityTheory` | not currently in use | `f30` | -| `lib/math/statistics/descriptive_statistics.rb` | `Math::Stats::DescriptiveStatistics` | not currently in use | `f30` | -| `lib/math/combinatorics/combinatorics.rb` | `Math::Stats` | not currently in use | `f30` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/math/statistics/statistical_learning.rb` | `Math::Stats::StatisticalLearning` | not currently in use | +| `lib/math/statistics/probability_theory.rb` | `Math::Stats::ProbabilityTheory` | not currently in use | +| `lib/math/statistics/descriptive_statistics.rb` | `Math::Stats::DescriptiveStatistics` | not currently in use | +| `lib/math/combinatorics/combinatorics.rb` | `Math::Stats` | not currently in use | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Math::Space::NucleotideSpace` | `∋ˢ?` | `f30` | -| `Ruuuby::MetaData::GitAPI` | `release_tags`, `branch_names`, `remote_release_current`, `remote_release_previous` | `f31` | -| `Math::NumberTheory` | `aliquot_sum`, `deficient?`, `deficiency`, `abundant?`, `abundance`, `abundancy_index`, `composite?` | `f32` | +| for | method(s) added | +| --- | --- | +| `Math::Space::NucleotideSpace` | `∋ˢ?` | +| `Ruuuby::MetaData::GitAPI` | `release_tags`, `branch_names`, `remote_release_current`, `remote_release_previous` | +| `Math::NumberTheory` | `aliquot_sum`, `deficient?`, `deficiency`, `abundant?`, `abundance`, `abundancy_index`, `composite?` | --- @@ -379,22 +386,21 @@ * remove func{∞?} from Class(`String`) * add `ORM`{`RuuubyGem`}, some functionality was added; also removed runtime constants needed solely for unit-tests (these tests are now semi-generated w/ `ORM` data) * add `RSpec` section for `locale` (local configs); `(not final design)` - * (`f22`) will now be designated for `GC` and the `GC::Profiler`, previous `f22` moved to {`f28_b12`} - -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/virtual/f06.rb` | | | `f06` | -| `app/models/ruuuby_gem.rb` | `RuuubyGem` | | `f15` | -| `lib/virtual/f28.rb` | | | `f28` | -| `lib/math/complex_analysis/complex_analysis.rb` | `Math::ComplexAnalysis` | not currently in use | `f30` | -| `lib/math/trigonometry/trigonometry.rb` | `Math::Trigonometry` | not currently in use | `f30` | -| `lib/math/graph_theory/graph_theory.rb` | `Math::GraphTheory` | not currently in use | `f30` | -| `lib/math/geometry/geometry.rb` | `Math::Geometry` | not currently in use | `f30` | -| `lib/math/space/discrete/symbolic_numbers_space.rb` | `Math::Space::SymbolicNumbersSpace` | 𝕊 | `f30` | - -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Object` | `ⓣ`, `Ⓣ` | `f06` | + +| path added | reference | notes | +| ---: | --- | --- | +| `lib/virtual/f06.rb` | | | +| `app/models/ruuuby_gem.rb` | `RuuubyGem` | | +| `lib/virtual/f28.rb` | | | +| `lib/math/complex_analysis/complex_analysis.rb` | `Math::ComplexAnalysis` | | +| `lib/math/trigonometry/trigonometry.rb` | `Math::Trigonometry` | | +| `lib/math/graph_theory/graph_theory.rb` | `Math::GraphTheory` | | +| `lib/math/geometry/geometry.rb` | `Math::Geometry` | | | +| `lib/math/space/discrete/symbolic_numbers_space.rb` | `Math::Space::SymbolicNumbersSpace` | 𝕊 | + +| for | method(s) added | +| --- | --- | +| `Object` | `ⓣ`, `Ⓣ` | --- @@ -402,25 +408,25 @@ * remove func{`get_prime_factors`} from `Integer`, newly created module{`Math::NumberTheory`} now offers that functionality * local git-config settings are now enforced with newly created `💎.api_git`, version-automation refactorings started -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/math/expression/equation.rb` | `Math::Expression::Equation` | not currently in use | `f10` | -| `lib/math/expression/sequence.rb` | `Math::Expression::Sequence` | not currently in use | `f10` | -| `lib/math/group_theory/circle_group.rb` | `Math::GroupTheory::CircleGroup` | not currently in use, aliased via(`𝕋`) | `f30` | -| `lib/ruuuby/ruuuby/git_api.rb` | `Ruuuby::MetaData::GitAPI` | `💎.api_git` (to fully replace existing `git` functionality found in `💎.api` and elsewhere) | `f31` | -| `lib/math/number_theory/number_theory.rb` | `Math::Ruuuby::NumberTheory` | | `f32` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/math/expression/equation.rb` | `Math::Expression::Equation` | | +| `lib/math/expression/sequence.rb` | `Math::Expression::Sequence` | | +| `lib/math/group_theory/circle_group.rb` | `Math::GroupTheory::CircleGroup` | aliased via(`𝕋`) | +| `lib/ruuuby/ruuuby/git_api.rb` | `Ruuuby::MetaData::GitAPI` | `💎.api_git` (to fully replace existing `git` functionality found in `💎.api` and elsewhere) | +| `lib/math/number_theory/number_theory.rb` | `Math::Ruuuby::NumberTheory` | | -| module | class-method(s) added | feature(s) | -| --- | --- | --- | -| `Math::NumberTheory::ℕ¹` | `get_prime_factors`, `get_divisors`, `get_proper_divisors`, `perfect_number?` | `f32` | -| `Math::NumberTheory::ℕ²` | `gcd`, `coprime?` | `f32` | +| for | class-method(s) added | +| --- | --- | +| `Math::NumberTheory::ℕ¹` | `get_prime_factors`, `get_divisors`, `get_proper_divisors`, `perfect_number?` | +| `Math::NumberTheory::ℕ²` | `gcd`, `coprime?` | --- # `v0.0.35` * add `gem 'rugged', '~> 1.0.0'` * apply general clean-ups, next few versions to have similar target - * (`f98`): remove many function calls and variables that didn't need to be executed or exist; start adding extra checks via{`mkmf`} which will halt/fail even before the compilations step + * remove many function calls and variables that didn't need to be executed or exist; start adding extra checks via{`mkmf`} which will halt/fail even before the compilations step * remove alias `🧬?`, `🧬` is now a 'global-alias' for the singleton{`NucleotideLikeSpace`} * remove alias `🅱️?`, `🛑🅱️❓`, etc; just `🅱` is now a 'global-alias' for the single{`BooleanLikeSpace`} * remove funcs{`stry?`, `countable?`} and{`🛑stry❓`, `🛑countable❓`} @@ -430,84 +436,84 @@ * add more detail to various `ORM` features/funcs, documentation and TDD still intentionally not fully present for these * add class `DescriptiveStandardError` -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/math/expression/expression.rb` | | not currently in use | `f10` | -| `lib/math/expression/formula.rb` | | not currently in use | `f10` | -| `lib/math/space/tuple_space.rb` | | | `f30` | -| `lib/math/space/types_space.rb` | | | `f30` | -| `lib/math/space/discrete/boolean-like_space.rb` | ``Math::Space::BooleanLikeSpace`` | | `f30` | -| `lib/math/space/discrete/number-like_space.rb` | ``Math::Space::NumberLikeSpace`` | | `f30` | -| `lib/math/space/discrete/nucleotide-like_space.rb` | ``Math::Space::NucleotideLikeSpace`` | | `f30` | - -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `TrueClass`, `FalseClass` | `to_i`, `to_b` | `f06` | -| `Rational` | `μ?` | `f10` | -| `String` | `to_🐫⬇`, `to_🐍⬆` | `f24` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/math/expression/expression.rb` | | | +| `lib/math/expression/formula.rb` | | | +| `lib/math/space/tuple_space.rb` | | | +| `lib/math/space/types_space.rb` | | | +| `lib/math/space/discrete/boolean-like_space.rb` | ``Math::Space::BooleanLikeSpace`` | | +| `lib/math/space/discrete/number-like_space.rb` | ``Math::Space::NumberLikeSpace`` | | +| `lib/math/space/discrete/nucleotide-like_space.rb` | ``Math::Space::NucleotideLikeSpace`` | | + +| for | method(s) added | +| --- | --- | +| `TrueClass`, `FalseClass` | `to_i`, `to_b` | +| `Rational` | `μ?` | +| `String` | `to_🐫⬇`, `to_🐍⬆` | # `v0.0.34` * increase precision of various funcs (ex: `sin²` and `cos²`), by performing calculations in `long double` instead of `double` * add `𝞽` as a 'global-const' which is a ThetaAngle representing a single complete turn * adjust parameter style of class-functions for `Math` to use named params * remove global-alias-funcs{`ℂ`, `ℚ`}; these now correspond to a specific singleton instance of the newly created class(`Math::SetTheory::NumberSet`) - * (`f28`): add `super golden ratio` as `Ψ`, `silver ratio` as `δ`, `plastic ratio` as `ρ`, `omega constant` as `Ω` + * add `super golden ratio` as `Ψ`, `silver ratio` as `δ`, `plastic ratio` as `ρ`, `omega constant` as `Ω` * remove various out-dated testing helper functions, meta-data generation/processing will eventually replace this * remove `Array::EMPTY_INSTANCE`, `∅` by itself now aliases a singleton of type{`NumberSet`} - * (`f15`): create `ORM`{`RuuubyFeatureBehavior`} which is many to one{`RuuubyFeature`} + * create `ORM`{`RuuubyFeatureBehavior`} which is many to one{`RuuubyFeature`} * remove number-set membership check funcs from `Numerics` and create `singleton` instances of `NumberSet` which covers the previous functionality (just more scalable) * remove as much deprecated code as possible, file structure adjustments started - * (`f98`): move `Float`'s method{`≈≈`} into `C-extensions` + * move `Float`'s method{`≈≈`} into `C-extensions` * remove funcs (and related ones): `🛑ℤ❓` and `🛑𝕌❓`, these checks are now covered by existing functions w/ new types of normalizers added for existing normalizer feature -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/math/set_theory/closure.rb` | ``Math::SetTheory::Closure`` | | `f11` | -| `lib/ruuuby/math/set_theory/number_set.rb` | ``Math::SetTheory::NumberSet`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/algebraic_numbers.rb` | ``Math::SetTheory::AlgebraicNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/boolean_numbers.rb` | ``Math::SetTheory::BooleanNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/complex_numbers.rb` | ``Math::SetTheory::ComplexNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/empty_set.rb` | ``Math::SetTheory::EmptySet`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/imaginary_numbers.rb` | ``Math::SetTheory::ImaginaryNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/integer_numbers.rb` | ``Math::SetTheory::IntegerNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/irrational_numbers.rb` | ``Math::SetTheory::IrrationalNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/natural_numbers.rb` | ``Math::SetTheory::NaturalNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/null_set.rb` | ``Math::SetTheory::NullSet`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/rational_numbers.rb` | ``Math::SetTheory::RationalNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/real_algebraic_numbers.rb` | ``Math::SetTheory::RealAlgebraicNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/real_numbers.rb` | ``Math::SetTheory::RealNumbers`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/universal_set.rb` | ``Math::SetTheory::UniversalSet`` | | `f11` | -| `lib/ruuuby/math/set_theory/discrete/whole_numbers.rb` | ``Math::SetTheory::WholeNumbers`` | | `f11` | -| `app/models/ruuuby_feature_behavior.rb` | | | `f15` | -| `ext/ruby_class_mods/c4_theta_angle.h` | | for organization | `f27` | - -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Object` | `set?`, `🛑set❓` | `f06` | -| `Integer` | `get_prime_factors` | `f17` | -| `ThetaAngle` | `normalize`, `windings` | `f28` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/math/set_theory/closure.rb` | ``Math::SetTheory::Closure`` | | +| `lib/ruuuby/math/set_theory/number_set.rb` | ``Math::SetTheory::NumberSet`` | | +| `lib/ruuuby/math/set_theory/discrete/algebraic_numbers.rb` | ``Math::SetTheory::AlgebraicNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/boolean_numbers.rb` | ``Math::SetTheory::BooleanNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/complex_numbers.rb` | ``Math::SetTheory::ComplexNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/empty_set.rb` | ``Math::SetTheory::EmptySet`` | | +| `lib/ruuuby/math/set_theory/discrete/imaginary_numbers.rb` | ``Math::SetTheory::ImaginaryNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/integer_numbers.rb` | ``Math::SetTheory::IntegerNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/irrational_numbers.rb` | ``Math::SetTheory::IrrationalNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/natural_numbers.rb` | ``Math::SetTheory::NaturalNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/null_set.rb` | ``Math::SetTheory::NullSet`` | | +| `lib/ruuuby/math/set_theory/discrete/rational_numbers.rb` | ``Math::SetTheory::RationalNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/real_algebraic_numbers.rb` | ``Math::SetTheory::RealAlgebraicNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/real_numbers.rb` | ``Math::SetTheory::RealNumbers`` | | +| `lib/ruuuby/math/set_theory/discrete/universal_set.rb` | ``Math::SetTheory::UniversalSet`` | | +| `lib/ruuuby/math/set_theory/discrete/whole_numbers.rb` | ``Math::SetTheory::WholeNumbers`` | | +| `app/models/ruuuby_feature_behavior.rb` | | | +| `ext/ruby_class_mods/c4_theta_angle.h` | | for organization | + +| for | method(s) added | +| --- | --- | +| `Object` | `set?`, `🛑set❓` | +| `Integer` | `get_prime_factors` | +| `ThetaAngle` | `normalize`, `windings` | --- # `v0.0.33` - * (`f98`): create new Class(`ThetaAngle`) which is essentially a wrapper over a `C-struct` + * create new Class(`ThetaAngle`) which is essentially a wrapper over a `C-struct` * modify global-funcs `sin`, `cos`, `tan`, etc to utilize the `ThetaAngle` class * add empty code file(`lib/ruuuby/class/method/math_function.rb`) for future versions * apply lots of misc clean-ups and/or adjustments * `v0.0.34` to resolve missing parts from `ThetaAngle` and clean-up relating funcs from `String` -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/class/nums/theta_angle.rb` | `ThetaAngle` | | `f27` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/class/nums/theta_angle.rb` | `ThetaAngle` | | -| class / module | method(s) added | feature(s) | -| --- | --- | --- | -| `Object` | `θ?`, `🛑θ❓`, `enumerable?`, `🛑enumerable❓` | `f06` | -| `Math` | `pythagoras_τ³?`, `cot`, `csc`, `sec`, `sin²`, `cos²` | `f17` | -| `TOPLEVEL_BINDING` | `℮`, `logₑ`, `log₂`, `log₁₀`, `arcsin`, `arccos`, `arctan`, `cot`, `csc`, `sec`, `sin²`, `cos²` | `f17` | -| `TOPLEVEL_BINDING` | `⅓`, `⅕`, `⅕`,`⅖`,`⅗`,`⅘`,`⅙`,`⅐`, `⅛`, `⅜`, `⅝`, `⅞`, `⅑`, `⅒` | `f17` | -| `TOPLEVEL_BINDING` | `θ°`, `θʳ`, `θᵍ`, `θ𝞽` | `f27` | -| `ThetaAngle` | `real`, `repr`, `as_radian`, `as_degree`, `as_gon`, `as_turn`, `radians?`, `degrees?`, `gons?`, `turns?`, `-@`, `+@`, `coerce`, `~`, `!`, `+`, `-`, `*`, `%`,`==`, `/`, `<=>`, `angle?`, `normal?`, `normalize!`, `golden_with?`, `explementary_with?`, `supplementary_with?`, `complementary_with?`, | `f27` | +| for | method(s) added | +| --- | --- | +| `Object` | `θ?`, `🛑θ❓`, `enumerable?`, `🛑enumerable❓` | +| `Math` | `pythagoras_τ³?`, `cot`, `csc`, `sec`, `sin²`, `cos²` | +| `TOPLEVEL_BINDING` | `℮`, `logₑ`, `log₂`, `log₁₀`, `arcsin`, `arccos`, `arctan`, `cot`, `csc`, `sec`, `sin²`, `cos²` | +| `TOPLEVEL_BINDING` | `⅓`, `⅕`, `⅕`,`⅖`,`⅗`,`⅘`,`⅙`,`⅐`, `⅛`, `⅜`, `⅝`, `⅞`, `⅑`, `⅒` | +| `TOPLEVEL_BINDING` | `θ°`, `θʳ`, `θᵍ`, `θ𝞽` | +| `ThetaAngle` | `real`, `repr`, `as_radian`, `as_degree`, `as_gon`, `as_turn`, `radians?`, `degrees?`, `gons?`, `turns?`, `-@`, `+@`, `coerce`, `~`, `!`, `+`, `-`, `*`, `%`,`==`, `/`, `<=>`, `angle?`, `normal?`, `normalize!`, `golden_with?`, `explementary_with?`, `supplementary_with?`, `complementary_with?`, | | from | methods/aliases removed | | ---------- | ----------------------- | @@ -516,44 +522,44 @@ --- # `v0.0.32` - * (`f98`) add flags to the compilation and linker steps (`wip`); replace locations in `C-extensions` that were previously accessing pointers not intended to be used beyond its internal scope (internal to `Ruby`) + * add flags to the compilation and linker steps (`wip`); replace locations in `C-extensions` that were previously accessing pointers not intended to be used beyond its internal scope (internal to `Ruby`) * global-func(`φ`) removed, reference replaced with(`𝚽`), a `Kernel` constant; also add the golden-angle constant(`Ⴔ`) * start utilizing more generic math notation where possible, ex-func(`∀τ²∈λ𝑓₍ᵢ،ᵢ₊₁₎`), very useful as this automatically applies (for example) to both regular objects like `Array` and also `ORM` objects like `RuuubyRelease` while still applicable to both * `v0.0.33` to utilize `golden-angle` as well as dramatically alter angle-trig related functions -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/module/attribute/includable/singleton.rb` | `Ruuuby::Attribute::Includable::RuuubySingleton` | | `f10` | -| `lib/ruuuby/module/attribute/extendable/singleton.rb` | `Ruuuby::Attribute::Extendable::RuuubySingleton` | | `f10` | -| `lib/ruuuby/class/proc.rb` | ``Proc`` | | `f10` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/module/attribute/includable/singleton.rb` | `Ruuuby::Attribute::Includable::RuuubySingleton` | | +| `lib/ruuuby/module/attribute/extendable/singleton.rb` | `Ruuuby::Attribute::Extendable::RuuubySingleton` | | +| `lib/ruuuby/class/proc.rb` | ``Proc`` | | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Enumerable` | `∀τ²∈λ𝑓₍ᵢ،ᵢ₊₁₎` | `f11` | +| for | method(s) added | +| --- | --- | +| `Enumerable` | `∀τ²∈λ𝑓₍ᵢ،ᵢ₊₁₎` | --- # `v0.0.31` * remove constants needed previous for supporting exponential operations from m(`Numeric`), needed values are now dynamically generated by `C-extensions` instead of relying on pre-existing constants (created specifically for just this purpose) - * (`f98`): lots of misc edits/clean-ups in `C-extensions` + * lots of misc edits/clean-ups in `C-extensions` * remove various un-used or now deprecated Modules such as `Ruuuby::MetaData::Vocabulary` (was a temporary location for `normalizers`) * engine/configs cleaned up and support started for multi-flag ENV_VARs * automation for `db/seeds/git_commits.rb` updated to better handle scenario where release had multiple commits, still lots of TODOs and missing `TDD` to be added * various modifications & additions to existing `ORM` Classes for general stability/reliability * flipped functionality of String's funcs `to_iso8601` and `as_iso8601` to closer match `Ruby style` -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/virtual/env` | ``ENV`` | note: `class << ENV` | `f10` | -| `db/seeds/ruuuby_releases/future_ruuuby_releases.rb` | | not currently used | `f15` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/virtual/env` | ``ENV`` | note: `class << ENV` | +| `db/seeds/ruuuby_releases/future_ruuuby_releases.rb` | | not currently used | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `String` | `as_utf8` | `f08` | -| TOPLEVEL_BINDING | `¼`, `½`, `¾`, `🌽` | `f10` | -| `File` | `insert_lines_before_expr` | `f12` | -| `GitCommit` | `get_latest`, `query_get_newest_within_version` | `f15` | -| `RuuubyRelease` | `on_before_save` | `f15` | +| for | method(s) added | +| --- | --- | +| `String` | `as_utf8` | +| TOPLEVEL_BINDING | `¼`, `½`, `¾`, `🌽` | +| `File` | `insert_lines_before_expr` | +| `GitCommit` | `get_latest`, `query_get_newest_within_version` | +| `RuuubyRelease` | `on_before_save` | | from | methods/aliases *removed* | | ------------------- | --------------------- | @@ -564,19 +570,19 @@ # `v0.0.30` * add normalizers to `sym?` * continued ORM cleanups started in `v0.0.29` - * add `f26` as continued step in enabling textual parsing for more useful code-file automations + * iterative step in enabling textual parsing for more useful code-file automations -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `app/model_attributes/extendable/uid.rb` | | | `f15` | -| `app/model_attributes/includable/uid.rb` | | | `f15` | +| path added | reference | notes | +| ---: | --- | --- | +| `app/model_attributes/extendable/uid.rb` | | +| `app/model_attributes/includable/uid.rb` | | -| (c)lass or (m)odule | method(s) added | feature(s) | notes | -| --- | --- | --- | --- | -| (c) `Object` | `singleton?` | `f06` | | -| (c) `Object` | `🅱?`, `🛑🅱❓`, `🧬?` | `f10` | | -| (m) `Module` | `get_all_defined_modules`, `get_all_defined_classes` | `f10` | | -| (c) `String` | `iso8601?`, `to_iso8601`, `as_iso8601` | `f26` | | +| for | method(s) added | notes | +| --- | --- | --- | +| `Object` | `singleton?` | | +| `Object` | `🅱?`, `🛑🅱❓`, `🧬?` | | +| `Module` | `get_all_defined_modules`, `get_all_defined_classes` | | +| `String` | `iso8601?`, `to_iso8601`, `as_iso8601` | | --- @@ -587,69 +593,69 @@ * general functionality increases for `Ruuuby` `MetaData`, add global func `💎` for quicker reference * add logger with output in directory{`tmp`}, file{`ruuuby.log`} -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/ruuuby/engine/ruuuby_engine.rb` | `Ruuuby::MetaData::RuuubyEngine` | alias{`💎.engine`} | `f15` | -| `lib/ruuuby/ruuuby/engine/ruuuby_logging.rb` | `Ruuuby::MetaData::RuuubyEngine.instance.logger` | alias{`💎.engine.logger`} | `f15` | -| `lib/ruuuby/ruuuby/metadata/ruuuby_metadata_constants.rb` | ``Ruuuby::MetaData`` | | `f15` | -| `app/models/ruuuby_dir` | ``RuuubyDir`` | directory operations specifically for `ORM` related context/use-cases | `f15` | -| `app/models/ruuuby_file` | ``RuuubyFile`` | file operations specifically for `ORM` related context/use-cases | `f15` | - -| (c)lass or (m)odule | method(s) added | feature(s) | notes | -| --- | --- | --- | --- | -| (c) `Array` | `∅` | `f05` | starting point of adding similar immutable references like `nil` but for (assumable to be immutable) objects that are `∅` | -| (c) `Object` | `🛑sym❓` | `f07` | | -| (m) `Ruuuby::MetaData` | `orm`, `orm_meta`, `paths`, `engine` | `f10` | shortcuts to either modules or singleton-instanced objects | -| (m) `Ruuuby::MetaData` | `info`, `debug` | `f10` | shortcuts for logging statements | -| TOPLEVEL_BINDING | `ℂ`, `ℚ` | `f11` | alias to `Complex`
alias to `Rational` | -| (m) `Kernel` | `💎` | `f11` | alias to `Ruuuby::MetaData` | | -| (c) `File` | `insert_line_before_expr` | `f13` | | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/ruuuby/engine/ruuuby_engine.rb` | `Ruuuby::MetaData::RuuubyEngine` | alias{`💎.engine`} | +| `lib/ruuuby/ruuuby/engine/ruuuby_logging.rb` | `Ruuuby::MetaData::RuuubyEngine.instance.logger` | alias{`💎.engine.logger`} | +| `lib/ruuuby/ruuuby/metadata/ruuuby_metadata_constants.rb` | ``Ruuuby::MetaData`` | | +| `app/models/ruuuby_dir` | ``RuuubyDir`` | directory operations specifically for `ORM` related context/use-cases | +| `app/models/ruuuby_file` | ``RuuubyFile`` | file operations specifically for `ORM` related context/use-cases | + +| for | method(s) added | notes | +| --- | --- | --- | +| `Array` | `∅` | starting point of adding similar immutable references like `nil` but for (assumable to be immutable) objects that are `∅` | +| `Object` | `🛑sym❓` | | +| `Ruuuby::MetaData` | `orm`, `orm_meta`, `paths`, `engine` | shortcuts to either modules or singleton-instanced objects | +| `Ruuuby::MetaData` | `info`, `debug` | shortcuts for logging statements | +| TOPLEVEL_BINDING | `ℂ`, `ℚ` | alias to `Complex`
alias to `Rational` | +| `Kernel` | `💎` | alias to `Ruuuby::MetaData` | | +| `File` | `insert_line_before_expr` | | --- # `v0.0.28` - * (`f15`): updating contents of `db/seeds/git_commits.rb` is now automated (starting point, LOTs of TODOs to guard against any edge case scenarios and future functionality requirements) - * (`f06`, `f98`): move funcs `class?`, `module?`, `nucleotide?` into `C-extensions` (also add `char?`) - * add `f24` as continued step in enabling textual parsing for more useful code-file automations - * (`f98`): add normalizers to funcs `int?` and `str?`, allows (mainly-visual) clean-up for `Ruuuby` funcs `🛑str❓` and `🛑int❓` + * updating contents of `db/seeds/git_commits.rb` is now automated (starting point, LOTs of TODOs to guard against any edge case scenarios and future functionality requirements) + * move funcs `class?`, `module?`, `nucleotide?` into `C-extensions` (also add `char?`) + * iterative step in enabling textual parsing for more useful code-file automations + * add normalizers to funcs `int?` and `str?`, allows (mainly-visual) clean-up for `Ruuuby` funcs `🛑str❓` and `🛑int❓` * add types to `Ruuuby::VirtualTypes` * rename c(`String`)'s func{♻️until!} to {remove_until}, add alias(`♻️⟶`); also add reverse direction w/ func{`♻️⟵`} -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/ruuuby/ruuuby_orm.rb` | `Ruuuby::MetaData::RuuubyORM` | | `f15` | -| `lib/ruuuby/ruuuby/routine_cli.rb` | `Ruuuby::Routine::CommandCLI` | | `f15` | +| path added | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/ruuuby/ruuuby_orm.rb` | `Ruuuby::MetaData::RuuubyORM` | | +| `lib/ruuuby/ruuuby/routine_cli.rb` | `Ruuuby::Routine::CommandCLI` | | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `String` | `char?`, | `f06` | -| `String` | `♻️⟵`, `♻️⟶∞`
[`upcase?`, `⬆️?`, `⬆?`, `🔠?`]
[`downcase?`, `⬇️?`, `⬇?`, `🔡?`] | `f08` | -| `String` | `🐫?`, [`🐫⬇️?`, `🐫⬇?`, `🐫🔡?`], `to_🐫`
`🐍?`, [`🐍⬆️?`, `🐍⬆?`, `🐍🔠?`], `to_🐍` | `f23` | +| for | method(s) added | +| --- | --- | +| `String` | `char?`, | +| `String` | `♻️⟵`, `♻️⟶∞`
[`upcase?`, `⬆️?`, `⬆?`, `🔠?`]
[`downcase?`, `⬇️?`, `⬇?`, `🔡?`] | +| `String` | `🐫?`, [`🐫⬇️?`, `🐫⬇?`, `🐫🔡?`], `to_🐫`
`🐍?`, [`🐍⬆️?`, `🐍⬆?`, `🐍🔠?`], `to_🐍` | --- # `v0.0.27` * contents in `db/seed.rb` split across files in newly created dir: `db/seeds/`; also add new `ORM: GitCommit`, (one `RuuubyRelease` to many `GitCommits`) * performing update of version number for `README.md` and `lib/ruuuby/version.rb` is now automated - * (`f98`): m{`Module`}'s func{`⨍_add_aliases`} converted to alias the func{`f_add_aliases`} created from `C-extensions` + * m{`Module`}'s func{`⨍_add_aliases`} converted to alias the func{`f_add_aliases`} created from `C-extensions` | gem added | version | | ---: | :---- | | `schema_plus_foreign_keys` | `0.1.8` | -| path added | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `db/seeds/git_commits.rb` | | | `f15` | -| `db/seeds/ruuuby_features.rb` | | | `f15` | -| `db/seeds/ruuuby_releases.rb` | | | `f15` | -| `app/models/git_commit.rb` | `::GitCommit` | | `f15` | -| `lib/ruuuby/ruuuby/ruuuby_api.rb` | `::Ruuuby::RuuubyAPI` | | `f15` | -| `lib/ruuuby/ruuuby/routine.rb` | | `example usage: Routine::CMD.new` | `f15` | +| path added | reference | notes | +| ---: | --- | --- | +| `db/seeds/git_commits.rb` | | | +| `db/seeds/ruuuby_features.rb` | | | +| `db/seeds/ruuuby_releases.rb` | | | +| `app/models/git_commit.rb` | `::GitCommit` | | +| `lib/ruuuby/ruuuby/ruuuby_api.rb` | `::Ruuuby::RuuubyAPI` | | +| `lib/ruuuby/ruuuby/routine.rb` | | `example usage: Routine::CMD.new` | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `File` | `dirname⁴` | `f12` | +| for | method(s) added | +| --- | --- | +| `File` | `dirname⁴` | --- @@ -660,50 +666,50 @@ * add normalizer_option(`:ℕ`) to func(🛑int❓) * add `RSpec` section `db`, clean-up various locations where `db/seed` was loaded before -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/module/attribute/includable/notation_set_mathematics.rb` | `Ruuuby::Attribute::Includable::Notation::SetMathematics` | | `f09` | -| `lib/ruuuby/ruuuby/ruuuby_metadata.rb` | `Ruuuby::MetaData` | design pending | | +| added path | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/module/attribute/includable/notation_set_mathematics.rb` | `Ruuuby::Attribute::Includable::Notation::SetMathematics` | | +| `lib/ruuuby/ruuuby/ruuuby_metadata.rb` | `Ruuuby::MetaData` | design pending | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Module` | `⨍_add_aliases` | `f10` | -| `File` | `replace_expr_with`, `replace_expr_with!` | `f12` | -| `RuuubyRelease` | `<`, `>`, `get_next_version_uid`, `get_latest_version_uid` | `f15` | +| class | method(s) added | +| --- | --- | +| `Module` | `⨍_add_aliases` | +| `File` | `replace_expr_with`, `replace_expr_with!` | +| `RuuubyRelease` | `<`, `>`, `get_next_version_uid`, `get_latest_version_uid` | -| class | alias(es) added | feature(s) | -| --- | --- | --- | -| `Object` | (freeze) `❄`, `❄?` | `f10` | +| class | alias(es) added | +| --- | --- | +| `Object` | (freeze) `❄`, `❄?` | --- # `v0.0.25` - * start dividing (`f98`)/`C-code` across multiple header files, lots of small misc changes (ex: moved various constants definitions from `Ruuuby's` `Float`) + * start dividing `C-code` across multiple header files, lots of small misc changes (ex: moved various constants definitions from `Ruuuby's` `Float`) * re-structure `Feature` <---> `Module` mapping, add `audit` tests to verify pattern is present/consistent * move certain funcs out of `Kernel` and directly add them to `TOPLEVEL_BINDING` to avoid polluting other classes - * (`f00`) start formalization of existing funcs w/ name(`η̂`, `normalize`) and/or when `normalization` is applied to `args` (any context) + * start formalization of existing funcs w/ name(`η̂`, `normalize`) and/or when `normalization` is applied to `args` (any context) * symbolic-math support being added only for niche use-cases, `automatic-differentiation` features to take priority in case of any feature-conflicts -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/global_funcs.rb` | | | `f15` | -| `ext/ruby/class_mods/c0_constants.h` | | | `f98` | -| `ext/ruby/class_mods/c1_typed_checks.h` | | | `f98` | -| `ext/ruby/class_mods/c2_extension_memory.h` | | | `f98` | -| `ext/ruby/class_mods/c3_macro_utilities.h` | | | `f98` | - -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `String` | `♻️until!` | `f08` | -| `TOPLEVEL_BINDING` | `tan`, `tan°` | `f17` | -| `String` | `to_radian` | `f17` | - -| class | alias(es) added | feature(s) | -| --- | --- | --- | -| `Array` | (remove_empty!): `♻️∅!` | `f10` | -| `Set` | (remove_empty!): `♻️∅!` | `f10` | -| `String` | (reverse): `↩️`, `↩️!`, `↩`, `↩!` | `f10` | -| `Array` | (reverse): `↩`, `↩!`, `↩∀` | `f10` | +| added path | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/global_funcs.rb` | | | +| `ext/ruby/class_mods/c0_constants.h` | | | +| `ext/ruby/class_mods/c1_typed_checks.h` | | | +| `ext/ruby/class_mods/c2_extension_memory.h` | | | +| `ext/ruby/class_mods/c3_macro_utilities.h` | | | + +| for | method(s) added | +| --- | --- | +| `String` | `♻️until!` | +| `TOPLEVEL_BINDING` | `tan`, `tan°` | +| `String` | `to_radian` | + +| for | alias(es) added | +| --- | --- | +| `Array` | (remove_empty!): `♻️∅!` | +| `Set` | (remove_empty!): `♻️∅!` | +| `String` | (reverse): `↩️`, `↩️!`, `↩`, `↩!` | +| `Array` | (reverse): `↩`, `↩!`, `↩∀` | --- @@ -711,98 +717,95 @@ * ensure `Ruby` data created from `C-extensions` gets guarded against `garbage-collection` * start utilizing configs for `Ruuuby`, especially for debugging information -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/configs.rb` | | | `f23` | +| added path | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/configs.rb` | | | --- # `v0.0.23` * (starting-point) add support for representing `Complex Infinity`; (for now) via Symbol(`∞ℂ`) - * add Feature(`f03`) and Attribute(`SubscriptIndexing`) to Class(`Symbol`) + * add Attribute(`SubscriptIndexing`) to Class(`Symbol`) * add missing tests and fix bugs (missing scenario coverage) for c(`Object`)'s funcs `🛑ℤ❓` and `🛑𝕌❓` * `power-operations` given support for working with 'custom' `infinitity values`, Class(`Rational`) given support for `superscript-power-operations` - * various consts defined into c(`Float`) but to soon be moved into (`f98`) -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Kernel` | `¿`, `∞`, `∞ℂ` | `f10`, `f17` | -| `Integer` | `¿?`, `nan?`, `∞ℂ?` | `f17` | -| `Float` | `¿?`, `∞ℂ?` | `f17` | -| `Symbol` | `power?`, `pow_to_i` | `f16` | -| `Rational` | `^` | `f16` | +| for | method(s) added | +| --- | --- | +| `Kernel` | `¿`, `∞`, `∞ℂ` | +| `Integer` | `¿?`, `nan?`, `∞ℂ?` | +| `Float` | `¿?`, `∞ℂ?` | +| `Symbol` | `power?`, `pow_to_i` | +| `Rational` | `^` | --- # `v0.0.22` * continued (minor) improvements to catching bad parameters & throwing needed errors - * (`f98`) add func(`err_to_num`) to class(`String`) as a utility function for throwing errors + * add func(`err_to_num`) to class(`String`) as a utility function for throwing errors * start organizing groups of functions into modules labeled by their `Feature` or `Attribute` (`includable` or `extendable`) * tech debt accumulation to be dealt with by `v0.1.0` to remove all `🍝 code` prior to adding support to `automatic differentiation` -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/class/sym.rb` | `Symbol` | | `f10` | -| `lib/ruuuby/module/attribute/includable/cardinality.rb` | `Ruuuby::Attribute::Includable::Cardinality` | | `f04` | -| `lib/ruuuby/module/attribute/includable/subscript_indexing.rb` | `Ruuuby::Attribute::Includable::SubscriptIndexing` | | `f10` | -| `lib/ruuuby/module/attribute/includable/syntax_cache.rb` | `Ruuuby::Attribute::Includable::SyntaxCache` | | `f10` | -| `lib/ruuuby/module/attribute/extendable/syntax_cache.rb` | `Ruuuby::Attribute::Extendable::SyntaxCache` | | `f10` | - -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Object` | `🛑𝕌❓` | `f06` | -| `Array` | `η̂!` | `f08` | -| `Symbol` | (downcase, upcase) `⬇️`, `⬇`, `🔡`, `⬆️`, `⬆`, `🔠` | `f10` | -| `String` | (downcase, upcase) `⬇️`, `⬇`, `🔡`, `⬆️`, `⬆`, `🔠`, `⬇️!`, `⬇!`, `🔡!`, `⬆️!`, `⬆!`, `🔠!` | `f10` | -| `Enumerable` | `∀ₓᵢ` (each_with_index) | `f10` | -| `Object` | `define_singleton_⨍` (define_singleton_function) | `f10` | -| `Kernel` | `🌽_previous_⨍` | `f10` | -| `String` | `digit?`, `to_num`, `to_num?` | `f21` | +| added path | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/class/sym.rb` | `Symbol` | | +| `lib/ruuuby/module/attribute/includable/cardinality.rb` | `Ruuuby::Attribute::Includable::Cardinality` | | +| `lib/ruuuby/module/attribute/includable/subscript_indexing.rb` | `Ruuuby::Attribute::Includable::SubscriptIndexing` | | +| `lib/ruuuby/module/attribute/includable/syntax_cache.rb` | `Ruuuby::Attribute::Includable::SyntaxCache` | | +| `lib/ruuuby/module/attribute/extendable/syntax_cache.rb` | `Ruuuby::Attribute::Extendable::SyntaxCache` | | + +| for | method(s) added | +| --- | --- | +| `Object` | `🛑𝕌❓` | +| `Array` | `η̂!` | +| `Symbol` | (downcase, upcase) `⬇️`, `⬇`, `🔡`, `⬆️`, `⬆`, `🔠` | +| `String` | (downcase, upcase) `⬇️`, `⬇`, `🔡`, `⬆️`, `⬆`, `🔠`, `⬇️!`, `⬇!`, `🔡!`, `⬆️!`, `⬆!`, `🔠!` | +| `Enumerable` | `∀ₓᵢ` (each_with_index) | +| `Object` | `define_singleton_⨍` (define_singleton_function) | +| `Kernel` | `🌽_previous_⨍` | +| `String` | `digit?`, `to_num`, `to_num?` | --- # `v0.0.21` * add const `NUCLEOTIDES` to `Ruuuby::VirtualTypes` * add missing scenarios & tests for `spec/helpers/static_test_data.rb` - * rename m(`Module`)'s func(`∃func?`) to(`∃⨍?`) - * rename m(`Module`)'s func(`∃func_alias?`) to(`∃⨍_alias?`) - * (`f98`) add `global-constant`(`$PRM_MANY`), param-type checking functions expanded for multi-param check use-cases + * add `global-constant`(`$PRM_MANY`), param-type checking functions expanded for multi-param check use-cases * add modules `ORMAttributeUID` and `ORMAttributeCache` to `ApplicationRecord` as well as module(`Syntax`), which each `ORM Class` will also define -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `bin/console_db` | | same as `/bin/console` but also pre-loads `db/seed.rb` | | -| `lib/ruuuby/class/re.rb` | `Regexp` | | `f20` | -| `app/models/db_schema.rb` | `RuuubyDBSchema` | `temporary design` | `f15` | -| `lib/ruuuby/module/attribute_extendable/static_attribute_syntax_cache` | `Ruuuby::StaticAttributeSyntaxCache` | | | +| added path | reference | notes | +| ---: | --- | --- | +| `bin/console_db` | | same as `/bin/console` but also pre-loads `db/seed.rb` | +| `lib/ruuuby/class/re.rb` | `Regexp` | | +| `app/models/db_schema.rb` | `RuuubyDBSchema` | `temporary design` | +| `lib/ruuuby/module/attribute_extendable/static_attribute_syntax_cache` | `Ruuuby::StaticAttributeSyntaxCache` | | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Object` | `class?`, `module?`, `nucleotide?` | `f06` | -| `Module` | `∋?`, `∌?`, `∈?`, `∉?` | `f09` | -| `Object` | `🛑ℤ❓` | `f14` | +| for | method(s) added | +| --- | --- | +| `Object` | `class?`, `module?`, `nucleotide?` | +| `Module` | `∋?`, `∌?`, `∈?`, `∉?` | +| `Object` | `🛑ℤ❓` | --- # `v0.0.20` - * (`f98`) add consts `RATIO_DEGREES_TO_RADIAN` and `RATIO_RADIANS_TO_DEGREE` into module `Math` + * add consts `RATIO_DEGREES_TO_RADIAN` and `RATIO_RADIANS_TO_DEGREE` into module `Math` * power-operations for `Integer` and `Float` given support for raising from `-1` to `-9` via superscripts(`⁻¹` to `⁻⁹`) -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/module/math.rb` | ``Math`` | | `f17` | -| `help/math/automatic_differentiation.rb` | | `Ruuuby's` current main focus to add functionality support to | `f19` | +| added path | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/module/math.rb` | ``Math`` | | +| `help/math/automatic_differentiation.rb` | | `Ruuuby's` current main focus to add functionality support to | -| class | method(s) added | feature(s) | +| for | method(s) added | | --- | --- | --- | -| `Object` | `🛑flt❓` | `f06` | -| `Float` | `≈≈` | `f17` | -| `Kernel` | `sin` | `f17` | -| `Kernel` | `sin°` | `f17` | -| `Kernel` | `cos` | `f17` | -| `Kernel` | `cos°` | `f17` | -| `Kernel` | `∠ᶜ` | `f17` | -| `Kernel` | `∠°` | `f17` | +| `Object` | `🛑flt❓` | +| `Float` | `≈≈` | +| `Kernel` | `sin` | +| `Kernel` | `sin°` | +| `Kernel` | `cos` | +| `Kernel` | `cos°` | +| `Kernel` | `∠ᶜ` | +| `Kernel` | `∠°` | --- @@ -815,13 +818,13 @@ * `ruby_class_mods.c` to start using `non-ascii` based `#define` statements * start adding code for negative-exponents -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `File`, `Dir` | `∅?` | `f04` | -| `ApplicationRecord` | `♻️`, `♻️!` | `f10` | -| `Kernel` | `🎲`, `∛`, `π`, `φ`, `γ` | `f10` | -| `Object` | `⁻¹`, `⁻²`, `⁻³`, `⁻⁴`, `⁻⁵`, `⁻⁶`, `⁻⁷`, `⁻⁸`, `⁻⁹` | `f16` | -| `Dir` | `normalized_paths` | `f12` | +| for | method(s) added | +| --- | --- | +| `File`, `Dir` | `∅?` | +| `ApplicationRecord` | `♻️`, `♻️!` | +| `Kernel` | `🎲`, `∛`, `π`, `φ`, `γ` | +| `Object` | `⁻¹`, `⁻²`, `⁻³`, `⁻⁴`, `⁻⁵`, `⁻⁶`, `⁻⁷`, `⁻⁸`, `⁻⁹` | +| `Dir` | `normalized_paths` | --- @@ -832,51 +835,51 @@ * start process of tracking language changes across versions into `ORM`/`db` * start process of auto-generating documentation from these objects -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/ruuuby/class/io/file.rb` | `File` | | `f12` | -| `lib/ruuuby/class/io/dir.rb` | `Dir` | | `f12` | -| `lib/ruuuby/types.rb` | `Ruuuby::VirtualTypes` | adds (module-scoped) constants `🅱️`, `STRY`, `NUMS`, `COUNTABLES` | `f06` | -| `app/models/application_record.rb` | `ApplicationRecord` | | `f15` | -| `app/models/ruuuby_changelog.rb` | `RuuubyChangelog` | | `f15` | -| `app/models/ruuuby_feature.rb` | `RuuubyFeature` | | `f15` | -| `app/models/ruuuby_release.rb` | `RuuubyRelease` | | `f15` | -| `lib/ruuuby/class/method.rb` | `Method`` | | | -| `conditionals/ide_helper.rb` | | received all duplicated aliases (for playing nice with IDEs, happens from funcs created in `C-extension`) | | -| `db/db.rb` | | | `f15` | -| `db/seed.rb` | | | `f15` | - -| class(es) | method(s) added | feature(s) | -| --- | --- | --- | -| `File`, `Dir` | `∃?` | `f12` | -| `File` | `dirname²`, `dirname³` | `f12` | -| `Kernel` | `📁` (`File`), `📂` (`File`), `🗄️` (`Dir`) | `f12` | -| `Object` | `flt?`, `num?` | `f06` | -| `Integer`, `Numeric` | `♾️?` (infinite?) | `f11` | -| `Method` | `🏠` (`source_location`) | `f10` | +| added path | reference | notes | +| ---: | --- | --- | +| `lib/ruuuby/class/io/file.rb` | `File` | | +| `lib/ruuuby/class/io/dir.rb` | `Dir` | | +| `lib/ruuuby/types.rb` | `Ruuuby::VirtualTypes` | adds (module-scoped) constants `🅱️`, `STRY`, `NUMS`, `COUNTABLES` | +| `app/models/application_record.rb` | `ApplicationRecord` | | +| `app/models/ruuuby_changelog.rb` | `RuuubyChangelog` | | +| `app/models/ruuuby_feature.rb` | `RuuubyFeature` | | +| `app/models/ruuuby_release.rb` | `RuuubyRelease` | | +| `lib/ruuuby/class/method.rb` | `Method`` | | +| `conditionals/ide_helper.rb` | | received all duplicated aliases (for playing nice with IDEs, happens from funcs created in `C-extension`) | +| `db/db.rb` | | | +| `db/seed.rb` | | | + +| class(es) | method(s) added | +| --- | --- | +| `File`, `Dir` | `∃?` | +| `File` | `dirname²`, `dirname³` | +| `Kernel` | `📁` (`File`), `📂` (`File`), `🗄️` (`Dir`) | +| `Object` | `flt?`, `num?` | +| `Integer`, `Numeric` | `♾️?` (infinite?) | +| `Method` | `🏠` (`source_location`) | --- # `0.0.17` #### Abstract - * (`f15`): start general, wide-scale, re-structuring to manage changes into categorized `features` + * start general, wide-scale, re-structuring to manage changes into categorized `features` #### Discrete * continued audit on number classes (see notes from v`0.0.15-16`) * for math related `RSpecs`, move common/shared `let` definitions into `spec_helper.rb`, add additional ones to form a general schema for testing data #### Methods & Aliases: - | (c)lass or (m)odule | methods/aliases added | feature | - | ------------------------------------ | --------------------- | ------- | - | (m) `Kernel` | `𝔠` | `f03` | - | (c) `String`, `Set`, `Array`, `Hash` | `𝔠` (length) | `f03` | - | (c) `Class` | `🆕` (new) | `f10` | - | (c) `Object` | `⁰`, `¹`, `²`, `³`, `⁴`, `⁵`, `⁶`, `⁷`, `⁸`, `⁹` | `f16` | - | (c) `Object` | `🛡️funcs` (protected_methods), `🙈funcs` (private_methods) | [`f01`, `f02`] | - | (m) `Module` | `🛡️` (protected), `∃🛡️func?` (protected_method_defined?), `🛡️instance_funcs` (protected_instance_methods), `🙈instance_funcs` (private_instance_methods), `🙈class_func` (private_class_method) | [`f01`, `f02`] | - | (c) `Integer` | `^`, `preserved_reference_to_bitwise_or` | `f16` | - | (c) `Float` | `^` | `f16` | + | for | methods/aliases added | + | -------------------------------- | --------------------- | + | `Kernel` | `𝔠` | + | `String`, `Set`, `Array`, `Hash` | `𝔠` (length) | + | `Class` | `🆕` (new) | + | `Object` | `⁰`, `¹`, `²`, `³`, `⁴`, `⁵`, `⁶`, `⁷`, `⁸`, `⁹` | + | `Object` | `🛡️funcs` (protected_methods), `🙈funcs` (private_methods) | + | `Module` | `🛡️` (protected), `∃🛡️func?` (protected_method_defined?), `🛡️instance_funcs` (protected_instance_methods), `🙈instance_funcs` (private_instance_methods), `🙈class_func` (private_class_method) | + | `Integer` | `^`, `preserved_reference_to_bitwise_or` | + | `Float` | `^` | #### Files Added: * `ruuuby/class/class.rb` @@ -889,17 +892,17 @@ * add first multi-step audit test against project file structure (will require better solution, just a starting point) * add/move the following methods/aliases: - | (c)lass or (m)odule | methods/aliases added/moved | feature | - | ------------------------------------ | --------------------------------------------------------- | ------- | - | (c) `Array` | `equal_contents?` (`≈≈` now aliases it) | - | (c) `Array` | `frequency_counts` (`📊` now aliases it) | - | (c) `Array` | `disjunctive_union` (`⊕` now aliases it) | - | (c) `Array` | `↩️` (reverse), `↩️!` (reverse!), `↩️∀` (reverse_each) | - | (c) `Object` | `🅱️?` (alias to `bool?`), `🛑🅱️❓` | - | (c) `Integer` | `∞?`, `𝕌?` | - | (c) `Float`, `Complex`, `BigDecimal` | `𝕌?` | - | (c) `Numeric` | `𝕌?`, `𝔹?` | - | (c) `Hash` | `🗝?`, `∃🗝?` (both alias `key?`, same as `🔑?`, `∃🔑?`) | + | for | methods/aliases added/moved | + | -------------------------------- | --------------------------------------------------------- | + | `Array` | `equal_contents?` (`≈≈` now aliases it) | + | `Array` | `frequency_counts` (`📊` now aliases it) | + | `Array` | `disjunctive_union` (`⊕` now aliases it) | + | `Array` | `↩️` (reverse), `↩️!` (reverse!), `↩️∀` (reverse_each) | + | `Object` | `🅱️?` (alias to `bool?`), `🛑🅱️❓` | + | `Integer` | `∞?`, `𝕌?` | + | `Float`, `Complex`, `BigDecimal` | `𝕌?` | + | `Numeric` | `𝕌?`, `𝔹?` | + | `Hash` | `🗝?`, `∃🗝?` (both alias `key?`, same as `🔑?`, `∃🔑?`) | --- @@ -910,13 +913,13 @@ * move certain module/class initial definition/creation into `ruby_class_mods.c` * for number classes (ex: `Integer`), fix various logical/performance/test-coverage flaws for funcs like `ℕ?` - | (c)lass or (m)odule | methods/aliases added/moved | feature | - | ------------------- | ------------------------------------------------ | ------- | - | (c) `Array` | `start_with?`, `ensure_start!` | `f08` | - | (c) `Set` | `remove_empty!`, `∅?` (empty?), `∀` (each), `∋?` | `f09` | - | (m) `Enumerable` | `∌?`, `⨍` (map) | `f09` | - | (c) `Numeric` | `∞?` (infinite?) | `f10` | - | (c) `Integer` | `finite?`, `infinite?` | `f11` | + | for | methods/aliases added/moved | + | --------------- | ------------------------------------------------ | + | `Array` | `start_with?`, `ensure_start!` | + | `Set` | `remove_empty!`, `∅?` (empty?), `∀` (each), `∋?` | + | `Enumerable` | `∌?`, `⨍` (map) | + | `Numeric` | `∞?` (infinite?) | + | `Integer` | `finite?`, `infinite?` | --- @@ -924,10 +927,7 @@ * add gem `'tty-command', '~> 0.9.0'` to group `runtime` * for use by `audit RSpecs`: start various means of tracking internal versions, configs, etc; will help form dynamically generated audits and reports * temporarily remove `.travis.yml` (auto-generated at project creation but would be useful to utilize) - -| feature | change | -| ------- | ------ | -| `f14` | adjust naming on param check functions (in `Ruuuby::ParamErr`), ex: `🛑❓bool` change to `🛑bool❓` | + * adjust naming on param check functions (in `Ruuuby::ParamErr`), ex: `🛑❓bool` change to `🛑bool❓` --- @@ -937,20 +937,20 @@ * heavily adjust usage/style for throwing param errors via `Ruuuby::Err` now(`Ruuuby::ParamErr`) * add new type of RSpec: `audit` - | (c)lass or (m)odule | methods/aliases added | feature | - | ------------------------ | --------------------- | ------- | - | (c) `Hash` | `∀` (each), `∅?` (empty) | `f09`, `f04` | - | (m) `Kernel` | `🛑` (raise), `√` (Math.sqrt) | `f14`, `f10` | - | (m) `Module` | `∃func?` (func created and alias removed), `∃🙈func?` (private_method_defined?) | `f13` | - | (c) `NilClass`, `String` | `∅?` (empty) | `f04` | - | (c) `Array` | `ensure_ending!`, `end_with?`, `∅?` (empty), `uniq_to_me` (∖) | `f09`, `f04` | - | (c) `Object` | `🛑❓bool`, `🛑❓int`, `🛑❓ary`, `🛑❓str`, `🛑❓stry`, `🛑❓str_or_ary` | `f14` | + | for | methods/aliases added | + | -------------------- | --------------------- | + | `Hash` | `∀` (each), `∅?` (empty) | + | `Kernel` | `🛑` (raise), `√` (Math.sqrt) | + | `Module` | `∃func?` (func created and alias removed), `∃🙈func?` (private_method_defined?) | + | `NilClass`, `String` | `∅?` (empty) | + | `Array` | `ensure_ending!`, `end_with?`, `∅?` (empty), `uniq_to_me` (∖) | + | `Object` | `🛑❓bool`, `🛑❓int`, `🛑❓ary`, `🛑❓str`, `🛑❓stry`, `🛑❓str_or_ary` | * remove the following methods/aliases: -| (c)lass or (m)odule | methods/aliases removed | -| ------------------- | --------------------- | -| (m) `Ruuuby::Err` | `param¬bool`, `param¬str`, `param¬stry`, `param¬ary`, `param¬module`, `param¬class` | +| for | methods/aliases removed | +| --------------- | --------------------- | +| `Ruuuby::Err` | `param¬bool`, `param¬str`, `param¬stry`, `param¬ary`, `param¬module`, `param¬class` | --- @@ -961,13 +961,13 @@ * add organization and new information to `help/ruuuby.md` * add files: `ruuuby/module/kernel.rb`, `ruuuby/module/module.rb`, and `ruuuby/arg_err.rb` - | (c)lass or (m)odule | methods/aliases added | feature | - | ------------------- | --------------------- | ------- | - | (m) `Module` | `🙈`, `🙈constants⟶`, `∃const?`, `∃func?`, `∃func_alias?` | `f13` | - | (m) `Kernel` | `∃module?`, `∃class?` | `f13` | - | (m) `Ruuuby::Err` | `param¬bool`, `param¬str`, `param¬stry`, `param¬ary`, `param¬module`, `param¬class` | `f14` | - | (c) `Ruuuby::Err::WrongParamType` | `generate_error_text`, `throw` | `f14` | - | (c) `Object` | `stry?` | `f06` | + | for | methods/aliases added | + | ------------------- | --------------------- | + | `Module` | `🙈`, `🙈constants⟶`, `∃const?`, `∃func?`, `∃func_alias?` | + | `Kernel` | `∃module?`, `∃class?` | + | `Ruuuby::Err` | `param¬bool`, `param¬str`, `param¬stry`, `param¬ary`, `param¬module`, `param¬class` | + | `Ruuuby::Err::WrongParamType` | `generate_error_text`, `throw` | + | `Object` | `stry?` | --- @@ -980,11 +980,11 @@ * move `String`'s added method `>>` * add private method `disjunctive_union` to `Array` for use in method`⊕` - | (c)lass or (m)odule | methods/aliases added | feature | - | ------------------- | --------------------- | ------- | - | (c) `Hash` | `🔑?`, `∃🔑?` | `f10` | - | (c) `Array` | `∀`, `📊`, `≈` | `f09` | - | (m) `Ruuuby` | `∃module?`, `∃class?` | `f13` | + | for | methods/aliases added | + | ------------------- | --------------------- | + | `Hash` | `🔑?`, `∃🔑?` | + | `Array` | `∀`, `📊`, `≈` | + | `Ruuuby` | `∃module?`, `∃class?` | --- @@ -995,13 +995,13 @@ * add `help/jruby.md` to document jruby extensions gotchas along the way * add initial `Dockerfile` and `docker-compose.yml` - | class | methods added | feature | - | ----------- | ---------------------------- | ------- | - | `Integer` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | `f11` | - | `Float` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | `f11` | - | `BigDecimal` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | `f11` | - | `Complex` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | `f11` | - | `Rational` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | `f11` | + | class | methods added | + | ----------- | ---------------------------- | + | `Integer` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | + | `Float` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | + | `BigDecimal` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | + | `Complex` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | + | `Rational` | `ℕ?`, `ℤ?`, `ℚ?`, `ℂ?`, `ℝ?` | --- @@ -1009,10 +1009,10 @@ * add example usage in `README.md` * add various aliases and functions for additional set math operations - | class | method(s)/alias(es) added | feature | - | ------- | ------------------------- | ------- | - | `Array` | `∌?`, `∋?` | `f09` | - | `String` | `∌?`, `∋?`, `∈?`, `∉?` | `f09` | + | class | method(s)/alias(es) added | + | ------- | ------------------------- | + | `Array` | `∌?`, `∋?` | + | `String` | `∌?`, `∋?`, `∈?`, `∉?` | --- @@ -1024,28 +1024,28 @@ * increase scope of performance RSpecs, light adjustments to remaining RSpecs for clarity & future scope * add various aliases to existing Ruby functions/fields/constants/etc -| class | base reference | alias | feature | -| --------------- | --------------------------------------- | ------------- | ------- | -| `Object` | method: `object_id` | `🆔` | `f10` | -| `Object` | method: `freeze` | `❄️` | `f10` | -| `Object` | method: `frozen?` | `❄️?` | `f10` | -| `Array` | method: `∑` | `each` | `f10` | -| `Array` | method: `⨍` | `map` | `f10` | +| class | base reference | alias | +| --------------- | --------------------------------------- | ------------- | +| `Object` | method: `object_id` | `🆔` | +| `Object` | method: `freeze` | `❄️` | +| `Object` | method: `frozen?` | `❄️?` | +| `Array` | method: `∑` | `each` | +| `Array` | method: `⨍` | `map` | * added the following methods: - | class | method added | feature | - | ------- | ---------------- | ------- | - | `Array` | `>>` | `f05` | - | `Array` | `⊕` | `f09` | - | `Array` | `∖` | `f09` | + | class | method added | + | ------- | ---------------- | + | `Array` | `>>` | + | `Array` | `⊕` | + | `Array` | `∖` | * add/replace various Ruby functions with native C-extensions (`ruuuby/ext/ruby_class_mods/ruby_class_mods.c`): - | modified class | funcs added/replaced | feature | - | --------------- | --------------------- | ------- | - | `Object` | `hsh?` | `f06` | - | `Array` | `remove_empty!` | `f07` | + | modified class | funcs added/replaced | + | --------------- | --------------------- | + | `Object` | `hsh?` | + | `Array` | `remove_empty!` | --- @@ -1055,10 +1055,10 @@ * added section `project layout` and update formatting to `README.md` * replace various Ruby functions with native C-extensions (`ruuuby/ext/ruby_class_mods/ruby_class_mods.c`): - | modified class | funcs replaced | feature | - | --------------- | --------------------------------------- | ------- | - | `Object` | `ary?`, `bool?`, `int?`, `str?`, `sym?` | `f06` | - | `NilClass` | `empty?` | `f04` | + | modified class | funcs replaced | + | --------------- | --------------------------------------- | + | `Object` | `ary?`, `bool?`, `int?`, `str?`, `sym?` | + | `NilClass` | `empty?` | --- @@ -1067,12 +1067,12 @@ * minor changes/functions-added to DRY some code * add `Gemfile.lock` to `.gitignore` - | class | method added | feature | - | ------- | ---------------- | ------- | - | `Object` | `sym?` | `f06` | - | `String` | `>>` | `f05` | - | `String` | `ensure_start!` | `f08` | - | `String` | `ensure_ending!` | `f08` | + | class | method added | + | ------- | ---------------- | + | `Object` | `sym?` | + | `String` | `>>` | + | `String` | `ensure_start!` | + | `String` | `ensure_ending!` | --- @@ -1081,9 +1081,9 @@ * `freeze` various constants and modules * slightly clean-up (with helper functions) and expand RSpec scenario coverage - | class | method added | feature | - | -------- | ------------ | ------- | - | `Object` | `str?` | `f06` | + | class | method added | + | -------- | ------------ | + | `Object` | `str?` | --- @@ -1106,38 +1106,38 @@ * modify `Ruuuby::Enum::Emoji` from `Strings` to `Symbols` * fix gemspec to reflect correct git URLs -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `lib/class/ary.rb` | ``Array`` | | `f07`, `f06` | -| `lib/class/int.rb` | ``Integer`` | | `f06` | +| added path | reference | notes | +| ---: | --- | --- | +| `lib/class/ary.rb` | ``Array`` | | +| `lib/class/int.rb` | ``Integer`` | | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Object` | `int?` | `f06` | -| `Object` | `ary?` | `f06` | -| `Array` | `remove_empty!` | `f07` | +| class | method(s) added | +| --- | --- | +| `Object` | `int?` | +| `Object` | `ary?` | +| `Array` | `remove_empty!` | --- # `v0.0.2` -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `Object` | `bool?` | `f06` | +| class | method(s) added | +| --- | --- | +| `Object` | `bool?` | --- # `v0.0.1` -| added path | reference | notes | feature(s) | -| ---: | --- | --- | --- | -| `CHANGELOG.md` | | | | -| `lib/ruuuby/class/nil.rb` | `NilClass` | | `f04` | -| `lib/ruuuby/enum/emoji.rb` | | `Ruuuby::Enum::Emoji` | | -| `bin/audit` | | for running rdoc, rspecs, and coverage reports | | +| added path | reference | notes | +| ---: | --- | --- | +| `CHANGELOG.md` | | | +| `lib/ruuuby/class/nil.rb` | `NilClass` | | +| `lib/ruuuby/enum/emoji.rb` | | `Ruuuby::Enum::Emoji` | +| `bin/audit` | | for running rdoc, rspecs, and coverage reports | -| class | method(s) added | feature(s) | -| --- | --- | --- | -| `NilClass` | `empty?` | `f04` | +| class | method(s) added | +| --- | --- | +| `NilClass` | `empty?` | --- diff --git a/Dockerfile b/Dockerfile index 0defacf..43fbba9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,10 +36,19 @@ ENV BUILD_CORE_LIBS git wget curl vim build-base readline readline-dev openssl-d ENV SERVICE_OS="alpine" ENV SERVICE_OS_VERSION="TODO:" +#ENV RUBY_GC_HEAP_INIT_SLOTS=40000 +#ENV RUBY_GC_HEAP_FREE_SLOTS=16384 +#ENV RUBY_GC_HEAP_GROWTH_FACTOR=1.6180 +#ENV RUBY_GC_HEAP_GROWTH_MAX_SLOTS=0 +#ENV RUBY_GC_HEAP_GROWTH_MAX_SLOTS=0 +#ENV RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO=0.25 +#ENV RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO=0.60 +#ENV RUBY_GC_MALLOC_LIMIT_MAX=67108864 + # TODO: clean up consistency, just use bitwise flags ENV BUNDLE_SILENCE_ROOT_WARNING=1 +ENV RUUUBY_F00 "b04|b05 ENV RUUUBY_F01 "b01|b03|b04{debug}" -ENV RUUUBY_F12 "b00" ENV RUUUBY_F26 "b00" ENV RUUUBY_F98 "11" ENV RUUUBY_OS_CURRENT "linux" @@ -65,7 +74,7 @@ ENV RBENV_ROOT /usr/local/rbenv # TODO: UPDATE TO 3.0.0 # https://cache.ruby-lang.org/pub/ruby/3.0/ ENV RUBY_VERSION 2.7.1 -#ENV GEM_VERSION "3.2.0.rc.1" +ENV RBENV_VERSION "3.0.0-preview1" ENV GEM_VERSION "3.2.0.rc.2" ENV BUNDLER_VERSION "bundler:2.2.0.rc.2" ENV CONFIGURE_OPTS --disable-install-doc diff --git a/Gemfile b/Gemfile index 1daa04d..fc78d02 100644 --- a/Gemfile +++ b/Gemfile @@ -2,9 +2,4 @@ source 'https://rubygems.org' -group :db do - gem 'pg' - gem 'activerecord' -end - gemspec diff --git a/History.txt b/History.txt index 58026c5..e3ae210 100644 --- a/History.txt +++ b/History.txt @@ -1,4 +1,15 @@ += `v0.1.0.pre.4` / 2020-11-24 + +* continue `DB` migrations +* apply miscellaneous clean ups +* (*unofficially*) add gems{`rails`, `keycutter`, `github-linguist`} +* remove `rng` tests among others while reviewing scope of needed `statistics formulas` and approaches +* start of (critically needed) migration for more formal `CICD` + * begin preparation for proper git branching w/ `git hooks` on both `client` and `server` side + * begin preparation for proper build pipelines (w/ hybrid of code and one of the many great `CICD` frameworks) + * iterative refactor of mapping between features & code; `Ruuuby Dockerization` to resume following more cleanup + = `v0.1.0.pre.3` / 2020-11-16 * add gem{`open3`} diff --git a/README.md b/README.md index 264c19a..69f8ca1 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ # Ruuuby [![Gem Version](https://badge.fury.io/rb/ruuuby.svg)](https://badge.fury.io/rb/ruuuby) -| for resource | reference | -| ------------------: | :---------------------------------------------------------- | -| latest version | [`0.1.0.pre.3`](https://rubygems.org/gems/ruuuby/versions/0.1.0.pre.3-x86_64-darwin-19) | -| stable version | [`0.0.49`](https://rubygems.org/gems/ruuuby/versions/0.0.49-x86_64-darwin-18) | -| changelog | [`CHANGELOG.md`](https://github.com/utarsuno/ruuuby/blob/master/CHANGELOG.md) with in progress migration to [`[History.txt format]`](https://guides.rubygems.org/releasing-rubygems/) | -| `JIT` testing | `RUBYOPT="--jit --jit-warnings --jit-wait --jit-max-cache=1337 --jit-verbose=2 --jit-debug -w" ./bin/console/ruuuby` | -| common
non-ascii | `∅`,`∃`,`∄`,`∋`,`∌`,`∈`,`∉`,`ⓣ`,`Ⓣ`,`≈`,`∞`,`π`,`℮`,`𝚽`
`η̂`,`μ`,`∴`,`𝔠`,`𝔦`,`𝔣`,`Λ`,`λ`,`∫`,`⨍`,`𝑓`,`∀`,`τ`,`x̃`,`𝚡`,`𝛿`,`σ`,`⌋`,`⌈`
`𝔹`,`ℂ`,`ℕ`,`𝕎`,`ℤ`,`ℚ`,`𝔸ᵣ`,`ℂ`,`𝕋`,`𝕀`,`ℝ`,`𝕌`,`𝕊`,`🅱`
`±`,`Ω`,`γ`,`Ψ`,`ρ`,`δ`,`Ⴔ`,`⨁`,`⨂`,`∖`,`≡`,`√`,`∛`,`↩`,`‣`,`⟶`,`↘`,`⬇`,`⬆`
`𝞽`,`θ`,`°`,`ʳ`,`ᵍ`,`⦜`,`○`,`ₑ`,`₀`,`₁`,`₂`,`₃`,`ₓ`,`ᵢ`,`ᵀ`,`▣`
`⁻ⁿ`,`⁰`,`¹`,`²`,`³`,`⁴`,`⁵`,`⁶`,`⁷`,`⁸`,`⁹`,`●`,`◆`,`▲,`▬,`▰`
`¼`,`½`,`¾`,`⅓`,`⅕`,`⅕`,`⅖`,`⅗`,`⅘`,`⅙`,`⅐`,`⅛`,`⅜`,`⅝`,`⅞`,`⅑`,`⅒`
`📁`,`🗄️`,`💾`,`🕒`,`🎲`,`📊`,`🧟`,`💻`,`📱`,`🌐`,`❄️`,`💎`,`⚠️`,`🔑`,`✏️`,`📖`,`🏠`
`✅`,`♻️`,`🍺`,`🛡`,`📅`,`🛑`,`❌`,`❓`,`🆔`,`🧬`
`🐇`,`🐋`,`🐍`,`🐫`,`🙈` | -| download source for utilized version of Ruby | [Ruby3.0.0-preview1](https://www.ruby-lang.org/en/news/2020/09/25/ruby-3-0-0-preview1-released/) | -| summary & purpose | in migration until version{`0.1.0`} | +| for resource | reference | +| ---------------------: | :---------------------------------------------------------- | +| latest version | [`0.1.0.pre.4`](https://rubygems.org/gems/ruuuby/versions/0.1.0.pre.4-x86_64-darwin-19) | +| stable version | [`0.0.49`](https://rubygems.org/gems/ruuuby/versions/0.0.49-x86_64-darwin-18) | +| copy-paste smiley face | `˙ ͜ʟ˙` | +| changelog | [`CHANGELOG.md`](https://github.com/utarsuno/ruuuby/blob/master/CHANGELOG.md) with in progress migration to [`[History.txt format]`](https://guides.rubygems.org/releasing-rubygems/) | +| `JIT` testing | `RUBYOPT="--jit --jit-warnings --jit-wait --jit-max-cache=1337 --jit-verbose=2 --jit-debug -w" ./bin/console/ruuuby` | +| common
non-ascii | `∅`,`∃`,`∄`,`∋`,`∌`,`∈`,`∉`,`ⓣ`,`Ⓣ`,`≈`,`∞`,`π`,`℮`,`𝚽`
`η̂`,`μ`,`𝔠`,`Λ`,`λ`,`∫`,`⨍`,`𝑓`,`∀`,`τ`,`χ²`,`x̃`,`𝚡`,`𝛿`,`σ`
`𝔹`,`ℂ`,`ℕ`,`𝕎`,`ℤ`,`ℚ`,`𝔸ᵣ`,`ℂ`,`𝕋`,`𝕀`,`ℝ`,`𝕌`,`𝕊`,`🅱`
`±`,`Ω`,`γ`,`Ψ`,`ρ`,`δ`,`Ⴔ`,`⨁`,`⨂`,`∖`,`≡`,`√`,`∛`,
`↩`,`‣`,`⟶`,`↘`,`➚`,`⬇`,`⬆`,`●`,`◆`,`▲`,`▬`,`▰`,`♪`
`𝞽`,`θ`,`°`,`ʳ`,`ᵍ`,`⦜`,`○`,`ᵀ`,`▣`,`∴`,`𝔦`,`𝔣`,`⌈`,`⌋`
`ₑ`,`₀`,`₁`,`₂`,`₃`,`ₓ`,`ᵢ`,`⁻ⁿ`,`⁰`,`¹`,`²`,`³`,`⁴`,`⁵`,`⁶`,`⁷`,`⁸`,`⁹`
`¼`,`½`,`¾`,`⅓`,`⅕`,`⅕`,`⅖`,`⅗`,`⅘`,`⅙`,`⅐`,`⅛`,`⅜`,`⅝`,`⅞`,`⅑`,`⅒`
`💎`,`🌐`,`🆔`,`🛑`,`❓`,`💻`,`🔑`,`🐋`,`🐍`,`🐫`,`🙈`
`📁`,`🗄️`,`💾`,`🕒`,`🎲`,`📊`,`🧟`,`❄️`,`⚠️`,`✏️`,`📖`,`🏠`
`📱`,`🌎`,`✅`,`♻️`,`🍺`,`🛡`,`📅`,`❌`,`🧬`,`🐇`,`🌽` | +| [download source for utilized version of Ruby](https://cache.ruby-lang.org/pub/ruby/3.0/) | [Ruby3.0.0-preview1](https://www.ruby-lang.org/en/news/2020/09/25/ruby-3-0-0-preview1-released/) | +| summary & purpose | in migration until version{`0.1.0`} | ### Examples @@ -19,7 +20,7 @@ # run node.js tests on live container{A}, transfer results as file to live container{B} qa_results = 🐋['service_js_dev'].cmd!(%w(npm test --check-leaks)).join.as_utf8 -🐋['service_nginx_dev'].📁✏️('/example/file/path', qa_results) +🐋['service_nginx_dev'].📁✏️('/example/file/path.txt', qa_results) # send chat message, triggering execution of background QA tests which involve randomness # ‣ allowing relatively ∞ time for tests to complete, as needed @@ -89,22 +90,25 @@ data = {haaallo: 'wooorld', ye: 'ee'} ### Gems: | gem | version | :development, :runtime | notes | -| ---: | :--- | :---: | ---: | +| :---: | :---: | :---: | :--- | | `tty-command` | [`0.10.0`](https://rubygems.org/gems/tty-command/versions/0.10.0) | ✅, ✅ | always required | | `finite_machine` | [`0.14.0`](https://rubygems.org/gems/finite_machine/versions/0.14.0) | ✅, ✅ | always required | | `bunny` | [`2.17.0`](https://rubygems.org/gems/bunny/versions/2.17.0) | ✅, ❌ | toggleable feature | | `docker-api` | [`2.0.0`](https://rubygems.org/gems/docker-api/versions/2.0.0) | ✅, ❌ | toggleable feature | | `open3` | [`0.1.0`](https://rubygems.org/gems/open3/versions/0.1.0) | ✅, ❌ | toggleable feature | | `pg` | [`1.2.3`](https://rubygems.org/gems/pg/versions/1.2.3) | ✅, ❌ | toggleable feature | -| `activerecord` | [`6.1.0.rc1`](https://rubygems.org/gems/activerecord/versions/6.1.0.rc1) | ✅, ❌ | toggleable feature | +| `activerecord` | [`6.0.3.4`](https://rubygems.org/gems/activerecord/versions/6.0.3.4) | ✅, ❌ | toggleable feature | +| `keycutter` | [`1.0.2`](https://rubygems.org/gems/keycutter/versions/1.0.2) | ✅, ❌ | development utility | | `rdoc` | [`6.2.1`](https://rubygems.org/gems/rdoc/versions/6.2.1) | ✅, ❌ | development utility | | `rspec` | [`3.10.0`](https://rubygems.org/gems/rspec/versions/3.10.0) | ✅, ❌ | development utility | | `rspec-benchmark` | [`0.6.0`](https://rubygems.org/gems/rspec-benchmark/versions/0.6.0) | ✅, ❌ | development utility | | `rake` | [`13.0.1`](https://rubygems.org/gems/rake/versions/13.0.1) | ✅, ❌ | development utility | | `rake-compiler` | [`1.1.1`](https://rubygems.org/gems/rake-compiler/versions/1.1.1) | ✅, ❌ | development utility | -| `rugged` | [`1.1.0`](https://rubygems.org/gems/rugged/versions/1.1.0) | ❌, ❌ | broke w/ migration, fix wip | | `rubygems-update` | [`3.2.0.rc.2`](https://rubygems.org/gems/rubygems-update/versions/3.2.0.rc.2) | ❌, ❌ | recommended version | | `bundler` | [`2.2.0.rc.2`](https://rubygems.org/gems/bundler/versions/2.2.0.rc.2) | ❌, ❌ | recommended version | +| `rugged` | [`1.1.0`](https://rubygems.org/gems/rugged/versions/1.1.0) | ❌, ❌ | to be (re-added) after increasing `CICD` scope | +| `github-linguist` | [`7.12.0`](https://rubygems.org/gems/github-linguist/versions/7.12.0) | ❌, ❌ | to be added after increasing `CICD` scope | +| `rails` | [`6.0.3.4`](https://rubygems.org/gems/rails/versions/6.0.3.4) | ❌, ❌ | to be added after increasing `CICD` scope | ## Overview: @@ -151,7 +155,6 @@ data = {haaallo: 'wooorld', ye: 'ee'} | class(es) | func(s) added | | ---------------------: | :---------------------------------- | | `File`, `Dir`, `ENV`, `NilClass`, `Vector` | `∅?` | -| `Module` | `∃⨍_alias?`, `∃⨍?` | | `File` | `replace_expr_with`, `replace_expr_with!`, `insert_line_before_expr` | | `Object` | `Ⓣ`, `ary?`, `bool?`, `hsh?`, `int?`, `flt?`, `num?`, `str?`, `chr?`, `sym?`, `matrix?`, `vec?`
`🛑bool❓`, `🛑int❓`, `🛑flt❓`, `🛑num❓`, `🛑ary❓`, `🛑str❓`, `🛑sym❓` | | `String` | `♻️⟵`, `♻️⟶`, `♻️⟶∞`,`∋?`, `∌?`, `∈?`, `∉?`
`⬇?`⟶`downcase?`, `⬆?`⟶`upcase?`, `⬇!`⟶`downcase!`, `⬆!`⟶`upcase!`
`🐫?`, `🐫⬇?`, `to_🐫``🐍⬆?`, `🐍?`, `to_🐍`
`digit?`, `to_num`, `to_num?`, `palindrome?`
`as_utf8`, `iso8601?`, `to_iso8601`, `as_iso8601` | @@ -175,7 +178,7 @@ data = {haaallo: 'wooorld', ye: 'ee'} --- -#### Runnable Commands +### Runnable Commands > documentation to update here prior to version{0.1.0} @@ -183,22 +186,31 @@ data = {haaallo: 'wooorld', ye: 'ee'} ### Code Base Statistics: -| categories | attribute | value(s) | stable before version{`0.1.0`} | # of | -| -----------------: | :----------------------: | ----------: | :-----: | :---- | -| `QA` | `unit` | `1202` | ✅ | tests (core functionality) | -| `QA` | `integration` | `20` | ✅ | tests (state & functionality of grouped units) | -| `QA`,`performance` | `benchmarks-runtime` | | ❌ | | -| `QA`,`performance` | `benchmarks-memory` | | ❌ | | -| `QA` | `rng` | `2` | ✅ | tests (involving statistics/randomness, ex: verifying a geometric distribution)) | -| `QA`,`DB` | `system` | `7` | ✅ | tests (`integration` scaled to `micro-services` & w/ randomness involved to help encounter niche error-states) | -| `QA`,`DB` | `engine` | | ❌ | | -| `QA`,`DB` | `ORM` | | ❌ | | -| `QA`,`DB` | `services` | | ❌ | | -| `QA`,`CICD`,`DB` | `domain` | | ❌ | | -| `CICD` | `audit` | `83` | ✅ | tests (anything non-functionality based) | -| `CICD` | `locale` | `66` | ✅ | tests (verifying `Ruuuby` needed build configs) | -| `CICD` | `preferences` | `20` | ❌ | tests (verifying preferred `OS & development configs & values`) | -| `structure` | `tech-debt` | `8` | ✅ | tests (tracking missing functionality) | -| `structure` | `features` | | ❌ | | -| `coverage` | `code-documentation` | `? %` | ❌ | | -| `coverage` | `code-coverage-tested` | `? %` | ❌ | | +#### Discrete Tests: *(relative test weights are estimated, pending formal calculations)* + +| relative weight per test | testing categories | label | count | stable before version{`0.1.0`} | description | +| -----: | :----------------: | :----------------------: | :----------: | :-----: | :---- | +| `0.01` | `QA` | `unit` | `1189` | ✅ | core functionality | +| `0.01` | `QA` | `tech-debt` | `9` | ✅ | track missing or incorrect functionality | +| `0.01` | `CICD` | `audit` | `82` | ✅ | anything non-functionality based regarding expected `code structure` | +| `0.01` | `CICD` | `preferences` | `26` | ✅ | verify developer preferred `OS & dev configs/values` | +| `0.02` | `QA`,`DB` | `DB engine` | | ❌ | `DB` specific `unit` tests | +| `0.05` | `QA`,`DB` | `ORM` | | ❌ | `ORM` specific `unit` tests | +| `0.05` | `CICD` | `locale` | `55` | ✅ | verify `Ruuuby` required (build) configs | +| `0.05` | `QA` | `integration` | `42` | ✅ | state & functionality of grouped `unit` tests (especially for any set of code involving more than `1 feature`) | +| `0.10` | `QA` | `rng` | | ❌ | verify data distributions (each test allowed relatively ∞ time to complete) | +| `0.15` | `QA`,`performance` | `benchmarks-runtime` | | ❌ | verify ideal boundaries and variance of `runtime performance` | +| `0.15` | `QA`,`performance` | `benchmarks-memory` | | ❌ | verify ideal boundaries and variance of `memory performance` | +| `0.25` | `QA`,`performance` | `benchmark-matrices` | | ❌ | verify ideal `macro trends` through aggregations of data-sets from `benchmarks`, `logs`, `DB data`, etc | +| `0.50` | `QA`,`DB` | `services` | | ❌ | `integration` scaled across groups of `ORM & DB` tests | +| `0.75` | `QA`,`DB` | `system` | `7` | ✅ | `integration` scaled to `micro-services` w/ randomness added to help encounter niche error-states | +| `1.00` | `QA`,`CICD`,`DB` | `domain` | | ❌ | `integration` scaled across groups of `micro-services` | + +#### Code Coverage + +| category | `%` of code covered | stable before version{`0.1.0`} | +| ---------------------: | :----------------------: | :----------------------------- | +| `features` | `?` | ❌ | +| `documentation` | `?` | ❌ | +| `full test suite` | `?` | ❌ | +| `configuration as code` | `?` | ❌ | diff --git a/Rakefile b/Rakefile index b0bf957..c350fb1 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,6 @@ namespace :qa do task :unit do #ENV['RUUUBY_F01'] = 'b00' ENV['RUUUBY_PERFORMANCE_LIMIT'] = 'on' - ENV['RUUUBY_AUTOLOAD_DB'] = 'off' ::Rake::Task['rspec_unit'].invoke end @@ -32,7 +31,6 @@ namespace :qa do ENV['RUBYOPT'] = '-W:no-deprecated -W:no-experimental' ENV['RUUUBY_F01'] = 'b00' ENV['RUUUBY_PERFORMANCE_LIMIT'] = 'on' - ENV['RUUUBY_AUTOLOAD_DB'] = 'off' ENV['RUUUBY_RSPEC_INTEGRATION'] = 'on' ::Rake::Task['rspec_integration'].execute end @@ -43,13 +41,12 @@ namespace :qa do ENV['RUUUBY_PERFORMANCE_LIMIT'] = 'on' ENV['RUUUBY_F92'] = 'b01|b02' ENV['RUUUBY_RSPEC_INTEGRATION'] = 'off' - ENV['RUUUBY_AUTOLOAD_DB'] = 'on' - ::Rake::Task['rspec_db'].invoke + ::Rake::Task['rspec_db_new'].invoke end task :rng do ENV['RUBYOPT'] = '-W:no-deprecated -W:no-experimental' - ENV['RUUUBY_F01'] = 'b00' + ENV['RUUUBY_F01'] = 'b01|b03|b04{debug}' ENV['RUUUBY_PERFORMANCE_LIMIT'] = 'on' ::Rake::Task['rspec_rng'].execute end @@ -127,7 +124,9 @@ module CategoriesQA DB_NEW = %w( /spec/helpers/db/autoload_me /services/ruuuby_db/spec/migration_spec + /services/ruuuby_db/spec/test/migration_spec ) + SPEC_RNG = %w(/spec/helpers/rng/autoload_me) INTEGRATION = %w(/spec/helpers/integration/autoload_me) LIB_BENCHMARK = %w(/spec/helpers/performance/autoload_me) LOCALE_BASE = %w(/spec/helpers/locale/autoload_me) @@ -140,6 +139,7 @@ module CategoriesQA /services/dev_configs/mac/spec/locale/f92_b00_spec /services/dev_configs/mac/spec/locale/f98_spec /services/dev_configs/mac/spec/locale/locale_full_verification_spec + /services/dev_configs/mac/spec/locale/ruby_installation_spec ) end end @@ -187,7 +187,7 @@ add_task_rspec('performance', '', CategoriesQA::Preload::LIB_BENCHMARK) add_task_rspec('unit') add_task_rspec('audit') -add_task_rspec('rng') +add_task_rspec('rng', '', CategoriesQA::Preload::SPEC_RNG) add_task_rspec('locale', '**/*_full_verification_spec.rb', CategoriesQA::Preload::LOCALE_BASE) add_task_rspec('preferences', '', CategoriesQA::Preload::LOCALE_FULL) add_task_rspec('tech_debt') diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 31a93de..9d70d41 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -65,8 +65,8 @@ services: POSTGRES_USER: 'myuser' POSTGRES_PASSWORD: 'mypassword' POSTGRES_DB: 'env_test' - # ports: - # - 5433:5433 + ports: + - 5433:5432 volumes: - 'vol_db_test/:/var/lib/postgresql/data/' - './services/ruuuby_db/init.sql:/docker-entrypoint-initdb.d/init.sql' diff --git a/ext/ruby_class_mods/c0_constants.h b/ext/ruby_class_mods/00_constants.h similarity index 81% rename from ext/ruby_class_mods/c0_constants.h rename to ext/ruby_class_mods/00_constants.h index f6be901..49d918b 100644 --- a/ext/ruby_class_mods/c0_constants.h +++ b/ext/ruby_class_mods/00_constants.h @@ -1,15 +1,13 @@ // encoding: UTF-8 #ifndef CRUUUBY_H0_CONSTANTS -#define CRUUUBY_H0_CONSTANTS "defined(CRUUUBY_H0_CONSTANTS)" +#define CRUUUBY_H0_CONSTANTS -#define COMPILED_AT_DATETIME __DATE__ " " __TIME__ - -/*____________________________________________________________________________________________________________________________________________________________________ +/*______________________________________________________________________________________________________________________ __ __ __ ___ ___ ___ __ / ` / \ |\ | /__` | /\ |\ | | \ / /\ | | | |__ /__` \__, \__/ | \| .__/ | /~~\ | \| | \/ /~~\ |___ \__/ |___ .__/ -____________________________________________________________________________________________________________________________________________________________________ */ +______________________________________________________________________________________________________________________*/ #define CACHE_VAL_NOT_SET (-1337) @@ -173,25 +171,11 @@ static const VALUE ℤ9 = INT2FIX(9); // --------------------------------------------------------------------------------------------------------------------- -//static ID cached_rb_intern_raise_to_power; rb_intern("**"); -#define ID_OF_POW 134 -#define ID_OF_UMINUS 133 -#define ID_OF_UPLUS 132 +#define ID_OF_POW 134 +#define ID_OF_UMINUS 133 +#define ID_OF_UPLUS 132 #define ID_OF_COMPARE 135 -#define ID_OF_POW 134 -#define ID_OF_RSHIFT 137 - -// --------------------------------------------------------------------------------------------------------------------- - -#define NORM_ERROR 0 -#define NORM_UNIVERSAL 2 -#define NORM_UNIVERSAL_W_STR 3 -#define NORM_NATURAL 4 -#define NORM_NATURAL_W_STR 5 -#define NORM_WHOLE 6 -#define NORM_WHOLE_W_STR 7 -#define NORM_INTEGER 8 -#define NORM_INTEGER_W_STR 9 +#define ID_OF_RSHIFT 137 // --------------------------------------------------------------------------------------------------------------------- @@ -200,22 +184,4 @@ static const VALUE ℤ9 = INT2FIX(9); // --------------------------------------------------------------------------------------------------------------------- -#define FLAG_RUNTIME_VERSION_C_89 (unsigned short) 1 -#define FLAG_RUNTIME_VERSION_C_99 (unsigned short) 2 -#define FLAG_RUNTIME_VERSION_C_11 (unsigned short) 3 -#define FLAG_RUNTIME_VERSION_C_17 (unsigned short) 4 -#define FLAG_RUNTIME_VERSION_GNU_89 (unsigned short) 5 -#define FLAG_RUNTIME_VERSION_GNU_99 (unsigned short) 6 -#define FLAG_RUNTIME_VERSION_GNU_11 (unsigned short) 7 -#define FLAG_RUNTIME_VERSION_GNU_17 (unsigned short) 8 -#define FLAG_RUNTIME_VERSION_DEFAULT (unsigned short) 9 - -#define VAL_STD_VERSION_C_99 199901 -#define VAL_STD_VERSION_C_11 201112 -#define VAL_STD_VERSION_C_17 201710 -#define VAL_STD_VERSION_GNU_99 VAL_STD_VERSION_C_99 -#define VAL_STD_VERSION_GNU_11 VAL_STD_VERSION_C_11 -#define VAL_STD_VERSION_GNU_17 VAL_STD_VERSION_C_17 -#define VAL_STD_VERSION_DEFAULT VAL_STD_VERSION_GNU_17 - #endif diff --git a/ext/ruby_class_mods/c1_typed_checks.h b/ext/ruby_class_mods/01_typed_checks.h similarity index 95% rename from ext/ruby_class_mods/c1_typed_checks.h rename to ext/ruby_class_mods/01_typed_checks.h index 67cac6b..2988245 100644 --- a/ext/ruby_class_mods/c1_typed_checks.h +++ b/ext/ruby_class_mods/01_typed_checks.h @@ -7,13 +7,11 @@ ____________________________________________________________________________________________________________________________________________________________________ */ #ifndef CRUUUBY_H0_CONSTANTS -#include "c0_constants.h" +#include "00_constants.h" #endif #ifndef CRUUUBY_H1_CONSTANTS_TYPE_HEADERS -#define CRUUUBY_H1_CONSTANTS_TYPE_HEADERS "defined(CRUUUBY_H1_CONSTANTS_TYPE_HEADERS)" - -//extern enum ruby_value_type; +#define CRUUUBY_H1_CONSTANTS_TYPE_HEADERS /*____________________________________________________________________________________________________________________________________________________________________ __ __ __ ___ ___ ___ __ @@ -106,6 +104,7 @@ static inline VALUE 💎new_ary(const long known_max_size); #define is_empty_generic(arg) (rb_respond_to(arg, cached_rb_intern_is_empty) && rb_funcall(arg, cached_rb_intern_is_empty, 0) == Qtrue) #define is_non_empty_generic(arg) (rb_respond_to(arg, cached_rb_intern_is_empty) && rb_funcall(arg, cached_rb_intern_is_empty, 0) == Qfalse) +#define r_hsh_new() rb_hash_new() #define r_hsh_len(arg) RHASH_SIZE(arg) #define r_hsh_is_empty(arg) RHASH_EMPTY_P(arg) #define r_hsh_set(arg, key, val) rb_hash_aset(arg, key, val) @@ -143,9 +142,9 @@ static inline int c_int_is_natural(const int c_int) {return c_int > 0;} static inline int c_int_is_whole(const int c_int); static inline int c_int_is_whole(const int c_int) {return c_int >= 0;} -static inline VALUE r_flt_is_universal(const double flt); -static inline VALUE r_flt_has_decimals(const double flt); -static inline VALUE r_flt_smells_like_int(const double flt); +static inline VALUE c_flt_is_universal(const double flt); +static inline VALUE c_flt_has_decimals(const double flt); +static inline VALUE c_flt_smells_like_int(const double flt); #define r_int_passes_normalizer(self, the_normalizer, func_name, converter_func) {\ if (the_normalizer == 🅽_universal || the_normalizer == 🅽_integer || the_normalizer == 🅽_universal_w_str_allowed || the_normalizer == 🅽_integer_w_str_allowed) {\ @@ -163,17 +162,17 @@ static inline VALUE r_flt_smells_like_int(const double flt); #define r_flt_passes_normalizer(self, the_normalizer, func_name) {\ if (the_normalizer == 🅽_universal || the_normalizer == 🅽_universal_w_str_allowed) {\ - return r_flt_is_universal(NUM2DBL(self));\ + return c_flt_is_universal(NUM2DBL(self));\ } else if (the_normalizer == 🅽_integer || the_normalizer == 🅽_integer_w_str_allowed) {\ - return r_flt_smells_like_int(NUM2DBL(self));\ + return c_flt_smells_like_int(NUM2DBL(self));\ } else if (the_normalizer == 🅽_natural || the_normalizer == 🅽_natural_w_str_allowed) {\ const double val_self = NUM2DBL(self);\ - if (r_flt_smells_like_int(val_self)) {\ + if (c_flt_smells_like_int(val_self)) {\ if (val_self >= 1.0) {return Qtrue;} else {return Qfalse;}\ } else {return Qfalse;}\ } else if (the_normalizer == 🅽_whole || the_normalizer == 🅽_whole_w_str_allowed) {\ const double val_self = NUM2DBL(self);\ - if (r_flt_smells_like_int(val_self)) {\ + if (c_flt_smells_like_int(val_self)) {\ if (val_self >= 0.0) {return Qtrue;} else {return Qfalse;}\ } else {return Qfalse;}\ } else {\ @@ -226,7 +225,6 @@ static inline VALUE r_flt_smells_like_int(const double flt); } static inline int is_num(const VALUE arg); -//static inline int is_simple_num(const VALUE arg); static inline int is_non_simple_num(const VALUE arg); static inline int is_int_or_flt(const VALUE arg); diff --git a/ext/ruby_class_mods/c2_extension_memory.h b/ext/ruby_class_mods/02_extension_memory.h similarity index 94% rename from ext/ruby_class_mods/c2_extension_memory.h rename to ext/ruby_class_mods/02_extension_memory.h index 937f544..b3bd4cb 100644 --- a/ext/ruby_class_mods/c2_extension_memory.h +++ b/ext/ruby_class_mods/02_extension_memory.h @@ -1,11 +1,11 @@ -// encoding: utf-8 +// encoding: UTF-8 #ifndef CRUUUBY_H1_TYPED_CHECKS -#include "c1_typed_checks.h" +#include "01_typed_checks.h" #endif #ifndef CRUUUBY_H2_EXTENSION_MEMORY -#define CRUUUBY_H2_EXTENSION_MEMORY "defined(CRUUUBY_H2_EXTENSION_MEMORY)" +#define CRUUUBY_H2_EXTENSION_MEMORY /*____________________________________________________________________________________________________________________ __ __ ___ __ __ diff --git a/ext/ruby_class_mods/c3_macro_utilities.h b/ext/ruby_class_mods/03_macro_utilities.h similarity index 96% rename from ext/ruby_class_mods/c3_macro_utilities.h rename to ext/ruby_class_mods/03_macro_utilities.h index 2c913c1..62c624e 100644 --- a/ext/ruby_class_mods/c3_macro_utilities.h +++ b/ext/ruby_class_mods/03_macro_utilities.h @@ -1,11 +1,11 @@ // encoding: UTF-8 #ifndef CRUUUBY_H2_EXTENSION_MEMORY -#include "c2_extension_memory.h" +#include "02_extension_memory.h" #endif #ifndef CRUUUBY_H3_MACRO_UTILITIES -#define CRUUUBY_H3_MACRO_UTILITIES "defined(CRUUUBY_H3_MACRO_UTILITIES)" +#define CRUUUBY_H3_MACRO_UTILITIES // macros for internal pre-processing generators @@ -63,8 +63,6 @@ ________________________________________________________________________________ ensure_loaded_set_theory(discrete/universal_set)\ ensure_loaded_set_theory(discrete/whole_numbers)\ } -//ensure_loaded_set_theory(discrete/null_set) -//ensure_loaded_group_theory(circle_group) #define ensure_all_loaded_for_math_space(){\ ensure_loaded_math(space/space)\ @@ -89,6 +87,7 @@ ________________________________________________________________________________ #define ensure_all_loaded_for_statistics(){\ ensure_loaded_math(combinatorics/combinatorics)\ ensure_loaded_math(stats/stats)\ + ensure_loaded_math(stats/probability)\ ensure_loaded_math(stats/rng)\ ensure_loaded_math(stats/time_series)\ ensure_loaded_math(stats/descriptive)\ @@ -107,7 +106,6 @@ ________________________________________________________________________________ #define ensure_all_loaded_for_ruuuby_engine(){\ ensure_loaded_ruuuby(ruuuby/engine/component/component)\ - ensure_loaded_ruuuby(ruuuby/engine/component/api)\ ensure_loaded_ruuuby(ruuuby/engine/component/api_cli)\ } @@ -246,7 +244,8 @@ static inline void internal_only_add_frozen_const_to(VALUE kclass, VALUE * inter #define ERR_param_type(nucleotide, kclass, the_func, arg_name, the_arg, required_type) raise_err_arg("| %s{%s}-> m{%s} got arg(%s) w/ type{%s}, required-type{%s} |", nucleotide, kclass, the_func, arg_name, rb_obj_classname(the_arg), required_type); #define ERR_c_self_got_bad_param_type(the_func, the_arg, required_type) raise_err_arg("| c{%s}-> m{%s} got arg w/ type{%s}, required-type{%s} |", rb_obj_classname(self), the_func, rb_obj_classname(the_arg), required_type); #define ERR_c_self_got_non_ary_param(the_func, the_arg) raise_err_arg("| c{%s}-> m{%s} got arg w/ type{%s}, required-type{Array} |", rb_obj_classname(self), the_func, rb_obj_classname(the_arg)); -#define ERR_c_self_got_non_str_param(the_func, the_arg) raise_err_arg("| c{%s}-> m{%s} got arg w/ type{%s}, required-type{String} |", rb_obj_classname(self), the_func, rb_obj_classname(the_arg)); + +#define 🛑param_str(the_func, the_arg) raise_err_arg("| c{%s}-> m{%s} got arg{%"PRIsVALUE"} w/ type{%s}, required-type{String} |", rb_obj_classname(self), the_func, the_arg, rb_obj_classname(the_arg)); #define ERR_c_self_arg_err__print_self_them(description) raise_err_arg(description, self, them); #define ERR_c_self_err_runtime(...) raise_err_arg(description, self, them); diff --git a/ext/ruby_class_mods/c4_theta_angle.h b/ext/ruby_class_mods/04_theta_angle.h similarity index 99% rename from ext/ruby_class_mods/c4_theta_angle.h rename to ext/ruby_class_mods/04_theta_angle.h index 8df7456..adf3ded 100644 --- a/ext/ruby_class_mods/c4_theta_angle.h +++ b/ext/ruby_class_mods/04_theta_angle.h @@ -1,7 +1,7 @@ // encoding: UTF-8 #ifndef CRUUUBY_H3_MACRO_UTILITIES -#include "c3_macro_utilities.h" +#include "03_macro_utilities.h" #endif #ifndef CRUUUBY_H4_THETA_ANGLE diff --git a/ext/ruby_class_mods/c6_feature_macros.h b/ext/ruby_class_mods/05_feature_macros.h similarity index 95% rename from ext/ruby_class_mods/c6_feature_macros.h rename to ext/ruby_class_mods/05_feature_macros.h index 16f2eeb..8a2d902 100644 --- a/ext/ruby_class_mods/c6_feature_macros.h +++ b/ext/ruby_class_mods/05_feature_macros.h @@ -6,12 +6,12 @@ |___ | |__) | \ /~~\ | \ | | | | | \__/ | \ | .__/ ____________________________________________________________________________________________________________________________________________________________________ */ -#ifndef CRUUUBY_H5_INTERNAL_STRUCTS -#include "c5_internal_structs.h" +#ifndef CRUUUBY_H4_MACRO_UTILITIES +#include "04_theta_angle.h" #endif -#ifndef CRUUUBY_H6_FEATURE_MACROS -#define CRUUUBY_H6_FEATURE_MACROS +#ifndef CRUUUBY_H5_FEATURE_MACROS +#define CRUUUBY_H5_FEATURE_MACROS //ensure_loaded_default(tzinfo) @@ -101,7 +101,19 @@ ________________________________________________________________________________ \/_/ \/_____/ \/___/ */ #define ENGINE_STAT_SET(the_str, the_val) r_hsh_set(hsh_ruuuby_engine_stats, rb_str_new_cstr(the_str), the_val); -#define ENGINE_STAT_SET_DISABLED(the_str) r_hsh_set(hsh_ruuuby_engine_stats, rb_str_new_cstr(the_str), Qfalse); +#define ENGINE_STAT_DISABLE(the_str) r_hsh_set(hsh_ruuuby_engine_stats, rb_str_new_cstr(the_str), Qfalse); + +static void ENGINE_STAT_SET_SET(const VALUE key_outer, const VALUE key_inner, const VALUE the_val); +static void ENGINE_STAT_SET_SET(const VALUE key_outer, const VALUE key_inner, const VALUE the_val) { + VALUE the_hsh = rb_hash_aref(hsh_ruuuby_engine_stats, key_outer); + if (the_hsh == Qnil) { + VALUE the_new_hsh = r_hsh_new(); + r_hsh_set(the_new_hsh, key_inner, the_val); + r_hsh_set(hsh_ruuuby_engine_stats, key_outer, the_new_hsh); + } else { + r_hsh_set(the_hsh, key_inner, the_val); + } +} /* ___ ___ ________ /'___\ /'___`\ /\_____ \ diff --git a/ext/ruby_class_mods/c7_time_series_data.h b/ext/ruby_class_mods/06_time_series_data.h similarity index 99% rename from ext/ruby_class_mods/c7_time_series_data.h rename to ext/ruby_class_mods/06_time_series_data.h index 1a35ac8..76bf5ad 100644 --- a/ext/ruby_class_mods/c7_time_series_data.h +++ b/ext/ruby_class_mods/06_time_series_data.h @@ -1,11 +1,11 @@ // encoding: UTF-8 -#ifndef CRUUUBY_H6_FEATURE_MACROS -#include "c6_feature_macros.h" +#ifndef CRUUUBY_H5_FEATURE_MACROS +#include "05_feature_macros.h" #endif -#ifndef CRUUUBY_H7_TIME_SERIES_DATA -#define CRUUUBY_H7_TIME_SERIES_DATA +#ifndef CRUUUBY_H6_TIME_SERIES_DATA +#define CRUUUBY_H6_TIME_SERIES_DATA /* __ __ __ __ diff --git a/ext/ruby_class_mods/c8_graphs.h b/ext/ruby_class_mods/07_graphs.h similarity index 98% rename from ext/ruby_class_mods/c8_graphs.h rename to ext/ruby_class_mods/07_graphs.h index f36aacb..6a19aef 100644 --- a/ext/ruby_class_mods/c8_graphs.h +++ b/ext/ruby_class_mods/07_graphs.h @@ -1,11 +1,11 @@ // encoding: UTF-8 -#ifndef CRUUUBY_H7_TIME_SERIES_DATA -#include "c7_time_series_data.h" +#ifndef CRUUUBY_H6_TIME_SERIES_DATA +#include "06_time_series_data.h" #endif -#ifndef CRUUUBY_H8_GRAPHS -#define CRUUUBY_H8_GRAPHS +#ifndef CRUUUBY_H7_GRAPHS +#define CRUUUBY_H7_GRAPHS typedef struct Pseudo_Graph { unsigned int num_nodes; diff --git a/ext/ruby_class_mods/c5_internal_structs.h b/ext/ruby_class_mods/c5_internal_structs.h deleted file mode 100644 index 80bc2c3..0000000 --- a/ext/ruby_class_mods/c5_internal_structs.h +++ /dev/null @@ -1,62 +0,0 @@ -// encoding: UTF-8 - -/*____________________________________________________________________________________________________________________________________________________________________ - __ __ __ __ __ __ ___ __ - | | |__) |__) /\ |__) \ / | |\/| |__) / \ |__) | /__` - |___ | |__) | \ /~~\ | \ | | | | | \__/ | \ | .__/ -____________________________________________________________________________________________________________________________________________________________________ */ - -#ifndef CRUUUBY_H4_THETA_ANGLE -#include "c4_theta_angle.h" -#endif - -#ifndef CRUUUBY_H5_INTERNAL_STRUCTS -#define CRUUUBY_H5_INTERNAL_STRUCTS - -/* ___ __ - __ /\_ \ /\ \__ __ - ____/\_\ ___ ___ _____\//\ \ __ \ \ ,_\/\_\ ___ ___ __ _ __ - /',__\/\ \ /' __` __`\/\ '__`\\ \ \ /'__`\ \ \ \/\/\ \ /' __` __`\ /'__`\/\`'__\ - /\__, `\ \ \/\ \/\ \/\ \ \ \L\ \\_\ \_/\ __/ \ \ \_\ \ \/\ \/\ \/\ \/\ __/\ \ \/ - \/\____/\ \_\ \_\ \_\ \_\ \ ,__//\____\ \____\ \ \__\\ \_\ \_\ \_\ \_\ \____\\ \_\ - \/___/ \/_/\/_/\/_/\/_/\ \ \/ \/____/\/____/ \/__/ \/_/\/_/\/_/\/_/\/____/ \/_/ - \ \_\ - \/_/ */ - - - -/* __ - /\ \ __ - _ __ __ __ __ __ __ __\ \ \____ __ __ __ ___ __ /\_\ ___ __ - /\`'__\/\ \/\ \/\ \/\ \/\ \/\ \\ \ '__`\/\ \/\ \ /'__`\/' _ `\ /'_ `\/\ \ /' _ `\ /'__`\ - \ \ \/ \ \ \_\ \ \ \_\ \ \ \_\ \\ \ \L\ \ \ \_\ \ /\ __//\ \/\ \/\ \L\ \ \ \/\ \/\ \/\ __/ - \ \_\ \ \____/\ \____/\ \____/ \ \_,__/\/`____ \ \ \____\ \_\ \_\ \____ \ \_\ \_\ \_\ \____\ - \/_/ \/___/ \/___/ \/___/ \/___/ `/___/> \ \/____/\/_/\/_/\/___L\ \/_/\/_/\/_/\/____/ - /\___/ /\____/ - \/__/ \_/__/*/ -#define 💎parse_compiler_version_to_string(arg){\ - switch(compiler_version) {\ - case FLAG_RUNTIME_VERSION_C_89:\ - return c_str_to_frozen_r_str("c89");\ - case FLAG_RUNTIME_VERSION_C_99:\ - return c_str_to_frozen_r_str("c99");\ - case FLAG_RUNTIME_VERSION_C_11:\ - return c_str_to_frozen_r_str("c11");\ - case FLAG_RUNTIME_VERSION_C_17:\ - return c_str_to_frozen_r_str("c17");\ - case FLAG_RUNTIME_VERSION_GNU_11:\ - return c_str_to_frozen_r_str("gnu11");\ - case FLAG_RUNTIME_VERSION_GNU_17:\ - return c_str_to_frozen_r_str("gnu17");\ - case FLAG_RUNTIME_VERSION_GNU_89:\ - return c_str_to_frozen_r_str("gnu89");\ - case FLAG_RUNTIME_VERSION_GNU_99:\ - return c_str_to_frozen_r_str("gnu99");\ - case FLAG_RUNTIME_VERSION_DEFAULT:\ - return c_str_to_frozen_r_str("default");\ - default:\ - return c_str_to_frozen_r_str("???");\ - }\ -} - -#endif diff --git a/ext/ruby_class_mods/extconf.rb b/ext/ruby_class_mods/extconf.rb index 5d42d75..23d6d0b 100644 --- a/ext/ruby_class_mods/extconf.rb +++ b/ext/ruby_class_mods/extconf.rb @@ -6,6 +6,16 @@ os = ENV['RUUUBY_OS_CURRENT'] +env_f00 = ENV['RUUUBY_F00'] +flags_f00 = [false, false] +unless env_f00.nil? + if env_f00.include?('b04') + flags_f00[0] = true + elsif env_f00.include?('b05') + flags_f00[1] = true + end +end + env_f06 = ENV['RUUUBY_F06'] flag_f06_b08 = false flag_f06_b09 = false @@ -26,14 +36,6 @@ end end -env_f12 = ENV['RUUUBY_F12'] -flag_f12_b00 = false -unless env_f12.nil? - if env_f12.include?('b00') - flag_f12_b00 = true - end -end - env_f22 = ENV['RUUUBY_F22'] if env_f22.nil? flag_f22_b01 = false @@ -47,14 +49,6 @@ flag_f22_b07 = env_f22.include?('b07') end -env_f26 = ENV['RUUUBY_F26'] -flag_f26_b00 = false -unless env_f26.nil? - if env_f26.include?('b00') - flag_f26_b00 = true - end -end - env_f28 = ENV['RUUUBY_F28'] if env_f28.nil? flag_f28_b09 = false @@ -121,7 +115,7 @@ end end -puts "compiling ruuuby-extensions{#{::Ruuuby::VERSION}} w/ env_f98{#{env_f98.to_s}}" +#puts "compiling ruuuby-extensions{#{::Ruuuby::VERSION}} w/ env_f98{#{env_f98.to_s}}" $VERBOSE = true $DEBUG = true @@ -132,7 +126,10 @@ the_flags += %w(O3 fgnu89-inline fstrict-enums flto ftree-vectorize fvectorize fzvector) # etc -the_flags += %w(Wall Wformat fexceptions pipe std=gnu11) #std=gnu11 #std=c17 +the_flags += %w(Wall Wformat fexceptions pipe) + +# compiler GNU extensions standard (note: `gnu11` is intentionally used over `c17`) +the_flags += %w(std=gnu11) # x86_64 the_flags += %w(fPIC malign-double) @@ -176,19 +173,19 @@ the_flags += %w(DRUUUBY_F98_OPENMP) if flag_openmp the_flags += %w(DRUUUBY_F98_OPENGL) if flag_opengl +the_flags += %w(DRUUUBY_F00_B04) if flags_f00[0] +the_flags += %w(DRUUUBY_F00_B05) if flags_f00[1] + the_flags += %w(DRUUUBY_F06_B08) if flag_f06_b08 the_flags += %w(DRUUUBY_F06_B09) if flag_f06_b09 the_flags += %w(DRUUUBY_F10_B04) if flag_f10_b04 -the_flags += %w(DRUUUBY_F12_B00) if flag_f12_b00 the_flags += %w(DRUUUBY_F22_B01) if flag_f22_b01 the_flags += %w(DRUUUBY_F22_B05) if flag_f22_b05 the_flags += %w(DRUUUBY_F22_B06) if flag_f22_b06 the_flags += %w(DRUUUBY_F22_B07) if flag_f22_b07 -the_flags += %w(DRUUUBY_F26_B00) if flag_f26_b00 - the_flags += %w(DRUUUBY_F28_B09) if flag_f28_b09 the_flags += %w(DRUUUBY_F38) if flag_f38 @@ -202,6 +199,10 @@ the_flags += %w(DRUUUBY_F93) if flag_f93 +if env_f98 >= 11 + the_flags += %w(DRUUUBY_DEBUGGING) +end + # warnings # Wbad-function-cast the_flags += %w(Werror Wshadow Wdouble-promotion Wfloat-conversion Wundef fno-common g3 @@ -236,7 +237,7 @@ headers += %w(ruby ruby/assert ruby/debug ruby/defines ruby/encoding ruby/intern ruby/version ruby/missing) # for ruuuby -headers += %w(c0_constants c1_typed_checks c2_extension_memory c3_macro_utilities c4_theta_angle c5_internal_structs c6_feature_macros c7_time_series_data c8_graphs ruby_class_mods) +headers += %w(00_constants 01_typed_checks 02_extension_memory 03_macro_utilities 04_theta_angle 05_feature_macros 06_time_series_data 07_graphs ruby_class_mods) # for c headers += %w(stdio stdlib sys/types string float tgmath inttypes locale sys/resource) # tgmath includes {math, complex} @@ -245,6 +246,10 @@ headers += %w(time sys/time) end +if env_f98 >= 11 + headers += %w(optional/00_debugging) +end + headers.each{|header_file| abort("Unable to find header{#{header_file}.h}") unless find_header("#{header_file}.h")} #if env_f98 != 0 @@ -274,6 +279,9 @@ abort("Unable to find const{ℤ0} in header{c0_constants.h}") unless have_const("ℤ0", 'c0_constants.h') end -#abort("missing macro{M_SQRT2}") unless have_macro('M_SQRT2') +abort("missing macro{M_SQRT2}") unless have_macro('M_SQRT2') + +abort unless have_macro('RBIMPL_COMPILER_IS_CLANG_H') +abort unless have_macro('RBIMPL_COMPILER_IS_APPLE_H') create_makefile('ruby_class_mods') diff --git a/ext/ruby_class_mods/optional/00_debugging.h b/ext/ruby_class_mods/optional/00_debugging.h new file mode 100644 index 0000000..7aea795 --- /dev/null +++ b/ext/ruby_class_mods/optional/00_debugging.h @@ -0,0 +1,94 @@ +// encoding: UTF-8 + +#ifndef CRUUUBY_D0_DEBUGGING +#define CRUUUBY_D0_DEBUGGING + +#define STR_HELPER(x) #x +#define STR(x) STR_HELPER(x) + +// --------------------------------------------------------------------------------------------------------------------- + +#define COMPILED_AT_DATETIME __DATE__ " " __TIME__ + +// --------------------------------------------------------------------------------------------------------------------- + +#if RBIMPL_COMPILER_IS_GCC + #define COMPILER_NAME "gcc" +#elif RBIMPL_COMPILER_IS_Intel + #define COMPILER_NAME "intel" +#elif RBIMPL_COMPILER_IS_MSVC + #define COMPILER_NAME "msvc" +#elif RBIMPL_COMPILER_IS_SunPro + #define COMPILER_NAME "sunpro" +#elif RBIMPL_COMPILER_IS_Apple + #define COMPILER_NAME "apple" +#elif RBIMPL_COMPILER_IS_Clang + #define COMPILER_NAME "clang" +#endif + +// --------------------------------------------------------------------------------------------------------------------- + +#ifndef COMPILER_NAME + #define COMPILER_NAME "???" + #define COMPILER_VERSION "???" +#else + #define COMPILER_VERSION STR(RBIMPL_COMPILER_VERSION_MAJOR) "." STR(RBIMPL_COMPILER_VERSION_MINOR) "." STR(RBIMPL_COMPILER_VERSION_PATCH) +#endif + +// --------------------------------------------------------------------------------------------------------------------- +// @see https://stackoverflow.com/questions/14737104/what-is-the-default-c-std-standard-version-for-the-current-gcc-especially-on-u +#define VAL_STD_VERSION_C_99 199901 +#define VAL_STD_VERSION_C_11 201112 +#define VAL_STD_VERSION_C_17 201710 +#define VAL_STD_VERSION_GNU_99 VAL_STD_VERSION_C_99 +#define VAL_STD_VERSION_GNU_11 VAL_STD_VERSION_C_11 +#define VAL_STD_VERSION_GNU_17 VAL_STD_VERSION_C_17 +#define VAL_STD_VERSION_DEFAULT VAL_STD_VERSION_GNU_17 + +#ifdef __STRICT_ANSI__ + #ifdef __STDC_VERSION__ + #if __STDC_VERSION__ == VAL_STD_VERSION_C_99 + #define COMPILER_STANDARD "c99" + #elif __STDC_VERSION__ == VAL_STD_VERSION_C_11 + #define COMPILER_STANDARD "c11" + #elif __STDC_VERSION__ == VAL_STD_VERSION_C_17 + #define COMPILER_STANDARD "c17" + #else + #define COMPILER_STANDARD "default" + #endif + #else + #define COMPILER_STANDARD "c89" + #endif +#else + #ifdef __STDC_VERSION__ + #if __STDC_VERSION__ == VAL_STD_VERSION_GNU_99 + #define COMPILER_STANDARD "gnu99" + #elif __STDC_VERSION__ == VAL_STD_VERSION_GNU_11 + #define COMPILER_STANDARD "gnu11" + #elif __STDC_VERSION__ == VAL_STD_VERSION_GNU_17 + #define COMPILER_STANDARD "gnu17" + #else + #define COMPILER_STANDARD "default" + #endif + #else + #define COMPILER_STANDARD "c89" + #endif +#endif + +// --------------------------------------------------------------------------------------------------------------------- + +/* +char buffer[256]; +freopen("/dev/null", "a", stdout); +setbuf(stdout, buffer); +// the following function prints to stdout which will be stored into the buffer +ruby_show_version(); +freopen ("/dev/tty", "a", stdout); + +//ruby_show_version(); +//ruby_show_copyright(); +*/ + +// --------------------------------------------------------------------------------------------------------------------- + +#endif diff --git a/ext/ruby_class_mods/ruby_class_mods.c b/ext/ruby_class_mods/ruby_class_mods.c index d926f74..3218c2f 100644 --- a/ext/ruby_class_mods/ruby_class_mods.c +++ b/ext/ruby_class_mods/ruby_class_mods.c @@ -6,6 +6,9 @@ |___ | |__) | \ /~~\ | \ | | | | | \__/ | \ | .__/ ____________________________________________________________________________________________________________________________________________________________________ */ +#include "ruby.h" +#include "ruby/ruby.h" + #include "ruby/config.h" #include @@ -21,10 +24,9 @@ ________________________________________________________________________________ #include #include -//#include #include - #include +//#include //#include //#include @@ -43,31 +45,14 @@ ________________________________________________________________________________ #endif #endif -/* -#include "ruby/encoding.h" -#include -#include -#include "ruby/ruby.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -*/ - #ifndef CRUUUBY_H #include "ruby_class_mods.h" #endif +#ifdef RUUUBY_DEBUGGING +#include "optional/00_debugging.h" +#endif + /*____________________________________________________________________________________________________________________ __ __ ___ __ __ / ` /\ / ` |__| |__ . |__) | | |__) \ / @@ -120,15 +105,6 @@ static inline int is_num(const VALUE arg) { } } -/*static inline int is_simple_num(const VALUE arg) { - switch(TYPE(arg)){ - case RUBY_T_FIXNUM:case RUBY_T_FLOAT:case RUBY_T_BIGNUM: - re_c_ye - default: - re_no - } -}*/ - static inline int is_non_simple_num(const VALUE arg) { switch(TYPE(arg)){ case RUBY_T_RATIONAL:case RUBY_T_COMPLEX: @@ -142,7 +118,7 @@ static inline int is_non_simple_num(const VALUE arg) { static inline VALUE 💎new_ary(const long known_max_size) { if (known_max_size == 0) { return rb_ary_new_capa(0); - } else if (known_max_size > 0 && known_max_size <= 16L) { + } else if (known_max_size <= 15L) { return rb_ary_new_capa(known_max_size); } else { return rb_ary_new(); @@ -439,14 +415,6 @@ static void startup_step4_load_needed_ruuuby_files(void) { ensure_loaded_db(model_attributes/includable/uid) ensure_loaded_db(model_attributes/application_record) #endif - -#ifdef RUUUBY_F92_B04 - ensure_loaded_db(seeds/ruuuby_features) - ensure_loaded_db(seeds/ruuuby_feature_behaviors) - ensure_loaded_db(seeds/ruuuby_releases/past) - ensure_loaded_db(seeds/ruuuby_releases/active_or_recent) - ensure_loaded_db(seeds/ruuuby_dirs) -#endif } /*____________________________________________________________________________________________________________________________________________________________________ @@ -482,7 +450,7 @@ ________________________________________________________________________________ 💎parse_kargs_with_normalizer("flt?", re_as_bool(is_float(self)), if (them == 🅽_universal) { if (is_float(self)) { - return r_flt_is_universal(NUM2DBL(self)); + return c_flt_is_universal(NUM2DBL(self)); } else {re_no} } else {🛑normalizer_value("flt?", them)}) ) @@ -559,10 +527,10 @@ ________________________________________________________________________________ _____________________________________________________________________________________________________________________ */ // | func{finite?} | -static VALUE m_int_is_finite(const VALUE self){re_ye} +ⓡ𝑓_const(m_int_is_finite, re_ye) // | func{infinite?} | -static VALUE m_int_is_not_finite(const VALUE self){re_no} +ⓡ𝑓_const(m_int_is_not_finite, re_no) // | func{^} | ⓡ𝑓_self_them(m_int_patch_for_exponentials, @@ -637,10 +605,10 @@ ________________________________________________________________________________ ⓡ𝑓_def(m_flt_is_one, re_me_eq_to(ℤd1);) // | func{has_decimals?} | -ⓡ𝑓_def(m_flt_has_decimals, return r_flt_has_decimals(NUM2DBL(self));) +ⓡ𝑓_def(m_flt_has_decimals, return c_flt_has_decimals(NUM2DBL(self));) // | func{smells_like_int?} | -ⓡ𝑓_def(m_flt_smells_like_int, return r_flt_smells_like_int(NUM2DBL(self));) +ⓡ𝑓_def(m_flt_smells_like_int, return c_flt_smells_like_int(NUM2DBL(self));) // original source code referenced from: // @see https://floating-point-gui.de/errors/NearlyEqualsTest.java @@ -648,14 +616,14 @@ ________________________________________________________________________________ // | func{≈≈} | ⓡ𝑓_self_them(m_flt_basically_equal, if (rb_obj_equal(self, them) || self == them) {re_ye} - else if (!is_int_or_flt(them)) {re_no} else { + else if (!is_int_or_flt(them)) {re_no} + else { const double val_self = NUM2DBL(self); const double val_them = NUM2DBL(them); - if (val_self == val_them) {re_ye} else { - const double abs_a = fabs(val_self); - const double abs_b = fabs(val_them); + if (val_self == val_them) {re_ye} + else { const double diff = fabs(val_self - val_them); - const double summed = abs_a + abs_b; + const double summed = fabs(val_self) + fabs(val_them); if (val_self == 0.0 || val_them == 0.0 || (summed < M_FLT_EPSILON)) { re_as_bool(diff < (M_FLT_RELATIVE_ERR_RELAXED * M_FLT_EPSILON)) } else { @@ -749,9 +717,11 @@ ________________________________________________________________________________ | \| | |___ _____________________________________________________________________________________________________________________ */ -static VALUE m_nil_empty(const VALUE self) {re_ye} +// | function{empty?} | +ⓡ𝑓_const(m_nil_empty, re_ye) -ⓡ𝑓_self_them(m_nil_include,re_no) +// | function{include?} | +ⓡ𝑓_self_them_returning_const(m_nil_include, re_no) /*____________________________________________________________________________________________________________________ __ ___ __ __ @@ -762,16 +732,12 @@ ________________________________________________________________________________ // | function{>>} | ⓡ𝑓_self_them(m_str_prepend, if (is_str(them)) { - if (r_str_is_empty(them)) { - re_me - } else { + if (!(r_str_is_empty(them))) { r_str_pre_modify(self) r_str_prepend(self, them) - re_me } - } else { - ERR_c_self_got_non_str_param(">>", them) - } + re_me + } else {🛑param_str(">>", them)} ) /*___________________________________________________________________________________________________________________ @@ -863,6 +829,120 @@ ________________________________________________________________________________ } else {ERR_c_self_got_non_ary_param("disjunctive_union", them)} ) +/* __ __ + /\ \ __ /\ \__ __ + ___ ___ ___ ___\ \ \____/\_\ ___ __ \ \ ,_\ ___ _ __ /\_\ ___ ____ + /'___\ / __`\ /' __` __`\ \ '__`\/\ \ /' _ `\ /'__`\ \ \ \/ / __`\/\`'__\/\ \ /'___\ /',__\ + /\ \__//\ \L\ \/\ \/\ \/\ \ \ \L\ \ \ \/\ \/\ \/\ \L\.\_\ \ \_/\ \L\ \ \ \/ \ \ \/\ \__//\__, `\ + \ \____\ \____/\ \_\ \_\ \_\ \_,__/\ \_\ \_\ \_\ \__/.\_\\ \__\ \____/\ \_\ \ \_\ \____\/\____/ + \/____/\/___/ \/_/\/_/\/_/\/___/ \/_/\/_/\/_/\/__/\/_/ \/__/\/___/ \/_/ \/_/\/____/\/___/ */ + + +// source solution credit: https://blog.plover.com/math/choose.html +ⓡ𝑓_self_a_b(m_combinatorics_n_choose_k, + if (is_int(param_a) && is_int(param_b)) { + unsigned int n = RB_FIX2UINT(param_a); + unsigned int k = RB_FIX2UINT(param_b); + if (k == 0 || n == k) { + re_1 + } else if (k > n) { + rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{n_choose_k} got arg(n){%"PRIsVALUE"} w/ value smaller than arg(k){%"PRIsVALUE"} |", param_a, param_b); + } else if (((k - 1) * 2) < n) { + k = n - k; + } + unsigned long r = 1; + unsigned int d; + for (d = 1; d <= k; d++) { + r *= n--; + r /= d; + } + return ULONG2NUM(r); + } else { + rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{n_choose_k} did not receive type{Integer} for either arg(n){%"PRIsVALUE"} or arg(k){%"PRIsVALUE"} |", param_a, param_b); + } +) + +ⓡ𝑓_self_a_b(m_combinatorics_permutations, + if (is_int(param_a) && is_int(param_b)) { + int n = RB_FIX2INT(param_a); + int k = RB_FIX2INT(param_b); + if (n < 0 || k < 0) { + rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{permutations} received a negative Integer for either arg(n){%"PRIsVALUE"} or arg(k){%"PRIsVALUE"} |", param_a, param_b); + } if (k > n) { + rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{permutations} received arg(n){%"PRIsVALUE"} w/ a smaller value than arg(k){%"PRIsVALUE"} |", param_a, param_b); + } + unsigned long p = 1; + for (int i = 0; i < k; i++) { + p *= (n - i); + } + return ULONG2NUM(p); + } else { + rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{permutations} did not receive type{Integer} for either arg(n){%"PRIsVALUE"} or arg(k){%"PRIsVALUE"} |", param_a, param_b); + } +) + +/* __ __ __ + /\ \ /\ \__/\ \ + ___ __ __ ___ ___\ \ \____ __ _ __ \ \ ,_\ \ \___ __ ___ _ __ __ __ + /' _ `\/\ \/\ \ /' __` __`\ \ '__`\ /'__`\/\`'__\ \ \ \/\ \ _ `\ /'__`\ / __`\/\`'__\/\ \/\ \ + /\ \/\ \ \ \_\ \/\ \/\ \/\ \ \ \L\ \/\ __/\ \ \/ \ \ \_\ \ \ \ \/\ __//\ \L\ \ \ \/ \ \ \_\ \ + \ \_\ \_\ \____/\ \_\ \_\ \_\ \_,__/\ \____\\ \_\ \ \__\\ \_\ \_\ \____\ \____/\ \_\ \/`____ \ + \/_/\/_/\/___/ \/_/\/_/\/_/\/___/ \/____/ \/_/ \/__/ \/_/\/_/\/____/\/___/ \/_/ `/___/> \ + /\___/ + \/__/ */ +// source solution credit: https://www.geeksforgeeks.org/eulers-totient-function/ +ⓡ𝑓_self_them(m_number_theory_eulers_totient_func, + if (is_int(them)) { + unsigned long n = NUM2ULONG(them); + if (n == 0ul) {re_0} + unsigned long result = n; + for (unsigned long p = 2ul; p * p <= n; ++p) { + if (n % p == 0ul) { + while (n % p == 0ul) { + n /= p; + } + result -= result / p; + } + } + if (n > 1ul) { + result -= result / n; + } + return ULONG2NUM(result); + } else {rb_raise(R_ERR_ARG, "");} +) + +// source solution credit: https://www.geeksforgeeks.org/check-whether-number-semiprime-not/ +ⓡ𝑓_self_them(m_number_theory_is_semiprime, + if (is_fixnum(them)) { + int num = FIX2INT(them); + int num_primes_encountered = 0; + for (int i = 2; num_primes_encountered < 2 && i * i <= num; ++i) { + while (num % i == 0) { + num /= i; + ++num_primes_encountered; + } + } + // a remaining value of > 1 will be a prime number + if (num > 1) { + re_as_bool(num_primes_encountered == 1) + } else { + re_as_bool(num_primes_encountered == 2) + } + } else { + rb_raise(R_ERR_ARG, "| m{NumberTheory}-> sf{semiprime?} did not receive type{Fixnum} for either arg(n){%"PRIsVALUE"} but type{%s} |", them, rb_obj_classname(them)); + } +) + +/* __ __ + /\ \__ __ /\ \__ + \ \ ,_\ _ __ /\_\ __ ___ ___ ___ ___ ___ __\ \ ,_\ _ __ __ __ + \ \ \/ /\`'__\/\ \ /'_ `\ / __`\ /' _ `\ / __`\ /' __` __`\ /'__`\ \ \/ /\`'__\/\ \/\ \ + \ \ \_\ \ \/ \ \ \/\ \L\ \/\ \L\ \/\ \/\ \/\ \L\ \/\ \/\ \/\ \/\ __/\ \ \_\ \ \/ \ \ \_\ \ + \ \__\\ \_\ \ \_\ \____ \ \____/\ \_\ \_\ \____/\ \_\ \_\ \_\ \____\\ \__\\ \_\ \/`____ \ + \/__/ \/_/ \/_/\/___L\ \/___/ \/_/\/_/\/___/ \/_/\/_/\/_/\/____/ \/__/ \/_/ `/___/> \ + /\____/ /\___/ + \_/__/ \/__/ */ + /*____________________________________________________________________________________________________________________ ___ ___ ___ __ ___ | |__| |__ | /\ /\ |\ | / _` | |__ @@ -1495,15 +1575,7 @@ ptrθ_func(θ_m_is_reflex, } ) -/* __ __ - /\ \__ __ /\ \__ - \ \ ,_\ _ __ /\_\ __ ___ ___ ___ ___ ___ __\ \ ,_\ _ __ __ __ - \ \ \/ /\`'__\/\ \ /'_ `\ / __`\ /' _ `\ / __`\ /' __` __`\ /'__`\ \ \/ /\`'__\/\ \/\ \ - \ \ \_\ \ \/ \ \ \/\ \L\ \/\ \L\ \/\ \/\ \/\ \L\ \/\ \/\ \/\ \/\ __/\ \ \_\ \ \/ \ \ \_\ \ - \ \__\\ \_\ \ \_\ \____ \ \____/\ \_\ \_\ \____/\ \_\ \_\ \_\ \____\\ \__\\ \_\ \/`____ \ - \/__/ \/_/ \/_/\/___L\ \/___/ \/_/\/_/\/___/ \/_/\/_/\/_/\/____/ \/__/ \/_/ `/___/> \ - /\____/ /\___/ - \_/__/ \/__/ */ + static VALUE m_cos(const VALUE self, const VALUE val) { if (is_theta_angle(val)) { ptrθ data; 💎parse_ptrθ(val, data); @@ -1670,108 +1742,6 @@ static VALUE m_square_root(const VALUE self, const VALUE val) { rb_raise(R_ERR_ARG, "| m{Math}-> sf{square_root} may not convert the arg{%"PRIsVALUE"} into a Float |", val); } } -/* __ __ __ - /\ \ /\ \__/\ \ - ___ __ __ ___ ___\ \ \____ __ _ __ \ \ ,_\ \ \___ __ ___ _ __ __ __ - /' _ `\/\ \/\ \ /' __` __`\ \ '__`\ /'__`\/\`'__\ \ \ \/\ \ _ `\ /'__`\ / __`\/\`'__\/\ \/\ \ - /\ \/\ \ \ \_\ \/\ \/\ \/\ \ \ \L\ \/\ __/\ \ \/ \ \ \_\ \ \ \ \/\ __//\ \L\ \ \ \/ \ \ \_\ \ - \ \_\ \_\ \____/\ \_\ \_\ \_\ \_,__/\ \____\\ \_\ \ \__\\ \_\ \_\ \____\ \____/\ \_\ \/`____ \ - \/_/\/_/\/___/ \/_/\/_/\/_/\/___/ \/____/ \/_/ \/__/ \/_/\/_/\/____/\/___/ \/_/ `/___/> \ - /\___/ - \/__/ */ -// source solution credit: https://www.geeksforgeeks.org/eulers-totient-function/ -ⓡ𝑓_self_them(m_number_theory_eulers_totient_func, - if (is_int(them)) { - unsigned long n = NUM2ULONG(them); - if (n == 0ul) {re_0} - unsigned long result = n; - for (unsigned long p = 2ul; p * p <= n; ++p) { - if (n % p == 0ul) { - while (n % p == 0ul) { - n /= p; - } - result -= result / p; - } - } - if (n > 1ul) { - result -= result / n; - } - return ULONG2NUM(result); - } else {rb_raise(R_ERR_ARG, "");} -) - -// source solution credit: https://www.geeksforgeeks.org/check-whether-number-semiprime-not/ -ⓡ𝑓_self_them(m_number_theory_is_semiprime, - if (is_fixnum(them)) { - int num = FIX2INT(them); - int num_primes_encountered = 0; - for (int i = 2; num_primes_encountered < 2 && i * i <= num; ++i) { - while (num % i == 0) { - num /= i; - ++num_primes_encountered; - } - } - // a remaining value of > 1 will be a prime number - if (num > 1) { - re_as_bool(num_primes_encountered == 1) - } else { - re_as_bool(num_primes_encountered == 2) - } - } else { - rb_raise(R_ERR_ARG, "| m{NumberTheory}-> sf{semiprime?} did not receive type{Fixnum} for either arg(n){%"PRIsVALUE"} but type{%s} |", them, rb_obj_classname(them)); - } -) - -/* __ __ - /\ \ __ /\ \__ __ - ___ ___ ___ ___\ \ \____/\_\ ___ __ \ \ ,_\ ___ _ __ /\_\ ___ ____ - /'___\ / __`\ /' __` __`\ \ '__`\/\ \ /' _ `\ /'__`\ \ \ \/ / __`\/\`'__\/\ \ /'___\ /',__\ - /\ \__//\ \L\ \/\ \/\ \/\ \ \ \L\ \ \ \/\ \/\ \/\ \L\.\_\ \ \_/\ \L\ \ \ \/ \ \ \/\ \__//\__, `\ - \ \____\ \____/\ \_\ \_\ \_\ \_,__/\ \_\ \_\ \_\ \__/.\_\\ \__\ \____/\ \_\ \ \_\ \____\/\____/ - \/____/\/___/ \/_/\/_/\/_/\/___/ \/_/\/_/\/_/\/__/\/_/ \/__/\/___/ \/_/ \/_/\/____/\/___/ */ - -// source solution credit: https://blog.plover.com/math/choose.html -ⓡ𝑓_self_a_b(m_combinatorics_n_choose_k, - if (is_int(param_a) && is_int(param_b)) { - unsigned int n = RB_FIX2UINT(param_a); - unsigned int k = RB_FIX2UINT(param_b); - if (k == 0 || n == k) { - re_1 - } else if (k > n) { - rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{n_choose_k} got arg(n){%"PRIsVALUE"} w/ value smaller than arg(k){%"PRIsVALUE"} |", param_a, param_b); - } else if (((k - 1) * 2) < n) { - k = n - k; - } - unsigned long r = 1; - unsigned int d; - for (d = 1; d <= k; d++) { - r *= n--; - r /= d; - } - return ULONG2NUM(r); - } else { - rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{n_choose_k} did not receive type{Integer} for either arg(n){%"PRIsVALUE"} or arg(k){%"PRIsVALUE"} |", param_a, param_b); - } -) - -ⓡ𝑓_self_a_b(m_combinatorics_permutations, - if (is_int(param_a) && is_int(param_b)) { - int n = RB_FIX2INT(param_a); - int k = RB_FIX2INT(param_b); - if (n < 0 || k < 0) { - rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{permutations} received a negative Integer for either arg(n){%"PRIsVALUE"} or arg(k){%"PRIsVALUE"} |", param_a, param_b); - } if (k > n) { - rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{permutations} received arg(n){%"PRIsVALUE"} w/ a smaller value than arg(k){%"PRIsVALUE"} |", param_a, param_b); - } - unsigned long p = 1; - for (int i = 0; i < k; i++) { - p *= (n - i); - } - return ULONG2NUM(p); - } else { - rb_raise(R_ERR_ARG, "| m{Combinatorics}-> sf{permutations} did not receive type{Integer} for either arg(n){%"PRIsVALUE"} or arg(k){%"PRIsVALUE"} |", param_a, param_b); - } -) /* __ /\ \__ __ __ @@ -1921,10 +1891,6 @@ typedef struct SimpleTimerStruct { typedef struct Ruuuby_Engine_Stats { -#ifdef RUUUBY_F98_COMPILER - unsigned char runtime_compiler_version; -#endif - #ifdef RUUUBY_F98_MEMORY double max_memory_before_extensions_loaded; double max_memory_after_extensions_loaded; @@ -1962,47 +1928,6 @@ typedef struct Ruuuby_Engine_Stats { static VALUE m_memory_peak_this_runtime(const VALUE self){return DBL2NUM(memory_peak_this_runtime());} #endif // end: {RUUUBY_F98_MEMORY} - #ifdef RUUUBY_F98_COMPILER - static inline VALUE compiler_version_to_s(const unsigned short compiler_version) __attribute__ ((const)); - static inline VALUE compiler_version_to_s(const unsigned short compiler_version) {💎parse_compiler_version_to_string(compiler_version);} - - // @see https://stackoverflow.com/questions/14737104/what-is-the-default-c-std-standard-version-for-the-current-gcc-especially-on-u - static inline unsigned short establish_compiler_version(void) __attribute__ ((const)); - static inline unsigned short establish_compiler_version(void) { - #ifdef __STRICT_ANSI__ - #ifdef __STDC_VERSION__ - switch(__STDC_VERSION__){ - case VAL_STD_VERSION_C_99: - return FLAG_RUNTIME_VERSION_C_99; - case VAL_STD_VERSION_C_11: - return FLAG_RUNTIME_VERSION_C_11; - case VAL_STD_VERSION_C_17: - return FLAG_RUNTIME_VERSION_C_17; - default: - return FLAG_RUNTIME_VERSION_DEFAULT; - } - #else - return FLAG_RUNTIME_VERSION_C_89; - #endif - #else - #ifdef __STDC_VERSION__ - switch(__STDC_VERSION__) { - case VAL_STD_VERSION_GNU_99: - return FLAG_RUNTIME_VERSION_GNU_99; - case VAL_STD_VERSION_GNU_11: - return FLAG_RUNTIME_VERSION_GNU_11; - case VAL_STD_VERSION_GNU_17: - return FLAG_RUNTIME_VERSION_GNU_17; - default: - return FLAG_RUNTIME_VERSION_DEFAULT; - } - #else - return FLAG_RUNTIME_VERSION_GNU_89; - #endif - #endif - } - #endif // end: {RUUUBY_F98_COMPILER} - #ifdef RUUUBY_F98_TIMER void simple_timer_start(SimpleTimer * simple_timer); void simple_timer_end(SimpleTimer * simple_timer); @@ -2028,103 +1953,111 @@ typedef struct Ruuuby_Engine_Stats { static void engine_start_up_finished(RuuubyEngineStats * engine); static void engine_start_up_finished(RuuubyEngineStats * engine) { - Ⓒruuuby_engine = rb_funcall(ⓜruuuby_engine, rb_intern("_get_engine"), 0); + Ⓒruuuby_engine = rb_funcall(ⓜruuuby_engine, rb_intern("_get_engine"), 0); hsh_ruuuby_engine_stats = rb_hash_new(); + 💎set_instance_field(Ⓒruuuby_engine,hsh_ruuuby_engine_stats,stats_ext); ENGINE_STAT_SET("compiled_at", c_str_to_r_str(COMPILED_AT_DATETIME)); + #ifdef RUUUBY_F00_B04 + ENGINE_STAT_SET("F00_B04", Qtrue); + #else + ENGINE_STAT_DISABLE("F00_B04"); + #endif + #ifdef RUUUBY_F00_B05 + ENGINE_STAT_SET("F00_B05", Qtrue); + #else + ENGINE_STAT_DISABLE("F00_B05"); + #endif #ifdef RUUUBY_F06_B08 ENGINE_STAT_SET("F06_B08", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F06_B08"); + ENGINE_STAT_DISABLE("F06_B08"); #endif #ifdef RUUUBY_F06_B09 ENGINE_STAT_SET("F06_B09", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F06_B09"); + ENGINE_STAT_DISABLE("F06_B09"); #endif #ifdef RUUUBY_F10_B04 ENGINE_STAT_SET("F10_B04", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F10_B04"); - #endif - #ifdef RUUUBY_F12_B00 - ENGINE_STAT_SET("F12_B00", Qtrue); - #else - ENGINE_STAT_SET_DISABLED("F12_B00"); + ENGINE_STAT_DISABLE("F10_B04"); #endif #ifdef RUUUBY_F22_B01 ENGINE_STAT_SET("F22_B01", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F22_B01"); + ENGINE_STAT_DISABLE("F22_B01"); #endif #ifdef RUUUBY_F22_B05 ENGINE_STAT_SET("F22_B05", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F22_B05"); + ENGINE_STAT_DISABLE("F22_B05"); #endif #ifdef RUUUBY_F22_B06 ENGINE_STAT_SET("F22_B06", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F22_B06"); + ENGINE_STAT_DISABLE("F22_B06"); #endif #ifdef RUUUBY_F22_B07 ENGINE_STAT_SET("F22_B07", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F22_B07"); - #endif - #ifdef RUUUBY_F26_B00 - ENGINE_STAT_SET("F26_B00", Qtrue); - #else - ENGINE_STAT_SET_DISABLED("F26_B00"); + ENGINE_STAT_DISABLE("F22_B07"); #endif #ifdef RUUUBY_F28_B09 ENGINE_STAT_SET("F28_B09", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F28_B09"); + ENGINE_STAT_DISABLE("F28_B09"); #endif #ifdef RUUUBY_F43 ENGINE_STAT_SET("F43", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F43"); + ENGINE_STAT_DISABLE("F43"); #endif #ifdef RUUUBY_F92_B00 ENGINE_STAT_SET("F92_B00", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F92_B00"); + ENGINE_STAT_DISABLE("F92_B00"); #endif #ifdef RUUUBY_F92_B01 ENGINE_STAT_SET("F92_B01", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F92_B01"); + ENGINE_STAT_DISABLE("F92_B01"); #endif #ifdef RUUUBY_F92_B02 ENGINE_STAT_SET("F92_B02", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F92_B02"); + ENGINE_STAT_DISABLE("F92_B02"); #endif #ifdef RUUUBY_F93 ENGINE_STAT_SET("F93", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F93"); + ENGINE_STAT_DISABLE("F93"); #endif #ifdef RUUUBY_F98_DEBUG ENGINE_STAT_SET("F98_DEBUG", Qtrue); #else - ENGINE_STAT_SET_DISABLED("F98_DEBUG"); + ENGINE_STAT_DISABLE("F98_DEBUG"); #endif #ifdef RUUUBY_F98_COMPILER - engine->runtime_compiler_version = establish_compiler_version(); - ENGINE_STAT_SET("compiler", compiler_version_to_s(engine->runtime_compiler_version)); + VALUE key_outer_compiler = rb_str_new_cstr("compiler"); + rb_str_modify(key_outer_compiler); + ENGINE_STAT_SET_SET(key_outer_compiler, c_str_to_frozen_r_str("standard"), c_str_to_frozen_r_str(COMPILER_STANDARD)); + ENGINE_STAT_SET_SET(key_outer_compiler, c_str_to_frozen_r_str("name"), c_str_to_frozen_r_str(COMPILER_NAME)); + ENGINE_STAT_SET_SET(key_outer_compiler, c_str_to_frozen_r_str("version"), c_str_to_frozen_r_str(COMPILER_VERSION)); + rb_str_free(key_outer_compiler); #else - ENGINE_STAT_SET_DISABLED("compiler"); + ENGINE_STAT_DISABLE("compiler"); #endif #ifdef RUUUBY_F98_MEMORY + VALUE key_outer_memory = rb_str_new_cstr("memory"); + rb_str_modify(key_outer_memory); + engine->max_memory_after_extensions_loaded = memory_peak_this_runtime(); - ENGINE_STAT_SET("mem_pre_load", DBL2NUM(engine->max_memory_before_extensions_loaded)); - ENGINE_STAT_SET("mem_post_load", DBL2NUM(engine->max_memory_after_extensions_loaded)); + ENGINE_STAT_SET_SET(key_outer_memory, c_str_to_frozen_r_str("pre_load"), DBL2NUM(engine->max_memory_before_extensions_loaded)); + ENGINE_STAT_SET_SET(key_outer_memory, c_str_to_frozen_r_str("post_load"), DBL2NUM(engine->max_memory_after_extensions_loaded)); rb_gc_enable(); rb_gc_verify_internal_consistency(); @@ -2135,11 +2068,10 @@ typedef struct Ruuuby_Engine_Stats { engine->max_memory_after_gc = memory_peak_this_runtime(); - ENGINE_STAT_SET("mem_after_gc", DBL2NUM(engine->max_memory_after_gc)); + ENGINE_STAT_SET_SET(key_outer_memory, c_str_to_frozen_r_str("after_gc"), DBL2NUM(engine->max_memory_after_gc)); + rb_str_free(key_outer_memory); #else - ENGINE_STAT_SET_DISABLED("mem_pre_load"); - ENGINE_STAT_SET_DISABLED("mem_post_load"); - ENGINE_STAT_SET_DISABLED("mem_after_gc"); + ENGINE_STAT_DISABLE("memory"); #endif #ifdef RUUUBY_F98_TIMER simple_timer_end(& (engine->simple_timer)); diff --git a/ext/ruby_class_mods/ruby_class_mods.h b/ext/ruby_class_mods/ruby_class_mods.h index 051da54..65b36b9 100644 --- a/ext/ruby_class_mods/ruby_class_mods.h +++ b/ext/ruby_class_mods/ruby_class_mods.h @@ -1,11 +1,11 @@ // encoding: UTF-8 -#ifndef CRUUUBY_H8_GRAPHS -#include "c8_graphs.h" +#ifndef CRUUUBY_H7_GRAPHS +#include "07_graphs.h" #endif #ifndef CRUUUBY_H -#define CRUUUBY_H "defined(CRUUUBY_H)" +#define CRUUUBY_H /*____________________________________________________________________________________________________________________ ___ __ __ __ ___ __ __ ___ __ __ @@ -47,14 +47,19 @@ ________________________________________________________________________________ #define declare_func(func_name, expr, return_type, single_param) return_type func_name(single_param);return_type func_name(single_param){expr} #define declare_static_func(func_name, expr, return_type, single_param) static return_type func_name(single_param);static return_type func_name(single_param){expr} -//#define r_func_pure(func_name, expr) PUREFUNC(static VALUE func_name(const VALUE self) {expr}) +//#define r_func_pure(func_name, expr) PUREFUNC(static VALUE func_name(const VALUE self) {expr}) #define ⓡ𝑓(func_name, expr) PUREFUNC(static VALUE func_name(const VALUE self) {expr}); + +#define ⓡ𝑓_const(func_name, expr) CONSTFUNC(static VALUE func_name(const VALUE self));static VALUE func_name(const VALUE self){expr} + #define ⓡ𝑓_def(func_name, expr) declare_static_func(func_name, expr, VALUE, VALUE self) #define ⓡ𝑓_def2(func_name, param_0, param_1, expr) VALUE func_name(const VALUE param_0, const VALUE param_1);VALUE func_name(const VALUE param_0, const VALUE param_1){expr} #define ⓡ𝑓_def3(func_name, param_0, param_1, param_2, expr) VALUE func_name(VALUE param_0, VALUE param_1, VALUE param_2);VALUE func_name(VALUE param_0, VALUE param_1, VALUE param_2){expr} -#define ⓡ𝑓_kargs(func_name, expr) static VALUE func_name(int argc, VALUE * argv, VALUE self);static VALUE func_name(int argc, VALUE * argv, VALUE self){expr} -#define ⓡ𝑓_self_them(func_name, expr) ⓡ𝑓_def2(func_name, self, them, expr) +#define ⓡ𝑓_kargs(func_name, expr) static VALUE func_name(int argc, VALUE * argv, VALUE self);static VALUE func_name(int argc, VALUE * argv, VALUE self){expr} +#define ⓡ𝑓_self_them(func_name, expr) ⓡ𝑓_def2(func_name, self, them, expr) +#define ⓡ𝑓_self_them_returning_const(func_name, expr) CONSTFUNC(static VALUE func_name(const VALUE self, const VALUE them));static VALUE func_name(const VALUE self, const VALUE them){expr} + #define ⓡ𝑓_self_a_b(func_name, expr) ⓡ𝑓_def3(func_name, self, param_a, param_b, expr) #define c_func(func_name, expr) declare_func(func_name, expr, void, void) @@ -63,9 +68,9 @@ ________________________________________________________________________________ #define 💎add_module_under(kclass, str) rb_define_module_under(kclass, str); #define 💎add_class_under(kclass, kclass_super, str) rb_define_class_under(kclass, str, kclass_super); -#define 💎add_func_alias(kclass, name_alias, name_original) rb_define_alias(kclass, name_alias, name_original); -#define 💎add_const_under(kclass, const_name, const_value) rb_define_const(kclass, const_name, const_value); -#define 💎add_const_flt(const_name, const_as_c_double) 💎add_const_under(R_FLT, const_name, DBL2NUM(const_as_c_double)) +#define 💎add_func_alias(kclass, name_alias, name_original) rb_define_alias(kclass, name_alias, name_original); +#define 💎add_const_under(kclass, const_name, const_value) rb_define_const(kclass, const_name, const_value); +#define 💎add_const_flt(const_name, const_as_c_double) 💎add_const_under(R_FLT, const_name, DBL2NUM(const_as_c_double)) #define 💎add_const_theta_angle(const_name, dbl_angle, mode_angle, ref, initial_flags) {\ ref = θ_new_constant(dbl_angle, mode_angle, initial_flags);\ rb_define_const(R_MATH, const_name, ref);\ @@ -114,23 +119,19 @@ static VALUE has_smell_of_int(const VALUE arg); static VALUE is_finite_num(const VALUE arg) {return rb_funcall(arg, cached_rb_intern_is_finite, 0);} static VALUE has_smell_of_int(const VALUE arg){return rb_funcall(arg, cached_rb_intern_smells_like_int, 0);} -CONSTFUNC(static VALUE m_nil_empty(const VALUE self)); -CONSTFUNC(static VALUE m_int_is_finite(const VALUE self)); -CONSTFUNC(static VALUE m_int_is_not_finite(const VALUE self)); - void Init_ruby_class_mods(void); // -------------- -static inline VALUE r_flt_has_decimals(const double flt){ +static inline VALUE c_flt_has_decimals(const double flt) { if (isfinite(flt)) {re_as_bool(flt != trunc(flt))} else {re_no} } -static inline VALUE r_flt_smells_like_int(const double flt){ +static inline VALUE c_flt_smells_like_int(const double flt) { if (isfinite(flt)) {re_as_bool(flt == trunc(flt))} else {re_no} } -static inline VALUE r_flt_is_universal(const double flt){ +static inline VALUE c_flt_is_universal(const double flt) { re_as_bool(isfinite(flt)) } diff --git a/lib/ruuuby/class/io/dir.rb b/lib/ruuuby/class/io/dir.rb index cc62529..98b9de2 100644 --- a/lib/ruuuby/class/io/dir.rb +++ b/lib/ruuuby/class/io/dir.rb @@ -15,29 +15,28 @@ def ∅?; ::Dir.empty?(self.path); end # @param [String] path (to a directory) # - # @return [Boolean] true, if provided path exists and is a directory + # @return [Boolean] true, if provided{`path`} exists and is a directory def self.∃?(path) 🛑str❓(:path, path) ::File.directory?(path) end + # @return [Boolean] true, if the provided{`path`} does not exist (as a directory) + def self.∄?(path); !(self.∃?(path)); end + # @see https://stackoverflow.com/questions/2370702/one-liner-to-recursively-list-directories-in-ruby # # @param [Boolean] recursively def ∀📁(recursively=false) if recursively ::Dir["#{self.path}**/*"].reject{|fn| ::File.directory?(fn)} - #::Dir["#{self.path}**/*"] else self.∀{|path| yield path if ::File.file?("#{self.path}/#{path}")} - #self.∀{|path| yield "#{self.path}/#{path}"} - #self.∀{|path| yield path if ::File.file?(path)} end end # @param [Boolean] recursively def ∀🗄️(recursively=false) - #self.∀{|path| yield path if ::Dir.∃?("#{self.path}#{path}")} if recursively ::Dir["#{self.path}**/*"].reject{|fn| ::File.file?(fn)} else @@ -47,7 +46,6 @@ def ∀🗄️(recursively=false) yield ::Dir.new(full_path) end end - #self.∀{|path| yield ::Dir.new("#{self.path}#{path}") if ::File.directory?("#{self.path}".ensure_ending!('/') + path)} end end @@ -62,8 +60,6 @@ def md5(recursively=false) if recursively results = [] self.∀🗄️ do |sub_dir| - #dir = Dir.new("#{self.path}#{sub_dir}/") - #results << [dir.md5(true), sub_dir] results << [sub_dir.md5(true), sub_dir.path] end results.sort!{|a, b| a[1] <=> b[1]} @@ -139,7 +135,7 @@ def path_overlap_reversed(dir_or_path) 🛑 ::ArgErr.str(elf, 'dir_or_path', dir_or_path) unless (dir_or_path.str? || dir_or_path.is_a?(::Dir)) sections_self = self.path.split('/') sections_them = dir_or_path.str? ? dir_or_path.split('/') : dir_or_path.path.split('/') - them_str = dir_or_path.str? ? dir_or_path : dir_or_path.path + #them_str = dir_or_path.str? ? dir_or_path : dir_or_path.path num_same = 0 if sections_self[-1] == sections_them[-1] num_same = 1 diff --git a/lib/ruuuby/class/io/file.rb b/lib/ruuuby/class/io/file.rb index 40fbdd3..15364b9 100644 --- a/lib/ruuuby/class/io/file.rb +++ b/lib/ruuuby/class/io/file.rb @@ -14,9 +14,12 @@ class ::File attribute_lazy_loadable('tempfile', false) # TODO: all these characters should be valid for JavaScript: http://www.fileformat.info/info/charset/UTF-16/list.htm + # TODO: unit test w/ https://unix.stackexchange.com/questions/16640/how-can-i-get-the-size-of-a-file-in-a-bash-script class << self alias_method :∅?, :empty? + + alias_method :∃?, :file? end module Syntax @@ -42,18 +45,6 @@ def ∅?; ::File.∅?(self.path); end # @return [String] def self.md5(path); ::Math::Crypto.md5(::File.read(path)) if self.∃!(path); end - # TODO: missing coverage - # - # @param [String] path - # - # @raise [ArgumentError] - # - # @return [Boolean] - def self.∃?(path) - 🛑str❓('path', path) - ::File.file?(path) - end - def self.∄?(path); !self.∃?(path); end # @param [String] path @@ -64,7 +55,6 @@ def self.∄?(path); !self.∃?(path); end def self.∃!(path) 🛑str❓('path', path) 🛑 ::RuntimeError.new("| c{File}-> m{∃!} got path{#{path}} which does not exist as a file |") unless ::File.file?(path) - true end diff --git a/lib/ruuuby/class/re.rb b/lib/ruuuby/class/re.rb index 48532e8..7d292ca 100644 --- a/lib/ruuuby/class/re.rb +++ b/lib/ruuuby/class/re.rb @@ -1,12 +1,16 @@ # encoding: UTF-8 +# @see https://docs.oracle.com/database/121/ADFNS/adfns_regexp.htm#ADFNS9999 +# # ----------------------------------------------------------------------------------------- # | for | regex | # | ------------------------------------ | ------------------------------------------------ | # | lowercase letter | `[[:lower:]]` | # | uppercase letter | `[[:upper:]]` | # | marker start | `\A` | -# | market end | `\z` | +# | marker end | `\z` | +# | marker start in DB context | `^` | +# | marker end in DB context | `$` | # ----------------------------------------------------------------------------------------- # # add various functions to existing class +Regexp+ diff --git a/lib/ruuuby/configs.rb b/lib/ruuuby/configs.rb index 7a9a361..72f2a08 100644 --- a/lib/ruuuby/configs.rb +++ b/lib/ruuuby/configs.rb @@ -1,74 +1,7 @@ # encoding: UTF-8 -# ------------------------------------------------------------------------------------------------------------ | *f23* | - BEGIN { 💎.engine.engine.start - - # add these methods onto the `main` object (similar to adding methods to `Kernel`, but of smaller scope to avoid polluting other Classes) - class << self - include( - ::Math::Trig - ) - - #$🌎 = self - #$git = 💎.engine.api_locale.api_git - end - - # TODO: create better solution than loading it here - module ::Kernel - - # @type [Float] - Ω = ::Float::CONST_OMEGA - - # TODO: https://en.wikipedia.org/wiki/Golden_spiral - # TODO: https://en.wikipedia.org/wiki/Polar_coordinate_system - # TODO: https://en.wikipedia.org/wiki/Euler%27s_formula - - # ---------------------------------------------------------------------------------------------------------- | *f28* | - - 𝔹 = ::Math::SetTheory::BooleanNumbers.instance - - ℕ = ::Math::SetTheory::NaturalNumbers.instance - - 𝕎 = ::Math::SetTheory::WholeNumbers.instance - - ℤ = ::Math::SetTheory::IntegerNumbers.instance - - ℚ = ::Math::SetTheory::RationalNumbers.instance - - 𝔸ᵣ = ::Math::SetTheory::RealAlgebraicNumbers.instance - - 𝔸 = ::Math::SetTheory::AlgebraicNumbers.instance - - ℂ = ::Math::SetTheory::ComplexNumbers.instance - - #𝕋 = ::Math::GroupTheory::CircleGroup.instance - - 𝕀 = ::Math::SetTheory::IrrationalNumbers.instance - - ℝ = ::Math::SetTheory::RealNumbers.instance - - 𝕌 = ::Math::SetTheory::UniversalSet.instance - - # ---------------------------------------------------------------------------------------------------------- | *f06* | - - ::Kernel.const_set(:𝕊, ::Math::Space::SymbolicNumbers.instance) - - ::Kernel.const_set(:🅱, ::Math::Space::BooleanSpace.instance) - - 🙈 - - def 🧬; ::Math::Space::NucleotideSpace.instance; end - - def 🔢; ::Math::Space::NumberSpace.instance; end - - def ∅; ::Math::SetTheory::EmptySet.instance; end - - def 𝕚; ::Math::SetTheory::ImaginaryNumbers.instance; end - end - # | -------------------------------------------------------------------------------------------------------------------- - } END { diff --git a/lib/ruuuby/db/db_connection.rb b/lib/ruuuby/db/db_connection.rb index 4c6a178..4033fcb 100644 --- a/lib/ruuuby/db/db_connection.rb +++ b/lib/ruuuby/db/db_connection.rb @@ -53,7 +53,30 @@ def sql(sql) 🛑str❓('sql', sql) puts "executing sql{#{sql}}" #@connection.execute(sql) - @connection.exec_query(sql) + @connection.exec_query(sql) + end + + # TODO: ruuuby specific DB class + def ∃⨍?(func_name); self.sql("SELECT does_func_exist('#{func_name}');").rows[0][0]; end + + # TODO: ruuuby specific DB class + def ∃table?(table_name); self.sql("SELECT does_table_exist('#{table_name}');").rows[0][0]; end + + def db_size + self.sql("SELECT db_size_bytes FROM db_size_stats() WHERE dat_name = 'env_test';").rows[0] + end + + def refresh_stats(table_name) + self.sql("ANALYZE #{table_name};") + end + + # @param [String] table_name + # @param [Boolean] update_cache + # + # @return [Integer] + def num_rows(table_name, update_cache=false) + refresh_stats(table_name) if update_cache + self.sql("SELECT table_row_count_estimate('#{table_name}');").rows[0][0] end def _connected?; @connection != nil; end diff --git a/lib/ruuuby/db/migrations/env_vars.rb b/lib/ruuuby/db/migrations/env_vars.rb new file mode 100644 index 0000000..23d8c8b --- /dev/null +++ b/lib/ruuuby/db/migrations/env_vars.rb @@ -0,0 +1,84 @@ +# encoding: UTF-8 + +#class CreateRuuubyGem < ActiveRecord::Migration[6.0] +class CreateEnvVars < RuuubyDBMigration + + DB_FILE_NAME = '01_env_vars.sql' + + def self.up + + create_table :env_var_groups do |t| + t.string :group_name, :null => false + + t.index :group_name, unique: true + end + + create_table :env_var_tiers do |t| + t.string :the_desc, :null => false + + t.boolean :tier_err_if_present, :null => false + t.boolean :tier_optional, :null => false + t.boolean :tier_ignore, :null => false + t.boolean :tier_err_if_missing, :null => false + + t.index :the_desc, unique: true + end + + create_table :env_vars do |t| + t.string :the_key, :null => false + t.string :the_desc, :null => false + + t.index :the_key, unique: true + t.index :the_desc, unique: true + + t.references :env_var_groups, foreign_key: { references: :env_var_groups } + end + + create_table :env_var_sets do |t| + t.string :the_val, :null => false + + t.references :env_var_tiers, foreign_key: { references: :env_var_tiers } + t.references :env_vars, foreign_key: { references: :env_vars } + + t.index :env_vars_id, unique: true + end + + execute(self.read_sql_rollout_file(DB_FILE_NAME)) + execute(self.read_sql_seed_file(DB_FILE_NAME)) + end + + def self.down + ♻️index(:env_vars, :the_key) + ♻️index(:env_vars, :the_desc) + + ♻️index(:env_var_sets, :env_vars_id) + + ♻️index(:env_var_groups, :group_name) + + ♻️index(:env_var_tiers, :the_desc) + + ♻️table(:env_var_sets) + ♻️table(:env_vars) + ♻️table(:env_var_tiers) + ♻️table(:env_var_groups) + + execute(self.read_sql_rollback_file(DB_FILE_NAME)) + end + +end + +class ::EnvVars < ::ApplicationRecord + +end + +class ::EnvVarTiers < ::ApplicationRecord + +end + +class ::EnvVarGroups < ::ApplicationRecord + +end + +class ::EnvVarSets < ::ApplicationRecord + +end diff --git a/lib/ruuuby/db/migrations/migration_ext.rb b/lib/ruuuby/db/migrations/migration_ext.rb index c549217..8ffd139 100644 --- a/lib/ruuuby/db/migrations/migration_ext.rb +++ b/lib/ruuuby/db/migrations/migration_ext.rb @@ -36,14 +36,14 @@ def self.∃⨍_sql?(func_name) def ∃table?(table_name); table_exists?(table_name); end # @param [Symbol] table_name - # @param [Symbol] single_field - def ♻️index(table_name, single_field) - remove_index(table_name, single_field) if index_exists?(table_name, single_field) + # @param [Symbol] fields + def ♻️index(table_name, fields) + remove_index(table_name, fields) if index_exists?(table_name, fields) end # @param [Symbol] table_name - # @param [Symbol] single_field - def ♻️index!(table_name, single_field); remove_index(table_name, single_field); end + # @param [Symbol] fields + def ♻️index!(table_name, fields); remove_index(table_name, fields); end # @param [Symbol] table_name def ♻️table(table_name); drop_table(table_name, if_exists: true); end diff --git a/lib/ruuuby/db/migrations/rollback/00_ruuuby_gem.sql b/lib/ruuuby/db/migrations/rollback/00_ruuuby_gem.sql index 19ac3f1..9932f62 100644 --- a/lib/ruuuby/db/migrations/rollback/00_ruuuby_gem.sql +++ b/lib/ruuuby/db/migrations/rollback/00_ruuuby_gem.sql @@ -1,3 +1,4 @@ +--() { :; }; exec psql -f "$0" -- -------------------------------------------- ⚠️ -------------------------------------------- -- testing purposes @@ -5,22 +6,43 @@ BEGIN TRANSACTION; +-- __ ___ ___ __ ___ __ +-- |__) |__ | |__ /\ /__` |__ /__` +-- | \ |___ |___ |___ /~~\ .__/ |___ .__/ +DROP FUNCTION IF EXISTS ruuuby_release_id(_release_version TEXT); +DROP FUNCTION IF EXISTS ruuuby_release_validate_version_beta(_version_ruuuby TEXT); +DROP FUNCTION IF EXISTS ruuuby_release_validate_version_standard(_version_ruuuby TEXT); +DROP FUNCTION IF EXISTS ruuuby_release_validate_version_any(_version_ruuuby TEXT); +DROP PROCEDURE IF EXISTS ruuuby_release_syntax_err_version(_version_ruuuby TEXT); +DROP PROCEDURE IF EXISTS ruuuby_release_validate_syntax_version(_version_ruuuby TEXT); +DROP PROCEDURE IF EXISTS ruuuby_release_add(_version_ruuuby TEXT, _is_released BOOLEAN); +DROP PROCEDURE IF EXISTS ruuuby_release_prepare(_version_ruuuby TEXT); + +-- ___ ___ ___ __ ___ __ +-- |__ |__ /\ | | | |__) |__ /__` +-- | |___ /~~\ | \__/ | \ |___ .__/ +DROP FUNCTION IF EXISTS ruuuby_feature_id(_uid SMALLINT); +DROP PROCEDURE IF EXISTS ruuuby_feature_add(_uid SMALLINT, _is_optional BOOLEAN, _desc_self TEXT); + +-- __ ___ __ __ __ +-- |__) |__ |__| /\ \ / | / \ |__) /__` +-- |__) |___ | | /~~\ \/ | \__/ | \ .__/ +DROP PROCEDURE IF EXISTS ruuuby_feature_behavior_add(_uid SMALLINT,text,text); + +-- __ ___ __ +-- / _` |__ |\/| /__` +-- \__> |___ | | .__/ DROP PROCEDURE IF EXISTS ruuuby_gem_add(text,text,text,boolean,boolean,text,text,text); DROP PROCEDURE IF EXISTS ruuuby_gem_add_recommended(text,text,text,text,text,text); DROP PROCEDURE IF EXISTS ruuuby_gem_add_dev(text,text,text,text,text,text); DROP PROCEDURE IF EXISTS ruuuby_gem_add_prod(text,text,text,text,text,text); DROP PROCEDURE IF EXISTS ruuuby_gem_update(text,text,text); DROP PROCEDURE IF EXISTS ruuuby_gem_remove(text,text); -DROP PROCEDURE IF EXISTS ruuuby_release_add(text,timestamp); -DROP PROCEDURE IF EXISTS ruuuby_feature_add(_uid TEXT, _is_optional BOOLEAN, _desc_self TEXT); -DROP PROCEDURE IF EXISTS ruuuby_feature_behavior_add(text,text,text); DROP FUNCTION IF EXISTS ruuuby_release_gem_changelogs(text); DROP FUNCTION IF EXISTS ruuuby_active_gems(); DROP FUNCTION IF EXISTS ruuuby_gem_id(_name TEXT); DROP FUNCTION IF EXISTS ruuuby_gem_latest_changelog_id(text); DROP FUNCTION IF EXISTS ruuuby_gem_current_version(text); -DROP FUNCTION IF EXISTS ruuuby_release_id(_release_version TEXT); -DROP FUNCTION IF EXISTS ruuuby_feature_id(_uid TEXT); COMMIT TRANSACTION; diff --git a/lib/ruuuby/db/migrations/rollback/01_env_vars.sql b/lib/ruuuby/db/migrations/rollback/01_env_vars.sql new file mode 100644 index 0000000..17fb8df --- /dev/null +++ b/lib/ruuuby/db/migrations/rollback/01_env_vars.sql @@ -0,0 +1,13 @@ +--() { :; }; exec psql -f "$0" + +-- -------------------------------------------- ⚠️ -------------------------------------------- +-- testing purposes +-- -------------------------------------------- ⚠️ -------------------------------------------- + +BEGIN TRANSACTION; + +DROP FUNCTION IF EXISTS env_var_group_id(_group_name TEXT); +DROP FUNCTION IF EXISTS env_var_tier_id(_tier_name TEXT); +DROP PROCEDURE IF EXISTS env_var_add(_group_name TEXT, _env_var_name TEXT, _desc TEXT); + +COMMIT TRANSACTION; diff --git a/lib/ruuuby/db/migrations/rollout/00_ruuuby_gem.sql b/lib/ruuuby/db/migrations/rollout/00_ruuuby_gem.sql index 147647b..4de6a92 100644 --- a/lib/ruuuby/db/migrations/rollout/00_ruuuby_gem.sql +++ b/lib/ruuuby/db/migrations/rollout/00_ruuuby_gem.sql @@ -1,3 +1,4 @@ +--() { :; }; exec psql -f "$0" -- -------------------------------------------- ⚠️ -------------------------------------------- -- testing purposes @@ -8,67 +9,162 @@ BEGIN TRANSACTION; -- __ ___ ___ __ ___ __ -- |__) |__ | |__ /\ /__` |__ /__` -- | \ |___ |___ |___ /~~\ .__/ |___ .__/ -CREATE OR REPLACE FUNCTION ruuuby_release_id(_release_version TEXT) RETURNS BIGINT AS $$ + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION ruuuby_release_id + (_release_version TEXT) RETURNS BIGINT AS $$ BEGIN RETURN (SELECT id FROM ruuuby_releases WHERE version = _release_version); END; $$ LANGUAGE plpgsql; -CREATE OR REPLACE PROCEDURE ruuuby_release_add(_version_ruuuby TEXT, _time_released TIMESTAMP DEFAULT NULL) LANGUAGE plpgsql AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION ruuuby_release_validate_version_beta(_version_ruuuby TEXT) RETURNS BOOLEAN AS $$ +BEGIN + RETURN (_version_ruuuby ~ '^\d.\d.\d(\d)?.pre.\d(\d)?$'); +END; $$ LANGUAGE plpgsql; + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION ruuuby_release_validate_version_standard(_version_ruuuby TEXT) RETURNS BOOLEAN AS $$ +BEGIN + RETURN (_version_ruuuby ~ '^\d.\d.\d(\d)?$'); +END; $$ LANGUAGE plpgsql; + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION ruuuby_release_validate_version_any(_version_ruuuby TEXT) RETURNS BOOLEAN AS $$ +BEGIN + CASE + WHEN (ruuuby_release_validate_version_beta(_version_ruuuby)) THEN + RETURN TRUE; + WHEN (ruuuby_release_validate_version_standard(_version_ruuuby)) THEN + RETURN TRUE; + ELSE + RETURN FALSE; + END CASE; +END; $$ LANGUAGE plpgsql; + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_release_syntax_err_version(_version_ruuuby TEXT) LANGUAGE plpgsql AS $$ BEGIN - INSERT INTO ruuuby_releases (version, changelogs, dt_released) VALUES (_version_ruuuby, NULL, _time_released); + RAISE EXCEPTION 'invalid ruuuby release version syntax provided w/ value{%}', _version_ruuuby + USING HINT = 'check against regex formats {^\d.\d.\d(\d)?.pre.\d(\d)?$} and{^\d.\d.\d(\d)?$}'; +END; $$; + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_release_validate_syntax_version(_version_ruuuby TEXT) LANGUAGE plpgsql AS $$ +BEGIN + IF NOT (ruuuby_release_validate_version_any(_version_ruuuby)) THEN + CALL ruuuby_release_syntax_err_version(); + END IF; +END; $$; + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_release_add + (_version_ruuuby TEXT, _is_released BOOLEAN DEFAULT TRUE) LANGUAGE plpgsql AS $$ +BEGIN + CASE + WHEN (ruuuby_release_validate_version_beta(_version_ruuuby)) THEN + INSERT INTO ruuuby_releases (version, is_beta, is_published) VALUES (_version_ruuuby, TRUE, _is_released); + WHEN (ruuuby_release_validate_version_standard(_version_ruuuby)) THEN + INSERT INTO ruuuby_releases (version, is_beta, is_published) VALUES (_version_ruuuby, FALSE, _is_released); + ELSE + CALL ruuuby_release_syntax_err_version(); + END CASE; +END; $$; + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_release_prepare + (_version_ruuuby TEXT) LANGUAGE plpgsql AS $$ +BEGIN + CALL ruuuby_release_add(_version_ruuuby, FALSE); END; $$; -- ___ ___ ___ __ ___ __ -- |__ |__ /\ | | | |__) |__ /__` -- | |___ /~~\ | \__/ | \ |___ .__/ -CREATE OR REPLACE FUNCTION ruuuby_feature_id(_uid TEXT) RETURNS BIGINT AS $$ + +-- --------------------------------------------------------------------------------------------------------------------- +CREATE OR REPLACE FUNCTION ruuuby_feature_id + (_uid SMALLINT) RETURNS BIGINT AS $$ BEGIN RETURN (SELECT id FROM ruuuby_features WHERE uid = _uid); END; $$ LANGUAGE plpgsql; -CREATE OR REPLACE PROCEDURE ruuuby_feature_add(_uid TEXT, _is_optional BOOLEAN, _desc_self TEXT) LANGUAGE plpgsql AS $$ +CREATE OR REPLACE PROCEDURE ruuuby_feature_add + (_uid SMALLINT, _is_optional BOOLEAN, _desc_self TEXT) LANGUAGE plpgsql AS $$ BEGIN - INSERT INTO ruuuby_features(uid, is_optional, desc_self) VALUES (_uid, _is_optional, _desc_self); + INSERT INTO ruuuby_features(uid, is_optional, desc_self) VALUES (_uid,_is_optional,_desc_self); END; $$; +-- --------------------------------------------------------------------------------------------------------------------- -- __ ___ __ __ __ -- |__) |__ |__| /\ \ / | / \ |__) /__` -- |__) |___ | | /~~\ \/ | \__/ | \ .__/ -CREATE OR REPLACE PROCEDURE ruuuby_feature_behavior_add(_feature_uid TEXT, _behavior_uid TEXT, _desc_self TEXT) LANGUAGE plpgsql AS $$ + +-- --------------------------------------------------------------------------------------------------------------------- +CREATE OR REPLACE PROCEDURE ruuuby_feature_behavior_add + (_feature_uid SMALLINT, _behavior_uid SMALLINT, _is_optional BOOLEAN, _desc_self TEXT) LANGUAGE plpgsql AS $$ BEGIN - INSERT INTO ruuuby_feature_behaviors (uid, desc_self, ruuuby_features_id) VALUES (_behavior_uid, _desc_self, (ruuuby_feature_id(_feature_uid))); + INSERT INTO ruuuby_feature_behaviors (uid, desc_self, is_optional, ruuuby_features_id) VALUES + (_behavior_uid, _desc_self, _is_optional, (ruuuby_feature_id(_feature_uid))); END; $$; +-- --------------------------------------------------------------------------------------------------------------------- -- __ ___ __ -- / _` |__ |\/| /__` -- \__> |___ | | .__/ -CREATE OR REPLACE PROCEDURE ruuuby_gem_add(_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _env_dev BOOLEAN DEFAULT TRUE, _env_prod BOOLEAN DEFAULT FALSE, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ + +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_gem_add + (_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _env_dev BOOLEAN DEFAULT TRUE, _env_prod BOOLEAN DEFAULT FALSE, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ DECLARE gem_id BIGINT; val_gem_url TEXT := (SELECT 'https://rubygems.org/gems/' || _name AS result_url); ruuuby_id CONSTANT BIGINT := (SELECT ruuuby_release_id(_version_ruuuby)); BEGIN + CALL ruuuby_release_validate_syntax_version(_version_ruuuby); + INSERT INTO ruuuby_gems (name, env_dev, env_prod, ref_source, ref_version, url_gem) VALUES (_name, _env_dev, _env_prod, _ref_source, _ref_version, val_gem_url); SELECT ruuuby_gem_id(_name) INTO gem_id; INSERT INTO ruuuby_gem_changelogs (version_current, is_version_latest, ruuuby_gem_id, ruuuby_releases_id) VALUES (_version_current, TRUE, gem_id, ruuuby_id); END; $$; -CREATE OR REPLACE PROCEDURE ruuuby_gem_add_dev(_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_gem_add_dev + (_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ BEGIN CALL ruuuby_gem_add(_version_ruuuby, _name, _version_current, TRUE, FALSE, _ref_source, _ref_version, _git_url); END; $$; -CREATE OR REPLACE PROCEDURE ruuuby_gem_add_prod(_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_gem_add_prod + (_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ BEGIN CALL ruuuby_gem_add(_version_ruuuby, _name, _version_current, TRUE, TRUE, _ref_source, _ref_version, _git_url); END; $$; -CREATE OR REPLACE PROCEDURE ruuuby_gem_add_recommended(_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_gem_add_recommended + (_version_ruuuby TEXT, _name TEXT, _version_current TEXT, _ref_source TEXT DEFAULT NULL, _ref_version TEXT DEFAULT NULL, _git_url TEXT DEFAULT NULL) LANGUAGE plpgsql AS $$ BEGIN CALL ruuuby_gem_add(_version_ruuuby, _name, _version_current, FALSE, FALSE, _ref_source, _ref_version, _git_url); END; $$; -CREATE OR REPLACE PROCEDURE ruuuby_gem_update(_version_ruuuby text, _name text, _version_current text) LANGUAGE plpgsql AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_gem_update + (_version_ruuuby text, _name text, _version_current text) LANGUAGE plpgsql AS $$ DECLARE gem_id CONSTANT BIGINT := (SELECT ruuuby_gem_id(_name)); ruuuby_id CONSTANT BIGINT := (SELECT ruuuby_release_id(_version_ruuuby)); @@ -77,7 +173,10 @@ BEGIN INSERT INTO ruuuby_gem_changelogs (version_current, is_version_latest, ruuuby_gem_id, ruuuby_releases_id) VALUES (_version_current, TRUE, gem_id, ruuuby_id); END; $$; -CREATE OR REPLACE PROCEDURE ruuuby_gem_remove(_version_ruuuby text, _name text) LANGUAGE plpgsql AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE PROCEDURE ruuuby_gem_remove + (_version_ruuuby text, _name text) LANGUAGE plpgsql AS $$ DECLARE gem_id CONSTANT BIGINT := (SELECT ruuuby_gem_id(_name)); ruuuby_id CONSTANT BIGINT := (SELECT ruuuby_release_id(_version_ruuuby)); @@ -86,36 +185,49 @@ BEGIN INSERT INTO ruuuby_gem_changelogs (version_current, is_version_latest, ruuuby_gem_id, ruuuby_releases_id) VALUES ('REMOVE', TRUE, gem_id, ruuuby_id); END; $$; -CREATE OR REPLACE FUNCTION ruuuby_gem_id(_name TEXT) RETURNS BIGINT AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION ruuuby_gem_id + (_name TEXT) RETURNS BIGINT AS $$ BEGIN RETURN (SELECT id FROM ruuuby_gems WHERE name = _name LIMIT 1); END; $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION ruuuby_gem_latest_changelog_id(_name text) RETURNS BIGINT AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION ruuuby_gem_latest_changelog_id + (_name text) RETURNS BIGINT AS $$ BEGIN RETURN (SELECT MAX(id) FROM ruuuby_gem_changelogs WHERE ruuuby_gem_id = (SELECT ruuuby_gem_id(_name))); END; $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION ruuuby_gem_current_version(_name text) RETURNS TEXT AS $$ +-- --------------------------------------------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION ruuuby_gem_current_version + (_name text) RETURNS TEXT AS $$ BEGIN RETURN (SELECT version_current FROM ruuuby_gem_changelogs WHERE ruuuby_gem_id = (SELECT ruuuby_gem_id(_name)) ORDER BY id DESC LIMIT 1); END; $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION ruuuby_release_gem_changelogs (_release_version TEXT) +CREATE OR REPLACE FUNCTION ruuuby_release_gem_changelogs(_version_ruuuby TEXT) RETURNS TABLE ( version_current CHARACTER VARYING, version CHARACTER VARYING, name CHARACTER VARYING ) AS $$ BEGIN + CALL ruuuby_release_validate_syntax_version(_version_ruuuby); + RETURN QUERY SELECT rgc.version_current, rr.version, rg.name FROM ruuuby_gem_changelogs AS rgc JOIN ruuuby_releases AS rr ON rr.id = rgc.ruuuby_releases_id - AND rr.version = _release_version + AND rr.version = _version_ruuuby LEFT JOIN ruuuby_gems AS rg ON rg.id = rgc.ruuuby_gem_id ORDER BY rgc.id DESC; END; $$ LANGUAGE plpgsql; +-- --------------------------------------------------------------------------------------------------------------------- + CREATE OR REPLACE FUNCTION ruuuby_active_gems () RETURNS TABLE ( name CHARACTER VARYING, @@ -136,4 +248,6 @@ BEGIN ORDER BY rg.env_prod DESC, rg.env_dev DESC, rg.name ASC, q0.version_current; END; $$ LANGUAGE plpgsql; +-- --------------------------------------------------------------------------------------------------------------------- + COMMIT TRANSACTION; diff --git a/lib/ruuuby/db/migrations/rollout/01_env_vars.sql b/lib/ruuuby/db/migrations/rollout/01_env_vars.sql new file mode 100644 index 0000000..a752792 --- /dev/null +++ b/lib/ruuuby/db/migrations/rollout/01_env_vars.sql @@ -0,0 +1,33 @@ +--() { :; }; exec psql -f "$0" + +-- -------------------------------------------- ⚠️ -------------------------------------------- +-- testing purposes +-- -------------------------------------------- ⚠️ -------------------------------------------- + +BEGIN TRANSACTION; + +CREATE OR REPLACE FUNCTION env_var_group_id + (_group_name TEXT) RETURNS BIGINT AS $$ +BEGIN + RETURN (SELECT id FROM env_var_groups WHERE group_name = _group_name LIMIT 1); +END; $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION env_var_tier_id + (_tier_name TEXT) RETURNS BIGINT AS $$ +BEGIN + RETURN (SELECT id FROM env_var_tiers WHERE the_desc = _tier_name LIMIT 1); +END; $$ LANGUAGE plpgsql; + +CREATE OR REPLACE PROCEDURE env_var_add + (_group_name TEXT, _env_var_name TEXT, _desc TEXT) LANGUAGE plpgsql AS $$ +DECLARE + _group_id BIGINT := (SELECT env_var_group_id(_group_name)); +BEGIN + INSERT INTO env_vars (the_key, the_desc, env_var_groups_id) VALUES (_env_var_name, _desc, _group_id); +END; $$; + +-- env_var_tiers_id +-- _tiers_id +-- _tiers_id BIGINT := (SELECT env_var_tier_id(_tier_name)); + +COMMIT TRANSACTION; diff --git a/lib/ruuuby/db/migrations/ruuuby_gem.rb b/lib/ruuuby/db/migrations/ruuuby_gem.rb index 048fef9..56f4584 100644 --- a/lib/ruuuby/db/migrations/ruuuby_gem.rb +++ b/lib/ruuuby/db/migrations/ruuuby_gem.rb @@ -5,6 +5,7 @@ class CreateRuuubyGem < RuuubyDBMigration DB_FILE_NAME = '00_ruuuby_gem.sql' +=begin # @return [Boolean] def self.up_verify needed_funcs = %w(ruuuby_release_id ruuuby_feature_id ruuuby_feature_add ruuuby_release_add @@ -12,52 +13,59 @@ def self.up_verify ruuuby_gem_update ruuuby_gem_remove ruuuby_gem_id ruuuby_gem_latest_changelog_id ruuuby_gem_current_version ruuuby_release_gem_changelogs) - needed_tables = %w(ruuuby_releases ruuuby_features ruuuby_feature_behaviors ruuuby_gems ruuuby_gem_changelogs) - needed_funcs_found = !(needed_funcs.∀.any? {|elem| !self.∃⨍_sql?(elem)}) - needed_table_found = !(needed_tables.∀.any? {|elem| !self.∃table?(elem)}) - needed_funcs_found && needed_table_found end +=end def self.up + create_table :ruuuby_releases do |t| - t.string :version, :null => false - t.json :changelogs, :null => true + t.string :version, :null => false + t.json :changelogs, :null => true t.timestamp :dt_released, :null => true - t.index :version, unique: true + # meta-data + t.boolean :is_beta, :null => false + t.boolean :is_published, :null => true + t.bigint :gem_size, :null => true + + t.index :version, unique: true end - add_index :ruuuby_releases, :version, unique: true create_table :ruuuby_features do |t| - t.string :uid, :null => false, :unique => true + t.integer :uid, null: false, limit: 2 t.boolean :is_optional, :null => false - t.string :desc_self, :null => false, :unique => true + t.string :desc_self, :null => false, :unique => true + + t.index :uid, unique: true + t.index :desc_self, unique: true end - add_index :ruuuby_features, :uid, unique: true create_table :ruuuby_feature_behaviors do |t| - t.string :uid, :null => false, :unique => true - t.string :desc_self, :null => false, :unique => true - # TODO: t.boolean :is_optional, :null => false + t.integer :uid, null: false, limit: 2 + t.string :desc_self, :null => false + t.boolean :is_optional, :null => false t.references :ruuuby_features, foreign_key: { references: :ruuuby_features } - end - add_index :ruuuby_feature_behaviors, :uid, unique: true - # TODO: ruuuby_feature_groups - # TODO: ruuuby_feature_behaviors_ptrs + t.index :desc_self, unique: true + t.index [:uid, :ruuuby_features_id], unique: true + end create_table :ruuuby_gems do |t| - t.string :name, :null => false, :unique => true - t.text :url_gem, :null => true, :unique => true - t.text :url_git, :null => true, :unique => true + t.string :name, :null => false + t.text :url_gem, :null => true + t.text :url_git, :null => true t.boolean :env_dev, :null => false t.boolean :env_prod, :null => false t.string :ref_source, :null => true t.string :ref_version, :null => true #t.timestamps + + t.index :name, unique: true + t.index :url_gem, unique: true + t.index :url_git, unique: true end create_table :ruuuby_gem_changelogs do |t| @@ -81,13 +89,19 @@ def self.up def self.down ♻️index(:ruuuby_releases, :version) ♻️index(:ruuuby_features, :uid) - ♻️index(:ruuuby_feature_behaviors, :uid) - - ♻️table!(:ruuuby_gem_changelogs) - ♻️table!(:ruuuby_gems) - ♻️table!(:ruuuby_releases) - ♻️table!(:ruuuby_feature_behaviors) - ♻️table!(:ruuuby_features) + ♻️index(:ruuuby_features, :desc_self) + ♻️index(:ruuuby_feature_behaviors, :desc_self) + ♻️index(:ruuuby_feature_behaviors, [:desc_self, :ruuuby_features_id]) + + ♻️index(:ruuuby_gems, :name) + ♻️index(:ruuuby_gems, :url_gem) + ♻️index(:ruuuby_gems, :url_git) + + ♻️table(:ruuuby_gem_changelogs) + ♻️table(:ruuuby_gems) + ♻️table(:ruuuby_releases) + ♻️table(:ruuuby_feature_behaviors) + ♻️table(:ruuuby_features) execute(self.read_sql_rollback_file(DB_FILE_NAME)) end diff --git a/lib/ruuuby/db/migrations/seed/00_ruuuby_gem.sql b/lib/ruuuby/db/migrations/seed/00_ruuuby_gem.sql index 72df09f..300cc48 100644 --- a/lib/ruuuby/db/migrations/seed/00_ruuuby_gem.sql +++ b/lib/ruuuby/db/migrations/seed/00_ruuuby_gem.sql @@ -1,3 +1,4 @@ +--() { :; }; exec psql -f "$0" -- -------------------------------------------- ⚠️ -------------------------------------------- -- testing purposes @@ -68,6 +69,22 @@ CALL ruuuby_release_add('0.1.0.pre.1'); CALL ruuuby_release_add('0.1.0.pre.2'); CALL ruuuby_release_add('0.1.0.pre.3'); +--76.20% Ruby +--16.06% C +--3.85% JavaScript +--1.84% Dockerfile +--1.77% SQL +--0.18% Shell +--0.05% HTML +--0.04% CSS +CALL ruuuby_release_add('0.1.0.pre.4'); + +-- TODO: @see https://github.com/rbenv/rbenv/wiki/Authoring-plugins#rbenv-hooks +-- TODO: @see https://githooks.com/ +-- TODO: @see https://medium.com/@sairamkrish/git-branching-strategy-for-true-continuous-delivery-eade4435b57e +-- TODO: @see https://proandroiddev.com/how-to-set-up-an-efficient-development-workflow-with-git-and-ci-cd-5e8916f6bece +--CALL ruuuby_release_add('0.1.0.pre.5'); + -- ___ __ -- /'___\ /\ \__ -- /\ \__/ __ __ \ \ ,_\ __ __ _ __ __ ____ @@ -76,24 +93,23 @@ CALL ruuuby_release_add('0.1.0.pre.3'); -- \ \_\\ \____\ \__/.\_\\ \__\\ \____/\ \_\\ \____\/\____/ -- \/_/ \/____/\/__/\/_/ \/__/ \/___/ \/_/ \/____/\/___/ -CALL ruuuby_feature_add('f00', FALSE, '`η̂` to alias concept of `normalization` (offered in any applicable context)'); - +CALL ruuuby_feature_add(0::smallint, FALSE, 'utilize non-ascii to enable quicker to read code'); -CALL ruuuby_feature_add('f40', TRUE, 'provide an `API` for `Docker` operations w/ a light layer over gem{`docker-api`}'); -CALL ruuuby_feature_add('f41', TRUE, 'provide an `API` for `Brew` operations'); -CALL ruuuby_feature_add('f42', TRUE, 'provide an `API` for `RabbitMQ` operations w/ a light layer over gem{`bunny`}'); -CALL ruuuby_feature_add('f43', TRUE, 'provide an `API` for `Iconv`'); -CALL ruuuby_feature_add('f44', TRUE, 'provide an `API` for `ZSH`'); -CALL ruuuby_feature_add('f46', TRUE, 'provide an `API` for `Bundler`'); -CALL ruuuby_feature_add('f47', TRUE, 'provide an `API` for `Gem`'); +CALL ruuuby_feature_add(40::smallint, TRUE, 'provide an `API` for `Docker` operations w/ a light layer over gem{`docker-api`}'); +CALL ruuuby_feature_add(41::smallint, TRUE, 'provide an `API` for `Brew` operations'); +CALL ruuuby_feature_add(42::smallint, TRUE, 'provide an `API` for `RabbitMQ` operations w/ a light layer over gem{`bunny`}'); +CALL ruuuby_feature_add(43::smallint, TRUE, 'provide an `API` for `Iconv`'); +CALL ruuuby_feature_add(44::smallint, TRUE, 'provide an `API` for `ZSH`'); +CALL ruuuby_feature_add(46::smallint, TRUE, 'provide an `API` for `Bundler`'); +CALL ruuuby_feature_add(47::smallint, TRUE, 'provide an `API` for `Gem`'); -CALL ruuuby_feature_add('f92', TRUE, 'enable building with specific DB support loaded'); -CALL ruuuby_feature_add('f93', TRUE, 'offer help in managing custom scripts, functionality, and anything else needed for too niche of scenarios to consider adding as a feature or even a conditionally-loadable feature'); -CALL ruuuby_feature_add('f94', TRUE, 'enable a `WebAssembly` based build (for `JS`/`WebGL`)'); -CALL ruuuby_feature_add('f95', TRUE, 'enable a pure `Ruby` only build'); -CALL ruuuby_feature_add('f96', TRUE, 'support multiple Operation Systems'); -CALL ruuuby_feature_add('f97', TRUE, 'offer custom builds of `Ruuuby` to support only the needed/wanted unicode/symbols/emojis etc'); -CALL ruuuby_feature_add('f98', FALSE, '`C-extensions`'); +CALL ruuuby_feature_add(92::smallint, TRUE, 'enable building with specific DB support loaded'); +CALL ruuuby_feature_add(93::smallint, TRUE, 'offer help in managing custom scripts, functionality, and anything else needed for too niche of scenarios to consider adding as a feature or even a conditionally-loadable feature'); +CALL ruuuby_feature_add(94::smallint, TRUE, 'enable a `WebAssembly` based build (for `JS`/`WebGL`)'); +CALL ruuuby_feature_add(95::smallint, TRUE, 'enable a pure `Ruby` only build'); +CALL ruuuby_feature_add(96::smallint, TRUE, 'support multiple Operation Systems'); +CALL ruuuby_feature_add(97::smallint, TRUE, 'offer custom builds of `Ruuuby` to support only the needed/wanted unicode/symbols/emojis etc'); +CALL ruuuby_feature_add(98::smallint, FALSE, '`C-extensions`'); -- __ __ -- /\ \ /\ \ __ @@ -103,22 +119,27 @@ CALL ruuuby_feature_add('f98', FALSE, '`C-extensions`'); -- \ \_,__/\ \____\\ \_\ \_\ \__/.\_\\ \___/ \ \_\ \____/\ \_\\/\____/ -- \/___/ \/____/ \/_/\/_/\/__/\/_/ \/__/ \/_/\/___/ \/_/ \/___/ -CALL ruuuby_feature_behavior_add('f00', 'b00', 'create func{η̂!} for class(`Array`)'); - -CALL ruuuby_feature_behavior_add('f01', 'b00', 'supports mode: none (empty methods called for logging)'); -CALL ruuuby_feature_behavior_add('f01', 'b01', 'supports mode: stdout (log to console)'); -CALL ruuuby_feature_behavior_add('f01', 'b02', 'supports mode: stderr (log only errors to console)'); -CALL ruuuby_feature_behavior_add('f01', 'b03', 'supports mode: file (standard Ruby log file logging)'); -CALL ruuuby_feature_behavior_add('f01', 'b04', 'supports setting the logging level'); -CALL ruuuby_feature_behavior_add('f01', 'b05', 'supports running a hybrid of logging modes'); - -CALL ruuuby_feature_behavior_add('f92', 'b00', 'enable support for ActiveRecord'); -CALL ruuuby_feature_behavior_add('f92', 'b01', 'enable support for pg for PostgreSQL'); ---CALL ruuuby_feature_behavior_add('f92', 'b02', 'enable support for SQLite3'); - -CALL ruuuby_feature_behavior_add('f98', 'b00', 'dynamically add `macros` w/ `mkmf` in order to (during pre-processing) include/exclude feature-code to be compiled w/ or w/o'); -CALL ruuuby_feature_behavior_add('f98', 'b01', 'offer (to `Ruuuby`) access to `C` math functions, especially those involving higher precision'); -CALL ruuuby_feature_behavior_add('f98', 'b02', 'simplify import/require statements & setup as much as possible'); +CALL ruuuby_feature_behavior_add(0::smallint, 0::smallint, FALSE, '`η̂` to alias concept of `normalization`'); +CALL ruuuby_feature_behavior_add(0::smallint, 1::smallint, FALSE, '`∅` to alias concept of `empty`'); +CALL ruuuby_feature_behavior_add(0::smallint, 2::smallint, FALSE, '`∃` to alias concept of `does this(arg) exist?` and `∄` for inverse meaning'); +CALL ruuuby_feature_behavior_add(0::smallint, 3::smallint, FALSE, '`𝔠` to alias concept of `cardinality`'); +CALL ruuuby_feature_behavior_add(0::smallint, 4::smallint, TRUE, '`📅` to alias Class{`Date`}, `🕒` for{`🕒`}, and `📅🕒` for{`DateTime`}'); +CALL ruuuby_feature_behavior_add(0::smallint, 5::smallint, TRUE, '`📁` to alias Class{`File`} and `🗄️` for{`Dir`}'); + +CALL ruuuby_feature_behavior_add(1::smallint, 0::smallint, TRUE, 'supports mode: none (empty methods called for logging)'); +CALL ruuuby_feature_behavior_add(1::smallint, 1::smallint, TRUE, 'supports mode: stdout (log to console)'); +CALL ruuuby_feature_behavior_add(1::smallint, 2::smallint, TRUE, 'supports mode: stderr (log only errors to console)'); +CALL ruuuby_feature_behavior_add(1::smallint, 3::smallint, TRUE, 'supports mode: file (standard Ruby log file logging)'); +CALL ruuuby_feature_behavior_add(1::smallint, 4::smallint, TRUE, 'supports setting the logging level'); +CALL ruuuby_feature_behavior_add(1::smallint, 5::smallint, TRUE, 'supports running a hybrid of logging modes'); + +CALL ruuuby_feature_behavior_add(92::smallint, 0::smallint, TRUE, 'enable support for ActiveRecord'); +CALL ruuuby_feature_behavior_add(92::smallint, 1::smallint, TRUE, 'enable support for pg for PostgreSQL'); + +-- TODO: refactor-ish +CALL ruuuby_feature_behavior_add(98::smallint, 0::smallint, FALSE, 'dynamically add `macros` w/ `mkmf` in order to (during pre-processing) include/exclude feature-code to be compiled w/ or w/o'); +CALL ruuuby_feature_behavior_add(98::smallint, 1::smallint, FALSE, 'offer (to `Ruuuby`) access to `C` math functions, especially those involving higher precision'); +CALL ruuuby_feature_behavior_add(98::smallint, 2::smallint, FALSE, 'simplify import/require statements & setup as much as possible'); -- | f98 | OpenAI | https://github.blog/2020-07-27-introducing-githubs-openapi-description/ | -- | f98 | OpenAI | https://github.com/OAI/OpenAPI-Specification | -- | f98 | WebGL | https://webgl2fundamentals.org/webgl/lessons/webgl-anti-patterns.html | @@ -186,12 +207,11 @@ CALL ruuuby_gem_update('0.1.0.pre.2', 'activerecord', '6.1.0.rc1'); CALL ruuuby_gem_add_dev('0.1.0.pre.3', 'open3', '0.1.0'); --- --------------------------------------------------------------------------------------------------------------------- - -INSERT INTO ruuuby_tags (name) VALUES ('finance'); -INSERT INTO ruuuby_tags (name) VALUES ('dev-tool'); -INSERT INTO ruuuby_tags (name) VALUES ('dev-url'); +CALL ruuuby_gem_update('0.1.0.pre.4', 'activerecord', '6.0.3.4'); +CALL ruuuby_gem_add_recommended('0.1.0.pre.4', 'keycutter', '1.0.2', '::Keycutter', '::VERSION', NULL); +CALL ruuuby_gem_add_recommended('0.1.0.pre.4', 'github-linguist', '7.12.0', '::Linguist', '::VERSION', NULL); +CALL ruuuby_gem_add_recommended('0.1.0.pre.4', 'rails', '6.0.3.4', '::Rails', '.version', NULL); -INSERT INTO ruuuby_resource_types (name) VALUES ('URL'); +-- --------------------------------------------------------------------------------------------------------------------- COMMIT TRANSACTION; diff --git a/lib/ruuuby/db/migrations/seed/01_env_vars.sql b/lib/ruuuby/db/migrations/seed/01_env_vars.sql new file mode 100644 index 0000000..342262f --- /dev/null +++ b/lib/ruuuby/db/migrations/seed/01_env_vars.sql @@ -0,0 +1,54 @@ +--() { :; }; exec psql -f "$0" + +-- -------------------------------------------- ⚠️ -------------------------------------------- +-- testing purposes +-- -------------------------------------------- ⚠️ -------------------------------------------- + +BEGIN TRANSACTION; + +INSERT INTO env_var_tiers + (the_desc,tier_err_if_missing,tier_optional,tier_ignore,tier_err_if_present) +VALUES + ('tier_err_if_missing',TRUE,FALSE,FALSE,FALSE), + ('tier_optional',FALSE,TRUE,FALSE,FALSE), + ('tier_ignore',FALSE,FALSE,TRUE,FALSE), + ('tier_err_if_present',FALSE,FALSE,FALSE,TRUE); + +INSERT INTO env_var_groups (group_name) VALUES + ('rbenv'), + ('ruuuby_compiling'), + ('brew'), + ('docker'); + +-- --------------------------------------------------------------------------------------------------------------------- +-- @see https://github.com/rbenv/rbenv +--CALL env_var_add('rbenv', 'tier_err_if_present', 'RBENV_VERSION', 'specifies version of Ruby to be used, overrides global & application-specific version'); +--CALL env_var_add('rbenv', 'tier_err_if_missing', 'RBENV_ROOT', 'specifies location for Ruby versions and shims'); +--CALL env_var_add('rbenv', 'tier_optional', 'RBENV_DEBUG', 'add verbose debug info'); + +-- TODO: look into utilizing +--CALL env_var_add('rbenv', 'tier_optional', 'RBENV_HOOK_PATH', 'list of paths searched against for rbenv hooks'); +--CALL env_var_add('rbenv', 'tier_err_if_present', 'RBENV_DIR', 'directory starting path to search for `.ruby-version` files'); +-- --------------------------------------------------------------------------------------------------------------------- + +--CALL env_var_add('ruuuby_compiling', 'ARCHFLAGS', 'specifies the OS architecture to compile/run for'); + +-- TODO: add tests ensuring these have an effect (for 3.0.0preview1 specifically) +--CALL env_var_add('ruuuby_compiling', 'RUBY_GC_HEAP_INIT_SLOTS', ''); +--CALL env_var_add('ruuuby_compiling', 'RUBY_GC_HEAP_FREE_SLOTS', ''); +--CALL env_var_add('ruuuby_compiling', 'RUBY_GC_HEAP_GROWTH_FACTOR', ''); +--CALL env_var_add('ruuuby_compiling', 'RUBY_GC_HEAP_GROWTH_MAX_SLOTS', ''); +--CALL env_var_add('ruuuby_compiling', 'RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO', ''); +--CALL env_var_add('ruuuby_compiling', 'RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO', ''); +--CALL env_var_add('ruuuby_compiling', 'RUBY_GC_MALLOC_LIMIT_MAX', ''); + +--CALL env_var_add('brew', 'HOMEBREW_NO_ANALYTICS', 'toggle for homebrew analytics'); + +--CALL env_var_add('docker', 'DOCKER_API_VERSION', ''); +--CALL env_var_add('docker', 'COMPOSE_API_VERSION', ''); +--CALL env_var_add('docker', 'COMPOSE_CONVERT_WINDOWS_PATHS', ''); +--CALL env_var_add('docker', 'COMPOSE_FORCE_WINDOWS_HOST', ''); +--CALL env_var_add('docker', 'COMPOSE_PATH_SEPARATOR', ''); +--CALL env_var_add('docker', 'COMPOSE_PROJECT_NAME', ''); + +COMMIT TRANSACTION diff --git a/lib/ruuuby/db/seeds/ruuuby_dirs.rb b/lib/ruuuby/db/seeds/ruuuby_dirs.rb deleted file mode 100644 index 6c31e17..0000000 --- a/lib/ruuuby/db/seeds/ruuuby_dirs.rb +++ /dev/null @@ -1,14 +0,0 @@ -# encoding: UTF-8 - -dir_base = ::RuuubyDir.spawn(💎.engine.path_base, 'ruuuby', false) -@dir_ext = dir_base.spawn_dir('ext/', 'ext', false) -@dir_ext_ruby_class_mods = @dir_ext.spawn_dir('ruby_class_mods/', 'ruby_class_mods', false) -@dir_db = dir_base.spawn_dir('db/', 'db', false) -@dir_seeds = @dir_db.spawn_dir('seeds/', 'seeds', false) -@dir_seeds_ruuuby_releases = @dir_seeds.spawn_dir('ruuuby_releases/', 'ruuuby_releases', false) -dir_base.spawn_file('.gitignore', 'gitignore', '', false) -dir_base.spawn_file('.gitattributes', 'gitattributes', '', false) -@ruuuby_gemspec = dir_base.spawn_file('ruuuby.gemspec', 'ruuuby', '.gemspec', false) -dir_base.spawn_file('Rakefile', 'Rakefile', '', false) -dir_base.spawn_file('Gemfile', 'Gemfile', '', false) -@ruuuby_readme = dir_base.spawn_file('README.md', 'README', '.md', false) diff --git a/lib/ruuuby/db/seeds/ruuuby_feature_behaviors.rb b/lib/ruuuby/db/seeds/ruuuby_feature_behaviors.rb index ae89bb0..7e5c82d 100644 --- a/lib/ruuuby/db/seeds/ruuuby_feature_behaviors.rb +++ b/lib/ruuuby/db/seeds/ruuuby_feature_behaviors.rb @@ -1,13 +1,5 @@ # encoding: UTF-8 -@f04.spawn_behaviors( - [ - 'Enumerable classes{ex: `Array`, `Set`, `String` have func{`∅?`}', - "'class' ENV and class{NilClass} have func{`∅?`}", - 'classes: `File` & `Dir` have func{`∅?`}' # TODO: create a way to mark this behavior as hybrid/relating to feature 12 - ] -) - @f05.spawn_behaviors(['offer func{>>} to class(`Array`)', 'offer func{>>} to class(`String`)']) @f06.spawn_behaviors( @@ -47,7 +39,6 @@ @f11.spawn_behaviors(['create module{SetTheory}', 'create class{Closure}', 'create class{NumberSet}']) @f12.spawn_behaviors([ - 'offer Class aliases: {`📁` -> `File`}, {`🗄️` -> `Dir`}', "offer a light layer over `Ruby's` loadable `CSV` data parsing", "offer a light layer over `Ruby's` loadable `YAML` data parsing", 'offer regular expression checks for valid file & dir paths' @@ -76,12 +67,6 @@ ] ) -@f26.spawn_behaviors( - [ - 'offer Class aliases: {`📅` -> `Date`}, {`🕒` -> `Time`}, {`📅🕒` -> `DateTime`}|{OPTIONAL}' - ] -) - @f27.spawn_behaviors( [ 'has additive identity{0} and multiplicative identity{1}', diff --git a/lib/ruuuby/db/seeds/ruuuby_features.rb b/lib/ruuuby/db/seeds/ruuuby_features.rb index 0e80543..252dcd8 100644 --- a/lib/ruuuby/db/seeds/ruuuby_features.rb +++ b/lib/ruuuby/db/seeds/ruuuby_features.rb @@ -2,8 +2,6 @@ @f01 = ::RuuubyFeature.spawn(1, 'simplify debugging state & logging through the `RuuubyEngine`', 2, %w(ruuuby engine logging logs log)) @f02 = ::RuuubyFeature.spawn(2, 'augment working with other `API` sets, be it a small `CLI script` to larger `domain-driven/micro-services` representations', 2, %w(ruuuby engine cli)) -@f03 = ::RuuubyFeature.spawn(3, "`𝔠` to alias concept of `cardinality`", 2, %w()) -@f04 = ::RuuubyFeature.spawn(4, '`∅` to alias concept of `empty`', 2, %w()) @f05 = ::RuuubyFeature.spawn(5, '`>>` to offer reverse functionality of `<<`', 4, %w(str ary >> <<)) @f06 = ::RuuubyFeature.spawn(6, 'offer easy to use type-check funcs for common/core Classes (ex: `variable.int?`)', 1, %w()) @f07 = ::RuuubyFeature.spawn(7, 'offer layer of functionality to easily describe & check various meta-data on Ruby', 1, %w()) @@ -12,7 +10,6 @@ @f10 = ::RuuubyFeature.spawn(10, 'offer special character aliases for natural ease of readability', 2, %w()) @f11 = ::RuuubyFeature.spawn(11, 'abstract `SetTheory` and offer discrete singleton objs which reference various groups of numbers', 2, %w(math set-theory)) @f12 = ::RuuubyFeature.spawn(12, 'enable more simple `file/directory io`', 2, %w(io file dir)) -@f13 = ::RuuubyFeature.spawn(13, '`∃` to alias concept of `does this(arg) exist?` and `∄` to mean inverse: `does this(arg) not exist?`', 2, %w()) @f14 = ::RuuubyFeature.spawn(14, 'enable easier catching and throwing of parameter type errors', 2, %w()) @f15 = ::RuuubyFeature.spawn(15, 'enable quicker tracking and auditing of features across versions', 2, %w()) @f16 = ::RuuubyFeature.spawn(16, 'for specific classes, patch in the operation of raising to an exponent, using operator(`^`) w/ `superscripts`', 2, %w()) @@ -28,7 +25,7 @@ @f26 = ::RuuubyFeature.spawn(26, 'enable more simple syntax parsing for `ISO8601` and other time operations', 1, %w()) @f27 = ::RuuubyFeature.spawn(27, 'add new class (`ThetaAngle`) for easier operations involving angles', 2, %w()) @f28 = ::RuuubyFeature.spawn(28, 'formally support various math constants & equations (ex: aliasing the golden-ratio w/ (`𝚽`)', 2, %w(math geometry symbolic-math)) -@f29 = ::RuuubyFeature.spawn(29, 'add new class (`Quaternion`) for easier operations involving `quaternions`', 0, %w(math linear-algebra Quaternion)) + @f30 = ::RuuubyFeature.spawn(30, 'mimic `SetTheory` by creating data-type groupings for Ruby data', 2, %w()) @f31 = ::RuuubyFeature.spawn(31, 'provide an `API` for `GIT` operations w/ a light layer over gem{`rugged`}', 2, %w(ruuuby engine git api)) @f32 = ::RuuubyFeature.spawn(32, 'abstract `NumberTheory`; offering static math functions', 2, %w(math number-theory)) diff --git a/lib/ruuuby/env.rb b/lib/ruuuby/env.rb index cc799fe..6c29dd7 100644 --- a/lib/ruuuby/env.rb +++ b/lib/ruuuby/env.rb @@ -8,6 +8,11 @@ class << ENV alias :∀🔑 :each_key alias :∀ :each + alias :∃? :has_key? + + # @return [Boolean] true if the provided{`key`} does not exist + def ∄?(key); !(self.∃?(key)); end + def cache; if @cache == nil; @cache = ENV.to_hash; end; @cache; end # `does each provided key exist w/ the the same provided value?` @@ -18,16 +23,6 @@ def cache; if @cache == nil; @cache = ENV.to_hash; end; @cache; end # @return [Boolean] def ∀🔑∃_value?(keys_to_find, expected_value); self.cache.∀🔑∃_value?(keys_to_find, expected_value); end - # @param [String] the_key - # - # @raise [ArgumentError] if the provided arg(the_key) is not of type +String+ - # - # @return [Boolean] true, if there exists an ENV_VAR w/ matching name - def ∃?(the_key) - 🛑str❓('the_key', the_key) - self.has_key?(the_key) - end - # @param [*] env_key_then_opts # # @raise [RuntimeError] when provided 1 arg and the key DNE diff --git a/lib/ruuuby/feature_lazy_loader.rb b/lib/ruuuby/feature_lazy_loader.rb index 8fceca0..569e87f 100644 --- a/lib/ruuuby/feature_lazy_loader.rb +++ b/lib/ruuuby/feature_lazy_loader.rb @@ -12,37 +12,39 @@ # \/_/ # ===================================================================================================================== -if 💎.engine.stats_ext['F10_B04'] - ::Method.alias_method :🏠, :source_location -end +feature_configs = 💎.engine.stats_ext -if 💎.engine.stats_ext['F12_B00'] +if feature_configs['F00_B04'] class ::Object # @return [Date] - def 📁; ::File; end + def 📅; ::Date; end - # @return [Dir] - def 🗄️; ::Dir; end + # @return [Time] + def 🕒; ::Time; end + # @return [DateTime] + def 📅🕒; ::DateTime; end end end -if 💎.engine.stats_ext['F26_B00'] +if feature_configs['F00_B05'] class ::Object - # @return [Date] - def 📅; ::Date; end + # @return [File] + def 📁; ::File; end - # @return [::Time] - def 🕒; ::Time; end + # @return [Dir] + def 🗄️; ::Dir; end - # @return [::DateTime] - def 📅🕒; ::DateTime; end end end -if 💎.engine.stats_ext['F28_B09'] +if feature_configs['F10_B04'] + ::Method.alias_method :🏠, :source_location +end + +if feature_configs['F28_B09'] class ::Object # @return [Float] +Float::ONE_HALF+ @@ -237,3 +239,63 @@ def ∞ℂ; ::Float::INFINITY_COMPLEX; end # ----------------------------------------------------------------------------------------------------------------- end + +# ===================================================================================================================== +# __ +# __ __ /\ \__ __ +# /\_\ ___ ___ ___ /\_\ __ _ __ __ \ \ ,_\/\_\ ___ ___ +# \/\ \ /' _ `\ /' __` __`\/\ \ /'_ `\/\`'__\/'__`\ \ \ \/\/\ \ / __`\ /' _ `\ +# \ \ \/\ \/\ \ /\ \/\ \/\ \ \ \/\ \L\ \ \ \//\ \L\.\_\ \ \_\ \ \/\ \L\ \/\ \/\ \ +# \ \_\ \_\ \_\ \ \_\ \_\ \_\ \_\ \____ \ \_\\ \__/.\_\\ \__\\ \_\ \____/\ \_\ \_\ +# \/_/\/_/\/_/ \/_/\/_/\/_/\/_/\/___L\ \/_/ \/__/\/_/ \/__/ \/_/\/___/ \/_/\/_/ +# /\____/ +# \_/__/ +# ===================================================================================================================== + +module ::Kernel + + # @type [Float] + Ω = ::Float::CONST_OMEGA + + # TODO: https://en.wikipedia.org/wiki/Golden_spiral + # TODO: https://en.wikipedia.org/wiki/Polar_coordinate_system + # TODO: https://en.wikipedia.org/wiki/Euler%27s_formula + + 𝔹 = ::Math::SetTheory::BooleanNumbers.instance + + ℕ = ::Math::SetTheory::NaturalNumbers.instance + + 𝕎 = ::Math::SetTheory::WholeNumbers.instance + + ℤ = ::Math::SetTheory::IntegerNumbers.instance + + ℚ = ::Math::SetTheory::RationalNumbers.instance + + 𝔸ᵣ = ::Math::SetTheory::RealAlgebraicNumbers.instance + + 𝔸 = ::Math::SetTheory::AlgebraicNumbers.instance + + ℂ = ::Math::SetTheory::ComplexNumbers.instance + + #𝕋 = ::Math::GroupTheory::CircleGroup.instance + + 𝕀 = ::Math::SetTheory::IrrationalNumbers.instance + + ℝ = ::Math::SetTheory::RealNumbers.instance + + 𝕌 = ::Math::SetTheory::UniversalSet.instance + + ::Kernel.const_set(:𝕊, ::Math::Space::SymbolicNumbers.instance) + + ::Kernel.const_set(:🅱, ::Math::Space::BooleanSpace.instance) + + 🙈 + + def 🧬; ::Math::Space::NucleotideSpace.instance; end + + def 🔢; ::Math::Space::NumberSpace.instance; end + + def ∅; ::Math::SetTheory::EmptySet.instance; end + + def 𝕚; ::Math::SetTheory::ImaginaryNumbers.instance; end +end diff --git a/lib/ruuuby/math/stats/probability.rb b/lib/ruuuby/math/stats/probability.rb index 7ec2740..8c1ef83 100644 --- a/lib/ruuuby/math/stats/probability.rb +++ b/lib/ruuuby/math/stats/probability.rb @@ -3,6 +3,15 @@ # `ProbabilityTheory` # # relatively focuses more on `events` that can occur in `sample spaces` -module ::Math::Stats::Probability +module ::Math::Stats + # TODO: https://en.wikipedia.org/wiki/Probability_density_function + module Probability + module Hypothesis + + # TODO: chi squared + + end + end + end diff --git a/lib/ruuuby/math/stats/stats.rb b/lib/ruuuby/math/stats/stats.rb index dad2b42..f345256 100644 --- a/lib/ruuuby/math/stats/stats.rb +++ b/lib/ruuuby/math/stats/stats.rb @@ -3,6 +3,8 @@ # mathematics related code module ::Math::Stats + + # ‣ notice: all data points share equal weight # ‣ thus it does NOT take into account the `evenness` of the data # diff --git a/lib/ruuuby/module/module.rb b/lib/ruuuby/module/module.rb index b28e6b2..b7cc4ab 100644 --- a/lib/ruuuby/module/module.rb +++ b/lib/ruuuby/module/module.rb @@ -1,6 +1,6 @@ # encoding: UTF-8 -# add various aliases & functions to existing class{+Module+} +# `Ruuuby` modifications to existing class{+Module+} class ::Module # ---------------------------------------------------------------------------------------------------------- | *f10* | alias_method :∃const?, :const_defined? @@ -11,27 +11,4 @@ class ::Module alias_method :🛡️, :protected alias_method :∃🛡️⨍?, :protected_method_defined? # ---------------------------------------------------------------------------------------------------------- | *f13* | - - # @param [Symbol] func_name - # @param [Symbol] alias_name - # - # @raise [ArgumentError] - # - # @return [Boolean] true, if this instance of Module has a function with provided name and alias - def ∃⨍_alias?(func_name, alias_name) - 🛑syms❓([func_name, alias_name]) - (self.instance_methods.include?(func_name) && self.instance_methods.include?(alias_name)) ? self.instance_method(func_name) == self.instance_method(alias_name) : false - end - - # @param [Symbol] func_name - # - # @raise [ArgumentError] - # - # @return [Boolean] true, if this object's Class has either a public or private method with matching func_name - def ∃⨍?(func_name) - 🛑sym❓('func_name', func_name) - self.method_defined?(func_name) ? true : self.∃🙈⨍?(func_name) - end - - # | ------------------------------------------------------------------------------------------------------------------ end diff --git a/lib/ruuuby/ruuuby/api/api_locale.rb b/lib/ruuuby/ruuuby/api/api_locale.rb index 2b1b377..a989c7b 100644 --- a/lib/ruuuby/ruuuby/api/api_locale.rb +++ b/lib/ruuuby/ruuuby/api/api_locale.rb @@ -10,7 +10,7 @@ module ::Ruuuby::MetaData # TODO: document https://gist.github.com/barnes7td/3804534 # # `💎.engine.api_locale` - class LocaleAPI < ::Ruuuby::MetaData::EngineComponentAPI + class LocaleAPI < ::Ruuuby::MetaData::EngineComponent def initialize(engine) super(engine) diff --git a/lib/ruuuby/ruuuby/api/f43_api_iconv.rb b/lib/ruuuby/ruuuby/api/f43_api_iconv.rb index 63e4923..61ee05c 100644 --- a/lib/ruuuby/ruuuby/api/f43_api_iconv.rb +++ b/lib/ruuuby/ruuuby/api/f43_api_iconv.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 module ::Ruuuby::MetaData - class LocaleAPI < ::Ruuuby::MetaData::EngineComponentAPI + class LocaleAPI < ::Ruuuby::MetaData::EngineComponent # @return [Ruuuby::MetaData::IconvAPI] def api_iconv; @api_iconv = ::Ruuuby::MetaData::IconvAPI.new(@engine) if @api_iconv.∅?; @api_iconv; end end diff --git a/lib/ruuuby/ruuuby/api/git/api_git.rb b/lib/ruuuby/ruuuby/api/git/api_git.rb index 8391be1..31176fe 100644 --- a/lib/ruuuby/ruuuby/api/git/api_git.rb +++ b/lib/ruuuby/ruuuby/api/git/api_git.rb @@ -36,6 +36,8 @@ module ::Ruuuby::MetaData # | | | | # | TODO: (libgit2) | https://libgit2.org/docs/guides/101-samples/ | | # | TODO: (libgit2) | https://git-scm.com/book/en/v2/Appendix-B%3A-Embedding-Git-in-your-Applications-Libgit2 | | + # | | | + # | TODO: https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-rubygems-for-use-with-github-packages \ # -------------------------------------------------------------------------------------------------------------------------------------------- # # terminology: diff --git a/lib/ruuuby/ruuuby/engine/component/api.rb b/lib/ruuuby/ruuuby/engine/component/api.rb deleted file mode 100644 index 9863ee3..0000000 --- a/lib/ruuuby/ruuuby/engine/component/api.rb +++ /dev/null @@ -1,20 +0,0 @@ -# encoding: UTF-8 - -# information and utilities that define and work w/ aspects of `Ruuuby` -module ::Ruuuby::MetaData - - class EngineComponentAPI < ::Ruuuby::MetaData::EngineComponent - - # @param [*] engine - def initialize(engine) - super(engine) - end - - # @return [String] - def version - @cached_version = self._calculate_version if @cached_version.∅? - @cached_version - end - - end -end diff --git a/lib/ruuuby/ruuuby/engine/component/api_cli.rb b/lib/ruuuby/ruuuby/engine/component/api_cli.rb index 9a46ceb..be83e61 100644 --- a/lib/ruuuby/ruuuby/engine/component/api_cli.rb +++ b/lib/ruuuby/ruuuby/engine/component/api_cli.rb @@ -2,7 +2,7 @@ # information and utilities that define and work w/ aspects of `Ruuuby` module ::Ruuuby::MetaData - class EngineComponentAPICLI < ::Ruuuby::MetaData::EngineComponentAPI + class EngineComponentAPICLI < ::Ruuuby::MetaData::EngineComponent attr_reader :cmd_start @@ -16,9 +16,6 @@ def initialize(engine, cmd_start) @cmd_start = cmd_start end - # @return [String, Array] - def _calculate_version; self.run_cmd('--version'); end - # @param [String] cmd # @param [String] output def executed_cmd_returned_expected_output(cmd, output) diff --git a/lib/ruuuby/ruuuby/ruuuby_api.rb b/lib/ruuuby/ruuuby/ruuuby_api.rb index 1afba2e..c2ee6ee 100644 --- a/lib/ruuuby/ruuuby/ruuuby_api.rb +++ b/lib/ruuuby/ruuuby/ruuuby_api.rb @@ -13,7 +13,7 @@ module ::Ruuuby::MetaData # | pty | pseudo-teletype | "device entry that acts like a terminal to the process performing I/O, but is managed by something else" # # `💎.engine.api` - class RuuubyAPI < ::Ruuuby::MetaData::EngineComponentAPI + class RuuubyAPI < ::Ruuuby::MetaData::EngineComponent # @param [*] engine # @param [Integer] default_timeout diff --git a/lib/ruuuby/ruuuby/ruuuby_orm.rb b/lib/ruuuby/ruuuby/ruuuby_orm.rb index 184cd0f..ef0a293 100644 --- a/lib/ruuuby/ruuuby/ruuuby_orm.rb +++ b/lib/ruuuby/ruuuby/ruuuby_orm.rb @@ -4,7 +4,7 @@ # `💎.engine.orm` module Ruuuby::MetaData - class RuuubyORM < ::Ruuuby::MetaData::EngineComponentAPI + class RuuubyORM < ::Ruuuby::MetaData::EngineComponent attr_reader :db_orm diff --git a/lib/ruuuby/version.rb b/lib/ruuuby/version.rb index e822767..088895a 100644 --- a/lib/ruuuby/version.rb +++ b/lib/ruuuby/version.rb @@ -3,11 +3,5 @@ # +Ruuuby+ module ::Ruuuby # @type [String] the version of Gem(*ruuuby*) reflected in this source code - VERSION = '0.1.0.pre.3'.freeze - - # @type [String] the version of Ruby utilized and minimum required - VERSION_RUBY = ::Gem.ruby_version.to_s.freeze - - # @type [String] the version of Gem{*rubygem-update*} utilized and recommended - VERSION_BUNDLER = '3.2.0.rc.2'.freeze + VERSION = '0.1.0.pre.4'.freeze end diff --git a/ruuuby.gemspec b/ruuuby.gemspec index 5f28b77..fe7a79c 100644 --- a/ruuuby.gemspec +++ b/ruuuby.gemspec @@ -3,6 +3,10 @@ ::Gem::Specification.new do |gem| require_relative 'lib/ruuuby/version' + # TODO: temp solution (for local testing) + required_ruby_version = ::Gem.ruby_version.to_s + required_ruby_version = '2.7.1' if required_ruby_version == '2.7.1.83' + gem.name = 'ruuuby' gem.version = ::Ruuuby::VERSION gem.summary = 'migration wip' @@ -10,9 +14,9 @@ gem.authors = ["Uladzislau Tarsunou"] gem.homepage = 'https://github.com/utarsuno/ruuuby' gem.license = 'MIT' - gem.required_ruby_version = ">= #{::Ruuuby::VERSION_RUBY}" - gem.required_rubygems_version = ">= #{::Ruuuby::VERSION_BUNDLER}" - gem.installed_by_version = ::Ruuuby::VERSION_BUNDLER + gem.required_ruby_version = ">= #{required_ruby_version}" + gem.required_rubygems_version = ">= #{::Gem::VERSION}" + gem.installed_by_version = ::Gem::VERSION gem.platform = ::Gem::Platform.local gem.post_install_message = "Gem{ruuuby, v#{::Ruuuby::VERSION}} has just been installed, cheers!" @@ -30,6 +34,7 @@ ] gem.bindir = 'bin' + # TODO: (will be included in .gem once all optional and/or non-Ruuuby related tests are moved into services based directories) # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. #gem.files = Dir.chdir(File.expand_path('..', __FILE__)) do @@ -53,8 +58,18 @@ gem.add_development_dependency(:'rake-compiler', '~> 1.1.1') gem.add_development_dependency(:'tty-command', '~> 0.10.0') gem.add_development_dependency(:finite_machine, '~> 0.14.0') + gem.add_development_dependency(:pg, '~> 1.2.3') - gem.add_development_dependency(:activerecord, '~> 6.1.0.rc1') + gem.add_development_dependency(:activerecord, '~> 6.0.3.4') + + # TODO: temp solution (for local testing) + unless required_ruby_version.start_with?('3') + gem.add_development_dependency(:rugged, '~> 1.1.0') + gem.add_development_dependency(:'github-linguist', '~> 7.12') + gem.add_development_dependency(:rails, '~> 6.0.3.4') + end + + gem.add_development_dependency(:keycutter, '~> 1.0.2') gem.add_development_dependency(:open3, '~> 0.1.0') diff --git a/services/dev_configs/db/models/brew_version.rb b/services/dev_configs/db/models/brew_version.rb new file mode 100644 index 0000000..afe04ef --- /dev/null +++ b/services/dev_configs/db/models/brew_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateBrewVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/db/models/java_version.rb b/services/dev_configs/db/models/java_version.rb new file mode 100644 index 0000000..e4289ef --- /dev/null +++ b/services/dev_configs/db/models/java_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateJavaVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/db/models/js/node_version.rb b/services/dev_configs/db/models/js/node_version.rb new file mode 100644 index 0000000..791b7a0 --- /dev/null +++ b/services/dev_configs/db/models/js/node_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateNodeVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/db/models/js/npm_version.rb b/services/dev_configs/db/models/js/npm_version.rb new file mode 100644 index 0000000..b6394b6 --- /dev/null +++ b/services/dev_configs/db/models/js/npm_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateNPMVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/db/models/js/yarn_version.rb b/services/dev_configs/db/models/js/yarn_version.rb new file mode 100644 index 0000000..34a6857 --- /dev/null +++ b/services/dev_configs/db/models/js/yarn_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateYarnVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/db/models/php_version.rb b/services/dev_configs/db/models/php_version.rb new file mode 100644 index 0000000..f4a9fe7 --- /dev/null +++ b/services/dev_configs/db/models/php_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateRubyVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/db/models/python_version.rb b/services/dev_configs/db/models/python_version.rb new file mode 100644 index 0000000..f4a9fe7 --- /dev/null +++ b/services/dev_configs/db/models/python_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateRubyVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/db/models/ruby_version.rb b/services/dev_configs/db/models/ruby_version.rb new file mode 100644 index 0000000..f4a9fe7 --- /dev/null +++ b/services/dev_configs/db/models/ruby_version.rb @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +class CreateRubyVersion < RuuubyDBMigration + +end diff --git a/services/dev_configs/mac/lib/zsh_configs.rb b/services/dev_configs/mac/lib/zsh_configs.rb new file mode 100644 index 0000000..7b57942 --- /dev/null +++ b/services/dev_configs/mac/lib/zsh_configs.rb @@ -0,0 +1,2 @@ +# encoding: UTF-8 + diff --git a/spec/feature/f40/f40_b00_docker_service_spec.rb b/services/dev_configs/mac/spec/locale/f40/f40_b00_docker_service_spec.rb similarity index 94% rename from spec/feature/f40/f40_b00_docker_service_spec.rb rename to services/dev_configs/mac/spec/locale/f40/f40_b00_docker_service_spec.rb index ae99b8b..b110294 100644 --- a/spec/feature/f40/f40_b00_docker_service_spec.rb +++ b/services/dev_configs/mac/spec/locale/f40/f40_b00_docker_service_spec.rb @@ -2,10 +2,7 @@ RSpec.describe 'f40_b00' do - context 'feature{f40_b00} functionality for' do - end # end: {functionality} - - context 'docker_locale', :locale do + context 'docker_locale', :preferences do context 'local system' do context 'w/ {docker}' do @@ -76,6 +73,6 @@ end end - end # end: {locale} + end # end: {preferences} end diff --git a/spec/feature/f40/f40_b01_docker_service_spec.rb b/services/dev_configs/mac/spec/locale/f40/f40_b01_docker_service_spec.rb similarity index 87% rename from spec/feature/f40/f40_b01_docker_service_spec.rb rename to services/dev_configs/mac/spec/locale/f40/f40_b01_docker_service_spec.rb index a84712a..0c8fab9 100644 --- a/spec/feature/f40/f40_b01_docker_service_spec.rb +++ b/services/dev_configs/mac/spec/locale/f40/f40_b01_docker_service_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 RSpec.describe 'f40_b01' do - context 'locale', :locale do + context 'locale', :preferences do context 'feature{f40}' do context 'behavior{b01}' do it 'func{healthy?} (currently) verifies local ENV VARs' do diff --git a/services/dev_configs/mac/spec/locale/f45_spec.rb b/services/dev_configs/mac/spec/locale/f45_spec.rb index 5c24e0b..b675f72 100644 --- a/services/dev_configs/mac/spec/locale/f45_spec.rb +++ b/services/dev_configs/mac/spec/locale/f45_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 RSpec.describe 'ruby' do - context 'locale', :preferences do + context 'preferences', :preferences do context 'recommended settings for {curl}' do it 'expected version{7.64.1} matches' do diff --git a/services/dev_configs/mac/spec/locale/f47_spec.rb b/services/dev_configs/mac/spec/locale/f47_spec.rb index e216c67..582cf83 100644 --- a/services/dev_configs/mac/spec/locale/f47_spec.rb +++ b/services/dev_configs/mac/spec/locale/f47_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 RSpec.describe 'ruby' do - context 'locale', :preferences do + context 'preferences', :preferences do context 'for gem{rubygems-update}' do it 'has correct version' do diff --git a/services/dev_configs/mac/spec/locale/f98_spec.rb b/services/dev_configs/mac/spec/locale/f98_spec.rb index 68ddd3e..3c926d3 100644 --- a/services/dev_configs/mac/spec/locale/f98_spec.rb +++ b/services/dev_configs/mac/spec/locale/f98_spec.rb @@ -1,24 +1,30 @@ # encoding: UTF-8 RSpec.describe 'ruby' do - context 'locale', :preferences do + let(:expected_compiler_version){ + [ + "Apple clang version 12.0.0 (clang-1200.0.32.21)", + "Target: x86_64-apple-darwin19.6.0", + "Thread model: posix", + "InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin" + ] + } + context 'preferences', :preferences do context 'recommended settings for {compiler}' do + it 'w/ clang' do + expect(💻('clang --version')).to eq(expected_compiler_version) + end - it '${clang --version} matches ${cc --version}' do - expect(💻('clang --version')).to eq(💻('cc --version')) + it 'w/ cc' do + expect(💻('cc --version')).to eq(expected_compiler_version) end - it '${gcc --version} has correct version' do + it 'w/ gcc' do out, err = 💻('gcc --version', true) - - expect(out[0]).to eq("Apple clang version 12.0.0 (clang-1200.0.32.21)") - expect(out[1]).to eq("Target: x86_64-apple-darwin19.6.0") - expect(out[2]).to eq("Thread model: posix") - expect(out[3]).to eq("InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin") + expect(out).to eq(expected_compiler_version) end - end - end + end # end: {preferences} end diff --git a/services/dev_configs/mac/spec/locale/locale_full_verification_spec.rb b/services/dev_configs/mac/spec/locale/locale_full_verification_spec.rb index 4d8eb17..def6f16 100644 --- a/services/dev_configs/mac/spec/locale/locale_full_verification_spec.rb +++ b/services/dev_configs/mac/spec/locale/locale_full_verification_spec.rb @@ -22,18 +22,33 @@ end end - # @see https://en.wikipedia.org/wiki/History_of_Python context 'other coding languages' do - context 'python' do + context 'Python' do it 'has expected version{3.9.0}' do expect(💻('python3 --version')).to eq('Python 3.9.0') end end - context 'java' do + context 'Java' do it 'has correct version{13.0.2}' do expect(💻('java --version')).to eq(['openjdk 13.0.2 2020-01-14', 'OpenJDK Runtime Environment (build 13.0.2+8)', 'OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)']) end end + context 'PHP' do + it 'has expected version{7.4.12}' do + expect(💻('php --version')).to eq(["PHP 7.4.12 (cli) (built: Oct 29 2020 18:37:21) ( NTS )", "Copyright (c) The PHP Group", "Zend Engine v3.4.0, Copyright (c) Zend Technologies", " with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies"]) + end + end + context 'JS' do + it 'found expected npm version' do + expect(💻('npm -v')).to eq('6.14.4') + end + it 'found expected node version' do + expect(💻('node -v')).to eq('v15.2.1') + end + it 'found expected yarn version' do + expect(💻('yarn -v')).to eq('1.22.10') + end + end end end diff --git a/services/dev_configs/mac/spec/locale/ruby_installation_spec.rb b/services/dev_configs/mac/spec/locale/ruby_installation_spec.rb new file mode 100644 index 0000000..226a051 --- /dev/null +++ b/services/dev_configs/mac/spec/locale/ruby_installation_spec.rb @@ -0,0 +1,13 @@ +# encoding: UTF-8 + +RSpec.describe 'ruby' do + context 'preferences', :preferences do + it 'helpful ENV_VARs are set' do + path_to_ruby = "/Users/#{💎.engine.os.current_user}/.rbenv/versions/3.0.0-preview1/bin/ruby" + alt_calculation = ::File.join(::RbConfig::CONFIG['bindir'], ::RbConfig::CONFIG['ruby_install_name'] + ::RbConfig::CONFIG['EXEEXT']) + expect(ENV['RUBY']).to eq(path_to_ruby) + expect(::RbConfig.ruby).to eq(path_to_ruby) + expect(alt_calculation).to eq(path_to_ruby) + end + end +end diff --git a/services/ruuuby/Dockerfile b/services/ruuuby/Dockerfile index c3392e2..888b1f4 100644 --- a/services/ruuuby/Dockerfile +++ b/services/ruuuby/Dockerfile @@ -23,9 +23,8 @@ ENV BUILD_LINUX_CORE linux-headers imagemagick-dev ENV BUNDLE_SILENCE_ROOT_WARNING=1 ENV RUUUBY_OS_CURRENT "linux" +ENV RUUUBY_F00 "b04|b05" ENV RUUUBY_F01 "b01|b03|b04{debug}" -ENV RUUUBY_F12 "b00" -ENV RUUUBY_F26 "b00" ENV RUUUBY_F43 "b00" ENV RUUUBY_F98 "11" diff --git a/services/ruuuby_db/bin/db b/services/ruuuby_db/bin/db index d7c743d..209f63e 100755 --- a/services/ruuuby_db/bin/db +++ b/services/ruuuby_db/bin/db @@ -13,11 +13,14 @@ $ruuuby.engine.stats_ext['RUUUBY_CONFIGS'] = 'configs_local/db/test.yml' require_relative '../../../lib/ruuuby/db/migrations/migration_ext' require_relative '../../../lib/ruuuby/db/migrations/ruuuby_gem' +require_relative '../../../lib/ruuuby/db/migrations/env_vars' #💎.engine.orm.db_orm.obtain_connection $orm = 💎.engine.orm +$db = $orm.db_orm -$gems = CreateRuuubyGem.new +$gems = CreateRuuubyGem.new +$env_vars = CreateEnvVars.new require 'irb' IRB.start(__FILE__) diff --git a/services/ruuuby_db/init.sql b/services/ruuuby_db/init.sql index 5a2ac68..6be4a3b 100644 --- a/services/ruuuby_db/init.sql +++ b/services/ruuuby_db/init.sql @@ -1,3 +1,4 @@ +--() { :; }; exec psql -f "$0" --| ___ __ --| /'___\ /\ \__ __ @@ -37,6 +38,7 @@ END; $$ LANGUAGE plpgsql; -- --------------------------------------------------------------------------------------------------------------------- +-- TODO: lower priority, simplify query CREATE OR REPLACE FUNCTION does_func_exist(_func_name TEXT) RETURNS BOOLEAN AS $$ BEGIN RETURN (SELECT COUNT(*) FROM get_all_funcs() AS data_src WHERE data_src.function_name = _func_name LIMIT 1) > 0; @@ -71,7 +73,10 @@ END; $$ LANGUAGE plpgsql; -- --------------------------------------------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION get_all_table_names () RETURNS TABLE(table_name TEXT) AS $$ +CREATE OR REPLACE FUNCTION get_all_table_names () + RETURNS TABLE ( + table_name TEXT + ) AS $$ SELECT t.table_name FROM information_schema.tables AS t WHERE t.table_type = 'BASE TABLE' AND t.table_schema NOT IN ('pg_catalog', 'information_schema'); $$ LANGUAGE SQL; @@ -109,6 +114,13 @@ END; $$ LANGUAGE plpgsql; -- --------------------------------------------------------------------------------------------------------------------- +CREATE OR REPLACE FUNCTION table_row_count_estimate(_table_name TEXT) RETURNS BIGINT AS $$ +BEGIN + RETURN (SELECT reltuples as approximate_row_count FROM pg_class WHERE relname = _table_name); +END; $$ language plpgsql; + +-- --------------------------------------------------------------------------------------------------------------------- + --| __ __ __ --| /\ \ /\ \__ /\ \ --| \_\ \ __ \ \ ,_\ __ \ \ \____ __ ____ __ ____ @@ -133,6 +145,44 @@ BEGIN ; END; $$ LANGUAGE plpgsql; +-- @see https://serverfault.com/questions/128284/how-to-see-active-connections-and-current-activity-in-postgresql-8-4 +CREATE OR REPLACE FUNCTION db_active_connections(_datname NAME) + RETURNS TABLE ( + -- custom field added + time_running interval, + -- default fields and their order + datid oid, + datname name, + pid integer, + leader_pid integer, + usesysid oid, + usename name, + application_name text, + client_addr inet, + client_hostname text, + client_port integer, + backend_start TIMESTAMP WITH TIME ZONE, + xact_start TIMESTAMP WITH TIME ZONE, + query_start TIMESTAMP WITH TIME ZONE, + state_change TIMESTAMP WITH TIME ZONE, + wait_event_type TEXT, + wait_event TEXT, + state TEXT, + backend_xid xid, + backend_xmin xid, + query text, + backend_type text + ) AS $$ +BEGIN + RETURN QUERY + select (CURRENT_TIMESTAMP - s.backend_start) AS time_running, * + from pg_stat_activity AS s + where s.datname = _datname + ORDER BY time_running DESC; +END; $$ LANGUAGE plpgsql; + +-- TODO: https://coderwall.com/p/k5yeyq/postgres-terminanting-db-connections + --| __ --| /\ \__ __ --| __ __ _\ \ ,_\ __ ___ ____/\_\ ___ ___ ____ diff --git a/services/ruuuby_db/spec/dev/migration_spec.rb b/services/ruuuby_db/spec/dev/migration_spec.rb index dd55d69..f99c522 100644 --- a/services/ruuuby_db/spec/dev/migration_spec.rb +++ b/services/ruuuby_db/spec/dev/migration_spec.rb @@ -1 +1,5 @@ # encoding: UTF-8 + +#RSpec.describe 'db/db.rb' do +# let(:api){Ruuuby::MetaData.engine.orm.db_orm} +#end diff --git a/services/ruuuby_db/spec/migration_spec.rb b/services/ruuuby_db/spec/migration_spec.rb index d25d10d..103394e 100644 --- a/services/ruuuby_db/spec/migration_spec.rb +++ b/services/ruuuby_db/spec/migration_spec.rb @@ -1,27 +1,8 @@ # encoding: UTF-8 -class CreateMockData < RuuubyDBMigration - - def self.up - create_table :mock_data do |t| - t.string :mock_data, :null => false - end - - add_index :mock_data, :mock_data, unique: true - end - - def self.down - ♻️index(:mock_data, :mock_data) - ♻️table(:mock_data) - end -end - -class MockData < ApplicationRecord - -end - RSpec.describe 'db/db.rb' do let(:api){Ruuuby::MetaData.engine.orm.db_orm} + let(:table_name){'mock_data'} context 'db_new', :db_new do @@ -35,21 +16,22 @@ class MockData < ApplicationRecord context 'func{does_func_exit}' do context 'handles needed scenarios' do it 'cases: positive' do - expect(api.sql("SELECT does_func_exist('does_func_exist');").values[0][0]).to eq(true) - expect(api.sql("SELECT does_func_exist('get_all_funcs');").values[0][0]).to eq(true) - expect(api.sql("SELECT does_func_exist('does_func_schema_match');").values[0][0]).to eq(true) - expect(api.sql("SELECT does_func_exist('does_table_exist');").values[0][0]).to eq(true) - expect(api.sql("SELECT does_func_exist('get_all_table_names');").values[0][0]).to eq(true) - expect(api.sql("SELECT does_func_exist('get_all_table_name_schema_pairs');").values[0][0]).to eq(true) - expect(api.sql("SELECT does_func_exist('table_size_stats');").values[0][0]).to eq(true) - expect(api.sql("SELECT does_func_exist('db_size_stats');").values[0][0]).to eq(true) + expect(api.∃⨍?('does_func_exist')).to eq(true) + expect(api.∃⨍?('get_all_funcs')).to eq(true) + expect(api.∃⨍?('does_func_schema_match')).to eq(true) + expect(api.∃⨍?('does_table_exist')).to eq(true) + expect(api.∃⨍?('get_all_table_names')).to eq(true) + expect(api.∃⨍?('get_all_table_name_schema_pairs')).to eq(true) + expect(api.∃⨍?('table_size_stats')).to eq(true) + expect(api.∃⨍?('db_size_stats')).to eq(true) + expect(api.∃⨍?('db_active_connections')).to eq(true) end it 'cases: negative' do - expect(api.sql("SELECT does_func_exist('does_func_existdoes_func_exist');").values[0][0]).to eq(false) - expect(api.sql("SELECT does_func_exist('');").values[0][0]).to eq(false) - expect(api.sql("SELECT does_func_exist('1');").values[0][0]).to eq(false) - expect(api.sql("SELECT does_func_exist(' ');").values[0][0]).to eq(false) - expect(api.sql("SELECT does_func_exist('fake_func_name');").values[0][0]).to eq(false) + expect(api.∃⨍?('does_func_existdoes_func_exist')).to eq(false) + expect(api.∃⨍?('')).to eq(false) + expect(api.∃⨍?('1')).to eq(false) + expect(api.∃⨍?(' ')).to eq(false) + expect(api.∃⨍?('fake_func_name')).to eq(false) end end end @@ -61,14 +43,14 @@ class MockData < ApplicationRecord 'does_func_schema_match', '_func_name text, _func_args text, _func_return_type name', 'bool'); -").values[0][0]).to eq(true) +").rows[0][0]).to eq(true) end it 'cases: negative' do expect(api.sql("SELECT does_func_schema_match( 'does_func_schema_match', '_fake_param text, _func_arg name, _func_return_type text', 'bigint'); -").values[0][0]).to eq(false) +").rows[0][0]).to eq(false) end end end @@ -77,9 +59,9 @@ class MockData < ApplicationRecord context 'can create tables w/ migrations' do it 'can be created' do - expect(@mock.∃table?('mock_data')).to eq(false) + expect(@mock.∃table?(table_name)).to eq(false) @mock.up - expect(@mock.∃table?('mock_data')).to eq(true) + expect(@mock.∃table?(table_name)).to eq(true) end it 'and populate data' do a = MockData.new({mock_data: 'hello world'}) @@ -96,12 +78,25 @@ class MockData < ApplicationRecord expect{b.💾!}.to raise_error(::ActiveRecord::RecordNotUnique) a.♻️! end + it 'correctly counting number of rows' do + rows_before = api.num_rows(table_name, true) + expect(rows_before).to eq(0) + a = MockData.new({mock_data: 'hello world0'}) + b = MockData.new({mock_data: 'hello world1'}) + a.💾! + b.💾! + rows_after = api.num_rows(table_name, true) + expect(rows_after > rows_before).to eq(true) + a.♻️! + b.♻️! + expect(api.num_rows(table_name, true)).to eq(0) + end end context 'can drop tables w/ migrations' do it 'can be removed' do @mock.down - expect(@mock.∃table?('mock_data')).to eq(false) + expect(@mock.∃table?(table_name)).to eq(false) end end diff --git a/services/ruuuby_db/spec/test/migration_spec.rb b/services/ruuuby_db/spec/test/migration_spec.rb index dd55d69..7560210 100644 --- a/services/ruuuby_db/spec/test/migration_spec.rb +++ b/services/ruuuby_db/spec/test/migration_spec.rb @@ -1 +1,33 @@ # encoding: UTF-8 + +RSpec.describe 'db/db.rb' do + let(:api){Ruuuby::MetaData.engine.orm.db_orm} + + context 'db_new', :db_new do + + before :all do + @gems = CreateRuuubyGem.new + @gems.down + end + + context 'RuuubyGem' do + context 'can be migrated up' do + it 'w/o error' do + expect{@gems.up}.to_not raise_error + end + it 'creating needed tables' do + expect(api.∃table?('ruuuby_releases')).to eq(true) + expect(api.∃table?('ruuuby_features')).to eq(true) + expect(api.∃table?('ruuuby_feature_behaviors')).to eq(true) + expect(api.∃table?('ruuuby_gems')).to eq(true) + expect(api.∃table?('ruuuby_gem_changelogs')).to eq(true) + end + it 'creating needed functions' do + + end + end + end + + end + +end diff --git a/services/web_assets/Dockerfile b/services/web_assets/Dockerfile index 0debe54..5fa5a1c 100644 --- a/services/web_assets/Dockerfile +++ b/services/web_assets/Dockerfile @@ -72,9 +72,8 @@ CMD ["node", "server.js"] FROM build_base as build_env_dev ENV BUILD_ENV=dev ENV NODE_ENV=development - -# BUILD_LIBS_DEV_ONLY ENV BUID_LIBS_DEV_ONLY zsh vim dpkg mandoc man-pages + RUN apk add --update --no-cache git zsh vim dpkg \ && sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" \ && sed -i '1d' /etc/passwd \ @@ -113,7 +112,9 @@ CMD ["node", "server.js"] FROM build_base as build_env_test ENV BUILD_ENV=test ENV NODE_ENV=test +ENV BUILD_LIBS_TEST_ONLY dpkg +RUN apk add --update --no-cache dpkg \ COPY ./bin /root/ruuuby_js/bin COPY ./dist /root/ruuuby_js/dist COPY ./intermediate /root/ruuuby_js/intermediate diff --git a/services/web_assets/src/attribute/bitwise_flags/max_31.js b/services/web_assets/src/attribute/bitwise_flags/max_31.js index f522ce9..8dd9db6 100644 --- a/services/web_assets/src/attribute/bitwise_flags/max_31.js +++ b/services/web_assets/src/attribute/bitwise_flags/max_31.js @@ -1,15 +1,21 @@ -// supports a maximum of 31 unique keys /** - * + * supports a maximum of 31 unique keys */ const AttributeBitwiseFlags31 = function(){}; AttributeBitwiseFlags31.prototype = { + /** + * + */ flags_clear: function() { this._flags31[0] = 0; }, + /** + * @param {number} flag_number + * @param {boolean} b + */ flag_set: function(flag_number, b) { if (b) { this._flags31[0] |= flag_number; @@ -18,40 +24,79 @@ AttributeBitwiseFlags31.prototype = { } }, + /** + * @param {number} flag_number + */ flag_set_off: function(flag_number) { this._flags31[0] &= (~flag_number); }, + /** + * @param {number} flag_number + */ flag_set_on: function(flag_number) { this._flags31[0] |= flag_number; }, + /** + * @param {number} flag_number + * + * @return {boolean} + */ flag_is_off: function(flag_number) { return (this._flags31[0] & flag_number) === 0; }, + /** + * @param {number} flag_number + * + * @return {boolean} + */ flag_is_on: function(flag_number) { return (this._flags31[0] & flag_number) > 0; }, + /** + * @param {number} f0 + * @param {number} f1 + * + * @return {boolean} + */ flags_are_same: function(f0, f1) { return ((this._flags31[0] & (f0 | f1)) === (f0 | f1)) || ((this._flags31[0] & f0) + (this._flags31[0] & f1) === 0); }, + /** + * @param {number} f0 + * @param {number} f1 + * + * @return {boolean} + */ flags_are_on: function(f0, f1) { return (this._flags31[0] & (f0 | f1)) === (f0 | f1); }, + /** + * @param {number} f0 + * @param {number} f1 + * + * @return {boolean} + */ flags_are_off: function(f0, f1) { return (this._flags31[0] & f0) + (this._flags31[0] & f1) === 0; }, + /** + * @param {number} f0 + * @param {number} f1 + * + * @return {boolean} + */ flags_are_either_on: function(f0, f1) { return (this._flags31[0] & (f0 | f1)) > 0; }, }; -//export const AttributeFlags31 = AttributeBitwiseFlags31; export default { AttributeFlags31: AttributeBitwiseFlags31 } diff --git a/spec/feature/f15/f15_spec.rb b/spec/audit/ruuuby_spec.rb similarity index 70% rename from spec/feature/f15/f15_spec.rb rename to spec/audit/ruuuby_spec.rb index a16eb4d..70394d1 100644 --- a/spec/feature/f15/f15_spec.rb +++ b/spec/audit/ruuuby_spec.rb @@ -1,13 +1,10 @@ # encoding: UTF-8 -RSpec.describe 'f15_spec' do - - context 'f15', :db do - end +RSpec.describe 'ruuuby' do context 'ruuuby', :audit do - context 'defines a version number' do - it 'as a frozen string' do + context 'defines version numbers for' do + it 'for frozen constant{VERSION}' do expect(Ruuuby::VERSION.str?).to eq(true) expect(Ruuuby::VERSION.❄️?).to eq(true) end diff --git a/spec/class/nums/float_spec.rb b/spec/class/nums/float_spec.rb index d3503e3..0abcf4b 100644 --- a/spec/class/nums/float_spec.rb +++ b/spec/class/nums/float_spec.rb @@ -29,11 +29,24 @@ context 'by adding function{has_decimals?}' do context 'handles needed scenarios' do - it 'cases: positive' do - [-1337.1, -1.2, -0.3, 0.999999999999, 1.4, 1.5, 1337.6].∀{|scenario| expect(scenario.has_decimals?).to eq(true)} + context 'cases: positive' do + it 'w/ floats close to zero' do + [-1337.1, -1.2, -0.999999999999, -0.3, -0.000000000001, 0.00000000001, 0.999999999999, 1.4, 1.5,]. + ∀{|scenario| expect(scenario.has_decimals?).to eq(true)} + end + it 'w/ floats far from zero' do + [-1337.133713371337, -1337.1, 1337.6, 1337.133713371337]. + ∀{|scenario| expect(scenario.has_decimals?).to eq(true)} + end end - it 'cases: negative' do - [-1337.0, -2.0, -1.0, -0.0, 0.0, 1.0, 2.0, 1337.0].∀{|scenario| expect(scenario.has_decimals?).to eq(false)} + #1187 + context 'cases: negative' do + it 'w/ regular floats' do + [-1337.0, -2.0, -1.0, -0.0, 0.0, 1.0, 2.0, 1337.0].∀{|scenario| expect(scenario.has_decimals?).to eq(false)} + end + it 'w/ infinities' do + [::Float::INFINITY_NEGATIVE, ::Float::INFINITY].∀{|scenario| expect(scenario.has_decimals?).to eq(false)} + end end end end diff --git a/spec/db/seed_data_spec.rb b/spec/db/seed_data_spec.rb deleted file mode 100644 index 5b002d6..0000000 --- a/spec/db/seed_data_spec.rb +++ /dev/null @@ -1,343 +0,0 @@ -# encoding: UTF-8 - -=begin -RSpec.describe 'db/seed.rb' do - - context 'db', :db do - - context 'has historical release data' do - - context 'has needed gem information' do - #it 'there exists a gem for{rubygems-update}' do - # the_gem = ::RuuubyGem['rubygems-update'] - # expect(the_gem.ⓣ).to eq(::RuuubyGem) - # expect(the_gem.ruuuby_release.uid).to eq('v0.0.39') - #end - context 'expected number per mode types' do - it 'for none there is{0}' do - expect(::RuuubyGem.fetch_by_type(false, false).length).to eq(0) - end - it 'for{runtime} there is{0}' do - expect(::RuuubyGem.fetch_by_type(false, true).length).to eq(0) - end - it 'for{development} there is{13}' do - expect(::RuuubyGem.fetch_by_type(true, false).length).to eq(13) - end - it 'for{development & runtime} there is{1}' do - expect(::RuuubyGem.fetch_by_type(true, true).length).to eq(1) - end - end - it 'there is only 1 gem which is for mode{development & runtime}' do - expect(::RuuubyGem.fetch_by_type(true, true).first).to eq(::RuuubyGem['tty-command']) - end - end - - context 'defines versions' do - context 'v0.0.0' do - it 'as expected' do - audit_version(v0_0_0, 'v0.0.0', 0, 0) - end - end - - context 'v0.0.1' do - it 'as expected' do - audit_version(v0_0_1, 'v0.0.1', 4, 0) - expect(v0_0_1.id).to_not eq(v0_0_0.id) - end - end - - context 'v0.0.2' do - it 'as expected' do - audit_version(v0_0_2, 'v0.0.2', 0, 0) - expect(v0_0_2.id).to_not eq(v0_0_0.id) - expect(v0_0_2.id).to_not eq(v0_0_1.id) - end - end - - context 'v0.0.3' do - it 'as expected' do - audit_version(v0_0_3, 'v0.0.3', 0, 0) - end - end - - context 'v0.0.4' do - it 'as expected' do - audit_version(v0_0_4, 'v0.0.4', 1, 0) - end - end - - context 'v0.0.5' do - it 'as expected' do - audit_version(v0_0_5, 'v0.0.5', 0, 0) - end - end - - context 'v0.0.6' do - it 'as expected' do - audit_version(v0_0_6, 'v0.0.6', 0, 0) - end - end - - context 'v0.0.7' do - it 'as expected' do - audit_version(v0_0_7, 'v0.0.7', 1, 0) - end - end - - context 'v0.0.8' do - it 'as expected' do - audit_version(v0_0_8, 'v0.0.8', 0, 0) - end - end - - context 'v0.0.9' do - it 'as expected' do - audit_version(v0_0_9, 'v0.0.9', 0, 0) - end - end - - context 'v0.0.10' do - it 'as expected' do - audit_version(v0_0_10, 'v0.0.10', 0, 0) - end - end - - context 'v0.0.11' do - it 'as expected' do - audit_version(v0_0_11, 'v0.0.11', 0, 0) - end - end - - context 'v0.0.12' do - it 'as expected' do - audit_version(v0_0_12, 'v0.0.12', 0, 0) - end - end - - context 'v0.0.13' do - it 'as expected' do - audit_version(v0_0_13, 'v0.0.13', 0, 0) - end - end - - context 'v0.0.14' do - it 'as expected' do - audit_version(v0_0_14, 'v0.0.14', 1, 0) - end - end - - context 'v0.0.15' do - it 'as expected' do - audit_version(v0_0_15, 'v0.0.15', 0, 0) - end - end - - context 'v0.0.16' do - it 'as expected' do - audit_version(v0_0_16, 'v0.0.16', 0, 0) - end - end - - context 'v0.0.17' do - it 'as expected' do - audit_version(v0_0_17, 'v0.0.17', 0, 0) - end - end - - context 'v0.0.18' do - it 'as expected' do - audit_version(v0_0_18, 'v0.0.18', 2, 0) - end - end - - context 'v0.0.19' do - it 'as expected' do - audit_version(v0_0_19, 'v0.0.19', 0, 0) - end - end - - context 'v0.0.20' do - it 'as expected' do - audit_version(v0_0_20, 'v0.0.20', 0, 0) - end - end - - context 'v0.0.21' do - it 'as expected' do - audit_version(v0_0_21, 'v0.0.21', 0, 0) - end - end - - context 'v0.0.22' do - it 'as expected' do - audit_version(v0_0_22, 'v0.0.22', 0, 0) - end - end - - context 'v0.0.23' do - it 'as expected' do - audit_version(v0_0_23, 'v0.0.23', 0, 0) - end - end - - context 'v0.0.24' do - it 'as expected' do - audit_version(v0_0_24, 'v0.0.24', 0, 0) - end - end - - context 'v0.0.25' do - it 'as expected' do - audit_version(v0_0_25, 'v0.0.25', 0, 0) - end - end - - context 'v0.0.26' do - it 'as expected' do - audit_version(v0_0_26, 'v0.0.26', 0, 0) - end - end - - context 'v0.0.27' do - it 'as expected' do - audit_version(v0_0_27, 'v0.0.27', 1, 0) - end - end - - context 'v0.0.28' do - it 'as expected' do - audit_version(v0_0_28, 'v0.0.28', 0, 0) - end - end - - context 'v0.0.29' do - it 'as expected' do - audit_version(v0_0_29, 'v0.0.29', 0, 0) - end - end - - context 'v0.0.30' do - it 'as expected' do - audit_version(v0_0_30, 'v0.0.30', 0, 0) - end - end - - context 'v0.0.31' do - it 'as expected' do - audit_version(v0_0_31, 'v0.0.31', 0, 0) - end - end - - context 'v0.0.32' do - it 'as expected' do - audit_version(v0_0_32, 'v0.0.32', 0, 0) - end - end - - context 'v0.0.33' do - it 'as expected' do - audit_version(v0_0_33, 'v0.0.33', 0, 0) - end - end - - context 'v0.0.34' do - it 'as expected' do - audit_version(v0_0_34, 'v0.0.34', 0, 0) - end - end - - context 'v0.0.35' do - it 'as expected' do - audit_version(v0_0_35, 'v0.0.35', 1, 0) - end - end - - context 'v0.0.36' do - it 'as expected' do - audit_version(v0_0_36, 'v0.0.36', 0, 0) - end - end - - context 'v0.0.37' do - it 'as expected' do - audit_version(v0_0_37, 'v0.0.37', 0, 0) - end - end - - context 'v0.0.38' do - it 'as expected' do - audit_version(v0_0_38, 'v0.0.38', 0, 0) - end - end - - context 'v0.0.39' do - it 'as expected' do - audit_version(v0_0_39, 'v0.0.39', 1, 2) - end - end - - context 'v0.0.40' do - it 'as expected' do - audit_version(v0_0_40, 'v0.0.40', 0, 0) - end - end - - context 'v0.0.41' do - it 'as expected' do - audit_version(v0_0_41, 'v0.0.41', 0, 0) - end - end - - context 'v0.0.42' do - it 'as expected' do - audit_version(v0_0_42, 'v0.0.42', 0, 0) - end - end - - context 'v0.0.43' do - it 'as expected' do - audit_version(v0_0_43, 'v0.0.43', 0, 0) - end - end - - context 'v0.0.44' do - it 'as expected' do - audit_version(v0_0_44, 'v0.0.44', 0, 2) - end - end - - context 'v0.0.45' do - it 'as expected' do - audit_version(v0_0_45, 'v0.0.45', 0, 1) - end - end - - context 'v0.0.46' do - it 'as expected' do - audit_version(v0_0_46, 'v0.0.46', 0, 0) - end - end - - context 'v0.0.47' do - it 'as expected' do - audit_version(v0_0_47, 'v0.0.47', 0, 2) - end - end - - context 'v0.0.48' do - it 'as expected' do - audit_version(v0_0_48, 'v0.0.48', 2, 0) - end - end - - context 'v0.0.49' do - it 'as expected' do - audit_version(v0_0_49, 'v0.0.49', 0, 1) - end - end - - end # end{versions} - end - end -end -=end diff --git a/spec/feature/f00/f00_b01_spec.rb b/spec/feature/f00/f00_b01_spec.rb new file mode 100644 index 0000000..9c063e4 --- /dev/null +++ b/spec/feature/f00/f00_b01_spec.rb @@ -0,0 +1,102 @@ +# encoding: UTF-8 + +RSpec.describe 'f00_b01' do + let(:f00_b04){Ruuuby::MetaData.engine.stats_ext['F00_B04']} + + context 'functionality' do + + context 'for c{String}' do + context 'handles needed scenarios' do + it 'cases: positive' do + expect(''.∅?).to eq(true) + end + it 'cases: negative' do + expect(' '.∅?).to eq(false) + expect("\t".∅?).to eq(false) + expect($/.∅?).to eq(false) + expect('0'.∅?).to eq(false) + expect('∅'.∅?).to eq(false) + expect('❓'.∅?).to eq(false) + expect('a'.∅?).to eq(false) + end + end + end + + context 'for c{NilClass}' do + context 'handles needed scenarios' do + it 'cases: positive' do + expect(nil.empty?).to eq(true) + if f00_b04 + expect(nil.∅?).to eq(true) + else + expect{nil.∅?}.to_not raise_error + end + end + it 'cases: negative' do + expect(NilClass.respond_to?(:empty?)).to eq(false) + expect(NilClass.respond_to?(:∅?)).to eq(false) + end + it 'cases: error' do + unless f00_b04 + expect{nil.∅?}.to raise_error(::NoMethodError) + end + end + end + end + + context 'for {ENV}' do + it 'handles needed case' do + expect(ENV.∅?).to eq(ENV.empty?) + end + end + end # end: {functionality} + + context 'f00_b01', :audit do + context 'funcs provided are defined in correct location' do + it 'for ENV' do + expect(ENV.respond_to?(:∅?)).to eq(true) + end + it 'for data-structure based Classes' do + expect_∃⨍(:∅?, ::Hash) + expect_∃⨍(:∅?, ::Array) + expect_∃⨍(:∅?, ::Set) + expect_∃⨍(:∅?, ::String) + end + it 'for IO classes' do + expect_∃⨍(:∅?, ::Dir) + expect_∃⨍(:∅?, ::File) + end + it 'for NilClass' do + expect_∃⨍(:∅?, ::NilClass) + end + + context 'w/o side-effects' do + it 'on classes effected' do + expect(::String.respond_to?(:∅?)).to eq(false) + expect(::NilClass.respond_to?(:∅?)).to eq(false) + end + end + + end + end # end: {audit} + + # __ ___ __ ___ __ __ __ ___ + # |__) |__ |__) |__ / \ |__) |\/| /\ |\ | / ` |__ + # | |___ | \ | \__/ | \ | | /~~\ | \| \__, |___ + context 'performance', :performance do + + context 'the following perform extremely quickly' do + context 'func{∅?}' do + it 'w/ positive cases' do + expect{nil.∅?}.to perform_extremely_quickly + expect{''.∅?}.to perform_extremely_quickly + end + it 'w/ negative cases' do + expect{' '.∅?}.to perform_extremely_quickly + end + end + end + + end # end: {performance} + +end diff --git a/spec/feature/f00/f00_b02_spec.rb b/spec/feature/f00/f00_b02_spec.rb new file mode 100644 index 0000000..b646463 --- /dev/null +++ b/spec/feature/f00/f00_b02_spec.rb @@ -0,0 +1,26 @@ +# encoding: UTF-8 + +RSpec.describe 'f00_b02' do + + context 'functionality' do + end # end: {functionality} + + context 'audit', :audit do + context 'funcs provided are defined in correct location' do + it 'for ENV' do + expect_∃⨍(:∃?, ENV) + expect_∃⨍(:∄?, ENV) + end + it 'for IO classes' do + expect(::Dir.respond_to?(:∃?)).to eq(true) + expect(::File.respond_to?(:∃?)).to eq(true) + expect(::Dir.respond_to?(:∄?)).to eq(true) + expect(::File.respond_to?(:∄?)).to eq(true) + end + end + end # end: {audit} + + context 'performance', :performance do + end # end: {performance} + +end diff --git a/spec/feature/f03/f03_spec.rb b/spec/feature/f00/f00_b03_spec.rb similarity index 80% rename from spec/feature/f03/f03_spec.rb rename to spec/feature/f00/f00_b03_spec.rb index 29ae98e..b274451 100644 --- a/spec/feature/f03/f03_spec.rb +++ b/spec/feature/f00/f00_b03_spec.rb @@ -1,6 +1,13 @@ # encoding: UTF-8 -RSpec.describe 'f03' do +RSpec.describe 'f00_b03' do + + context 'functionality' do + it 'for ENV' do + expect(ENV.𝔠).to eq(ENV.length) + end + end + context 'audit', :audit do context 'feature(f03) passes audits' do context 'funcs provided are defined in correct location' do @@ -9,7 +16,6 @@ end it 'for ENV' do expect(ENV.respond_to?(:𝔠)).to eq(true) - expect(ENV.𝔠).to eq(ENV.length) end it 'for Enumerables' do expect_∃⨍(:𝔠, ::Hash) @@ -20,4 +26,5 @@ end end end + end diff --git a/spec/feature/f00/f00_b04_spec.rb b/spec/feature/f00/f00_b04_spec.rb new file mode 100644 index 0000000..ee86387 --- /dev/null +++ b/spec/feature/f00/f00_b04_spec.rb @@ -0,0 +1,19 @@ +# encoding: UTF-8 + +RSpec.describe 'f00_b04' do + + context 'functionality' do + it 'main adds funcs{📅, 🕒, 📅🕒}' do + if 💎.engine.stats_ext['F00_B04'] + expect(📅).to eq(::Date) + expect(🕒).to eq(::Time) + expect(📅🕒).to eq(::DateTime) + else + expect{📅}.to raise_error(::NameError) + expect{🕒}.to raise_error(::NameError) + expect{📅🕒}.to raise_error(::NameError) + end + end + end + +end diff --git a/spec/feature/f00/f00_b05_spec.rb b/spec/feature/f00/f00_b05_spec.rb new file mode 100644 index 0000000..23093e1 --- /dev/null +++ b/spec/feature/f00/f00_b05_spec.rb @@ -0,0 +1,27 @@ +# encoding: UTF-8 + +RSpec.describe 'f00_b05' do + let(:f00_b05){💎.engine.stats_ext['F00_B05']} + + context 'needed global funcs get added to main' do + context 'func{📁}' do + it 'aliases File' do + if f00_b05 + expect(📁).to eq(::File) + else + expect{📁}.to raise_error(::NameError) + end + end + end + context 'func{🗄️}' do + it 'aliases Dir' do + if f00_b05 + expect(🗄️).to eq(::Dir) + else + expect{🗄️}.to raise_error(::NameError) + end + end + end + end + +end diff --git a/spec/feature/f00/f00_db_orm_spec.rb b/spec/feature/f00/f00_db_orm_spec.rb deleted file mode 100644 index 22e6f3f..0000000 --- a/spec/feature/f00/f00_db_orm_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f00_db_orm' do - - context 'db_orm', :db do - context 'feature{f00}' do - it 'passes ORM audit' do - audit_feature(f00, 'f00', 1, "`η̂` to alias concept of `normalization` (offered in any applicable context)") - end - end - - context 'defines behaviors' do - it 'defines{b00}' do - audit_feature_behavior(f00, f00_b00, 'b00', 'create func{η̂!} for class(`Array`)') - end - end - - end - -end diff --git a/spec/feature/f00/f00_spec.rb b/spec/feature/f00/f00_spec.rb deleted file mode 100644 index 824c58a..0000000 --- a/spec/feature/f00/f00_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f00' do - - context 'functionality' do - - end - -end diff --git a/spec/feature/f03/f03_db_orm_spec.rb b/spec/feature/f03/f03_db_orm_spec.rb deleted file mode 100644 index a8a861e..0000000 --- a/spec/feature/f03/f03_db_orm_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f03_db_orm' do - - context 'db_orm', :db do - context 'defines f03' do - it 'passes ORM audit' do - audit_feature(f03, 'f03', 0, "`𝔠` to alias concept of `cardinality`") - end - end - end - -end diff --git a/spec/feature/f04/f04_b00_spec.rb b/spec/feature/f04/f04_b00_spec.rb deleted file mode 100644 index 0d660e0..0000000 --- a/spec/feature/f04/f04_b00_spec.rb +++ /dev/null @@ -1,81 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f04_b00' do - - context 'functionality' do - - context 'for c{String}' do - context 'handles needed scenarios' do - context 'cases: positive' do - it 'w/o alias' do - expect(''.empty?).to eq(true) - end - it 'w/ alias' do - expect(''.∅?).to eq(true) - end - end - context 'cases: negative' do - it 'w/o alias' do - expect(' '.empty?).to eq(false) - expect("\t".empty?).to eq(false) - expect($/.empty?).to eq(false) - expect("0".empty?).to eq(false) - expect("∅".empty?).to eq(false) - expect("❓".empty?).to eq(false) - end - it 'w/ alias' do - expect(' '.∅?).to eq(false) - expect("\t".∅?).to eq(false) - expect($/.∅?).to eq(false) - expect("0".∅?).to eq(false) - expect("∅".∅?).to eq(false) - expect("❓".∅?).to eq(false) - end - it 'w/ Class instance' do - expect(::String.respond_to?(:∅?)).to eq(false) - end - end - end - end # end: {for c{String}} - - end # end: {functionality} - - context 'audit', :audit do - context 'feature(f04_b00) passes audits' do - context 'funcs provided are defined in correct location' do - it 'for Enumerables' do - expect_∃⨍(:∅?, ::Hash) - expect_∃⨍(:∅?, ::Array) - expect_∃⨍(:∅?, ::Set) - expect_∃⨍(:∅?, ::String) - end - end - end - end # end: {audit} - - - # __ ___ __ ___ __ __ __ ___ - # |__) |__ |__) |__ / \ |__) |\/| /\ |\ | / ` |__ - # | |___ | \ | \__/ | \ | | /~~\ | \| \__, |___ - context 'performance', :performance do - - context 'the following perform extremely quickly' do - context 'func{∅?}' do - context 'for needed scenarios' do - context 'w/ String' do - it 'cases: positive' do - expect{''.∅?}.to perform_extremely_quickly - expect{''.empty?}.to perform_extremely_quickly - end - it 'cases: negative' do - expect{' '.∅?}.to perform_extremely_quickly - expect{''.empty?}.to perform_extremely_quickly - end - end - end - end - end - - end # end: {performance} - -end diff --git a/spec/feature/f04/f04_b01_spec.rb b/spec/feature/f04/f04_b01_spec.rb deleted file mode 100644 index 515bc08..0000000 --- a/spec/feature/f04/f04_b01_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f04_b01' do - - context 'functionality' do - context 'for c{NilClass}' do - context 'handles needed scenarios' do - it 'cases: positive' do - expect(nil.empty?).to eq(true) - expect(nil.∅?).to eq(true) - end - it 'cases: positive' do - expect(NilClass.respond_to?(:empty?)).to eq(false) - expect(NilClass.respond_to?(:∅?)).to eq(false) - end - end - end - end # end: {functionality} - - context 'audit', :audit do - context '{f04_b01} passes audits' do - context 'funcs provided are defined in correct location' do - it 'for ENV' do - expect(ENV.respond_to?(:∅?)).to eq(true) - expect(ENV.∅?).to eq(ENV.empty?) - end - it 'w/ nil' do - expect_∃⨍(:∅?, ::NilClass) - end - end - end - end # end: {audit} - - # __ ___ __ ___ __ __ __ ___ - # |__) |__ |__) |__ / \ |__) |\/| /\ |\ | / ` |__ - # | |___ | \ | \__/ | \ | | /~~\ | \| \__, |___ - context 'performance', :performance do - - context 'the following perform extremely quickly' do - it 'func{empty?}' do - expect{nil.empty?}.to perform_extremely_quickly - expect{nil.∅?}.to perform_extremely_quickly - end - end - - end # end: {performance} - -end diff --git a/spec/feature/f04/f04_db_orm_spec.rb b/spec/feature/f04/f04_db_orm_spec.rb deleted file mode 100644 index 4687777..0000000 --- a/spec/feature/f04/f04_db_orm_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f04_db_orm' do - - context 'db_orm', :db do - context 'defines f04' do - it 'passes ORM audit' do - audit_feature(f04, 'f04', 3, '`∅` to alias concept of `empty`') - end - - context 'defines behaviors' do - it 'defines{b00}' do - audit_feature_behavior(f04, f04_b00, 'b00', 'Enumerable classes{ex: `Array`, `Set`, `String` have func{`∅?`}') - end - - it 'defines{b01}' do - audit_feature_behavior(f04, f04_b01, 'b01', "'class' ENV and class{NilClass} have func{`∅?`}") - end - - it 'defines{b02}' do - audit_feature_behavior(f04, f04_b02, 'b02', 'classes: `File` & `Dir` have func{`∅?`}') - end - end # end: {defines behaviors} - end - end - -end diff --git a/spec/feature/f04/f04_spec.rb b/spec/feature/f04/f04_spec.rb deleted file mode 100644 index 4171961..0000000 --- a/spec/feature/f04/f04_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f04' do - - context 'audit', :audit do - context 'feature(f04) passes audits' do - context 'funcs provided are defined in correct location' do - it 'for c{Dir}' do - expect_∃⨍(:∅?, ::Dir) - end - it 'for c{File}' do - expect_∃⨍(:∅?, ::File) - end - end - end - end # end: {audit} - -end diff --git a/spec/feature/f12/f12_db_orm_spec.rb b/spec/feature/f12/f12_db_orm_spec.rb index e4774fd..0c61028 100644 --- a/spec/feature/f12/f12_db_orm_spec.rb +++ b/spec/feature/f12/f12_db_orm_spec.rb @@ -9,9 +9,6 @@ end context 'defines behaviors' do - it 'has{b00}' do - audit_feature_behavior(f12, f12_b00, 'b00', 'offer Class aliases: {`📁` -> `File`}, {`🗄️` -> `Dir`}') - end it 'has{b01}' do audit_feature_behavior(f12, f12_b01, 'b01', "offer a light layer over `Ruby's` loadable `CSV` data parsing") diff --git a/spec/feature/f12/f12_spec.rb b/spec/feature/f12/f12_spec.rb index 1001410..50f4bf4 100644 --- a/spec/feature/f12/f12_spec.rb +++ b/spec/feature/f12/f12_spec.rb @@ -1,28 +1,6 @@ # encoding: UTF-8 RSpec.describe 'f12' do - let(:flag_f12_b00){💎.engine.stats_ext['F12_B00']} - - context 'needed global funcs get added to main' do - context 'func{📁}' do - it 'aliases File' do - if flag_f12_b00 - expect(📁).to eq(::File) - else - expect{📁}.to raise_error(::NameError) - end - end - end - context 'func{🗄️}' do - it 'aliases Dir' do - if flag_f12_b00 - expect(🗄️).to eq(::Dir) - else - expect{🗄️}.to raise_error(::NameError) - end - end - end - end context 'audit', :audit do diff --git a/spec/feature/f12/file_spec.rb b/spec/feature/f12/file_spec.rb index b259591..fa1339d 100644 --- a/spec/feature/f12/file_spec.rb +++ b/spec/feature/f12/file_spec.rb @@ -8,7 +8,7 @@ context 'handles needed scenarios' do # positive cases intentionally omitted for time being it 'cases: error' do - expect{::File.∃?(nil)}.to raise_error(::ArgumentError) + expect{::File.∃?(nil)}.to raise_error(::TypeError) end end end diff --git a/spec/feature/f13/f13_db_orm_spec.rb b/spec/feature/f13/f13_db_orm_spec.rb deleted file mode 100644 index 86a0fe4..0000000 --- a/spec/feature/f13/f13_db_orm_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f13_db_orm' do - - context 'db_orm', :db do - context 'defines f13' do - it 'passes ORM audit' do - audit_feature(f13, 'f13', 0, '`∃` to alias concept of `does this(arg) exist?` and `∄` to mean inverse: `does this(arg) not exist?`') - end - end - end - -end diff --git a/spec/feature/f15/f15_db_orm_spec.rb b/spec/feature/f15/f15_db_orm_spec.rb deleted file mode 100644 index c026bbf..0000000 --- a/spec/feature/f15/f15_db_orm_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f15_db_orm' do - - context 'db_orm', :db do - context 'defines f15' do - it 'passes ORM audit' do - audit_feature(f15, 'f15', 0, 'enable quicker tracking and auditing of features across versions') - end - end - end - -end diff --git a/spec/feature/f17/f17_spec.rb b/spec/feature/f17/f17_spec.rb index 2ce8b23..515b2a7 100644 --- a/spec/feature/f17/f17_spec.rb +++ b/spec/feature/f17/f17_spec.rb @@ -4,63 +4,60 @@ RSpec.describe 'f17' do - context 'functionality' do - - context 'trigonometry' do - context 'math functions' do - context 'func{sin}' do - it 'provides needed values' do - expect(sin(θ°(30))).to eq(0.5) - expect(sin(θ°(90))).to eq(1) - expect(sin(θ°(180))).to eq(0) - expect(sin(θ°(270))).to eq(-1) - expect(sin(θ°(360))).to eq(0) - end - it 'can be more accurate than Math.sin' do - expect(::Math.sin(::Math::PI)).to_not eq(0) - expect(::Math.sin(::Math::PI * 2.0)).to_not eq(0) - expect(sin(θʳ(::Math::PI))).to eq(0) - expect(sin(θʳ(::Math::PI * 2.0))).to eq(0) - end - end # end: {func{sin}} - context 'func{cos}' do - it 'provides needed values' do - expect(cos((θ°(90)))).to eq(0) - expect(cos((θ°(180)))).to eq(-1) - expect(cos(θ°(270))).to eq(0) - expect(cos((θ°(360)))).to eq(1) - end - it 'can be more accurate than Math.sin' do - expect(::Math.cos(::Math::PI / 2)).to_not eq(0) - expect(::Math.cos(::Math::PI * (3.0 / 2))).to_not eq(0) - expect(cos(θʳ(::Math::PI / 2))).to eq(0) - expect(cos(θʳ(::Math::PI * (3.0 / 2)))).to eq(0) - end - end # end: {func{cos}} - context 'func{tan}' do - it 'provides needed values' do - expect(tan(θ°(0))).to eq(sin(θ°(0))/cos(θ°(0))) - expect((tan(θ°(30))).≈≈((sin(θ°(30))/cos(θ°(30))))).to eq(true) - expect((tan(θ°(45))).≈≈((sin(θ°(45))/cos(θ°(45))))).to eq(true) - expect((tan(θ°(60))).≈≈((sin(θ°(60))/cos(θ°(60))))).to eq(true) - #expect((tan(θ°(90))).≈≈((sin(θ°(90))/cos(θ°(90))))).to eq(true) - expect((tan(θ°(120))).≈≈((sin(θ°(120))/cos(θ°(120))))).to eq(true) - expect((tan(θ°(135))).≈≈((sin(θ°(135))/cos(θ°(135))))).to eq(true) - expect((tan(θ°(150))).≈≈((sin(θ°(150))/cos(θ°(150))))).to eq(true) - #expect((tan(θ°(180))).≈≈((sin(θ°(180))/cos(θ°(180))))).to eq(true) - expect((tan(θ°(210))).≈≈((sin(θ°(210))/cos(θ°(210))))).to eq(true) - expect((tan(θ°(225))).≈≈((sin(θ°(225))/cos(θ°(225))))).to eq(true) - expect((tan(θ°(240))).≈≈((sin(θ°(240))/cos(θ°(240))))).to eq(true) - #expect((tan(θ°(270))).≈≈((sin(θ°(270))/cos(θ°(270))))).to eq(true) - expect((tan(θ°(300))).≈≈((sin(θ°(300))/cos(θ°(300))))).to eq(true) - expect((tan(θ°(315))).≈≈((sin(θ°(315))/cos(θ°(315))))).to eq(true) - expect((tan(θ°(330))).≈≈((sin(θ°(330))/cos(θ°(330))))).to eq(true) - expect(tan(θ°(360))).to eq(sin(θ°(360))/cos(θ°(360))) - end - end # end: {func{tan}} - end # end: {math functions} - end # end: {trigonometry} - end # end: {functionality} + context 'trigonometry', :integration do + context 'math functions' do + context 'func{sin}' do + it 'provides needed values' do + expect(sin(θ°(30))).to eq(0.5) + expect(sin(θ°(90))).to eq(1) + expect(sin(θ°(180))).to eq(0) + expect(sin(θ°(270))).to eq(-1) + expect(sin(θ°(360))).to eq(0) + end + it 'can be more accurate than Math.sin' do + expect(::Math.sin(::Math::PI)).to_not eq(0) + expect(::Math.sin(::Math::PI * 2.0)).to_not eq(0) + expect(sin(θʳ(::Math::PI))).to eq(0) + expect(sin(θʳ(::Math::PI * 2.0))).to eq(0) + end + end # end: {func{sin}} + context 'func{cos}' do + it 'provides needed values' do + expect(cos((θ°(90)))).to eq(0) + expect(cos((θ°(180)))).to eq(-1) + expect(cos(θ°(270))).to eq(0) + expect(cos((θ°(360)))).to eq(1) + end + it 'can be more accurate than Math.sin' do + expect(::Math.cos(::Math::PI / 2)).to_not eq(0) + expect(::Math.cos(::Math::PI * (3.0 / 2))).to_not eq(0) + expect(cos(θʳ(::Math::PI / 2))).to eq(0) + expect(cos(θʳ(::Math::PI * (3.0 / 2)))).to eq(0) + end + end # end: {func{cos}} + context 'func{tan}' do + it 'provides needed values' do + expect(tan(θ°(0))).to eq(sin(θ°(0))/cos(θ°(0))) + expect((tan(θ°(30))).≈≈((sin(θ°(30))/cos(θ°(30))))).to eq(true) + expect((tan(θ°(45))).≈≈((sin(θ°(45))/cos(θ°(45))))).to eq(true) + expect((tan(θ°(60))).≈≈((sin(θ°(60))/cos(θ°(60))))).to eq(true) + #expect((tan(θ°(90))).≈≈((sin(θ°(90))/cos(θ°(90))))).to eq(true) + expect((tan(θ°(120))).≈≈((sin(θ°(120))/cos(θ°(120))))).to eq(true) + expect((tan(θ°(135))).≈≈((sin(θ°(135))/cos(θ°(135))))).to eq(true) + expect((tan(θ°(150))).≈≈((sin(θ°(150))/cos(θ°(150))))).to eq(true) + #expect((tan(θ°(180))).≈≈((sin(θ°(180))/cos(θ°(180))))).to eq(true) + expect((tan(θ°(210))).≈≈((sin(θ°(210))/cos(θ°(210))))).to eq(true) + expect((tan(θ°(225))).≈≈((sin(θ°(225))/cos(θ°(225))))).to eq(true) + expect((tan(θ°(240))).≈≈((sin(θ°(240))/cos(θ°(240))))).to eq(true) + #expect((tan(θ°(270))).≈≈((sin(θ°(270))/cos(θ°(270))))).to eq(true) + expect((tan(θ°(300))).≈≈((sin(θ°(300))/cos(θ°(300))))).to eq(true) + expect((tan(θ°(315))).≈≈((sin(θ°(315))/cos(θ°(315))))).to eq(true) + expect((tan(θ°(330))).≈≈((sin(θ°(330))/cos(θ°(330))))).to eq(true) + expect(tan(θ°(360))).to eq(sin(θ°(360))/cos(θ°(360))) + end + end # end: {func{tan}} + end # end: {math functions} + end # end: {trigonometry} context 'audit', :audit do diff --git a/spec/feature/f22/f22_b01_spec.rb b/spec/feature/f22/f22_b01_spec.rb index 9cb3490..a6954a8 100644 --- a/spec/feature/f22/f22_b01_spec.rb +++ b/spec/feature/f22/f22_b01_spec.rb @@ -3,7 +3,6 @@ RSpec.describe 'f22_b01' do context 'locale', :locale do - let(:build_configs){::RbConfig::CONFIG} context 'feature{f22}' do context 'behavior{b01}: Just-In-Time-Compiler{JIT}' do @@ -17,10 +16,10 @@ context 'Just-In_Time compiler{JIT} is supported' do context 'as defined through build-settings{::RbConfig}' do it 'built w/ jit enabled' do - expect(build_configs['MJIT_SUPPORT']).to eq('yes') + expect(::RbConfig::CONFIG['MJIT_SUPPORT']).to eq('yes') end it 'built w/ correct path for{clang}' do - expect(build_configs['MJIT_CC']).to eq("#{💻('which clang')} -fdeclspec") + expect(::RbConfig::CONFIG['MJIT_CC']).to eq("#{💻('which clang')} -fdeclspec") end end end # end: {Just-In_Time compiler{JIT} is supported} diff --git a/spec/feature/f26/f26_spec.rb b/spec/feature/f26/f26_spec.rb index e438ab9..f728595 100644 --- a/spec/feature/f26/f26_spec.rb +++ b/spec/feature/f26/f26_spec.rb @@ -1,21 +1,7 @@ # encoding: UTF-8 RSpec.describe 'f26' do - let(:flag_f26_b00){💎.engine.stats_ext['F26_B00']} - - context 'functionality' do - it 'main adds funcs{📅, 🕒, 📅🕒}' do - if flag_f26_b00 - expect(📅).to eq(::Date) - expect(🕒).to eq(::Time) - expect(📅🕒).to eq(::DateTime) - else - expect{📅}.to raise_error(::NameError) - expect{🕒}.to raise_error(::NameError) - expect{📅🕒}.to raise_error(::NameError) - end - end - end # end: {functionality} + let(:flag_f00_b04){💎.engine.stats_ext['F26_B00']} context 'audit', :audit do context 'feature(f26) passes audits' do diff --git a/spec/feature/f27/f27_b01_spec.rb b/spec/feature/f27/f27_b01_spec.rb index 97816bc..e92f96b 100644 --- a/spec/feature/f27/f27_b01_spec.rb +++ b/spec/feature/f27/f27_b01_spec.rb @@ -5,144 +5,207 @@ RSpec.describe 'f27_b01' do context 'functionality' do + context 'can sum to value{1} w/ all 4 internal formats' do + + it 'w/ 4 operations' do + the_angle = θ°(90) + the_angle += θʳ(π / 2.0) + the_angle += θᵍ(100.0) + the_angle += θ𝞽(0.25) + expect(the_angle).to eq(𝞽) + end - context 'can sum to value{1} w/' do + it 'w/ 8 operations' do + the_angle = θ°(0) + (0..1).each do |index| + the_angle += θ°(45) + the_angle += θʳ(π / 4.0) + the_angle += θᵍ(50.0) + the_angle += θ𝞽(1.0 / 8.0) + end + expect(the_angle).to eq(𝞽) + end - context 'all 4 internal formats' do + it 'w/ 16 operations' do + the_angle = θ°(0) + (0..3).each do |index| + the_angle += θ°(22.5) + the_angle += θʳ(π / 8.0) + the_angle += θᵍ(25.0) + the_angle += θ𝞽(1.0 / 16) + end + expect(the_angle).to eq(𝞽) + end - it 'w/ 4 operations' do - the_angle = θ°(90) - the_angle += θʳ(π / 2.0) - the_angle += θᵍ(100.0) - the_angle += θ𝞽(0.25) - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 32 operations' do + the_angle = θ°(0) + (0..7).each do |index| + the_angle += θ°(11.25) + the_angle += θʳ(π / 16.0) + the_angle += θᵍ(12.5) + the_angle += θ𝞽(1.0 / 32) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 8 operations' do - the_angle = θ°(0) - (0..1).each do |index| - the_angle += θ°(45) - the_angle += θʳ(π / 4.0) - the_angle += θᵍ(50.0) - the_angle += θ𝞽(1.0 / 8.0) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 64 operations' do + the_angle = θ°(0) + (0..15).each do |index| + the_angle += θ°(5.625) + the_angle += θʳ(π / 32.0) + the_angle += θᵍ(6.25) + the_angle += θ𝞽(1.0 / 64) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 16 operations' do - the_angle = θ°(0) - (0..3).each do |index| - the_angle += θ°(22.5) - the_angle += θʳ(π / 8.0) - the_angle += θᵍ(25.0) - the_angle += θ𝞽(1.0 / 16) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 128 operations' do + the_angle = θ°(0) + (0..31).each do |index| + the_angle += θ°(2.8125) + the_angle += θʳ(π / 64.0) + the_angle += θᵍ(3.125) + the_angle += θ𝞽(1.0 / 128) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 32 operations' do - the_angle = θ°(0) - (0..7).each do |index| - the_angle += θ°(11.25) - the_angle += θʳ(π / 16.0) - the_angle += θᵍ(12.5) - the_angle += θ𝞽(1.0 / 32) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 256 operations' do + the_angle = θ°(0) + (0..63).each do |index| + the_angle += θ°(1.40625) + the_angle += θʳ(π / 128.0) + the_angle += θᵍ(1.5625) + the_angle += θ𝞽(1.0 / 256) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 64 operations' do - the_angle = θ°(0) - (0..15).each do |index| - the_angle += θ°(5.625) - the_angle += θʳ(π / 32.0) - the_angle += θᵍ(6.25) - the_angle += θ𝞽(1.0 / 64) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 512 operations' do + the_angle = θ°(0) + (0..127).each do |index| + the_angle += θ°(0.703125) + the_angle += θʳ(π / 256.0) + the_angle += θᵍ(0.78125) + the_angle += θ𝞽(1.0 / 512) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 128 operations' do - the_angle = θ°(0) - (0..31).each do |index| - the_angle += θ°(2.8125) - the_angle += θʳ(π / 64.0) - the_angle += θᵍ(3.125) - the_angle += θ𝞽(1.0 / 128) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 1024 operations' do + the_angle = θ°(0) + (0..255).each do |index| + the_angle += θ°(0.3515625) + the_angle += θʳ(π / 512.0) + the_angle += θᵍ(0.390625) + the_angle += θ𝞽(1.0 / 1024) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 256 operations' do - the_angle = θ°(0) - (0..63).each do |index| - the_angle += θ°(1.40625) - the_angle += θʳ(π / 128.0) - the_angle += θᵍ(1.5625) - the_angle += θ𝞽(1.0 / 256) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 2048 operations' do + the_angle = θ°(0) + (0..511).each do |index| + the_angle += θ°(0.17578125) + the_angle += θʳ(π / 1024.0) + the_angle += θᵍ(0.1953125) + the_angle += θ𝞽(1.0 / 2048) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 512 operations' do - the_angle = θ°(0) - (0..127).each do |index| - the_angle += θ°(0.703125) - the_angle += θʳ(π / 256.0) - the_angle += θᵍ(0.78125) - the_angle += θ𝞽(1.0 / 512) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 4096 operations' do + the_angle = θ°(0) + (0..1023).each do |index| + the_angle += θ°(0.087890625) + the_angle += θʳ(π / 2048.0) + the_angle += θᵍ(0.09765625) + the_angle += θ𝞽(1.0 / 4096) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 1024 operations' do - the_angle = θ°(0) - (0..255).each do |index| - the_angle += θ°(0.3515625) - the_angle += θʳ(π / 512.0) - the_angle += θᵍ(0.390625) - the_angle += θ𝞽(1.0 / 1024) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 8192 operations' do + the_angle = θ°(0) + (0..2047).each do |index| + the_angle += θ°(0.0439453125) + the_angle += θʳ(π / 4096.0) + the_angle += θᵍ(0.048828125) + the_angle += θ𝞽(1.0 / 8192) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 2048 operations' do - the_angle = θ°(0) - (0..511).each do |index| - the_angle += θ°(0.17578125) - the_angle += θʳ(π / 1024.0) - the_angle += θᵍ(0.1953125) - the_angle += θ𝞽(1.0 / 2048) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 16384 operations' do + the_angle = θ°(0) + (0..4095).each do |index| + the_angle += θ°(0.02197265625) + the_angle += θʳ(π / 8192.0) + the_angle += θᵍ(0.0244140625) + the_angle += θ𝞽(1.0 / 16384) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 4096 operations' do - the_angle = θ°(0) - (0..1023).each do |index| - the_angle += θ°(0.087890625) - the_angle += θʳ(π / 2048.0) - the_angle += θᵍ(0.09765625) - the_angle += θ𝞽(1.0 / 4096) - end - expect(the_angle).to eq(::Math::ANGLE_TAU) + it 'w/ 32768 operations' do + the_angle = θ°(0) + (0..8191).each do |index| + the_angle += θ°(0.010986328125) + the_angle += θʳ(π / 16384.0) + the_angle += θᵍ(0.01220703125) + the_angle += θ𝞽(1.0 / 32768) end + expect(the_angle).to eq(𝞽) + end - it 'w/ 8192 operations' do + it 'w/ 65536 operations' do + the_angle = θ°(0) + (0..16383).each do |index| + the_angle += θ°(0.0054931640625) + the_angle += θʳ(π / 32768.0) + the_angle += θᵍ(0.006103515625) + the_angle += θ𝞽(1.0 / 65536) + end + expect(the_angle).to eq(𝞽) + end + + it 'w/ 131072 operations' do + the_angle = θ°(0) + (0..32767).each do |index| + the_angle += θ°(0.00274658203125) + the_angle += θʳ(π / 65536.0) + the_angle += θᵍ(0.0030517578125) + the_angle += θ𝞽(1.0 / 131072) + end + expect(the_angle).to eq(𝞽) + end + + it 'w/ 262144 operations' do + the_angle = θ°(0) + (0..65535).each do |index| + the_angle += θ°(0.001373291015625) + the_angle += θʳ(π / 131072.0) + the_angle += θᵍ(0.00152587890625) + the_angle += θ𝞽(1.0 / 262144) + end + expect(the_angle).to eq(𝞽) + end + + context 'w/ current precision loss ~ 500k+ operations', :tech_debt do + it 'not matching w/ 524288 operations' do the_angle = θ°(0) - (0..2047).each do |index| - the_angle += θ°(0.0439453125) - the_angle += θʳ(π / 4096.0) - the_angle += θᵍ(0.048828125) - the_angle += θ𝞽(1.0 / 8192) + (0..131071).each do |index| + the_angle += θ°(0.000686645507813) + the_angle += θʳ(π / 262144.0) + the_angle += θᵍ(0.000762939453125) + the_angle += θ𝞽(1.0 / 524288) end - expect(the_angle).to eq(::Math::ANGLE_TAU) + # the_angle == 360.000000000002 + expect(the_angle).to_not eq(𝞽) end - end end - end end diff --git a/spec/feature/f28/f28_b00_spec.rb b/spec/feature/f28/f28_b00_spec.rb index 16e4856..cf376bc 100644 --- a/spec/feature/f28/f28_b00_spec.rb +++ b/spec/feature/f28/f28_b00_spec.rb @@ -4,34 +4,33 @@ using ::Object::ContextSuperscripts RSpec.describe 'f28_b00' do - context 'functionality' do - context 'golden ratio' do - context 'has correct value' do - it '𝚽 == √𝚽 * √𝚽' do - expect(𝚽).to eq(√(𝚽) * √(𝚽)) - end - it '𝚽 == √((5+√5) / (5-√5))' do - expect(𝚽).to eq(√((5+√(5))/(5-√(5)))) + + context 'golden ratio', :integration do + + context 'has correct value' do + it '𝚽 == √𝚽 * √𝚽' do + expect(𝚽).to eq(√(𝚽) * √(𝚽)) + end + it '𝚽 == √((5+√5) / (5-√5))' do + expect(𝚽).to eq(√((5+√(5))/(5-√(5)))) + end + it '𝚽 == (1 + √(5)) / 2.0' do + expect(𝚽).to eq((1 + √(5)) / 2.0) + end + + context 'trig related functions' do + it '𝚽 = 2 * sin(54°)' do + expect(𝚽).to eq(2 * sin(θ°(54))) end - it '𝚽 == (1 + √(5)) / 2.0' do - expect(𝚽).to eq((1 + √(5)) / 2.0) + it '𝚽 = 1 + 2 * sin(18°)' do + expect(𝚽).to eq(1.0 + 2.0 * sin(θ°(18))) end - context 'trig related functions' do - it '𝚽 = 2 * sin(54°)' do - expect(𝚽).to eq(2 * sin(θ°(54))) - end - it '𝚽 = 1 + 2 * sin(18°)' do - expect(𝚽).to eq(1.0 + 2.0 * sin(θ°(18))) - end - it '𝚽 = ½ * csc(18°)' do - expect(𝚽).to eq(0.5 * csc(θ°(18))) - end + it '𝚽 = ½ * csc(18°)' do + expect(𝚽).to eq(0.5 * csc(θ°(18))) end end - end # end: {golden ratio} - end + end - context 'integration tests', :integration do context '{f28_b00} and {f16}' do it '0 == 𝚽^² - 𝚽 - 1' do expect((𝚽 ** 2) - 𝚽 - 1.0).to eq(0) @@ -47,5 +46,7 @@ expect(𝚽 ** 2).to eq(𝚽 + 1) end end - end + + end # end: {golden ratio integration tests} + end diff --git a/spec/feature/f28/f28_b02_spec.rb b/spec/feature/f28/f28_b02_spec.rb index 9457f52..57c7bf5 100644 --- a/spec/feature/f28/f28_b02_spec.rb +++ b/spec/feature/f28/f28_b02_spec.rb @@ -4,34 +4,32 @@ using ::Object::ContextSuperscripts RSpec.describe 'f28_b02' do - context 'functionality' do - context '℮' do - context 'has correct value' do - it '℮ == Math::E' do - expect(℮).to eq(::Math::E) - expect(℮.ⓣ).to eq(::Float) - expect(℮ < 3).to eq(true) - expect(℮ > 2).to eq(true) - end - - it 'parses{℮^⁰} correctly' do - expect(℮ ** 0).to eq(1) - expect(℮^⁰).to eq(1) - end + context '℮', :integration do + context 'has correct value' do + it '℮ == Math::E' do + expect(℮).to eq(::Math::E) + expect(℮.ⓣ).to eq(::Float) + expect(℮ < 3).to eq(true) + expect(℮ > 2).to eq(true) + end - context 'works w/ needed relating equations' do + it 'parses{℮^⁰} correctly' do + expect(℮ ** 0).to eq(1) + expect(℮^⁰).to eq(1) + end - it "Euler's Identity" do - expect((℮ ** (1i * π)) + 1.0).to eq(0) - end + context 'works w/ needed relating equations' do - it "Euler's Formula" do - expect(℮ ** (1i * 1)).to eq(cos(θʳ(1)) + 1i * sin(θʳ(1))) - end + it "Euler's Identity" do + expect((℮ ** (1i * π)) + 1.0).to eq(0) + end + it "Euler's Formula" do + expect(℮ ** (1i * 1)).to eq(cos(θʳ(1)) + 1i * sin(θʳ(1))) end end - end # end: {angle tau} + + end end end diff --git a/spec/feature/f28/f28_b05_spec.rb b/spec/feature/f28/f28_b05_spec.rb index 26a148e..fa54412 100644 --- a/spec/feature/f28/f28_b05_spec.rb +++ b/spec/feature/f28/f28_b05_spec.rb @@ -3,25 +3,23 @@ using ::ThetaAngle::ContextRuuuby RSpec.describe 'f28_b05' do - context 'functionality' do - context 'silver ratio' do - context 'has correct value' do - it 'δ = 1 + √2' do - expect(::Float::RATIO_SILVER).to eq(1 + √(2)) + context 'silver ratio', :integration do + context 'has correct value' do + it 'δ = 1 + √2' do + expect(::Float::RATIO_SILVER).to eq(1 + √(2)) + end + context 'w/ trig funcs' do + it 'sinʳ(⅛π)' do + expect((sin(θʳ(π / 8.0))).≈≈((√(1.0 - (1.0 / ::Float::RATIO_SILVER))) / 2.0)).to eq(true) + end + it 'cosʳ(⅛π)' do + expect((cos(θʳ(π / 8.0))).≈≈((√(1.0 + ::Float::RATIO_SILVER)) / 2.0)).to eq(true) + end + it 'tanʳ(⅛π)' do + expect((tan(θʳ(π * 3.0/8))).≈≈(::Float::RATIO_SILVER)).to eq(true) end - context 'w/ trig funcs' do - it 'sinʳ(⅛π)' do - expect((sin(θʳ(π / 8.0))).≈≈((√(1.0 - (1.0 / ::Float::RATIO_SILVER))) / 2.0)).to eq(true) - end - it 'cosʳ(⅛π)' do - expect((cos(θʳ(π / 8.0))).≈≈((√(1.0 + ::Float::RATIO_SILVER)) / 2.0)).to eq(true) - end - it 'tanʳ(⅛π)' do - expect((tan(θʳ(π * 3.0/8))).≈≈(::Float::RATIO_SILVER)).to eq(true) - end - it 'cotʳ(⅛π)' do - expect((cot(θʳ(π / 8.0))).≈≈(::Float::RATIO_SILVER)).to eq(true) - end + it 'cotʳ(⅛π)' do + expect((cot(θʳ(π / 8.0))).≈≈(::Float::RATIO_SILVER)).to eq(true) end end end diff --git a/spec/feature/f29/f29_db_orm_spec.rb b/spec/feature/f29/f29_db_orm_spec.rb deleted file mode 100644 index cfb63d8..0000000 --- a/spec/feature/f29/f29_db_orm_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f29_db_orm' do - - context 'db_orm', :db do - - context 'defines{f29}' do - - it 'passes ORM audit' do - audit_feature(f29, 'f29', 0, 'add new class (`Quaternion`) for easier operations involving `quaternions`') - end - - end - - end - -end diff --git a/spec/feature/f31/f31_b01_spec.rb b/spec/feature/f31/f31_b01_spec.rb index dd44f93..2638a0c 100644 --- a/spec/feature/f31/f31_b01_spec.rb +++ b/spec/feature/f31/f31_b01_spec.rb @@ -99,11 +99,6 @@ expect(cached_configs['diff.renames']).to eq('copies') end it '{algorithm}' do - # mini-changelog - # | version | value | - # | ------- | --------- | - # | 0.0.48 | minimal | - # | 0.0.49+ | histogram | expect(cached_configs['diff.algorithm']).to eq('histogram') end diff --git a/spec/feature/f35/f35_spec.rb b/spec/feature/f35/f35_spec.rb deleted file mode 100644 index 031b302..0000000 --- a/spec/feature/f35/f35_spec.rb +++ /dev/null @@ -1,67 +0,0 @@ -# encoding: UTF-8 - -RSpec.describe 'f35' do - - context 'temp location', :rng do - context 'rng.rb' do - - it 'func{🎲.𝔦𝔦}' do - # @see http://www.clayford.net/statistics/how-many-rolls-of-a-die-to-see-all-sides-at-least-once/ - num_trails_expected_on_avg = 15 - side_counts = [0,0,0,0,0,0] - allowed_maximum_trials = ((num_trails_expected_on_avg ** 𝚽) ** 𝚽).to_i - num_trails_executed = 0 - num_trail_counter = 0 - all_sides_hit = false - allowed_maximum_trials.∀ do || - side_counts[🎲.𝔦𝔦(0, 5)] += 1 - if num_trails_executed < num_trails_expected_on_avg || num_trail_counter == num_trails_expected_on_avg - all_sides_hit = !(side_counts.any?{|i| i == 0}) - if all_sides_hit - break - end - num_trail_counter = 0 - else - num_trail_counter += 1 - end - num_trails_executed += 1 - end - - delta_off = num_trails_executed < num_trails_expected_on_avg ? num_trails_expected_on_avg - num_trails_executed : num_trails_executed - num_trails_expected_on_avg - - puts "| 00 | #{num_trails_executed.to_s} | TODO | #{delta_off.to_s} |" - - expect(all_sides_hit).to eq(true) - end - - it 'func{🎲.𝔣}' do - the_sum = 0.0 - 99999.∀ do || - the_sum += 🎲.𝔣 - end - the_average = the_sum / 99999.0 - percent_err = ::Math::Stats::Descriptive.percentage_error(0.5,the_average) - delta_off = (0.05 - percent_err).abs - - puts "| 01 | #{the_average.to_s} | #{percent_err.to_s} | #{delta_off.to_s} |" - - expect(percent_err < 0.05) - end - - end - end - - context 'hybrid tests', :integration do - context 'dual-behaviors' do - - context 'feature{f35}, behaviors{b00, b03}' do - it '{simple_moving_average} matches data provided from {arithmetic_mean}' do - data = [1337, (🎲.𝔦(1337)), (🎲.𝔦(1337)), (🎲.𝔦(1337)), (🎲.𝔦(1337))] - expect(::Math::Stats.μ(*data)).to eq(::Math::Stats::TimeSeries.simple_moving_average(data, data.length)[0]) - end - end # end: {feature{f35}, behaviors{b00, b03}} - - end # end: {dual-behaviors} - end # end: {integration} - -end diff --git a/spec/feature/f98/f98_b00_spec.rb b/spec/feature/f98/f98_b00_spec.rb index a1f4347..4c7a7bb 100644 --- a/spec/feature/f98/f98_b00_spec.rb +++ b/spec/feature/f98/f98_b00_spec.rb @@ -4,8 +4,14 @@ context 'feature{f98} for', :locale do context '{b00}' do - it 'has{gnu11} correctly marked' do - expect(💎.engine.stats_ext['compiler']).to eq('gnu11') + it 'has compiler-standard{gnu11} correctly marked' do + expect(💎.engine.stats_ext['compiler']['standard']).to eq('gnu11') + end + it 'has compiler{apple} correctly marked' do + expect(💎.engine.stats_ext['compiler']['name']).to eq('apple') + end + it 'has compiler-version{12.0.0} correctly marked' do + expect(💎.engine.stats_ext['compiler']['version']).to eq('12.0.0') end end end diff --git a/spec/helpers/db/autoload_me.rb b/spec/helpers/db/autoload_me.rb index 85499d6..6009b7a 100644 --- a/spec/helpers/db/autoload_me.rb +++ b/spec/helpers/db/autoload_me.rb @@ -1,14 +1,33 @@ # encoding: UTF-8 $ruuuby = 💎 -$ruuuby.engine.stats_ext['RUUUBY_ENV'] = 'dev' -$ruuuby.engine.stats_ext['RUUUBY_CONFIGS'] = 'configs_local/db/dev.yml' +$ruuuby.engine.stats_ext['RUUUBY_ENV'] = 'test' +$ruuuby.engine.stats_ext['RUUUBY_CONFIGS'] = 'configs_local/db/test.yml' require_relative '../../../lib/ruuuby/db/migrations/migration_ext' require_relative '../../../lib/ruuuby/db/migrations/ruuuby_gem' +require_relative '../../../lib/ruuuby/db/migrations/env_vars' $orm = 💎.engine.orm +class CreateMockData < RuuubyDBMigration + def self.up + create_table :mock_data do |t| + t.string :mock_data, :null => false + + t.index :mock_data, unique: true + end + end + def self.down + ♻️index(:mock_data, :mock_data) + ♻️table(:mock_data) + end +end + +class MockData < ApplicationRecord + self.table_name= :mock_data +end + module HelpersDB def audit_feature(the_feature, feature_str, expected_num_feats, description) @@ -64,263 +83,4 @@ def audit_feature_behavior(the_feature, the_feature_behavior, uid, description) let(:data_git_author_date_oldest){'2018-12-13T18:03:49-06:00'} let(:data_git_author_date_newer){'2020-11-31T18:03:39-06:00'} let(:data_git_author_date_wo_normalization){'2019-12-31 18:03:39 -0600'} - - let(:v0_0_0){::RuuubyRelease[0, 0, 0]} - let(:v0_0_1){::RuuubyRelease[0, 0, 1]} - let(:v0_0_2){::RuuubyRelease[0, 0, 2]} - let(:v0_0_3){::RuuubyRelease[0, 0, 3]} - let(:v0_0_4){::RuuubyRelease[0, 0, 4]} - let(:v0_0_5){::RuuubyRelease[0, 0, 5]} - let(:v0_0_6){::RuuubyRelease[0, 0, 6]} - let(:v0_0_7){::RuuubyRelease[0, 0, 7]} - let(:v0_0_8){::RuuubyRelease[0, 0, 8]} - let(:v0_0_9){::RuuubyRelease[0, 0, 9]} - let(:v0_0_10){::RuuubyRelease[0, 0, 10]} - let(:v0_0_11){::RuuubyRelease[0, 0, 11]} - let(:v0_0_12){::RuuubyRelease[0, 0, 12]} - let(:v0_0_13){::RuuubyRelease[0, 0, 13]} - let(:v0_0_14){::RuuubyRelease[0, 0, 14]} - let(:v0_0_15){::RuuubyRelease[0, 0, 15]} - let(:v0_0_16){::RuuubyRelease[0, 0, 16]} - let(:v0_0_17){::RuuubyRelease[0, 0, 17]} - let(:v0_0_18){::RuuubyRelease[0, 0, 18]} - let(:v0_0_19){::RuuubyRelease[0, 0, 19]} - let(:v0_0_20){::RuuubyRelease[0, 0, 20]} - let(:v0_0_21){::RuuubyRelease[0, 0, 21]} - let(:v0_0_22){::RuuubyRelease[0, 0, 22]} - let(:v0_0_23){::RuuubyRelease[0, 0, 23]} - let(:v0_0_24){::RuuubyRelease[0, 0, 24]} - let(:v0_0_25){::RuuubyRelease[0, 0, 25]} - let(:v0_0_26){::RuuubyRelease[0, 0, 26]} - let(:v0_0_27){::RuuubyRelease[0, 0, 27]} - let(:v0_0_28){::RuuubyRelease[0, 0, 28]} - let(:v0_0_29){::RuuubyRelease[0, 0, 29]} - let(:v0_0_30){::RuuubyRelease[0, 0, 30]} - let(:v0_0_31){::RuuubyRelease[0, 0, 31]} - let(:v0_0_32){::RuuubyRelease[0, 0, 32]} - let(:v0_0_33){::RuuubyRelease[0, 0, 33]} - let(:v0_0_34){::RuuubyRelease[0, 0, 34]} - let(:v0_0_35){::RuuubyRelease[0, 0, 35]} - let(:v0_0_36){::RuuubyRelease[0, 0, 36]} - let(:v0_0_37){::RuuubyRelease[0, 0, 37]} - let(:v0_0_38){::RuuubyRelease[0, 0, 38]} - let(:v0_0_39){::RuuubyRelease[0, 0, 39]} - let(:v0_0_40){::RuuubyRelease[0, 0, 40]} - let(:v0_0_41){::RuuubyRelease[0, 0, 41]} - let(:v0_0_42){::RuuubyRelease[0, 0, 42]} - let(:v0_0_43){::RuuubyRelease[0, 0, 43]} - let(:v0_0_44){::RuuubyRelease[0, 0, 44]} - let(:v0_0_45){::RuuubyRelease[0, 0, 45]} - let(:v0_0_46){::RuuubyRelease[0, 0, 46]} - let(:v0_0_47){::RuuubyRelease[0, 0, 47]} - let(:v0_0_48){::RuuubyRelease[0, 0, 48]} - let(:v0_0_49){::RuuubyRelease[0, 0, 49]} - - let(:f00){::RuuubyFeature[0]} - let(:f00_b00){f00.ruuuby_feature_behaviors[0]} - let(:f00_b01){f00.ruuuby_feature_behaviors[1]} - - let(:f01){::RuuubyFeature[1]} - let(:f01_b00){f01.ruuuby_feature_behaviors[0]} - let(:f01_b01){f01.ruuuby_feature_behaviors[1]} - let(:f01_b02){f01.ruuuby_feature_behaviors[2]} - let(:f01_b03){f01.ruuuby_feature_behaviors[3]} - let(:f01_b04){f01.ruuuby_feature_behaviors[4]} - let(:f01_b05){f01.ruuuby_feature_behaviors[5]} - - let(:f02){::RuuubyFeature[2]} - let(:f03){::RuuubyFeature[3]} - - let(:f04){::RuuubyFeature[4]} - let(:f04_b00){f04.ruuuby_feature_behaviors[0]} - let(:f04_b01){f04.ruuuby_feature_behaviors[1]} - let(:f04_b02){f04.ruuuby_feature_behaviors[2]} - - let(:f05){::RuuubyFeature[5]} - let(:f05_b00){f05.ruuuby_feature_behaviors[0]} - let(:f05_b01){f05.ruuuby_feature_behaviors[1]} - - let(:f06){::RuuubyFeature[6]} - let(:f06_b00){f06.ruuuby_feature_behaviors[0]} - let(:f06_b01){f06.ruuuby_feature_behaviors[1]} - let(:f06_b02){f06.ruuuby_feature_behaviors[2]} - let(:f06_b03){f06.ruuuby_feature_behaviors[3]} - let(:f06_b04){f06.ruuuby_feature_behaviors[4]} - let(:f06_b05){f06.ruuuby_feature_behaviors[5]} - let(:f06_b06){f06.ruuuby_feature_behaviors[6]} - let(:f06_b07){f06.ruuuby_feature_behaviors[7]} - let(:f06_b08){f06.ruuuby_feature_behaviors[8]} - let(:f06_b09){f06.ruuuby_feature_behaviors[9]} - - let(:f07){::RuuubyFeature[7]} - let(:f07_b00){f07.ruuuby_feature_behaviors[0]} - - let(:f08){::RuuubyFeature[8]} - let(:f09){::RuuubyFeature[9]} - - let(:f10){::RuuubyFeature[10]} - let(:f10_b00){f10.ruuuby_feature_behaviors[0]} - let(:f10_b01){f10.ruuuby_feature_behaviors[1]} - let(:f10_b02){f10.ruuuby_feature_behaviors[2]} - let(:f10_b03){f10.ruuuby_feature_behaviors[3]} - let(:f10_b04){f10.ruuuby_feature_behaviors[4]} - let(:f10_b05){f10.ruuuby_feature_behaviors[5]} - let(:f10_b06){f10.ruuuby_feature_behaviors[6]} - let(:f10_b07){f10.ruuuby_feature_behaviors[7]} - let(:f10_b08){f10.ruuuby_feature_behaviors[8]} - - let(:f11){::RuuubyFeature[11]} - let(:f11_b00){f11.ruuuby_feature_behaviors[0]} - let(:f11_b01){f11.ruuuby_feature_behaviors[1]} - let(:f11_b02){f11.ruuuby_feature_behaviors[2]} - - let(:f12){::RuuubyFeature[12]} - let(:f12_b00){f12.ruuuby_feature_behaviors[0]} - let(:f12_b01){f12.ruuuby_feature_behaviors[1]} - - let(:f13){::RuuubyFeature[13]} - let(:f15){::RuuubyFeature[15]} - let(:f16){::RuuubyFeature[16]} - let(:f17){::RuuubyFeature[17]} - let(:f18){::RuuubyFeature[18]} - let(:f19){::RuuubyFeature[19]} - let(:f20){::RuuubyFeature[20]} - let(:f21){::RuuubyFeature[21]} - - let(:f22){::RuuubyFeature[22]} - let(:f22_b00){f22.ruuuby_feature_behaviors[0]} - let(:f22_b01){f22.ruuuby_feature_behaviors[1]} - let(:f22_b02){f22.ruuuby_feature_behaviors[2]} - let(:f22_b03){f22.ruuuby_feature_behaviors[3]} - let(:f22_b04){f22.ruuuby_feature_behaviors[4]} - let(:f22_b05){f22.ruuuby_feature_behaviors[5]} - let(:f22_b06){f22.ruuuby_feature_behaviors[6]} - let(:f22_b07){f22.ruuuby_feature_behaviors[7]} - - let(:f23){::RuuubyFeature[23]} - - let(:f24){::RuuubyFeature[24]} - let(:f24_b00){f24.ruuuby_feature_behaviors[0]} - let(:f24_b01){f24.ruuuby_feature_behaviors[1]} - let(:f24_b02){f24.ruuuby_feature_behaviors[2]} - let(:f24_b03){f24.ruuuby_feature_behaviors[3]} - - let(:f25){::RuuubyFeature[25]} - - let(:f26){::RuuubyFeature[26]} - let(:f26_b00){f26.ruuuby_feature_behaviors[0]} - - let(:f27){::RuuubyFeature[27]} - let(:f27_b00){f27.ruuuby_feature_behaviors[0]} - let(:f27_b01){f27.ruuuby_feature_behaviors[1]} - let(:f27_b02){f27.ruuuby_feature_behaviors[2]} - let(:f27_b03){f27.ruuuby_feature_behaviors[3]} - let(:f27_b04){f27.ruuuby_feature_behaviors[4]} - let(:f27_b05){f27.ruuuby_feature_behaviors[5]} - let(:f27_b06){f27.ruuuby_feature_behaviors[6]} - let(:f27_b07){f27.ruuuby_feature_behaviors[7]} - let(:f27_b08){f27.ruuuby_feature_behaviors[8]} - let(:f27_b09){f27.ruuuby_feature_behaviors[9]} - let(:f27_b10){f27.ruuuby_feature_behaviors[10]} - - let(:f28){::RuuubyFeature[28]} - let(:f28_b00){f28.ruuuby_feature_behaviors[0]} - let(:f28_b01){f28.ruuuby_feature_behaviors[1]} - let(:f28_b02){f28.ruuuby_feature_behaviors[2]} - let(:f28_b03){f28.ruuuby_feature_behaviors[3]} - let(:f28_b04){f28.ruuuby_feature_behaviors[4]} - let(:f28_b05){f28.ruuuby_feature_behaviors[5]} - let(:f28_b06){f28.ruuuby_feature_behaviors[6]} - let(:f28_b07){f28.ruuuby_feature_behaviors[7]} - let(:f28_b08){f28.ruuuby_feature_behaviors[8]} - let(:f28_b09){f28.ruuuby_feature_behaviors[9]} - let(:f28_b10){f28.ruuuby_feature_behaviors[10]} - let(:f28_b11){f28.ruuuby_feature_behaviors[11]} - let(:f28_b12){f28.ruuuby_feature_behaviors[12]} - - let(:f29){::RuuubyFeature[29]} - - let(:f30){::RuuubyFeature[30]} - let(:f30_b00){f30.ruuuby_feature_behaviors[0]} - let(:f30_b01){f30.ruuuby_feature_behaviors[1]} - let(:f30_b02){f30.ruuuby_feature_behaviors[2]} - let(:f30_b03){f30.ruuuby_feature_behaviors[3]} - let(:f30_b04){f30.ruuuby_feature_behaviors[4]} - - let(:f31){::RuuubyFeature[31]} - let(:f31_b00){f31.ruuuby_feature_behaviors[0]} - let(:f31_b01){f31.ruuuby_feature_behaviors[1]} - - let(:f32){::RuuubyFeature[32]} - let(:f32_b00){f32.ruuuby_feature_behaviors[0]} - let(:f32_b01){f32.ruuuby_feature_behaviors[1]} - let(:f32_b02){f32.ruuuby_feature_behaviors[2]} - let(:f32_b03){f32.ruuuby_feature_behaviors[3]} - let(:f32_b04){f32.ruuuby_feature_behaviors[4]} - let(:f32_b05){f32.ruuuby_feature_behaviors[5]} - let(:f32_b06){f32.ruuuby_feature_behaviors[6]} - let(:f32_b07){f32.ruuuby_feature_behaviors[7]} - let(:f32_b08){f32.ruuuby_feature_behaviors[8]} - let(:f32_b09){f32.ruuuby_feature_behaviors[9]} - let(:f32_b10){f32.ruuuby_feature_behaviors[10]} - - let(:f33){::RuuubyFeature[33]} - - let(:f34){::RuuubyFeature[34]} - let(:f34_b00){f34.ruuuby_feature_behaviors[0]} - let(:f34_b01){f34.ruuuby_feature_behaviors[1]} - let(:f34_b02){f34.ruuuby_feature_behaviors[2]} - let(:f34_b03){f34.ruuuby_feature_behaviors[3]} - let(:f34_b04){f34.ruuuby_feature_behaviors[4]} - - let(:f35){::RuuubyFeature[35]} - let(:f35_b00){f35.ruuuby_feature_behaviors[0]} - let(:f35_b01){f35.ruuuby_feature_behaviors[1]} - let(:f35_b02){f35.ruuuby_feature_behaviors[2]} - let(:f35_b03){f35.ruuuby_feature_behaviors[3]} - - let(:f36){::RuuubyFeature[36]} - let(:f36_b00){f36.ruuuby_feature_behaviors[0]} - let(:f36_b01){f36.ruuuby_feature_behaviors[1]} - let(:f36_b02){f36.ruuuby_feature_behaviors[2]} - let(:f36_b03){f36.ruuuby_feature_behaviors[3]} - let(:f36_b04){f36.ruuuby_feature_behaviors[4]} - let(:f36_b05){f36.ruuuby_feature_behaviors[5]} - let(:f36_b06){f36.ruuuby_feature_behaviors[6]} - let(:f36_b07){f36.ruuuby_feature_behaviors[7]} - - let(:f37){::RuuubyFeature[37]} - let(:f37_b00){f37.ruuuby_feature_behaviors[0]} - let(:f37_b01){f37.ruuuby_feature_behaviors[1]} - let(:f37_b02){f37.ruuuby_feature_behaviors[2]} - - let(:f38){::RuuubyFeature[38]} - let(:f38_b00){f38.ruuuby_feature_behaviors[0]} - let(:f38_b01){f38.ruuuby_feature_behaviors[1]} - let(:f38_b02){f38.ruuuby_feature_behaviors[2]} - let(:f38_b03){f38.ruuuby_feature_behaviors[3]} - - let(:f39){::RuuubyFeature[39]} - - let(:f40){::RuuubyFeature[40]} - let(:f40_b00){f40.ruuuby_feature_behaviors[0]} - let(:f40_b01){f40.ruuuby_feature_behaviors[1]} - - let(:f41){::RuuubyFeature[41]} - let(:f41_b00){f41.ruuuby_feature_behaviors[0]} - let(:f41_b01){f41.ruuuby_feature_behaviors[1]} - - let(:f42){::RuuubyFeature[42]} - - let(:f93){::RuuubyFeature[93]} - let(:f94){::RuuubyFeature[94]} - let(:f95){::RuuubyFeature[95]} - let(:f96){::RuuubyFeature[96]} - let(:f97){::RuuubyFeature[97]} - - let(:f98){::RuuubyFeature[98]} - let(:f98_b00){f98.ruuuby_feature_behaviors[0]} - let(:f98_b01){f98.ruuuby_feature_behaviors[1]} - let(:f98_b02){f98.ruuuby_feature_behaviors[2]} - end diff --git a/spec/helpers/locale/autoload_me.rb b/spec/helpers/locale/autoload_me.rb index cf6663c..b48c762 100644 --- a/spec/helpers/locale/autoload_me.rb +++ b/spec/helpers/locale/autoload_me.rb @@ -3,6 +3,22 @@ require_relative '../../../lib/ruuuby/module/gem' require_relative '../../../lib/ruuuby/module/bundler' +module ::Ruuuby::MetaData + class EngineComponent + def version + @cached_version = self._calculate_version if @cached_version.∅? + @cached_version + end + end +end + +module ::Ruuuby::MetaData + class EngineComponentAPICLI < ::Ruuuby::MetaData::EngineComponent + # @return [String, Array] + def _calculate_version; self.run_cmd('--version'); end + end +end + module ::TTY class Command attribute_versionable('0.10.0'){::TTY::Command::VERSION} diff --git a/spec/helpers/rng/autoload_me.rb b/spec/helpers/rng/autoload_me.rb new file mode 100644 index 0000000..dd55d69 --- /dev/null +++ b/spec/helpers/rng/autoload_me.rb @@ -0,0 +1 @@ +# encoding: UTF-8 diff --git a/spec/feature/f15/readme_spec.rb b/spec/integration/readme_spec.rb similarity index 82% rename from spec/feature/f15/readme_spec.rb rename to spec/integration/readme_spec.rb index 66c7bcd..3b652b6 100644 --- a/spec/feature/f15/readme_spec.rb +++ b/spec/integration/readme_spec.rb @@ -3,30 +3,18 @@ using ::ThetaAngle::ContextRuuuby using ::String::ContextF24 using ::Object::ContextSuperscripts -include( - ::Math::Trig -) RSpec.describe 'README.md' do - # __ ___ __ - # /\ | | | \ | | /__` - # /~~\ \__/ |__/ | | .__/ - - context 'audit', :audit do + context 'integration', :integration do context 'README.md examples' do it 'works as described' do - expect(√(1787569)).to eq(1337) - expect(√(√(-1337.0^⁴))).to eq(1337) - expect(𝚽).to eq(1 + (𝚽^⁻¹)) expect(𝚽).to eq(2 * sin(θ°(54))) - expect(𝚽).to eq((θ°(360) - Ⴔ) / Ⴔ) expect(π).to eq(5 * acos(𝚽 / 2)) - - expect(θ°(180)).to eq(θ𝞽(0.5)) - expect(θᵍ(200)).to eq(θʳ(π)) + expect(θ°(360)).to eq(θʳ(π/2) * 4) + expect(√(√(-1337.0^⁴))).to eq(1337) expect('b'.∈? 'abc').to eq(true) expect('abc'.∌? 'd').to eq(true) @@ -37,15 +25,13 @@ expect(['snake_case'.🐍?, 'AHHH_CAPITALS'.🐍⬆?, 'UpperCaseCamel'.🐫?, 'lowerCaseCamel'.🐫⬇?]).to eq([true, true, true, true]) - elements_a = [1, 'a', 2, nil, [], 2] - elements_b = [nil, 2, 2, 'a', 1, []] - expect(elements_a.≈≈ elements_b).to eq(true) - expect(elements_a == elements_b).to eq(false) + expect([1, 'a', 2, nil, [], 2].≈≈([nil, 2, 2, 'a', 1, []])).to eq(true) + expect([1, 'a', 2, nil, [], 2] == [nil, 2, 2, 'a', 1, []]).to eq(false) - expect([ℕ.∋?(-5), ℤ.∋?(7.0), ℝ.∋?(∞), ℚ.∋?(Rational(2, 3))]).to eq([false, true, false, true]) + expect([ℕ.∋?(-5), 𝕎.∋?(0.0), ℤ.∋?(7.0), ℝ.∋?(∞), ℝ.∋?(3i), ℚ.∋?(2/3r)]).to eq([false, true, true, false, false, true]) if 💎.engine.stats_ext['F06_B08'] == true - expect(::Matrix[[1,3,5],[2,4,6]].ᵀ).to eq(::Matrix[[1,2],[3,4],[5,6]]) + expect(::Matrix[[1,1,1],[2,2,2]].ᵀ).to eq(::Matrix[[1,2],[1,2],[1,2]]) end expect([1, 2, 3].⨁ [3, 4]).to eq([1, 4, 2]) @@ -64,12 +50,25 @@ end it 'deprecated examples still work' do + expect(𝚽).to eq((θ°(360) - Ⴔ) / Ⴔ) + + expect(θ°(180)).to eq(θ𝞽(0.5)) + expect(θᵍ(200)).to eq(θʳ(π)) + + expect(√(1787569)).to eq(1337) expect(√(25) == 5).to eq(true) expect(5^²).to eq(5 * 5) expect(-5^⁴).to eq(-5 * -5 * -5 * -5) expect(√(25) == 5.0).to eq(true) expect(√(25.0) == 5).to eq(true) expect(√(25.0) == 5.0).to eq(true) + + elements_a = [1, 'a', 2, nil, [], 2] + elements_b = [nil, 2, 2, 'a', 1, []] + expect(elements_a.≈≈ elements_b).to eq(true) + expect(elements_a == elements_b).to eq(false) + + expect([ℕ.∋?(-5), ℤ.∋?(7.0), ℝ.∋?(∞), ℚ.∋?(Rational(2, 3))]).to eq([false, true, false, true]) end end end diff --git a/spec/locale/ag_gem_configs_spec.rb b/spec/locale/gem_configs_spec.rb similarity index 71% rename from spec/locale/ag_gem_configs_spec.rb rename to spec/locale/gem_configs_spec.rb index 30070e8..d39e52f 100644 --- a/spec/locale/ag_gem_configs_spec.rb +++ b/spec/locale/gem_configs_spec.rb @@ -1,6 +1,6 @@ # encoding: UTF-8 -RSpec.describe '[AutomaticGeneration]: gem configs' do +RSpec.describe 'gem configs' do context 'locale', :locale do @@ -48,16 +48,29 @@ expect(::TTY::Command.healthy?).to eq(true) end end - it 'helpful ENV_VARs are set' do - path_to_ruby = "/Users/#{💎.engine.os.current_user}/.rbenv/versions/3.0.0-preview1/bin/ruby" - alt_calculation = ::File.join(::RbConfig::CONFIG['bindir'], ::RbConfig::CONFIG['ruby_install_name'] + ::RbConfig::CONFIG['EXEEXT']) - expect(ENV['RUBY']).to eq(path_to_ruby) - expect(::RbConfig.ruby).to eq(path_to_ruby) - expect(alt_calculation).to eq(path_to_ruby) - end end end # end: {for gem{tty-command}} + context 'for gem{pg}' do + it 'has correct version{1.2.3}' do + expect(::PG::VERSION).to eq('1.2.3') + end + end # end: {for gem{pg}} + + context 'for gem{bunny}' do + it 'has correct version{2.17.0}' do + # TODO: temp solution (of loading library here) + require 'bunny' + expect(::Bunny::VERSION).to eq('2.17.0') + end + end # end: {for gem{bunny}} + + context 'for gem{finite_machine}' do + it 'has correct version{0.14.0}' do + expect(::FiniteMachine::VERSION).to eq('0.14.0') + end + end # end: {for gem{finite_machine}} + end # end: {by having correct configs} end # end: {all gems are healthy} diff --git a/spec/locale/locale_full_verification_spec.rb b/spec/locale/locale_full_verification_spec.rb index dda15b4..e4291c9 100644 --- a/spec/locale/locale_full_verification_spec.rb +++ b/spec/locale/locale_full_verification_spec.rb @@ -14,7 +14,6 @@ end context 'locale', :locale do - let(:build_configs){::RbConfig::CONFIG} context 'web protocol' do @@ -103,7 +102,7 @@ context 'misc configs are as needed' do it '$PATH separator is defined as{:}' do - expect(build_configs['PATH_SEPARATOR']).to eq(':') + expect(::RbConfig::CONFIG['PATH_SEPARATOR']).to eq(':') end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f5a5452..383391f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,6 +11,29 @@ require 'rspec' require 'rspec-benchmark' +class ::Module + # @param [Symbol] func_name + # @param [Symbol] alias_name + # + # @raise [ArgumentError] + # + # @return [Boolean] true, if this instance of Module has a function with provided name and alias + def ∃⨍_alias?(func_name, alias_name) + 🛑syms❓([func_name, alias_name]) + (self.instance_methods.include?(func_name) && self.instance_methods.include?(alias_name)) ? self.instance_method(func_name) == self.instance_method(alias_name) : false + end + + # @param [Symbol] func_name + # + # @raise [ArgumentError] + # + # @return [Boolean] true, if this object's Class has either a public or private method with matching func_name + def ∃⨍?(func_name) + 🛑sym❓('func_name', func_name) + self.method_defined?(func_name) ? true : self.∃🙈⨍?(func_name) + end +end + module HelpersSyntaxCache def expect_syntax(the_class, syntax_id, syntax_before_processing) @@ -111,7 +134,11 @@ def expect_regular_flt(val_scenario, val_expected) end def expect_∃⨍(the_func, owner, expected_result=true) - expect(owner.∃⨍?(the_func)).to eq(expected_result) + if owner == ENV + expect(ENV.respond_to?(the_func)).to eq(expected_result) + else + expect(owner.∃⨍?(the_func)).to eq(expected_result) + end end def expect_∃⨍_with_alias(the_func, aliases, owner, expected_result=true) @@ -205,13 +232,6 @@ def expect_∄ᴹ(kmodule) config.include HelpersFeature16 config.include HelpersSyntaxCache - stats = ::Ruuuby::MetaData.engine.stats_ext - - if ENV['RUUUBY_AUTOLOAD_DB'] == 'on' && (stats['F92_B00'] || stats['F92_B01'] || stats['F92_B02']) - config.include HelpersDB, :db - config.include_context 'shared_context_db', :db - end - if ENV['RUUUBY_PERFORMANCE_LIMIT'] == 'off' config.include PerformanceTestHelper, :performance config.include RSpec::Benchmark::Matchers, :performance diff --git a/spec/system/postgres_docker_service_spec.rb b/spec/system/postgres_docker_service_spec.rb index f3ec9da..39d8f56 100644 --- a/spec/system/postgres_docker_service_spec.rb +++ b/spec/system/postgres_docker_service_spec.rb @@ -29,6 +29,7 @@ expect(ENV.∃?('RUUUBY_F92')).to eq(true) expect(ENV['RUUUBY_F92'].include?('b01')).to eq(true) expect(ENV['RUUUBY_F92'].include?('b02')).to eq(true) + db = 💎.engine.orm.db_orm.connection expect(db.supports_advisory_locks?).to eq(true)