echolor 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/echolor +37 -0
- metadata +60 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 295593decece5f3e3635f6b620c66fffc0257814975c82197e8f034fa2de0351
|
4
|
+
data.tar.gz: 9eb24cde72ab298c7918cc66eecec887c3f484fbfdf4f86314c83be9199b2c02
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 405425d0e5b3a5d8719ebec24250bddb1f1817728c7541b6c2b9c2772acd4e15fe672fd2fd934c6fc35b3336c7076d3db7e1fc175e82f5d696d648367279a191
|
7
|
+
data.tar.gz: 0e774f6835a818949cfc105c05255fb3908edf5369d3bfa1413013b15ed2737648cf4acd6fbd375b9116c092049943cdb4a836b4d6a62f110379101eb70ff534
|
data/echolor
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
require 'optparse'
|
3
|
+
require 'colorize'
|
4
|
+
|
5
|
+
USAGE = 'Usage: echolor [options] [color] [text]'.freeze
|
6
|
+
skip_newline = false
|
7
|
+
|
8
|
+
def exit_with_msg msg
|
9
|
+
puts msg
|
10
|
+
exit 1
|
11
|
+
end
|
12
|
+
|
13
|
+
option_parser = OptionParser.new do |opts|
|
14
|
+
opts.banner = USAGE
|
15
|
+
|
16
|
+
opts.separator ''
|
17
|
+
opts.separator 'Available option(s):'
|
18
|
+
|
19
|
+
opts.on('-n', 'Skips newline') do
|
20
|
+
skip_newline = true
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.separator ''
|
24
|
+
|
25
|
+
COLORS = String.colors.join("\n\t")
|
26
|
+
opts.separator "Available colors:\n\t#{COLORS}"
|
27
|
+
end
|
28
|
+
option_parser.parse!
|
29
|
+
|
30
|
+
color = ARGV.first
|
31
|
+
text = ARGV[1..-1].join(' ') rescue ''
|
32
|
+
|
33
|
+
exit_with_msg option_parser.new if color.nil?
|
34
|
+
exit_with_msg 'Error: Invalid color' unless String.colors.include? color.to_sym
|
35
|
+
|
36
|
+
text += "\n" unless skip_newline
|
37
|
+
print text.send color
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: echolor
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Harman Singh
|
8
|
+
autorequire:
|
9
|
+
bindir: "."
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.8.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.8.1
|
27
|
+
description: echo, with colour, built for your command line.
|
28
|
+
email:
|
29
|
+
- harman28@gmail.com
|
30
|
+
executables:
|
31
|
+
- echolor
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- "./echolor"
|
36
|
+
homepage: https://github.com/harman28/echolor
|
37
|
+
licenses:
|
38
|
+
- MIT
|
39
|
+
metadata: {}
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- "."
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
requirements: []
|
55
|
+
rubyforge_project:
|
56
|
+
rubygems_version: 2.7.7
|
57
|
+
signing_key:
|
58
|
+
specification_version: 4
|
59
|
+
summary: echo, but with colour.
|
60
|
+
test_files: []
|