program_information 1.1.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.
Potentially problematic release.
This version of program_information might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/bin/program_information +14 -0
- data/doc/CONVENTIONS.md +22 -0
- data/doc/README.gen +9 -0
- data/lib/program_information.rb +2 -0
- data/lib/program_information/constants/array_test_with_this_as_input.rb +120 -0
- data/lib/program_information/constants/colours.rb +42 -0
- data/lib/program_information/constants/constants.rb +55 -0
- data/lib/program_information/constants/regex.rb +85 -0
- data/lib/program_information/initialize.rb +34 -0
- data/lib/program_information/menu.rb +29 -0
- data/lib/program_information/program_information.rb +568 -0
- data/lib/program_information/project/project_base_directory.rb +22 -0
- data/lib/program_information/report.rb +48 -0
- data/lib/program_information/reset.rb +46 -0
- data/lib/program_information/run.rb +18 -0
- data/lib/program_information/toplevel_methods.rb +159 -0
- data/lib/program_information/toplevel_methods/e.rb +14 -0
- data/lib/program_information/toplevel_methods/opnn.rb +27 -0
- data/lib/program_information/toplevel_methods/remove_archive_type.rb +32 -0
- data/lib/program_information/toplevel_methods/return_proper_pipe_token_to_this_input.rb +167 -0
- data/lib/program_information/toplevel_methods/return_short_name.rb +38 -0
- data/lib/program_information/version/version.rb +17 -0
- data/program_information.gemspec +49 -0
- data/test/testing_program_information.rb +49 -0
- metadata +112 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/System/Index/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'program_information/toplevel_methods/return_short_name.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'program_information/program_information.rb'
|
8
|
+
|
9
|
+
module ProgramInformation
|
10
|
+
|
11
|
+
# ========================================================================= #
|
12
|
+
# === ProgramInformation.return_short_name
|
13
|
+
#
|
14
|
+
# This method will ultimately return the value of @short_name value.
|
15
|
+
#
|
16
|
+
# Usage examples:
|
17
|
+
#
|
18
|
+
# ProgramInformation.return_short_name('ffmpeg-2.1.tar.xz') # => "ffmpeg"
|
19
|
+
# ProgramInformation.return_short_name('/Users/x/SRC/gobjectintrospection/gobject-introspection-1.53.4.tar.xz') # => "gobjectintrospection"
|
20
|
+
#
|
21
|
+
# In the first example, it will return 'ffmpeg', but keep in mind that
|
22
|
+
# we allow to keep '-' characters. In the second example, the '-'
|
23
|
+
# MUST be preserved.
|
24
|
+
# ========================================================================= #
|
25
|
+
def self.return_short_name(
|
26
|
+
of_this_program = ''
|
27
|
+
)
|
28
|
+
if of_this_program.nil? or of_this_program.empty?
|
29
|
+
opnn; e 'Please provide some input to the method '\
|
30
|
+
'ProgramInformation.return_short_name.'
|
31
|
+
else
|
32
|
+
_ = ::ProgramInformation::ProgramInformation.new(of_this_program)
|
33
|
+
_.short_name?
|
34
|
+
end
|
35
|
+
end; self.instance_eval { alias return_name return_short_name } # === ProgramInformation.return_name
|
36
|
+
self.instance_eval { alias return_program_real_name return_short_name } # === ProgramInformation.return_program_real_name
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/System/Index/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'program_information/version/version.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module ProgramInformation
|
8
|
+
|
9
|
+
class ProgramInformation
|
10
|
+
|
11
|
+
# ========================================================================= #
|
12
|
+
# === VERSION
|
13
|
+
# ========================================================================= #
|
14
|
+
VERSION = '1.1.3'
|
15
|
+
DEFAULT_VERSION = VERSION # Use an "alias" to the above constant.
|
16
|
+
|
17
|
+
end; end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# Gemspec for Project ProgramInformation.
|
3
|
+
# =========================================================================== #
|
4
|
+
require 'program_information'
|
5
|
+
|
6
|
+
Gem::Specification.new { |s|
|
7
|
+
|
8
|
+
s.name = 'program_information'
|
9
|
+
s.version = ProgramInformation::ProgramInformation::VERSION
|
10
|
+
s.date = Time.now.strftime('%Y-%m-%d')
|
11
|
+
|
12
|
+
DESCRIPTION = <<-EOF
|
13
|
+
|
14
|
+
This library is called program_information.
|
15
|
+
|
16
|
+
It allows you to return the real name and the version of strings
|
17
|
+
such as "htop-1.0.2.tar.xz".
|
18
|
+
|
19
|
+
The name would be "htop" and the version would be "1.0.2".
|
20
|
+
|
21
|
+
This project here was needed for the Cookbooks project and the
|
22
|
+
RBT project.
|
23
|
+
|
24
|
+
It has since then become somewhat useful on its own.
|
25
|
+
|
26
|
+
EOF
|
27
|
+
|
28
|
+
s.summary = DESCRIPTION
|
29
|
+
s.description = DESCRIPTION
|
30
|
+
|
31
|
+
s.extra_rdoc_files = %w()
|
32
|
+
|
33
|
+
s.authors = ['Robert A. Heiler']
|
34
|
+
s.email = 'shevegen@gmail.com'
|
35
|
+
s.files = Dir['**/*']
|
36
|
+
s.license = 'GPL-2.0'
|
37
|
+
s.homepage = 'http://rubygems.org/gems/program_information'
|
38
|
+
|
39
|
+
s.required_ruby_version = '>= '+RUBY_VERSION
|
40
|
+
s.required_rubygems_version = '>= '+Gem::VERSION
|
41
|
+
s.rubygems_version = '>= '+Gem::VERSION
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# Add the dependencies next:
|
45
|
+
# ========================================================================= #
|
46
|
+
s.add_dependency 'colours'
|
47
|
+
s.add_dependency 'remove_file_suffix'
|
48
|
+
|
49
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/System/Index/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
require 'cliner'
|
6
|
+
require 'colours/autoinclude'
|
7
|
+
require 'program_information'
|
8
|
+
|
9
|
+
cliner {
|
10
|
+
e 'Testing project ProgramInformation next.'
|
11
|
+
}; e
|
12
|
+
|
13
|
+
# =========================================================================== #
|
14
|
+
# === TEST_THESE_PROGRAMS
|
15
|
+
#
|
16
|
+
# It is recommended to move more complicated input to the bottom
|
17
|
+
# of this array. That way we can focus on it quickly.
|
18
|
+
# =========================================================================== #
|
19
|
+
TEST_THESE_PROGRAMS = ProgramInformation::ARRAY_TEST_THIS_AS_INPUT.reject(&:empty?)
|
20
|
+
|
21
|
+
# =========================================================================== #
|
22
|
+
# === test
|
23
|
+
# =========================================================================== #
|
24
|
+
def test(i)
|
25
|
+
cliner
|
26
|
+
e
|
27
|
+
e 'Now testing input `'+sfancy(i)+'`.'
|
28
|
+
e
|
29
|
+
begin
|
30
|
+
ProgramInformation::ProgramInformation.new(i).report(:do_report)
|
31
|
+
rescue Exception => error
|
32
|
+
pp error
|
33
|
+
end
|
34
|
+
# _ = ProgramInformation::ProgramInformation.new(entry, true, true)
|
35
|
+
e
|
36
|
+
cliner
|
37
|
+
e # Trailing newline.
|
38
|
+
end
|
39
|
+
|
40
|
+
# =========================================================================== #
|
41
|
+
# Iterate over TEST_THESE_PROGRAMS.
|
42
|
+
# =========================================================================== #
|
43
|
+
TEST_THESE_PROGRAMS.each {|entry| test(entry) }
|
44
|
+
|
45
|
+
TEST_THESE_PROGRAMS.each {|entry|
|
46
|
+
original_entry = entry.dup
|
47
|
+
entry = ProgramInformation.return_proper_pipe_token_to_this_input(entry)
|
48
|
+
e simp(original_entry.ljust(54))+' -> '+sfancy(entry)
|
49
|
+
}
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: program_information
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Robert A. Heiler
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colours
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: remove_file_suffix
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: |2+
|
42
|
+
|
43
|
+
This library is called program_information.
|
44
|
+
|
45
|
+
It allows you to return the real name and the version of strings
|
46
|
+
such as "htop-1.0.2.tar.xz".
|
47
|
+
|
48
|
+
The name would be "htop" and the version would be "1.0.2".
|
49
|
+
|
50
|
+
This project here was needed for the Cookbooks project and the
|
51
|
+
RBT project.
|
52
|
+
|
53
|
+
It has since then become somewhat useful on its own.
|
54
|
+
|
55
|
+
email: shevegen@gmail.com
|
56
|
+
executables: []
|
57
|
+
extensions: []
|
58
|
+
extra_rdoc_files: []
|
59
|
+
files:
|
60
|
+
- README.md
|
61
|
+
- bin/program_information
|
62
|
+
- doc/CONVENTIONS.md
|
63
|
+
- doc/README.gen
|
64
|
+
- lib/program_information.rb
|
65
|
+
- lib/program_information/constants/array_test_with_this_as_input.rb
|
66
|
+
- lib/program_information/constants/colours.rb
|
67
|
+
- lib/program_information/constants/constants.rb
|
68
|
+
- lib/program_information/constants/regex.rb
|
69
|
+
- lib/program_information/initialize.rb
|
70
|
+
- lib/program_information/menu.rb
|
71
|
+
- lib/program_information/program_information.rb
|
72
|
+
- lib/program_information/project/project_base_directory.rb
|
73
|
+
- lib/program_information/report.rb
|
74
|
+
- lib/program_information/reset.rb
|
75
|
+
- lib/program_information/run.rb
|
76
|
+
- lib/program_information/toplevel_methods.rb
|
77
|
+
- lib/program_information/toplevel_methods/e.rb
|
78
|
+
- lib/program_information/toplevel_methods/opnn.rb
|
79
|
+
- lib/program_information/toplevel_methods/remove_archive_type.rb
|
80
|
+
- lib/program_information/toplevel_methods/return_proper_pipe_token_to_this_input.rb
|
81
|
+
- lib/program_information/toplevel_methods/return_short_name.rb
|
82
|
+
- lib/program_information/version/version.rb
|
83
|
+
- program_information.gemspec
|
84
|
+
- test/testing_program_information.rb
|
85
|
+
homepage: http://rubygems.org/gems/program_information
|
86
|
+
licenses:
|
87
|
+
- GPL-2.0
|
88
|
+
metadata: {}
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 2.6.5
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 3.0.6
|
103
|
+
requirements: []
|
104
|
+
rubygems_version: 3.0.6
|
105
|
+
signing_key:
|
106
|
+
specification_version: 4
|
107
|
+
summary: This library is called program_information. It allows you to return the
|
108
|
+
real name and the version of strings such as "htop-1.0.2.tar.xz". The name would
|
109
|
+
be "htop" and the version would be "1.0.2". This project here was needed for the
|
110
|
+
Cookbooks project and the RBT project. It has since then become somewhat useful
|
111
|
+
on its own.
|
112
|
+
test_files: []
|