indirect 0.1.0 โ 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +7 -5
- data/README.md +2 -0
- data/bin/indirect +1 -1
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/indirect.gemspec +2 -2
- data/lib/indirect/version.rb +1 -1
- data/lib/indirect.rb +49 -17
- data/lib/output +18 -13
- metadata +13 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60369d41e255aa8031709f6d103fbbfe542d8ae99486046b9f84188acb67c7c3
|
4
|
+
data.tar.gz: 176f39153efbc4200ac1d7f6a846e8657dc2c338075ffcf0c8fbca6c399eb766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 615d79f607c369a72737b6f4d8e699224629c2e81e5d67642c277bb18a6a743996b760d9ba602cfd945ef7db8aed648a7b9d489655f021e87c656adb18c4fbdf
|
7
|
+
data.tar.gz: abc16b9f1580fe7015671a434e40e7da614c023f1f6f54d6b967565fc4b885c8769b4747ad3179fc7ca3ad05c03085de90aced9f528631b10e327e3b04c5fede
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
indirect (
|
4
|
+
indirect (1.1.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
bump (0.10.0)
|
9
10
|
colorize (0.8.1)
|
10
11
|
diff-lcs (1.3)
|
11
|
-
rake (
|
12
|
+
rake (13.0.6)
|
12
13
|
rspec (3.8.0)
|
13
14
|
rspec-core (~> 3.8.0)
|
14
15
|
rspec-expectations (~> 3.8.0)
|
@@ -27,11 +28,12 @@ PLATFORMS
|
|
27
28
|
ruby
|
28
29
|
|
29
30
|
DEPENDENCIES
|
30
|
-
|
31
|
+
bump (~> 0.10.0)
|
32
|
+
bundler (~> 2.1)
|
31
33
|
colorize (~> 0.8)
|
32
34
|
indirect!
|
33
|
-
rake (~>
|
35
|
+
rake (~> 13.0)
|
34
36
|
rspec (~> 3.0)
|
35
37
|
|
36
38
|
BUNDLED WITH
|
37
|
-
|
39
|
+
2.5.0.dev
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Inspired by hearing [@lynncyrin][lynn] talk about [npx business cards][1] at [!!Con West][!!con], this is a [gemx][2] business card. To see the output, run `gemx indirect`.
|
4
4
|
|
5
|
+
To create your own `gemx` business card, you can fork this repo, put your own info at the top of `indirect.rb`... and then even rename the files, if you want. ๐
|
6
|
+
|
5
7
|
[lynn]: https://twitter.com/lynncyrin
|
6
8
|
[!!con]: http://bangbangcon.com/west/
|
7
9
|
[1]: https://github.com/bnb/bitandbang
|
data/bin/indirect
CHANGED
data/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rake' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/indirect.gemspec
CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
|
-
spec.add_development_dependency "bundler", "~> 1
|
32
|
-
spec.add_development_dependency "rake", "~>
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
32
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
33
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
34
34
|
spec.add_development_dependency "colorize", "~> 0.8"
|
35
35
|
end
|
data/lib/indirect/version.rb
CHANGED
data/lib/indirect.rb
CHANGED
@@ -8,14 +8,15 @@ module Indirect
|
|
8
8
|
OpenStruct.new(
|
9
9
|
name: "Andrรฉ Arko",
|
10
10
|
handle: "indirect",
|
11
|
-
job: "Vice Minister of Computation at
|
12
|
-
oss: "
|
11
|
+
job: "Vice Minister of Computation at cloudcity.io",
|
12
|
+
oss: "RubyGems Coordinator at Ruby Central",
|
13
13
|
email: "andre@arko.net",
|
14
|
-
website: "
|
15
|
-
blog: "
|
14
|
+
website: "arko.net",
|
15
|
+
blog: "andre.arko.net",
|
16
16
|
twitter: "indirect",
|
17
17
|
github: "indirect",
|
18
|
-
linkedin: "
|
18
|
+
linkedin: "andrearko",
|
19
|
+
mastodon: "fiasco.social/@indirect",
|
19
20
|
card: "indirect",
|
20
21
|
)
|
21
22
|
end
|
@@ -27,32 +28,63 @@ module Indirect
|
|
27
28
|
|
28
29
|
def self.generate_card
|
29
30
|
require "colorize"
|
31
|
+
colors = [:cyan, :red, :blue, :green].cycle
|
32
|
+
|
30
33
|
title = [info.name.white, "/".green, info.handle.white].join(" ")
|
31
34
|
|
32
35
|
work = {
|
33
|
-
"Work" => info.job,
|
34
|
-
"Open Source" => info.oss,
|
36
|
+
"Work" => info.job.white,
|
37
|
+
"Open Source" => info.oss.white,
|
35
38
|
}.select{|k,v| v }
|
36
39
|
|
37
40
|
contact = {
|
38
|
-
"Email" => info.email,
|
39
|
-
"Website" => info.website,
|
40
|
-
"Blog" => info.blog,
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
41
|
+
"Email" => info.email ? info.email.send(colors.next) : nil,
|
42
|
+
"Website" => info.website ? "https://" << info.website.send(colors.next) : nil,
|
43
|
+
"Blog" => info.blog ? "https://" << info.blog.send(colors.next) : nil,
|
44
|
+
"GitHub" => info.github ? "https://github.com/" << info.github.send(colors.next) : nil,
|
45
|
+
"Mastodon" => info.twitter ? "https://" << info.mastodon.send(colors.next) : nil,
|
46
|
+
"Twitter" => info.twitter ? "https://twitter.com/" << info.twitter.send(colors.next) : nil,
|
47
|
+
"LinkedIn" => info.linkedin ? "https://linkedin.com/in/" << info.linkedin.send(colors.next) : nil,
|
44
48
|
}.select{|k,v| v }
|
45
49
|
|
46
50
|
card = {
|
47
|
-
"Card" => info.card ? "
|
51
|
+
"Card" => info.card ? "gem exec ".red << info.card.white : nil
|
48
52
|
}.select{|k,v| v }
|
49
53
|
|
50
54
|
sections = [work, contact, card]
|
51
|
-
|
52
|
-
|
55
|
+
label_size = sections.map(&:keys).flatten.map(&:length).max
|
56
|
+
|
57
|
+
body = sections.map do |section|
|
58
|
+
section.map do |name, value|
|
59
|
+
label = sprintf("%#{label_size}s", name) << ": "
|
60
|
+
[label.white.bold, value].join
|
61
|
+
end.join("\n")
|
53
62
|
end.join("\n\n")
|
54
63
|
|
55
|
-
|
64
|
+
content = [title, body].join("\n\n")
|
65
|
+
|
66
|
+
File.write card_path, in_box(content)
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.in_box(content)
|
70
|
+
require "colorize"
|
71
|
+
width = content.lines.map(&:uncolorize).map(&:length).max
|
72
|
+
edge_size = width + 6
|
73
|
+
|
74
|
+
box = "โญ" << "โ" * edge_size << "โฎ\n"
|
75
|
+
box << "โ" << " " * edge_size << "โ\n"
|
76
|
+
|
77
|
+
title = content.lines.first
|
78
|
+
cc = (width - title.chomp.uncolorize.size) / 2
|
79
|
+
box << "โ " << " " * cc << title.chomp << " " * cc << " โ\n"
|
80
|
+
|
81
|
+
content.lines[1..-1].each do |line|
|
82
|
+
space_count = width - line.chomp.uncolorize.size
|
83
|
+
box << "โ " << line.chomp << " " * space_count << " โ\n"
|
84
|
+
end
|
85
|
+
|
86
|
+
box << "โ" << " " * edge_size << "โ\n"
|
87
|
+
box << "โฐ" << "โ" * edge_size << "โฏ"
|
56
88
|
end
|
57
89
|
|
58
90
|
def self.card_path
|
data/lib/output
CHANGED
@@ -1,13 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
|
2
|
+
โ โ
|
3
|
+
โ [0;37;49mAndrรฉ Arko[0m [0;32;49m/[0m [0;37;49mindirect[0m โ
|
4
|
+
โ โ
|
5
|
+
โ [1;37;49m Work: [0m[0;37;49mVice Minister of Computation at cloudcity.io[0m โ
|
6
|
+
โ [1;37;49mOpen Source: [0m[0;37;49mRubyGems Coordinator at Ruby Central[0m โ
|
7
|
+
โ โ
|
8
|
+
โ [1;37;49m Email: [0m[0;36;49mandre@arko.net[0m โ
|
9
|
+
โ [1;37;49m Website: [0mhttps://[0;31;49marko.net[0m โ
|
10
|
+
โ [1;37;49m Blog: [0mhttps://[0;34;49mandre.arko.net[0m โ
|
11
|
+
โ [1;37;49m GitHub: [0mhttps://github.com/[0;32;49mindirect[0m โ
|
12
|
+
โ [1;37;49m Mastodon: [0mhttps://[0;36;49mfiasco.social/@indirect[0m โ
|
13
|
+
โ [1;37;49m Twitter: [0mhttps://twitter.com/[0;31;49mindirect[0m โ
|
14
|
+
โ [1;37;49m LinkedIn: [0mhttps://linkedin.com/in/[0;34;49mandrearko[0m โ
|
15
|
+
โ โ
|
16
|
+
โ [1;37;49m Card: [0m[0;31;49mgem exec [0m[0;37;49mindirect[0m โ
|
17
|
+
โ โ
|
18
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indirect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andre Arko
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.8'
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email:
|
71
71
|
- andre@arko.net
|
72
72
|
executables:
|
@@ -85,6 +85,8 @@ files:
|
|
85
85
|
- Rakefile
|
86
86
|
- bin/console
|
87
87
|
- bin/indirect
|
88
|
+
- bin/rake
|
89
|
+
- bin/rspec
|
88
90
|
- bin/setup
|
89
91
|
- exe/indirect
|
90
92
|
- indirect.gemspec
|
@@ -98,7 +100,7 @@ metadata:
|
|
98
100
|
homepage_uri: https://github.com/indirect/indirect
|
99
101
|
source_code_uri: https://github.com/indirect/indirect
|
100
102
|
changelog_uri: https://github.com/indirect/indirect/blob/master/CHANGELOG.md
|
101
|
-
post_install_message:
|
103
|
+
post_install_message:
|
102
104
|
rdoc_options: []
|
103
105
|
require_paths:
|
104
106
|
- lib
|
@@ -113,8 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
115
|
- !ruby/object:Gem::Version
|
114
116
|
version: '0'
|
115
117
|
requirements: []
|
116
|
-
rubygems_version: 3.0.
|
117
|
-
signing_key:
|
118
|
+
rubygems_version: 3.5.0.dev
|
119
|
+
signing_key:
|
118
120
|
specification_version: 4
|
119
121
|
summary: A CLI business card
|
120
122
|
test_files: []
|