xrpn 1.3.3 → 1.3.4

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.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/xcmd/copy +23 -0
  3. data/xcmd/move +23 -0
  4. data/xcmd/open +24 -0
  5. data/xcmd/read +12 -0
  6. data/xrpn.gemspec +2 -2
  7. metadata +8 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8167dcb78197e227f824c68546005f21579dba7675cc9ded60392a5faea6b38c
4
- data.tar.gz: a5de67d1bfc1fec03865523fdec1bfafb1595b383500012f7d242408c07d646d
3
+ metadata.gz: 1fd6c24bf0ae1e16e943aaf138b71c12d3fb91f96a76db8c4177ab4ff4a0a5f5
4
+ data.tar.gz: 38e57e229c8d739f5967de726866f87b309b1e74be3e42ca65d4807ea4768ea2
5
5
  SHA512:
6
- metadata.gz: 266d7d75ea40f2d46f5a2923999bb104452fd5f8977ccd25d78b8ba060d4dc24fb10d8206aaa31622259e3b2a14e1c595df3e8ccdb2f92fdf055d00d7fc665e3
7
- data.tar.gz: 563a67e0f13b95b2f590c9ad56a4383b36450184f376c8cef111ad211291901136f366d974516a5e6df9de6c384be28881b4df700357205d813df32f0717d1ca
6
+ metadata.gz: 8fda5beedc920d94a7711ad6d78908b785cd08ece3909a3e79583045300faf784c1b762640fd79fb1c9a178404b0da8199c4af9f50531a356f455fcb07b38107
7
+ data.tar.gz: 678af3b283e0970dca83f62c8ad85a26a3a4902b59aa0832edbf37308fd1a7dbd25dcd4fd9e250c6ff0f6eb48b4c8ec34cf9bde22f10ad7f2b1d1f855b3e0f10
data/xcmd/copy ADDED
@@ -0,0 +1,23 @@
1
+ class XRPN
2
+ # Copy file named in Alpha to filename in X
3
+ def copy
4
+ begin
5
+ require 'fileutils'
6
+ rescue
7
+ puts "Ruby FileUtils needs to be installed."
8
+ return
9
+ end
10
+ item = @a
11
+ dest = @x
12
+ while File.exist?(dest)
13
+ dest = dest.chop + (dest[-1].to_i + 1).to_s
14
+ end
15
+ begin
16
+ FileUtils.cp_r(item, dest)
17
+ rescue StandardError => err
18
+ puts err.to_s
19
+ end
20
+ end
21
+ end
22
+
23
+ # vim:ft=ruby:
data/xcmd/move ADDED
@@ -0,0 +1,23 @@
1
+ class XRPN
2
+ # Move file named in Alpha to filename in X
3
+ def move
4
+ begin
5
+ require 'fileutils'
6
+ rescue
7
+ puts "Ruby FileUtils needs to be installed."
8
+ return
9
+ end
10
+ item = @a
11
+ dest = @x
12
+ while File.exist?(dest)
13
+ dest = dest.chop + (dest[-1].to_i + 1).to_s
14
+ end
15
+ begin
16
+ FileUtils.mv(item, dest)
17
+ rescue StandardError => err
18
+ puts err.to_s
19
+ end
20
+ end
21
+ end
22
+
23
+ # vim:ft=ruby:
data/xcmd/open ADDED
@@ -0,0 +1,24 @@
1
+ class XRPN
2
+ # Open a file system file or make directory the current directory
3
+ def open
4
+ if File.directory?(@a) # Rescue for permission error
5
+ begin
6
+ Dir.chdir(@a)
7
+ rescue
8
+ puts "Cannot move to directory \"#{@a}\""
9
+ end
10
+ else
11
+ begin
12
+ if File.read(@a).force_encoding("UTF-8").valid_encoding?
13
+ system("exec $EDITOR #{@a}")
14
+ else
15
+ Thread.new { system("xdg-open #{@a} 2>/dev/null") }
16
+ end
17
+ rescue
18
+ puts "Cannot open file \"#{@a}\""
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ # vim:ft=ruby:
data/xcmd/read ADDED
@@ -0,0 +1,12 @@
1
+ class XRPN
2
+ # Reads content of file named in Alpha into X
3
+ def read
4
+ begin
5
+ @x = File.read(@a).chomp
6
+ rescue
7
+ puts "Cannot read file \"#{@a}\""
8
+ end
9
+ end
10
+ end
11
+
12
+ # 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 = '1.3.3'
3
+ s.version = '1.3.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 1.3.3: Implemented tones. Bug fixes."
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 1.3.4: Added file system commands READ, OPEN, COPY, MOVE."
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: 1.3.3
4
+ version: 1.3.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: 2023-01-13 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -28,8 +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 1.3.3: Implemented
32
- tones. Bug fixes.'
31
+ programs and opens the possibilities to many, many more. New in 1.3.4: Added file
32
+ system commands READ, OPEN, COPY, MOVE.'
33
33
  email: g@isene.com
34
34
  executables:
35
35
  - xrpn
@@ -95,6 +95,7 @@ files:
95
95
  - xcmd/cmdadd
96
96
  - xcmd/cmddel
97
97
  - xcmd/cmdhelp
98
+ - xcmd/copy
98
99
  - xcmd/correct
99
100
  - xcmd/cos
100
101
  - xcmd/crflas
@@ -175,11 +176,13 @@ files:
175
176
  - xcmd/mdy
176
177
  - xcmd/mean
177
178
  - xcmd/mod
179
+ - xcmd/move
178
180
  - xcmd/multiply
179
181
  - xcmd/oct
180
182
  - xcmd/octdec
181
183
  - xcmd/off
182
184
  - xcmd/on
185
+ - xcmd/open
183
186
  - xcmd/p_r
184
187
  - xcmd/pack
185
188
  - xcmd/page
@@ -220,6 +223,7 @@ files:
220
223
  - xcmd/rclpta
221
224
  - xcmd/rclsw
222
225
  - xcmd/rdn
226
+ - xcmd/read
223
227
  - xcmd/recip
224
228
  - xcmd/regmove
225
229
  - xcmd/regswap