t-rex 2.2.1 → 2.3
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 +21 -17
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 908c9816e08cc351d020a90fd6c570e891eb8495b705cf54ce8d7d9016844147
|
4
|
+
data.tar.gz: ebe6556bec04b4673b087619df540d20b776cb502523addf6b871d4de9c5ba80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9af9e67bd471cde02e77a3e64e010464aed7d1b6cf19f4f8e3189c762ff71a1c8bad59b37e8fb4024a19c99123fb6eb46a0be6b2420c88ef27d413f93466d477
|
7
|
+
data.tar.gz: 24196220301e501ff97845ded3639d3f959dc95e0b7072091e3c39ea453e8dc783b09f6117f14a260c1504899ecad9abd237cbc406bf23c9f26d47242374366c
|
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.3" # Upgraded to new version of rcurses
|
16
16
|
|
17
17
|
require 'rcurses'
|
18
18
|
include Rcurses::Input
|
@@ -64,7 +64,7 @@ HELPTEXT
|
|
64
64
|
if @hlp
|
65
65
|
@p_hlp.fg = 239
|
66
66
|
@p_hlp.ix = 0
|
67
|
-
@p_hlp.
|
67
|
+
@p_hlp.say(help)
|
68
68
|
else
|
69
69
|
@p_hlp.ix = @history.length - @h + 3
|
70
70
|
histprint
|
@@ -353,7 +353,7 @@ def histprint
|
|
353
353
|
print = @history.join("\n ")
|
354
354
|
@p_hlp.ix = 0 if @p_hlp.ix < 0
|
355
355
|
@p_hlp.fg = 145
|
356
|
-
@p_hlp.
|
356
|
+
@p_hlp.say(print)
|
357
357
|
return print
|
358
358
|
end
|
359
359
|
def num_format(n) # THE NUMBER FORMAT FUNCTION
|
@@ -511,14 +511,14 @@ def main_getkey(c) # GET KEY FROM USER
|
|
511
511
|
when 'M'
|
512
512
|
@reg = %w[0 0 0 0 0 0 0 0 0 0]
|
513
513
|
when 'S' # Store to Reg
|
514
|
-
@p_x.
|
514
|
+
@p_x.say(" Store x in Reg #(0-9)")
|
515
515
|
r = getchr
|
516
516
|
if r =~ /[0-9]/
|
517
517
|
@reg[r.to_i] = @stk.x
|
518
518
|
end
|
519
519
|
history("STO #{r}")
|
520
520
|
when 'R' # Recall from Reg
|
521
|
-
@p_x.
|
521
|
+
@p_x.say(" Recall from Reg #(0-9)")
|
522
522
|
r = getchr
|
523
523
|
if r =~ /[0-9]/
|
524
524
|
@stk.lift
|
@@ -526,14 +526,14 @@ def main_getkey(c) # GET KEY FROM USER
|
|
526
526
|
end
|
527
527
|
history("RCL #{r}")
|
528
528
|
when 's' # Set Sci size/limit
|
529
|
-
@p_x.
|
529
|
+
@p_x.say(" Sci notation limit (2-9)")
|
530
530
|
s = getchr
|
531
531
|
if s =~ /[2-9]/
|
532
532
|
@sci = s.to_i
|
533
533
|
end
|
534
534
|
history("Sci #{s}")
|
535
535
|
when 'f' # Set Fix size
|
536
|
-
@p_x.
|
536
|
+
@p_x.say(" Fixed decimals (0-9)")
|
537
537
|
f = getchr
|
538
538
|
if f =~ /[0-9]/
|
539
539
|
@fix = f.to_i
|
@@ -594,7 +594,7 @@ def main_getkey(c) # GET KEY FROM USER
|
|
594
594
|
when '@' # Ruby console
|
595
595
|
@p_hlp.fg = 168
|
596
596
|
loop do
|
597
|
-
@p_hlp.
|
597
|
+
@p_hlp.say("")
|
598
598
|
@p_hlp.prompt = " Ruby: "
|
599
599
|
@p_hlp.editline
|
600
600
|
Rcurses::Cursor.set(4,36)
|
@@ -611,9 +611,10 @@ def main_getkey(c) # GET KEY FROM USER
|
|
611
611
|
end
|
612
612
|
@p_hlp.fg = 239
|
613
613
|
getchr
|
614
|
-
@hlp ? help : @p_hlp.
|
614
|
+
@hlp ? help : @p_hlp.say("")
|
615
615
|
when 'Q' # QUIT
|
616
616
|
Rcurses.clear_screen
|
617
|
+
Rcurses::Cursor.show
|
617
618
|
exit 0
|
618
619
|
when /[0-9.,]/ # Go to entry mode for x
|
619
620
|
@stk.lift
|
@@ -638,7 +639,9 @@ def entry(chr) # X REGISTER ENTRY
|
|
638
639
|
Rcurses::Cursor.set(7,33)
|
639
640
|
Rcurses::Cursor.show
|
640
641
|
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)
|
641
|
-
@p_x.
|
642
|
+
@p_x.clear
|
643
|
+
@p_x.say(num)
|
644
|
+
Rcurses::Cursor.show
|
642
645
|
chr = getchr
|
643
646
|
case chr
|
644
647
|
when 'RIGHT'
|
@@ -690,6 +693,7 @@ def entry(chr) # X REGISTER ENTRY
|
|
690
693
|
when /[0-9.,]/
|
691
694
|
num.insert(pos,chr)
|
692
695
|
pos += 1
|
696
|
+
@p_x.say(num)
|
693
697
|
end
|
694
698
|
Rcurses::Cursor.col(33 - num.length + pos)
|
695
699
|
end
|
@@ -717,11 +721,11 @@ def refresh # REFRESH ALL PANES
|
|
717
721
|
@p_x.refresh
|
718
722
|
end
|
719
723
|
def pstack # PRINT STACK (XYZTL)
|
720
|
-
@p_l.
|
721
|
-
@p_t.
|
722
|
-
@p_z.
|
723
|
-
@p_y.
|
724
|
-
@p_x.
|
724
|
+
@p_l.say(num_format(@stk.l))
|
725
|
+
@p_t.say(num_format(@stk.t))
|
726
|
+
@p_z.say(num_format(@stk.z))
|
727
|
+
@p_y.say(num_format(@stk.y))
|
728
|
+
@p_x.say(num_format(@stk.x).b)
|
725
729
|
end
|
726
730
|
def pregs # PRINT CONTENT OF REGS (0-9)
|
727
731
|
@p_reg.text = "\n"
|
@@ -732,7 +736,7 @@ def pregs # PRINT CONTENT OF REGS (0-9)
|
|
732
736
|
@p_reg.refresh
|
733
737
|
end
|
734
738
|
def error(err) # PRINT ERRORS TO X
|
735
|
-
@p_x.
|
739
|
+
@p_x.say(err)
|
736
740
|
@history.insert(-2, err)
|
737
741
|
getchr
|
738
742
|
end
|
@@ -754,7 +758,7 @@ refresh
|
|
754
758
|
Rcurses::Cursor.hide
|
755
759
|
begin # Capture main loop
|
756
760
|
loop do # Main loop
|
757
|
-
@p_inf.
|
761
|
+
@p_inf.say(" #{@mod} Sci=#{@sci} Fix=#{@fix}".i)
|
758
762
|
pstack
|
759
763
|
pregs
|
760
764
|
@t = @stk.dup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t-rex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: '2.3'
|
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-
|
11
|
+
date: 2025-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rcurses
|
@@ -16,17 +16,17 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.5'
|
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: '
|
26
|
+
version: '3.5'
|
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.
|
29
|
+
on RPN (Reverse Polish Notation). New in 2.3: Upgraded to new version of rcurses.'
|
30
30
|
email: g@isene.com
|
31
31
|
executables:
|
32
32
|
- t-rex
|