UnitConverter 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b70d0a995a81cd47836609c2a394b4aeda8286d6b0724f3e2094b472af4482d3
4
+ data.tar.gz: 201f8515cbee7538804f41987263e5ada5a14a62b57b4f05ba922cea96a91444
5
+ SHA512:
6
+ metadata.gz: ec7dd3ba9ff2c76f7baa8a42135fa39e5f43258b3d35b933d290536a361aa702c37b2883c710acc9110623a974363c9d0e9a144693e8eef3d50885e370c60f13
7
+ data.tar.gz: a309828e6d16efd04e972b7d1a199cda21d7c6cb659abcdf77eb6e4658f808e8f5ee4795907a940f087b503f709931ba21f67c1e0b1d98cb482df986161967dd
@@ -0,0 +1 @@
1
+ {"entries":{"replit.nix":{"env":{"AR":"ar","AS":"as","CC":"gcc","CONFIG_SHELL":"/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin/bash","CXX":"g++","GEM_PATH":"/nix/store/ik8gc2bwrizbwyq7nxp16g27vnqhvwkp-ruby2.7.4-solargraph-0.39.17/lib/ruby/gems/2.7.0:/nix/store/f1ljr3wahpp317016wml0dlrdbpkyyar-ruby2.7.4-backport-1.2.0/lib/ruby/gems/2.7.0:/nix/store/15z0xkwhgi0ygkhkkal061855rxhrspx-ruby2.7.4-benchmark-0.1.1/lib/ruby/gems/2.7.0:/nix/store/gbpfgi0slnj8gz7gij9jhmmi70pj6k21-ruby2.7.4-e2mmap-0.1.0/lib/ruby/gems/2.7.0:/nix/store/k6qbd3y5zwh2rk6k2jvzjy75lpbnqb1w-ruby2.7.4-jaro_winkler-1.5.4/lib/ruby/gems/2.7.0:/nix/store/c45xpc2kpz9d4r35fhmz2hvk32ja9xsn-ruby2.7.4-maruku-0.7.3/lib/ruby/gems/2.7.0:/nix/store/5cmk350na0gx56gdy4alm9qf8ns4chxj-ruby2.7.4-nokogiri-1.12.3/lib/ruby/gems/2.7.0:/nix/store/mxi5cvj8mxchcvajgv7ychakxwkdd9cr-ruby2.7.4-mini_portile2-2.6.1/lib/ruby/gems/2.7.0:/nix/store/pbl798yrqrb4wy5wvvy4yv2byv7z6xhr-ruby2.7.4-racc-1.5.2/lib/ruby/gems/2.7.0:/nix/store/hp1adj9y84rm9hc6s6f3iv0n808qdbd4-ruby2.7.4-parser-2.7.2.0/lib/ruby/gems/2.7.0:/nix/store/v6jqp2gk91f6crxnyr0w1g3p11abqh7p-ruby2.7.4-ast-2.4.2/lib/ruby/gems/2.7.0:/nix/store/92xg92db7lr6nv8bryrl343xfpdk4hgn-ruby2.7.4-reverse_markdown-2.0.0/lib/ruby/gems/2.7.0:/nix/store/vza997nwsj6wfa9w6r57jmq7s2p9pnin-ruby2.7.4-rubocop-0.93.1/lib/ruby/gems/2.7.0:/nix/store/j56r0ca9z96jhrswn336cfca6agcq5hl-ruby2.7.4-parallel-1.20.1/lib/ruby/gems/2.7.0:/nix/store/qlqk65z9rpc7q0y985kj7sg8bjm9z59z-ruby2.7.4-rainbow-3.0.0/lib/ruby/gems/2.7.0:/nix/store/sg7mhnv1ls7vsxql88iv1kqyas75n5nn-ruby2.7.4-regexp_parser-2.1.1/lib/ruby/gems/2.7.0:/nix/store/s4d2i8ndwd9ng63m4p9kla792zc2g2yb-ruby2.7.4-rexml-3.2.5/lib/ruby/gems/2.7.0:/nix/store/nfxj6f98iaps7gymdajwf44nj1rh7bvf-ruby2.7.4-rubocop-ast-1.4.1/lib/ruby/gems/2.7.0:/nix/store/dllcqvdahr174hqy0v0gsdn6qw7k8x5k-ruby2.7.4-ruby-progressbar-1.11.0/lib/ruby/gems/2.7.0:/nix/store/jk0yx5928d2fs7vg2z83qn3f49yclwp6-ruby2.7.4-unicode-display_width-1.7.0/lib/ruby/gems/2.7.0:/nix/store/bb9mkjhn0qavr829kjzmq0k4fydvk2lg-ruby2.7.4-thor-1.1.0/lib/ruby/gems/2.7.0:/nix/store/7q157wrw7ba62nb5p2nx76lvcjz55h50-ruby2.7.4-tilt-2.0.10/lib/ruby/gems/2.7.0:/nix/store/3ns95ypnyz9y0h259mv3gsm5q56v50ds-ruby2.7.4-yard-0.9.26/lib/ruby/gems/2.7.0:/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/lib/ruby/gems/2.7.0","HOST_PATH":"/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/bin:/nix/store/ik8gc2bwrizbwyq7nxp16g27vnqhvwkp-ruby2.7.4-solargraph-0.39.17/bin:/nix/store/f1ljr3wahpp317016wml0dlrdbpkyyar-ruby2.7.4-backport-1.2.0/bin:/nix/store/15z0xkwhgi0ygkhkkal061855rxhrspx-ruby2.7.4-benchmark-0.1.1/bin:/nix/store/gbpfgi0slnj8gz7gij9jhmmi70pj6k21-ruby2.7.4-e2mmap-0.1.0/bin:/nix/store/k6qbd3y5zwh2rk6k2jvzjy75lpbnqb1w-ruby2.7.4-jaro_winkler-1.5.4/bin:/nix/store/c45xpc2kpz9d4r35fhmz2hvk32ja9xsn-ruby2.7.4-maruku-0.7.3/bin:/nix/store/5cmk350na0gx56gdy4alm9qf8ns4chxj-ruby2.7.4-nokogiri-1.12.3/bin:/nix/store/mxi5cvj8mxchcvajgv7ychakxwkdd9cr-ruby2.7.4-mini_portile2-2.6.1/bin:/nix/store/pbl798yrqrb4wy5wvvy4yv2byv7z6xhr-ruby2.7.4-racc-1.5.2/bin:/nix/store/hp1adj9y84rm9hc6s6f3iv0n808qdbd4-ruby2.7.4-parser-2.7.2.0/bin:/nix/store/v6jqp2gk91f6crxnyr0w1g3p11abqh7p-ruby2.7.4-ast-2.4.2/bin:/nix/store/92xg92db7lr6nv8bryrl343xfpdk4hgn-ruby2.7.4-reverse_markdown-2.0.0/bin:/nix/store/vza997nwsj6wfa9w6r57jmq7s2p9pnin-ruby2.7.4-rubocop-0.93.1/bin:/nix/store/j56r0ca9z96jhrswn336cfca6agcq5hl-ruby2.7.4-parallel-1.20.1/bin:/nix/store/qlqk65z9rpc7q0y985kj7sg8bjm9z59z-ruby2.7.4-rainbow-3.0.0/bin:/nix/store/sg7mhnv1ls7vsxql88iv1kqyas75n5nn-ruby2.7.4-regexp_parser-2.1.1/bin:/nix/store/s4d2i8ndwd9ng63m4p9kla792zc2g2yb-ruby2.7.4-rexml-3.2.5/bin:/nix/store/nfxj6f98iaps7gymdajwf44nj1rh7bvf-ruby2.7.4-rubocop-ast-1.4.1/bin:/nix/store/dllcqvdahr174hqy0v0gsdn6qw7k8x5k-ruby2.7.4-ruby-progressbar-1.11.0/bin:/nix/store/jk0yx5928d2fs7vg2z83qn3f49yclwp6-ruby2.7.4-unicode-display_width-1.7.0/bin:/nix/store/bb9mkjhn0qavr829kjzmq0k4fydvk2lg-ruby2.7.4-thor-1.1.0/bin:/nix/store/7q157wrw7ba62nb5p2nx76lvcjz55h50-ruby2.7.4-tilt-2.0.10/bin:/nix/store/3ns95ypnyz9y0h259mv3gsm5q56v50ds-ruby2.7.4-yard-0.9.26/bin:/nix/store/qafisjc9d9an7v19xvg0719cx66v1b0h-rufo-0.12.0/bin:/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin:/nix/store/ihxk2vlm0vi7c4j3gpm084kbxvz6v585-findutils-4.8.0/bin:/nix/store/kjx1mv85c5cgsrr4bwar22j7hbwj834m-diffutils-3.7/bin:/nix/store/gm2w08wwsa3vd500d8vq879s2lv65ldh-gnused-4.8/bin:/nix/store/v0slhpb2y3xa7gmv4q6gblkdk7n0f09j-gnugrep-3.6/bin:/nix/store/2wn093wbc6ps4brcsppxjd14vxvaa8a2-gawk-5.1.0/bin:/nix/store/5bxrjkyvqmzn1p897652y3lwa9fxagpw-gnutar-1.34/bin:/nix/store/liva1jnjdskrn57s42kfawr2zz66szzm-gzip-1.10/bin:/nix/store/ih2zkh2mbrx2c766ryk2i9hhlkly7snr-bzip2-1.0.6.0.2-bin/bin:/nix/store/pvkiiw0mp1yx0b21b7k105yywccychgh-gnumake-4.3/bin:/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin:/nix/store/aicl3kwfnaizk45aygm8bviqv7lk0a16-patch-2.7.6/bin:/nix/store/7jk6k46f56rszzc1bxi8mdrvcw53pym4-xz-5.2.5-bin/bin","LD":"ld","LOCALE_ARCHIVE":"/usr/lib/locale/locale-archive","NIX_BINTOOLS":"/nix/store/29bjq5hw1qglybp1a5f3ij9gxc2fyf94-binutils-wrapper-2.35.1","NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu":"1","NIX_BUILD_CORES":"16","NIX_BUILD_TOP":"/tmp","NIX_CC":"/nix/store/4xs1xyj8728yvh9y5v6ji819kwgfy2fv-gcc-wrapper-10.3.0","NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu":"1","NIX_CFLAGS_COMPILE":" -frandom-seed=kk33hrv56i -isystem /nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/include -isystem /nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/include","NIX_ENFORCE_NO_NATIVE":"1","NIX_HARDENING_ENABLE":"fortify stackprotector pic strictoverflow format relro bindnow","NIX_INDENT_MAKE":"1","NIX_LDFLAGS":"-rpath /nix/store/kk33hrv56ik0kwc583kg2qhcqn831r9b-nix-shell/lib64 -rpath /nix/store/kk33hrv56ik0kwc583kg2qhcqn831r9b-nix-shell/lib -L/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/lib -L/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/lib","NIX_STORE":"/nix/store","NM":"nm","OBJCOPY":"objcopy","OBJDUMP":"objdump","PATH":"/nix/store/w07a7k61dw5gnsyxj3kgcq3shr76jax8-bash-interactive-4.4-p23/bin:/nix/store/435paza0j48aa9vgvf6r2l12nrg4ld11-patchelf-0.12/bin:/nix/store/4xs1xyj8728yvh9y5v6ji819kwgfy2fv-gcc-wrapper-10.3.0/bin:/nix/store/dlni53myj53kx20pi4yhm7p68lw17b07-gcc-10.3.0/bin:/nix/store/6z35qvn00xrjvaznv9kfy8xddbbdz4gl-glibc-2.33-47-bin/bin:/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin:/nix/store/29bjq5hw1qglybp1a5f3ij9gxc2fyf94-binutils-wrapper-2.35.1/bin:/nix/store/v8imx1nvyz0hgvx9cbcmh6gp4ngw3ffj-binutils-2.35.1/bin:/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/bin:/nix/store/ik8gc2bwrizbwyq7nxp16g27vnqhvwkp-ruby2.7.4-solargraph-0.39.17/bin:/nix/store/f1ljr3wahpp317016wml0dlrdbpkyyar-ruby2.7.4-backport-1.2.0/bin:/nix/store/15z0xkwhgi0ygkhkkal061855rxhrspx-ruby2.7.4-benchmark-0.1.1/bin:/nix/store/gbpfgi0slnj8gz7gij9jhmmi70pj6k21-ruby2.7.4-e2mmap-0.1.0/bin:/nix/store/k6qbd3y5zwh2rk6k2jvzjy75lpbnqb1w-ruby2.7.4-jaro_winkler-1.5.4/bin:/nix/store/c45xpc2kpz9d4r35fhmz2hvk32ja9xsn-ruby2.7.4-maruku-0.7.3/bin:/nix/store/5cmk350na0gx56gdy4alm9qf8ns4chxj-ruby2.7.4-nokogiri-1.12.3/bin:/nix/store/mxi5cvj8mxchcvajgv7ychakxwkdd9cr-ruby2.7.4-mini_portile2-2.6.1/bin:/nix/store/pbl798yrqrb4wy5wvvy4yv2byv7z6xhr-ruby2.7.4-racc-1.5.2/bin:/nix/store/hp1adj9y84rm9hc6s6f3iv0n808qdbd4-ruby2.7.4-parser-2.7.2.0/bin:/nix/store/v6jqp2gk91f6crxnyr0w1g3p11abqh7p-ruby2.7.4-ast-2.4.2/bin:/nix/store/92xg92db7lr6nv8bryrl343xfpdk4hgn-ruby2.7.4-reverse_markdown-2.0.0/bin:/nix/store/vza997nwsj6wfa9w6r57jmq7s2p9pnin-ruby2.7.4-rubocop-0.93.1/bin:/nix/store/j56r0ca9z96jhrswn336cfca6agcq5hl-ruby2.7.4-parallel-1.20.1/bin:/nix/store/qlqk65z9rpc7q0y985kj7sg8bjm9z59z-ruby2.7.4-rainbow-3.0.0/bin:/nix/store/sg7mhnv1ls7vsxql88iv1kqyas75n5nn-ruby2.7.4-regexp_parser-2.1.1/bin:/nix/store/s4d2i8ndwd9ng63m4p9kla792zc2g2yb-ruby2.7.4-rexml-3.2.5/bin:/nix/store/nfxj6f98iaps7gymdajwf44nj1rh7bvf-ruby2.7.4-rubocop-ast-1.4.1/bin:/nix/store/dllcqvdahr174hqy0v0gsdn6qw7k8x5k-ruby2.7.4-ruby-progressbar-1.11.0/bin:/nix/store/jk0yx5928d2fs7vg2z83qn3f49yclwp6-ruby2.7.4-unicode-display_width-1.7.0/bin:/nix/store/bb9mkjhn0qavr829kjzmq0k4fydvk2lg-ruby2.7.4-thor-1.1.0/bin:/nix/store/7q157wrw7ba62nb5p2nx76lvcjz55h50-ruby2.7.4-tilt-2.0.10/bin:/nix/store/3ns95ypnyz9y0h259mv3gsm5q56v50ds-ruby2.7.4-yard-0.9.26/bin:/nix/store/qafisjc9d9an7v19xvg0719cx66v1b0h-rufo-0.12.0/bin:/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin:/nix/store/ihxk2vlm0vi7c4j3gpm084kbxvz6v585-findutils-4.8.0/bin:/nix/store/kjx1mv85c5cgsrr4bwar22j7hbwj834m-diffutils-3.7/bin:/nix/store/gm2w08wwsa3vd500d8vq879s2lv65ldh-gnused-4.8/bin:/nix/store/v0slhpb2y3xa7gmv4q6gblkdk7n0f09j-gnugrep-3.6/bin:/nix/store/2wn093wbc6ps4brcsppxjd14vxvaa8a2-gawk-5.1.0/bin:/nix/store/5bxrjkyvqmzn1p897652y3lwa9fxagpw-gnutar-1.34/bin:/nix/store/liva1jnjdskrn57s42kfawr2zz66szzm-gzip-1.10/bin:/nix/store/ih2zkh2mbrx2c766ryk2i9hhlkly7snr-bzip2-1.0.6.0.2-bin/bin:/nix/store/pvkiiw0mp1yx0b21b7k105yywccychgh-gnumake-4.3/bin:/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin:/nix/store/aicl3kwfnaizk45aygm8bviqv7lk0a16-patch-2.7.6/bin:/nix/store/7jk6k46f56rszzc1bxi8mdrvcw53pym4-xz-5.2.5-bin/bin","RANLIB":"ranlib","READELF":"readelf","RUBYLIB":"/nix/store/ik8gc2bwrizbwyq7nxp16g27vnqhvwkp-ruby2.7.4-solargraph-0.39.17/lib/ruby/gems/2.7.0/gems/solargraph-0.39.17/lib:/nix/store/f1ljr3wahpp317016wml0dlrdbpkyyar-ruby2.7.4-backport-1.2.0/lib/ruby/gems/2.7.0/gems/backport-1.2.0/lib:/nix/store/15z0xkwhgi0ygkhkkal061855rxhrspx-ruby2.7.4-benchmark-0.1.1/lib/ruby/gems/2.7.0/gems/benchmark-0.1.1/lib:/nix/store/gbpfgi0slnj8gz7gij9jhmmi70pj6k21-ruby2.7.4-e2mmap-0.1.0/lib/ruby/gems/2.7.0/gems/e2mmap-0.1.0/lib:/nix/store/k6qbd3y5zwh2rk6k2jvzjy75lpbnqb1w-ruby2.7.4-jaro_winkler-1.5.4/lib/ruby/gems/2.7.0/gems/jaro_winkler-1.5.4/lib:/nix/store/c45xpc2kpz9d4r35fhmz2hvk32ja9xsn-ruby2.7.4-maruku-0.7.3/lib/ruby/gems/2.7.0/gems/maruku-0.7.3/lib:/nix/store/5cmk350na0gx56gdy4alm9qf8ns4chxj-ruby2.7.4-nokogiri-1.12.3/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.3/lib:/nix/store/mxi5cvj8mxchcvajgv7ychakxwkdd9cr-ruby2.7.4-mini_portile2-2.6.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.6.1/lib:/nix/store/pbl798yrqrb4wy5wvvy4yv2byv7z6xhr-ruby2.7.4-racc-1.5.2/lib/ruby/gems/2.7.0/gems/racc-1.5.2/lib:/nix/store/hp1adj9y84rm9hc6s6f3iv0n808qdbd4-ruby2.7.4-parser-2.7.2.0/lib/ruby/gems/2.7.0/gems/parser-2.7.2.0/lib:/nix/store/v6jqp2gk91f6crxnyr0w1g3p11abqh7p-ruby2.7.4-ast-2.4.2/lib/ruby/gems/2.7.0/gems/ast-2.4.2/lib:/nix/store/92xg92db7lr6nv8bryrl343xfpdk4hgn-ruby2.7.4-reverse_markdown-2.0.0/lib/ruby/gems/2.7.0/gems/reverse_markdown-2.0.0/lib:/nix/store/vza997nwsj6wfa9w6r57jmq7s2p9pnin-ruby2.7.4-rubocop-0.93.1/lib/ruby/gems/2.7.0/gems/rubocop-0.93.1/lib:/nix/store/j56r0ca9z96jhrswn336cfca6agcq5hl-ruby2.7.4-parallel-1.20.1/lib/ruby/gems/2.7.0/gems/parallel-1.20.1/lib:/nix/store/qlqk65z9rpc7q0y985kj7sg8bjm9z59z-ruby2.7.4-rainbow-3.0.0/lib/ruby/gems/2.7.0/gems/rainbow-3.0.0/lib:/nix/store/sg7mhnv1ls7vsxql88iv1kqyas75n5nn-ruby2.7.4-regexp_parser-2.1.1/lib/ruby/gems/2.7.0/gems/regexp_parser-2.1.1/lib:/nix/store/s4d2i8ndwd9ng63m4p9kla792zc2g2yb-ruby2.7.4-rexml-3.2.5/lib/ruby/gems/2.7.0/gems/rexml-3.2.5/lib:/nix/store/nfxj6f98iaps7gymdajwf44nj1rh7bvf-ruby2.7.4-rubocop-ast-1.4.1/lib/ruby/gems/2.7.0/gems/rubocop-ast-1.4.1/lib:/nix/store/dllcqvdahr174hqy0v0gsdn6qw7k8x5k-ruby2.7.4-ruby-progressbar-1.11.0/lib/ruby/gems/2.7.0/gems/ruby-progressbar-1.11.0/lib:/nix/store/jk0yx5928d2fs7vg2z83qn3f49yclwp6-ruby2.7.4-unicode-display_width-1.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.7.0/lib:/nix/store/bb9mkjhn0qavr829kjzmq0k4fydvk2lg-ruby2.7.4-thor-1.1.0/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib:/nix/store/7q157wrw7ba62nb5p2nx76lvcjz55h50-ruby2.7.4-tilt-2.0.10/lib/ruby/gems/2.7.0/gems/tilt-2.0.10/lib:/nix/store/3ns95ypnyz9y0h259mv3gsm5q56v50ds-ruby2.7.4-yard-0.9.26/lib/ruby/gems/2.7.0/gems/yard-0.9.26/lib:/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/lib/ruby/site_ruby:/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/lib/ruby/site_ruby/2.7.0:/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4/lib/ruby/site_ruby/2.7.0/x86_64-linux","SIZE":"size","SOURCE_DATE_EPOCH":"315532800","STRINGS":"strings","STRIP":"strip","XDG_DATA_DIRS":"/nix/store/435paza0j48aa9vgvf6r2l12nrg4ld11-patchelf-0.12/share","_":"/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin/env","__ETC_PROFILE_SOURCED":"1","buildInputs":"/nix/store/yfmnyvd0asw5bs24lg611xn2gi4prqla-ruby-2.7.4 /nix/store/ik8gc2bwrizbwyq7nxp16g27vnqhvwkp-ruby2.7.4-solargraph-0.39.17 /nix/store/qafisjc9d9an7v19xvg0719cx66v1b0h-rufo-0.12.0","builder":"/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin/bash","configureFlags":"","depsBuildBuild":"","depsBuildBuildPropagated":"","depsBuildTarget":"","depsBuildTargetPropagated":"","depsHostHost":"","depsHostHostPropagated":"","depsTargetTarget":"","depsTargetTargetPropagated":"","doCheck":"","doInstallCheck":"","name":"nix-shell","nativeBuildInputs":"","nobuildPhase":"echo\necho \"This derivation is not meant to be built, aborting\";\necho\nexit 1\n","out":"/nix/store/kk33hrv56ik0kwc583kg2qhcqn831r9b-nix-shell","outputs":"out","patches":"","phases":"nobuildPhase","propagatedBuildInputs":"","propagatedNativeBuildInputs":"","shell":"/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin/bash","shellHook":"","stdenv":"/nix/store/r4bl79l2bdjawmr2rhhqvci56qh0fkvv-stdenv-linux","strictDeps":"","system":"x86_64-linux"},"dependencies":[{"path":"replit.nix","mod_time":"2021-11-11T20:51:51.769011973Z"}],"channel":"","channel_nix_path":""}}}
data/.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
data/.idea/.name ADDED
@@ -0,0 +1 @@
1
+ UnitConverter.rb
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="jdk" jdkName="ruby-3.1.3-p185" jdkType="RUBY_SDK" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, ruby-3.1.3-p185) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.1, ruby-3.1.3-p185) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="json (v2.6.1, ruby-3.1.3-p185) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.17.0, ruby-3.1.3-p185) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, ruby-3.1.3-p185) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="parser (v3.1.3.0, ruby-3.1.3-p185) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, ruby-3.1.3-p185) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, ruby-3.1.3-p185) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.6.1, ruby-3.1.3-p185) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, ruby-3.1.3-p185) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.41.1, ruby-3.1.3-p185) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.24.1, ruby-3.1.3-p185) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, ruby-3.1.3-p185) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.3.0, ruby-3.1.3-p185) [gem]" level="application" />
28
+ </component>
29
+ <component name="RakeTasksCache">
30
+ <option name="myRootTask">
31
+ <RakeTaskImpl id="rake" />
32
+ </option>
33
+ </component>
34
+ </module>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/UnitConverter.iml" filepath="$PROJECT_DIR$/.idea/UnitConverter.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
data/.replit ADDED
@@ -0,0 +1,23 @@
1
+ run = "p findAndReplaceImperialUnits(\"1 liter\")"
2
+ hidden = [".bundle"]
3
+
4
+ [packager]
5
+ language = "ruby"
6
+
7
+ [packager.features]
8
+ packageSearch = true
9
+ guessImports = true
10
+
11
+ [languages.ruby]
12
+ pattern = "**/*.rb"
13
+
14
+ [languages.ruby.languageServer]
15
+ start = ["solargraph", "stdio"]
16
+
17
+ [gitHubImport]
18
+ requiredFiles = [".replit", "replit.nix", "README.md"]
19
+
20
+ [nix]
21
+
22
+ [nix.channel]
23
+ channel = "stable-22_05"
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-10-20
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ #source "https://github.com/artx52135/UnitConverter"
5
+
6
+ # Specify your gem's dependencies in UnitConverter.gemspec
7
+ gemspec
8
+
9
+ gem "rake", "~> 13.0"
10
+
11
+ gem "minitest", "~> 5.0"
12
+
13
+ gem "rubocop", "~> 1.21"
14
+
15
+ gem "rspec", "~> 3.9"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,54 @@
1
+ ## Installation
2
+
3
+ Add this line to your application's Gemfile:
4
+
5
+ ```ruby
6
+ gem 'UnitConverter'
7
+ ```
8
+
9
+ And then execute:
10
+
11
+ $ bundle install
12
+
13
+ Or install it yourself as:
14
+
15
+ $ gem install UnitConverter
16
+
17
+ ## Usage
18
+
19
+ UnitConverter serves a quite simple purpose: transferring units of volume and weight (e.g. in recipes) from the US system to metric and back.
20
+ These functions of conversion are produced by two commands named massReplace(Imperial/Metric)Units, which are treating each instance of a unit separately according to conversion rules.
21
+
22
+ ## Development
23
+
24
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
25
+
26
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
27
+
28
+ ## License
29
+
30
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
31
+
32
+ ## GEM
33
+ UnitConverter serves a quite simple purpose: transferring units of volume and weight (e.g. in recipes) from the US system to metric and back. These functions of conversion are produced by two commands named find(Imperial/Metric)Units, which are treating each instance of a unit separately according to conversion rules.
34
+
35
+ The supported units are: US: pound, ounce, pint, quart, gallon, inch Metric: liter, kilogram, gram, milligram, centimeter
36
+
37
+ To convert, call UnitConverter.find(Imperial/Metric)Units("and input your text here")
38
+
39
+
40
+ Dry fettuccine, 8 oz
41
+ Olive oil, 2 tbsp
42
+ Chopped bacon, 2 oz
43
+ Minced garlic, 1 clove
44
+ Lightly beaten eggs, 2 pcs
45
+ Grated sharp white cheddar, 1/2 cup
46
+ Salt and pepper, to taste
47
+
48
+ Dry fettuccine, 240 gr
49
+ Olive oil, 2 tbsp
50
+ Chopped bacon, 60 g
51
+ Minced garlic, 1 clove
52
+ Lightly beaten eggs, 2 pcs
53
+ Grated sharp white cheddar, 1/2 cup
54
+ Salt and pepper, to taste
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # выполнить в терминале!!! gem build unitconverter.gemspec
3
+ # потом выполнить gem install ./UnitConverter-0.1.0.gem
4
+ require_relative "lib/UnitConverter/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "UnitConverter"
8
+ spec.version = UnitConverter::VERSION
9
+ spec.authors = ["Ilya Kramarenko, Artem Ramazanov"]
10
+ spec.email = ["kramarenko.miare13@yandex.ru, aramazanov@sfedu.ru"]
11
+
12
+ spec.summary = "custom units converter"
13
+ # spec.description = "TODO: Write a longer description or delete this line."
14
+ spec.homepage = "https://github.com/artx52135/UnitConverter/"
15
+ #"TODO: Put your gem's website or public repo URL here."
16
+ spec.license = "MIT"
17
+ spec.required_ruby_version = ">= 2.6.0"
18
+
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+ #"TODO: Set to your gem server 'https://example.com'"
21
+
22
+ spec.metadata["homepage_uri"] = spec.homepage
23
+ #spec.metadata["source_code_uri"] = "https://github.com/artx52135/UnitConverter/"
24
+ #"lib/UnitConverter/version" #"TODO: Put your gem's public repo URL here."
25
+ spec.metadata["changelog_uri"] = "https://github.com/artx52135/UnitConverter/blob/master/CHANGELOG.md"
26
+
27
+ # "TODO: Put your gem's CHANGELOG.md URL here."
28
+
29
+ # Specify which files should be added to the gem when it is released.
30
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
32
+ `git ls-files -z`.split("\x0").reject do |f|
33
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
34
+ end
35
+ end
36
+ spec.bindir = "exe"
37
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
38
+ spec.require_paths = ["lib"]
39
+
40
+ # Uncomment to register a new dependency of your gem
41
+ # spec.add_dependency "example-gem", "~> 1.0"
42
+
43
+ # For more information and examples about making a new gem, check out our
44
+ # guide at: https://bundler.io/guides/creating_gem.html
45
+ #gem.add_development_dependency "rspec", "~> 3.9"
46
+ end
data/UnitConverter.zip ADDED
Binary file
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UnitConverter
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,196 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "UnitConverter/version"
4
+
5
+ module UnitConverter
6
+ class Error < StandardError; end
7
+
8
+ # Your code goes here...
9
+ class Converter
10
+ #attr_accessor text: String
11
+
12
+ def initialize(ttt)
13
+ @text = ttt.to_s
14
+ end
15
+
16
+ def print_text
17
+ return @text
18
+ end
19
+ def self.format_decimal(number)
20
+ num = number.round(2) #(number.to_f * 100).to_i / 100.0
21
+ return num.to_s
22
+ end
23
+
24
+
25
+
26
+ def find_and_replace_imperial_units
27
+ if(!@text)
28
+ return ''
29
+ end
30
+ reg_imperial = /(\d*\s((lb|pound)(|s))|(\d*\s(oz|ounce(|s)))|(\d*\s(pint(|s)))|(\d*\s(quart(|s)))|(\d*\s(gallon(|s)))|(\d*\s(f(oo|ee)t))|(\d*\s(inch(|es))))(?=\b)/
31
+ words_array=@text.scan(/[[:word:]]+/)
32
+ size=words_array.size
33
+
34
+ (0..size - 2).each { |i|
35
+ if (/^[0-9]*[.,]?[0-9]+$/.match?(words_array[i]))
36
+ pair = words_array[i] + ' ' + words_array[i + 1]
37
+ if (pair.match(reg_imperial) != nil)
38
+ words_array[i] = Converter.replace_imperial_units(pair)
39
+ size -= 1
40
+ words_array.delete_at(i + 1)
41
+ end
42
+ end
43
+ }
44
+ text_new=words_array.join(" ")
45
+ text_new
46
+ end
47
+
48
+ def find_and_replace_metric_units
49
+ if(!@text)
50
+ return ''
51
+ end
52
+ reg_metric = /(\d*\s(milliliter(|s))|\d*\s(liter(|s))|\d*\s(kilogram(|s))|\d*\s(gram(|s))|\d*\s(centimeter(|s)))(?=\b)/
53
+ words_array=@text.scan(/[[:word:]]+/)
54
+ size=words_array.size
55
+
56
+ (0..size - 2).each { |i|
57
+ if (/^[0-9]*[.,]?[0-9]+$/.match?(words_array[i]))
58
+ pair = words_array[i] + ' ' + words_array[i + 1]
59
+ if (pair.match(reg_metric) != nil)
60
+ words_array[i] = Converter.replace_metric_units(pair)
61
+ size -= 1
62
+ words_array.delete_at(i + 1)
63
+ end
64
+ end
65
+ }
66
+
67
+ text_new=words_array.join(' ')
68
+ text_new
69
+ end
70
+
71
+
72
+
73
+
74
+
75
+ def self.replace_metric_units(match_str)
76
+ if(!match_str)
77
+ return ""
78
+ end
79
+ rl = /\d*\sliter(|s)/
80
+ rml = /\d*\smilliliter(|s)/
81
+ rk = /\d*\skilogram(|s)/
82
+ rgr = /\d*\sgram(|s)/
83
+ rcm = /\d*\scentimeter(|s)/
84
+ rm = /\d*\smeter(|s)/
85
+
86
+
87
+ number = (match_str.match(/[0-9]*[.,]?[0-9]+/)).to_s() #(match_str.match(/\d*/)).to_s
88
+ rez=''
89
+ case #match_str
90
+ when match_str.match(rl)
91
+ if (number.to_i % 4 == 0)
92
+ then rez= match_str.gsub(match_str, (number.to_f * 0.25).to_s + ' gallons')
93
+ else
94
+ rez= match_str.gsub(match_str, number + ' quarts')
95
+ end
96
+
97
+ when match_str.match(rml)
98
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f / 30.0) + ' fl ounces') #жидкая унция
99
+ when match_str.match(rk)
100
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f / 0.45) + ' pounds')
101
+ when match_str.match(rgr)
102
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f / 30.0) + ' ounces')
103
+ when match_str.match(rcm)
104
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f / 2.5) + ' inches')
105
+ when match_str.match(rm)
106
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f * 100 / 30.5) + ' feet')
107
+ end
108
+ rez #match_str
109
+ end
110
+
111
+
112
+ def self.replace_imperial_units(match_str)
113
+ if(!match_str)
114
+ return ""
115
+ end
116
+
117
+ rlb = /\d*\s(lb|pound)(|s)/
118
+ roz = /\d*\s(oz|ounce(|s))/
119
+ rp = /\d*\spint(|s)/
120
+ rq = /\d*\squart(|s)/
121
+ rg = /\d*\sgallon(|s)/
122
+ ri = /\d*\sinch(|es)/
123
+ rflu = /\d*\s(fl oz|fl ounce(|s))/
124
+ rft=/\d*\s(f(oo|ee)t)/
125
+
126
+ number = (match_str.match(/[0-9]*[.,]?[0-9]+/)).to_s() #/\d*/)).to_s()
127
+ rez=''
128
+ case #match_str
129
+ when match_str.match(rlb)
130
+ then if(number.to_f*450 > 1000)
131
+ rez= match_str.gsub(match_str, format_decimal(number.to_f * 0.45) +' kilograms')
132
+ else
133
+ rez= match_str.gsub(match_str, format_decimal(number.to_f * 450) +' grams')
134
+ end
135
+ when match_str.match(roz)
136
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f * 30) + ' grams')
137
+ when match_str.match(rp)
138
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f * 560)+' milliliters')
139
+ when match_str.match(rq)
140
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f) +' liters')
141
+ when match_str.match(rg)
142
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f * 4) +' liters')
143
+ when match_str.match(ri)
144
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f * 2.5) +' centimeters')
145
+ when match_str.match(rflu)
146
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f * 30.0) +' milliliters')
147
+ #else rez= match_str
148
+ when match_str.match(rft)
149
+ then rez= match_str.gsub(match_str, format_decimal(number.to_f / 3.27) +' meters')
150
+ end
151
+ rez
152
+ end
153
+
154
+ end
155
+
156
+
157
+ =begin
158
+
159
+ pp = UnitConverter::Converter.new("5 pounds")
160
+
161
+ puts "5 liters" + ' >>> ' + UnitConverter::Converter.replace_metric_units("5 liters")
162
+ puts "12 liters" + ' >>> ' + UnitConverter::Converter.replace_metric_units("12 liters")
163
+ puts "100 milliliters" + ' >>> ' + UnitConverter::Converter.replace_metric_units("100 milliliters")
164
+ puts "18 kilograms" + ' >>> ' + UnitConverter::Converter.replace_metric_units("18 kilograms")
165
+ puts "500 grams" + ' >>> ' + UnitConverter::Converter.replace_metric_units("500 grams")
166
+ puts "98 centimeters" + ' >>> ' + UnitConverter::Converter.replace_metric_units("98 centimeters")
167
+ puts "2 meters" + ' >>> ' + UnitConverter::Converter.replace_metric_units("2 meters")
168
+ puts ""
169
+ puts "5 pounds" + ' >>> ' + UnitConverter::Converter.replace_imperial_units("5 pounds")
170
+ puts "10 ounces" + ' >>> ' + UnitConverter::Converter.replace_imperial_units("10 ounces")
171
+ puts "0.5 pints" + ' >>> ' + UnitConverter::Converter.replace_imperial_units("0.5 pints")
172
+ puts "3 quarts" + ' >>> ' + UnitConverter::Converter.replace_imperial_units("3 quarts")
173
+ puts "50 inches" + ' >>> ' + UnitConverter::Converter.replace_imperial_units("50 inches")
174
+ puts "20 fl ounces" + ' >>> ' + UnitConverter::Converter.replace_imperial_units("20 fl ounces")
175
+ puts "6 feet" + ' >>> ' + UnitConverter::Converter.replace_imperial_units("6 feet")
176
+
177
+
178
+
179
+ tt3="5 milliliters 3 liters была метрическая система 12 крокодилов 20 kilograms"
180
+ puts tt3
181
+ puts '>>>'
182
+ #metric=UnitConverter::Converter.new(tt3)
183
+ #tt4=metric.find_and_replace_metric_units()
184
+ puts UnitConverter::Converter.new("5 milliliters 3 liters была метрическая система 12 крокодилов 20 kilograms").find_and_replace_metric_units()
185
+ #puts tt4#metric.print_text
186
+
187
+ tt5="5 веников 20 feet 5 pounds 1 ounce была имперская система"
188
+ puts tt5
189
+ puts '>>>'
190
+ imperial=UnitConverter::Converter.new(tt5)
191
+ tt6=imperial.find_and_replace_imperial_units()
192
+ puts tt6
193
+
194
+ puts "end"
195
+ =end
196
+ end
data/regex.txt ADDED
@@ -0,0 +1,11 @@
1
+ /rs/ = /\d*\sлож(ка|ки|ку|кой|ек|кам|ками)/
2
+ /rc/ = /\d*\sстакан(а|у|ом|ам|ами)/
3
+ /rp/ = /\d*\sфунт(а|у|ом|ам|ами)/
4
+ /ro/ = /\d*\sунци(я|и|ям|ях|й|ями)/
5
+ /rp/ = /\d*\sпинт(а|ы|ам|у|ой|е|ами|ах)/
6
+ /rq/ = /\d*\sкварт(а|ы|ам|у|ой|е|ами|ах)/
7
+ /rg/ = /\d*\sгаллон(а|у|ом|ам|ами)/
8
+ /rl/ = /\d*\sлитр(а|у|ом|ам|ами)/
9
+ /rk/ = /\d*\sкилограмм(а|у|ом|ам|ами)/
10
+ /rgr/ = /\d*\sграмм(а|у|ом|ам|ами)/
11
+ /rcm/ = /\d*\sсантиметр(а|у|ом|ам|ами)/
data/replit.nix ADDED
@@ -0,0 +1,7 @@
1
+ { pkgs }: {
2
+ deps = [
3
+ pkgs.ruby
4
+ pkgs.solargraph
5
+ pkgs.rufo
6
+ ];
7
+ }
@@ -0,0 +1,4 @@
1
+ module UnitConverter
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
@@ -0,0 +1,7 @@
1
+ module UnitConverter
2
+ class Converter
3
+ @text: String
4
+
5
+ def public: -> untyped
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: UnitConverter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ilya Kramarenko, Artem Ramazanov
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-01-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - kramarenko.miare13@yandex.ru, aramazanov@sfedu.ru
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".cache/replit/nix/env.json"
21
+ - ".idea/.gitignore"
22
+ - ".idea/.name"
23
+ - ".idea/UnitConverter.iml"
24
+ - ".idea/modules.xml"
25
+ - ".idea/vcs.xml"
26
+ - ".replit"
27
+ - ".rubocop.yml"
28
+ - CHANGELOG.md
29
+ - CODE_OF_CONDUCT.md
30
+ - Gemfile
31
+ - LICENSE.txt
32
+ - README.md
33
+ - Rakefile
34
+ - UnitConverter.gemspec
35
+ - UnitConverter.zip
36
+ - lib/UnitConverter.rb
37
+ - lib/UnitConverter/version.rb
38
+ - regex.txt
39
+ - replit.nix
40
+ - sig/UnitConverter.rbs
41
+ - sig/unit_converter/converter.rbs
42
+ homepage: https://github.com/artx52135/UnitConverter/
43
+ licenses:
44
+ - MIT
45
+ metadata:
46
+ allowed_push_host: https://rubygems.org
47
+ homepage_uri: https://github.com/artx52135/UnitConverter/
48
+ changelog_uri: https://github.com/artx52135/UnitConverter/blob/master/CHANGELOG.md
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 2.6.0
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubygems_version: 3.3.26
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: custom units converter
68
+ test_files: []