t-rex 2.1 → 2.2.1
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 +4 -4
- data/bin/t-rex +10 -6
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bb66e44a6d6ca2542d5b57317928a405cd354ec66907a7d2cec7b54364b50cf
|
4
|
+
data.tar.gz: 2caa942557bd74fdd067fb1e59f771aac855fea587ffa0ad10633a9d09aaffa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32f4dcebc2cac923aee7bc0d9bd21dc0f84b8ad89d37684dec77af21d452e0b06692d474eef590de553410cd69d82a5bba41de400beb9b107d8846d9e84db941
|
7
|
+
data.tar.gz: d39f5b2dfc0852179038b8a27cf7fad12942bc19c60bbecae52babd8a8b30a7f65b50e57b9c111da9841d74dd8f9241fab11bc091c992ebfe6e5e93114e39611
|
data/bin/t-rex
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
# for any damages resulting from its use. Further, I am under no
|
13
13
|
# obligation to maintain or extend this software. It is provided
|
14
14
|
# on an 'as is' basis without any expressed or implied warranty.
|
15
|
-
@version = "2.
|
15
|
+
@version = "2.2.1" # Clear screen upon exit
|
16
16
|
|
17
17
|
require 'rcurses'
|
18
18
|
include Rcurses::Input
|
@@ -29,7 +29,8 @@ help = <<HELPTEXT
|
|
29
29
|
Toggle US and European number formats by pressing '.
|
30
30
|
|
31
31
|
When entering a number into X, use 'h' to change the sign and 'e' to write an
|
32
|
-
exponent (10^x). Entering "123e4" becomes "1230000".
|
32
|
+
exponent (10^x). Entering "123e4" becomes "1230000". Use 'H' to enter a minus sign
|
33
|
+
after an 'e' to get a negative exponent. Entering "123e-4" becomes "0.0123".
|
33
34
|
|
34
35
|
Functions available are shown under the stack registers. The orange symbol
|
35
36
|
corresponds to the key to be pressed. For functions above each label (grey
|
@@ -612,6 +613,7 @@ def main_getkey(c) # GET KEY FROM USER
|
|
612
613
|
getchr
|
613
614
|
@hlp ? help : @p_hlp.puts("")
|
614
615
|
when 'Q' # QUIT
|
616
|
+
Rcurses.clear_screen
|
615
617
|
exit 0
|
616
618
|
when /[0-9.,]/ # Go to entry mode for x
|
617
619
|
@stk.lift
|
@@ -635,7 +637,7 @@ def entry(chr) # X REGISTER ENTRY
|
|
635
637
|
pos = 1
|
636
638
|
Rcurses::Cursor.set(7,33)
|
637
639
|
Rcurses::Cursor.show
|
638
|
-
while %w[0 1 2 3 4 5 6 7 8 9 . , h e RIGHT LEFT HOME END DEL BACK WBACK LDEL].include?(chr)
|
640
|
+
while %w[0 1 2 3 4 5 6 7 8 9 . , h H e RIGHT LEFT HOME END DEL BACK WBACK LDEL].include?(chr)
|
639
641
|
@p_x.puts(num)
|
640
642
|
chr = getchr
|
641
643
|
case chr
|
@@ -679,6 +681,9 @@ def entry(chr) # X REGISTER ENTRY
|
|
679
681
|
num.insert(0, "-")
|
680
682
|
pos += 1
|
681
683
|
end
|
684
|
+
when 'H'
|
685
|
+
num.insert(pos,"-")
|
686
|
+
pos += 1
|
682
687
|
when 'e'
|
683
688
|
num.insert(pos,chr)
|
684
689
|
pos += 1
|
@@ -691,9 +696,8 @@ def entry(chr) # X REGISTER ENTRY
|
|
691
696
|
num = "" if %w[DOWN UP].include?(chr)
|
692
697
|
num.gsub!(/,/, '.')
|
693
698
|
if num.include?("e")
|
694
|
-
|
695
|
-
|
696
|
-
num = n.join
|
699
|
+
base, exp_str = num.split("e")
|
700
|
+
num = (base.to_f * (10 ** exp_str.to_i)).to_s
|
697
701
|
end
|
698
702
|
num != "" ? number = num.to_f : number = ""
|
699
703
|
Rcurses::Cursor.hide
|
metadata
CHANGED
@@ -1,33 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t-rex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rcurses
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.9'
|
27
27
|
description: 'This is a terminal curses RPN calculator similar to the traditional
|
28
28
|
calculators from Hewlett Packard. See https://www.hpmuseum.org/rpn.htm for info
|
29
|
-
on RPN (Reverse Polish Notation). New in 2.1:
|
30
|
-
directly into X.'
|
29
|
+
on RPN (Reverse Polish Notation). New in 2.2.1: Clear screen upon exit.'
|
31
30
|
email: g@isene.com
|
32
31
|
executables:
|
33
32
|
- t-rex
|