indirect 0.1.0 โ 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/bin/indirect +1 -1
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/lib/indirect.rb +45 -15
- data/lib/indirect/version.rb +1 -1
- data/lib/output +17 -13
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9748ecc493f4ee0a58532a66576eb25255f980c9d0b13186a4af80b2345ea29
|
4
|
+
data.tar.gz: a791ac2e66daab10f3a4597496017914d53218cc91b5e5b3178d5ab6c2efde14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 157afeed76f47e91464592833ca25f95236762530726c41951b7a8e754911522a6c47527d5dacb4e88b937fd4d8ae983c64f4a7bba26a08a428ae0f2f933b0b2
|
7
|
+
data.tar.gz: 1c2d46ce5b65aafe2e5d678b55d140d01a6154be7b119e977717932151e827b7b3031c002834e9f14c6136e626cd873bbbb8b4502402b94d3a7b003e7aa2035e
|
data/Gemfile.lock
CHANGED
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/lib/indirect.rb
CHANGED
@@ -11,11 +11,11 @@ module Indirect
|
|
11
11
|
job: "Vice Minister of Computation at CloudCity.io",
|
12
12
|
oss: "Founder at Ruby Together and Team Lead of Bundler",
|
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
19
|
card: "indirect",
|
20
20
|
)
|
21
21
|
end
|
@@ -27,32 +27,62 @@ module Indirect
|
|
27
27
|
|
28
28
|
def self.generate_card
|
29
29
|
require "colorize"
|
30
|
+
colors = [:cyan, :red, :blue, :green].cycle
|
31
|
+
|
30
32
|
title = [info.name.white, "/".green, info.handle.white].join(" ")
|
31
33
|
|
32
34
|
work = {
|
33
|
-
"Work" => info.job,
|
34
|
-
"Open Source" => info.oss,
|
35
|
+
"Work" => info.job.white,
|
36
|
+
"Open Source" => info.oss.white,
|
35
37
|
}.select{|k,v| v }
|
36
38
|
|
37
39
|
contact = {
|
38
|
-
"Email" => info.email,
|
39
|
-
"Website" => info.website,
|
40
|
-
"Blog" => info.blog,
|
41
|
-
"Twitter" => info.twitter,
|
42
|
-
"GitHub" => info.github ? "https://github.com/" << info.github.
|
43
|
-
"LinkedIn" => info.linkedin,
|
40
|
+
"Email" => info.email ? info.email.send(colors.next) : nil,
|
41
|
+
"Website" => info.website ? "https://" << info.website.send(colors.next) : nil,
|
42
|
+
"Blog" => info.blog ? "https://" << info.blog.send(colors.next) : nil,
|
43
|
+
"Twitter" => info.twitter ? "https://" << info.twitter.send(colors.next) : nil,
|
44
|
+
"GitHub" => info.github ? "https://github.com/" << info.github.send(colors.next) : nil,
|
45
|
+
"LinkedIn" => info.linkedin ? "https://linkedin.com/in/" << info.linkedin.send(colors.next) : nil,
|
44
46
|
}.select{|k,v| v }
|
45
47
|
|
46
48
|
card = {
|
47
|
-
"Card" => info.card ? "
|
49
|
+
"Card" => info.card ? "gemx ".red << info.card.white : nil
|
48
50
|
}.select{|k,v| v }
|
49
51
|
|
50
52
|
sections = [work, contact, card]
|
51
|
-
|
52
|
-
|
53
|
+
label_size = sections.map(&:keys).flatten.map(&:length).max
|
54
|
+
|
55
|
+
body = sections.map do |section|
|
56
|
+
section.map do |name, value|
|
57
|
+
label = sprintf("%#{label_size}s", name) << ": "
|
58
|
+
[label.white.bold, value].join
|
59
|
+
end.join("\n")
|
53
60
|
end.join("\n\n")
|
54
61
|
|
55
|
-
|
62
|
+
content = [title, body].join("\n\n")
|
63
|
+
|
64
|
+
File.write card_path, in_box(content)
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.in_box(content)
|
68
|
+
require "colorize"
|
69
|
+
width = content.lines.map(&:uncolorize).map(&:length).max
|
70
|
+
edge_size = width + 6
|
71
|
+
|
72
|
+
box = "โญ" << "โ" * edge_size << "โฎ\n"
|
73
|
+
box << "โ" << " " * edge_size << "โ\n"
|
74
|
+
|
75
|
+
title = content.lines.first
|
76
|
+
cc = (width - title.chomp.uncolorize.size) / 2
|
77
|
+
box << "โ " << " " * cc << title.chomp << " " * cc << " โ\n"
|
78
|
+
|
79
|
+
content.lines[1..-1].each do |line|
|
80
|
+
space_count = width - line.chomp.uncolorize.size
|
81
|
+
box << "โ " << line.chomp << " " * space_count << " โ\n"
|
82
|
+
end
|
83
|
+
|
84
|
+
box << "โ" << " " * edge_size << "โ\n"
|
85
|
+
box << "โฐ" << "โ" * edge_size << "โฏ"
|
56
86
|
end
|
57
87
|
|
58
88
|
def self.card_path
|
data/lib/indirect/version.rb
CHANGED
data/lib/output
CHANGED
@@ -1,13 +1,17 @@
|
|
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;49mFounder at Ruby Together and Team Lead of Bundler[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 Twitter: [0mhttps://[0;32;49mindirect[0m โ
|
12
|
+
โ [1;37;49m GitHub: [0mhttps://github.com/[0;36;49mindirect[0m โ
|
13
|
+
โ [1;37;49m LinkedIn: [0mhttps://linkedin.com/in/[0;31;49mandrearko[0m โ
|
14
|
+
โ โ
|
15
|
+
โ [1;37;49m Card: [0m[0;31;49mgemx [0m[0;37;49mindirect[0m โ
|
16
|
+
โ โ
|
17
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
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.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andre Arko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -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
|