xrpn 2.3 → 2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6ace1f064aca783f21398cdb1f2f4f559ed9c81c5f0ec320bbfb1bcb141dba9
4
- data.tar.gz: 49ba0dbb56fb0d008b137f869aa384d405a178f65a3ae4cef0da13ce1ee417bd
3
+ metadata.gz: 84914aee77f72d7498f7550ebd2baab36750512ef40df1821a5eecd3e990bc42
4
+ data.tar.gz: 05f5f0827b724fc60f627ecf7a830396ae037c6e2cfaf5f0fe3240fb519a4e58
5
5
  SHA512:
6
- metadata.gz: 391751c7be85bb1c289813dbc181386ea5e547be63e22ae59991f7713d44bfe034cbed36cd8aedfb131dd19f433cb71fc75449cd6ba4300c4d642d65f4bbbed9
7
- data.tar.gz: 712a0cf5d4452142836fa7ef503ea56236bbe8bb76f500acceff98778072212d97751d604eb0d8c63d910bab166ef80c5c97a58f872e606067e5e577d51dd8d4
6
+ metadata.gz: 644a84de681db279ebc4d710559c05b7d5411733474ea40b8f7ee54644176d3c371c8dbc86cffac9d89a05ea5549a77cae382289731f2ef441f16415d305d3c2
7
+ data.tar.gz: 7a573988b18edbed9c245eeb82c2b3fc3038375f72ba2832ebe1d2f5114c182723ef122d5ca99cb8193477a5f9b9b6fc46388a60cb51454214f812f94f74323d
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # XRPN
2
- ![Ruby](https://img.shields.io/badge/language-Ruby-red) ![Unlicense](https://img.shields.io/badge/license-Unlicense-green) ![Stay Amazing](https://img.shields.io/badge/Stay-Amazing-important)
2
+ ![Ruby](https://img.shields.io/badge/language-Ruby-red) [![Gem Version](https://badge.fury.io/rb/xrpn.svg)](https://badge.fury.io/rb/xrpn) ![Unlicense](https://img.shields.io/badge/license-Unlicense-green) ![Stay Amazing](https://img.shields.io/badge/Stay-Amazing-important)
3
3
 
4
4
  ## Introduction
5
5
 
data/bin/xrpn CHANGED
@@ -80,7 +80,7 @@ load(Dir.home+'/.xrpn/conf') if File.exist?(Dir.home+'/.xrpn/conf')
80
80
  @p.x, @p.y, @p.z, @p.t, @p.a = @x, @y, @z, @t, @a
81
81
 
82
82
  # INITIALIZE XRPN PROGRAM
83
- @p.prg[@p.pg] = ["LBL \"XRPN\"", "END"] # Put dummy program in page 0 if no file/string to run
83
+ @p.prg[@p.pg] = ["LBL \"XRPN\"", "END"] unless $rfile # Put dummy program in page 0 if no file/string to run
84
84
  @p.prg[@p.pg] = hp_41($exe.split(",")) if $exe # Read in string as program is supplied by -e/--execute
85
85
  @p.prg[@p.pg] = hp_41(@p.prg[@p.pg]) if $rfile # Substitute HP-41 commands with XRPN commands
86
86
  if $lfile # Read file to load but not run if -l switch is used
data/xcmd/getweb CHANGED
@@ -5,9 +5,9 @@ class XRPN
5
5
  begin
6
6
  @x = open(@a) {|f| f.read }
7
7
  rescue
8
- return "Cannot get the content of '#{a}'"
8
+ return "Cannot get the content of \"#{a}\""
9
9
  end
10
10
  end
11
11
  end
12
12
 
13
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/pprg CHANGED
@@ -7,7 +7,7 @@ class XRPN
7
7
  pr = "\"#{@a}\""
8
8
  page, pos, prgm = locate_prg (pr)
9
9
  if pos == nil
10
- puts "No such program to print."
10
+ puts "No such program to print #{pr}"
11
11
  return
12
12
  end
13
13
  end
@@ -25,4 +25,4 @@ class XRPN
25
25
  end
26
26
  end
27
27
 
28
- # vim:ft=ruby:
28
+ # vim:ft=ruby:
data/xlib/check CHANGED
@@ -1,5 +1,5 @@
1
1
  def check(file)
2
- load Dir.home+"/.xrpn/lib/read_cmd"
2
+ load Dir.home+"/.xrpn/xlib/read_xcmd"
3
3
  read_cmd
4
4
  errors = 0
5
5
  if File.exist?(file)
data/xlib/read_xcmd CHANGED
@@ -1,12 +1,14 @@
1
1
  def read_xcmd
2
- $cmd = []
3
2
  if $gem
4
- Dir[$gem+"/xcmd/*"].each do |file|
5
- load file
6
- l = File.read(file)
7
- c = l.sub(/.*\s*def /m, '')
8
- c = c.sub(/\s.*/m, '')
9
- $cmd.push(c)
3
+ begin
4
+ Dir[$gem+"/xcmd/*"].each do |file|
5
+ load file
6
+ l = File.read(file)
7
+ c = l.sub(/.*\s*def /m, '')
8
+ c = c.sub(/\s.*/m, '')
9
+ $cmd.push(c)
10
+ end
11
+ rescue
10
12
  end
11
13
  end
12
14
  Dir[Dir.home+"/.xrpn/xcmd/*"].each do |file|
@@ -17,6 +19,7 @@ def read_xcmd
17
19
  $cmd.push(c)
18
20
  end
19
21
  $cmd.sort!
22
+ $cmd.uniq!
20
23
  end
21
24
 
22
25
  # vim:ft=ruby:
data/xlib/rxcmd ADDED
@@ -0,0 +1,20 @@
1
+ def rxcmd(xcmd)
2
+ return xcmd if $cmd.include?(xcmd)
3
+ $gem ? gfile = $gem+"/xcmd/#{xcmd}" : gfile = ""
4
+ xfile = Dir.home+"/.xrpn/xcmd/#{xcmd}"
5
+ [gfile, xfile].each do |file|
6
+ if File.exist?(file)
7
+ load file
8
+ l = File.read(file)
9
+ c = l.sub(/.*\s*def /m, '')
10
+ c = c.sub(/\s.*/m, '')
11
+ $cmd.push(c)
12
+ $cmd.sort!
13
+ $cmd.uniq!
14
+ return xcmd
15
+ end
16
+ end
17
+ return nil
18
+ end
19
+
20
+ # vim:ft=ruby:
data/xrpn.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'xrpn'
3
- s.version = '2.3'
3
+ s.version = '2.4'
4
4
  s.licenses = ['Unlicense']
5
5
  s.summary = "XRPN - The eXtended RPN (Reverse Polish Notation) programming language"
6
- s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 2.0: Startup speed 4X. Added command 'cmds'. 2.1: Fixed rounding overflow bug. Added : commands to access underlying Ruby. 2.2: Added error exception (flag 25) with commands 'error'=CF 25 and 'unerror'=SF 25. 2.3: Better Flag 25 handling."
6
+ s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 2.4: Fixed loading of files via the -f switch."
7
7
 
8
8
  s.authors = ["Geir Isene"]
9
9
  s.email = 'g@isene.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrpn
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.3'
4
+ version: '2.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-26 00:00:00.000000000 Z
11
+ date: 2025-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -28,10 +28,8 @@ description: 'A full programming language and environment extending the features
28
28
  the venerable HP calculator programmable calculators. With XRPN you can accomplish
29
29
  a wide range of modern programming tasks as well as running existing HP-41 FOCAL
30
30
  programs directly. XRPN gives modern life to tens of thousands of old HP calculator
31
- programs and opens the possibilities to many, many more. New in 2.0: Startup speed
32
- 4X. Added command ''cmds''. 2.1: Fixed rounding overflow bug. Added : commands to
33
- access underlying Ruby. 2.2: Added error exception (flag 25) with commands ''error''=CF
34
- 25 and ''unerror''=SF 25. 2.3: Better Flag 25 handling.'
31
+ programs and opens the possibilities to many, many more. New in 2.4: Fixed loading
32
+ of files via the -f switch.'
35
33
  email: g@isene.com
36
34
  executables:
37
35
  - xrpn
@@ -205,7 +203,6 @@ files:
205
203
  - xcmd/posfl
206
204
  - xcmd/pow
207
205
  - xcmd/pprg
208
- - xcmd/pprg1
209
206
  - xcmd/pprgtofile
210
207
  - xcmd/pprgx
211
208
  - xcmd/pra
@@ -233,7 +230,6 @@ files:
233
230
  - xcmd/recip
234
231
  - xcmd/regmove
235
232
  - xcmd/regswap
236
- - xcmd/reload
237
233
  - xcmd/reszfl
238
234
  - xcmd/rnd
239
235
  - xcmd/root
@@ -334,6 +330,7 @@ files:
334
330
  - xlib/numformat
335
331
  - xlib/read_state
336
332
  - xlib/read_xcmd
333
+ - xlib/rxcmd
337
334
  - xlib/save_state
338
335
  - xlib/save_xm
339
336
  - xlib/setpt
data/xcmd/pprg1 DELETED
@@ -1,28 +0,0 @@
1
- class XRPN
2
- # Print program
3
- def pprg
4
- page = @pg
5
- pos = 0
6
- if @a != ""
7
- pr = "\"#{@a}\""
8
- page, pos, prgm = locate_prg (pr)
9
- if pos == nil
10
- puts "No such program to print #{pr}"
11
- return
12
- end
13
- end
14
- @prg[page].each_index do |i|
15
- next if i < pos
16
- print "#{format('%02d', i + 1)}"
17
- if @prg[page][i].downcase.match(/lbl/)
18
- print "◆"
19
- else
20
- print " "
21
- end
22
- puts "#{@prg[page][i]}"
23
- break if @prg[page][i] == "END"
24
- end
25
- end
26
- end
27
-
28
- # vim:ft=ruby:
data/xcmd/reload DELETED
@@ -1,8 +0,0 @@
1
- class XRPN
2
- # Reload all commands in the ./xrpn/cmd directory (makes it possble to modify or add commands while a program is running)
3
- def reload
4
- read_cmd
5
- end
6
- end
7
-
8
- # vim:ft=ruby: