xrpn 1.1.11 → 1.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xrpn +25 -4
  3. data/lib/xrpn.rb +1 -2
  4. data/xrpn.gemspec +1 -1
  5. metadata +2 -3
  6. data/xlib/optparse +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c6f814c240c32360d827999b73c4e639c250961ad411ac5e3b24294b8a9485c
4
- data.tar.gz: ea22b560bc4af10f44745acb6c7bbeb963e592fe16db1fccc230881618c2e770
3
+ metadata.gz: a7a19f8e4bef73ee3b6099d50a418d033d129ecbfb808b7e6ca2e058f1036a74
4
+ data.tar.gz: 0eda38a9de877944f51b0c7c2407261b60d386edf1a7f7c1e466b9a601bdc01d
5
5
  SHA512:
6
- metadata.gz: a21aace2e83318a85933a96d720b8315fb38a22226f26be9747f11347e6eb8d0947abba4d95a8b4f381976f44732a0cf9772c6c2b7b0bf83bc7ce08abcc36725
7
- data.tar.gz: fdc11995bdaca9f7c3707c5bbd954260ca5392775bf5cf1591470a74f4d3b95f7f51345526e8df0ef478538693e3bd45eae896dc5cd991a491deec97bb8a201d
6
+ metadata.gz: 0c70decfd7068d4defa8b912cbafa7d30fb2595425f2df8a5a5ebf3ca02f775e1a4acca00cf7710413ba3f06907e11fa534778748da752db24e526788bbd0a9a
7
+ data.tar.gz: 118569c5be20f93115c304b9072dfae4e9c6254ab2fdd7ca78c75d5e8231ec580f035f252528734465b335b609a5d9187507b016ffa571fa1766b3f78425caa1
data/bin/xrpn CHANGED
@@ -9,11 +9,28 @@ require 'bigdecimal'
9
9
  require 'open-uri'
10
10
  require 'json'
11
11
  require 'tty-prompt'
12
- begin
13
- require 'xrpn'
14
- rescue LoadError
15
- puts "You may want to install xrpn via `gem install xrpn`"
12
+
13
+ # Handle the command line options
14
+ options = {}
15
+ optparse = OptionParser.new do |opts|
16
+ # Set a banner, displayed at the top of the help screen.
17
+ opts.banner = "Usage: xrpn [options]"
18
+
19
+ # Define the options, and what they do
20
+ opts.on('-f', '--file program', 'Specify the file to process') { |f| $rfile = f }
21
+ opts.on('-l', '--load program(s)', Array, 'File(s) to load, but not run') { |l| $lfile = l }
22
+ opts.on('-s', '--state STATE', 'Load a State file') { |s| $sfile = s }
23
+ opts.on('-c', '--check program', 'Program file to check for errors') { |c| check(c); exit }
24
+ opts.on('-x', '--X X-value', 'Set initial value in the X register') { |x| @x = x.to_f }
25
+ opts.on('-y', '--Y Y-value', 'Set initial value in the Y register') { |y| @y = y.to_f }
26
+ opts.on('-z', '--Z Z-value', 'Set initial value in the Z register') { |z| @z = z.to_f }
27
+ opts.on('-t', '--T T-value', 'Set initial value in the T register') { |t| @t = t.to_f }
28
+ opts.on('-a', '--Alpha Alpha-string', 'Set initial string in Alpha') { |a| @a = a.to_s }
29
+ opts.on('-h', 'Display SHORT help text') { puts opts; exit }
30
+ opts.on('--help', 'Display LONG help text') { help; puts; puts opts; exit}
31
+ opts.on('-v', '--version', 'Display the XRPN version number') { xrpn_version; exit }
16
32
  end
33
+ optparse.parse!
17
34
 
18
35
  # ENSURE DIRs
19
36
  Dir.mkdir(Dir.home + "/.xrpn") unless File.exist?(Dir.home + "/.xrpn")
@@ -24,6 +41,10 @@ end
24
41
  # INITIALIZE
25
42
  $theme = "dark"
26
43
  @x, @y, @z, @t, @a = 0, 0, 0, 0, ""
44
+ begin
45
+ require 'xrpn'
46
+ rescue LoadError
47
+ end
27
48
  Dir[Dir.home+"/.xrpn/xlib/*"].each { |file| load file } # Read libraries
28
49
  read_cmd # Read XRPN commands
29
50
  @p = XRPN.new($rfile)
data/lib/xrpn.rb CHANGED
@@ -1,3 +1,2 @@
1
1
  Dir[__dir__ + "/../xlib/*"].each { |file| load file }
2
- @x, @y, @z, @t, @a = 0, 0, 0, 0, ""
3
- Dir[__dir__ + "/../xcmd/*"].each { |file| puts file; load file }
2
+ Dir[__dir__ + "/../xcmd/*"].each { |file| load file }
data/xrpn.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'xrpn'
3
- s.version = '1.1.11'
3
+ s.version = '1.1.13'
4
4
  s.licenses = ['Unlicense']
5
5
  s.summary = "XRPN - The eXtended RPN (Reverse Polish Notation) programming language"
6
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."
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: 1.1.11
4
+ version: 1.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2022-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -313,7 +313,6 @@ files:
313
313
  - xlib/locate_prg
314
314
  - xlib/numeric
315
315
  - xlib/numformat
316
- - xlib/optparse
317
316
  - xlib/read_cmd
318
317
  - xlib/read_state
319
318
  - xlib/save_state
data/xlib/optparse DELETED
@@ -1,23 +0,0 @@
1
- # Handle the command line options
2
- options = {}
3
- optparse = OptionParser.new do |opts|
4
- # Set a banner, displayed at the top of the help screen.
5
- opts.banner = "Usage: xrpn [options]"
6
-
7
- # Define the options, and what they do
8
- opts.on('-f', '--file program', 'Specify the file to process') { |f| $rfile = f }
9
- opts.on('-l', '--load program(s)', Array, 'File(s) to load, but not run') { |l| $lfile = l }
10
- opts.on('-s', '--state STATE', 'Load a State file') { |s| $sfile = s }
11
- opts.on('-c', '--check program', 'Program file to check for errors') { |c| check(c); exit }
12
- opts.on('-x', '--X X-value', 'Set initial value in the X register') { |x| @x = x.to_f }
13
- opts.on('-y', '--Y Y-value', 'Set initial value in the Y register') { |y| @y = y.to_f }
14
- opts.on('-z', '--Z Z-value', 'Set initial value in the Z register') { |z| @z = z.to_f }
15
- opts.on('-t', '--T T-value', 'Set initial value in the T register') { |t| @t = t.to_f }
16
- opts.on('-a', '--Alpha Alpha-string', 'Set initial string in Alpha') { |a| @a = a.to_s }
17
- opts.on('-h', 'Display SHORT help text') { puts opts; exit }
18
- opts.on('--help', 'Display LONG help text') { help; puts; puts opts; exit}
19
- opts.on('-v', '--version', 'Display the XRPN version number') { xrpn_version; exit }
20
- end
21
- optparse.parse!
22
-
23
- # vim:ft=ruby: