esystem 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of esystem might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +37 -0
- data/doc/README.gen +35 -0
- data/esystem.gemspec +39 -0
- data/lib/esystem.rb +2 -0
- data/lib/esystem/esystem.rb +60 -0
- data/lib/esystem/method.rb +14 -0
- data/lib/esystem/version/version.rb +12 -0
- data/test/testing_esystem.rb +9 -0
- metadata +60 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c3e3de2f999105c931444fcdae725173eb3535f361aacd32b1e424529f9982b8
|
4
|
+
data.tar.gz: '08894d38e250677efc6f43d1b9cb443c72e929d0a98ff51960be51de0e3fb7ea'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4109d77d782bb7b60e187120c4cbcbc7d9ed633ba217cb7e67e100ad6bcf587b685954cc9e1114ab3c1f8f788a68141203b1a7f05933b63a1a7d23c7c9637a26
|
7
|
+
data.tar.gz: d4eba4a6629e804098f3c373f3cbb3916524ea3140cfc034eeac0105e8b4b18a56c3c28cf3844770716aacf70b014ecd15e32dcd6a0e9d1a562a61e117045315
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](https://www.gobolinux.org/)
|
2
|
+
[![forthebadge](http://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/esystem.svg)](https://badge.fury.io/rb/esystem)
|
4
|
+
|
5
|
+
## Overview
|
6
|
+
|
7
|
+
This library normally just provides a single method
|
8
|
+
called esystem().
|
9
|
+
|
10
|
+
This will output given text, then run system().
|
11
|
+
It is supposed to work either with the Colours
|
12
|
+
module or by doing: alias e puts prior to use it.
|
13
|
+
|
14
|
+
## Using the library
|
15
|
+
|
16
|
+
There are several ways to use it. Example:
|
17
|
+
|
18
|
+
require 'esystem'
|
19
|
+
|
20
|
+
Esystem.esystem 'ls'
|
21
|
+
|
22
|
+
You can, as with all modules in ruby, include the main
|
23
|
+
namespace:
|
24
|
+
|
25
|
+
include Esystem
|
26
|
+
|
27
|
+
That way you can omit having to type the leading
|
28
|
+
**Esystem.** part.
|
29
|
+
|
30
|
+
## Contact information
|
31
|
+
|
32
|
+
If you have specific suggestions to make this gem more
|
33
|
+
useful for others, please drop me an email at:
|
34
|
+
|
35
|
+
shevegen@gmail.com
|
36
|
+
|
37
|
+
Thank you.
|
data/doc/README.gen
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
ADD_RUBY_HEADER
|
2
|
+
|
3
|
+
## Overview
|
4
|
+
|
5
|
+
This library normally just provides a single method
|
6
|
+
called esystem().
|
7
|
+
|
8
|
+
This will output given text, then run system().
|
9
|
+
It is supposed to work either with the Colours
|
10
|
+
module or by doing: alias e puts prior to use it.
|
11
|
+
|
12
|
+
## Using the library
|
13
|
+
|
14
|
+
There are several ways to use it. Example:
|
15
|
+
|
16
|
+
require 'esystem'
|
17
|
+
|
18
|
+
Esystem.esystem 'ls'
|
19
|
+
|
20
|
+
You can, as with all modules in ruby, include the main
|
21
|
+
namespace:
|
22
|
+
|
23
|
+
include Esystem
|
24
|
+
|
25
|
+
That way you can omit having to type the leading
|
26
|
+
**Esystem.** part.
|
27
|
+
|
28
|
+
## Contact information
|
29
|
+
|
30
|
+
If you have specific suggestions to make this gem more
|
31
|
+
useful for others, please drop me an email at:
|
32
|
+
|
33
|
+
shevegen@gmail.com
|
34
|
+
|
35
|
+
Thank you.
|
data/esystem.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# Gemspec for Project Esystem.
|
3
|
+
# =========================================================================== #
|
4
|
+
require 'esystem/version/version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new { |s|
|
7
|
+
|
8
|
+
s.name = 'esystem'
|
9
|
+
s.version = Esystem::VERSION
|
10
|
+
s.date = Time.now.strftime('%Y-%m-%d')
|
11
|
+
|
12
|
+
DESCRIPTION = <<-EOF
|
13
|
+
|
14
|
+
This library normally just provides a single method
|
15
|
+
called esystem().
|
16
|
+
|
17
|
+
This will output given text, then run system().
|
18
|
+
It is supposed to work either with the Colours
|
19
|
+
module or by doing: alias e puts prior to use it.
|
20
|
+
|
21
|
+
EOF
|
22
|
+
|
23
|
+
s.summary = DESCRIPTION
|
24
|
+
s.description = DESCRIPTION
|
25
|
+
|
26
|
+
s.extra_rdoc_files = %w()
|
27
|
+
|
28
|
+
s.authors = ['Robert A. Heiler']
|
29
|
+
s.email = 'shevegen@gmail.com'
|
30
|
+
s.files = Dir['**/*']
|
31
|
+
s.license = 'GPL-2.0'
|
32
|
+
|
33
|
+
s.required_ruby_version = '>= '+RUBY_VERSION
|
34
|
+
s.required_rubygems_version = '>= '+Gem::VERSION
|
35
|
+
s.rubygems_version = '>= '+Gem::VERSION
|
36
|
+
|
37
|
+
s.homepage = 'http://rubygems.org/gems/esystem'
|
38
|
+
|
39
|
+
}
|
data/lib/esystem.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
#!/System/Index/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
module Esystem # include Esystem
|
6
|
+
|
7
|
+
# ========================================================================= #
|
8
|
+
# === Esystem.esystem
|
9
|
+
#
|
10
|
+
# This method combines output via the e() method, and a system call
|
11
|
+
# through the inbuilt method system().
|
12
|
+
#
|
13
|
+
# If the optional colourize-argument is given, then we will invoke
|
14
|
+
# sfancy(), which will colourize the command that is to be run.
|
15
|
+
# ========================================================================= #
|
16
|
+
def self.esystem(
|
17
|
+
i,
|
18
|
+
optional_try_to_colourize_the_result = false
|
19
|
+
)
|
20
|
+
i = i.to_s # Seems more useful to have that in a String all the time.
|
21
|
+
if block_given?
|
22
|
+
yielded = yield
|
23
|
+
case yielded
|
24
|
+
# ===================================================================== #
|
25
|
+
# === :do_colourize_the_result
|
26
|
+
# ===================================================================== #
|
27
|
+
when :do_colourize_the_result
|
28
|
+
optional_try_to_colourize_the_result = true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
case optional_try_to_colourize_the_result
|
32
|
+
when :colourize_output, :use_colours, :do_colourize,
|
33
|
+
:do_colourize_the_result
|
34
|
+
optional_try_to_colourize_the_result = true
|
35
|
+
end
|
36
|
+
if Object.const_defined? :Colours # Use Colours if it is available.
|
37
|
+
_ = i # Work on a copy of the input here.
|
38
|
+
_ = sfancy(_) if optional_try_to_colourize_the_result
|
39
|
+
Colours.e(_)
|
40
|
+
else
|
41
|
+
puts i
|
42
|
+
end
|
43
|
+
begin
|
44
|
+
system i
|
45
|
+
rescue Errno::ENOENT => e
|
46
|
+
puts 'The base-directory seems to have been deleted.'
|
47
|
+
pp e
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# ========================================================================= #
|
52
|
+
# === esystem
|
53
|
+
#
|
54
|
+
# Simply delegate towards the above.
|
55
|
+
# ========================================================================= #
|
56
|
+
def esystem(i, optional_try_to_colourize_the_result = false)
|
57
|
+
Esystem.esystem(i, optional_try_to_colourize_the_result)
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/System/Index/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
require 'esystem'
|
6
|
+
|
7
|
+
# =========================================================================== #
|
8
|
+
# === esystem
|
9
|
+
#
|
10
|
+
# This method combines output via e() with a system call through system().
|
11
|
+
# =========================================================================== #
|
12
|
+
def esystem(i, optional_try_to_colourize_the_result = false)
|
13
|
+
Esystem.esystem(i, optional_try_to_colourize_the_result)
|
14
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/System/Index/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
module Esystem
|
6
|
+
|
7
|
+
# ========================================================================= #
|
8
|
+
# === Esystem::VERSION
|
9
|
+
# ========================================================================= #
|
10
|
+
VERSION = '0.0.15'
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/System/Index/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# =========================================================================== #
|
4
|
+
require 'esystem/method'
|
5
|
+
require 'colours/autoinclude'
|
6
|
+
_ = 'ls' # Our test command.
|
7
|
+
esystem _
|
8
|
+
esystem _, :colourize_output
|
9
|
+
esystem _, :use_colours
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: esystem
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.15
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Robert A. Heiler
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: |2+
|
14
|
+
|
15
|
+
This library normally just provides a single method
|
16
|
+
called esystem().
|
17
|
+
|
18
|
+
This will output given text, then run system().
|
19
|
+
It is supposed to work either with the Colours
|
20
|
+
module or by doing: alias e puts prior to use it.
|
21
|
+
|
22
|
+
email: shevegen@gmail.com
|
23
|
+
executables: []
|
24
|
+
extensions: []
|
25
|
+
extra_rdoc_files: []
|
26
|
+
files:
|
27
|
+
- README.md
|
28
|
+
- doc/README.gen
|
29
|
+
- esystem.gemspec
|
30
|
+
- lib/esystem.rb
|
31
|
+
- lib/esystem/esystem.rb
|
32
|
+
- lib/esystem/method.rb
|
33
|
+
- lib/esystem/version/version.rb
|
34
|
+
- test/testing_esystem.rb
|
35
|
+
homepage: http://rubygems.org/gems/esystem
|
36
|
+
licenses:
|
37
|
+
- GPL-2.0
|
38
|
+
metadata: {}
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.6.5
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 3.0.6
|
53
|
+
requirements: []
|
54
|
+
rubygems_version: 3.0.6
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: 'This library normally just provides a single method called esystem(). This
|
58
|
+
will output given text, then run system(). It is supposed to work either with the
|
59
|
+
Colours module or by doing: alias e puts prior to use it.'
|
60
|
+
test_files: []
|