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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e40cce37f3887352faf5af1a973b233365765f02c23e9c57ea93921c47fc304f
4
- data.tar.gz: ef6af0a4b53e24517657e09d8bfcccd5e89030ba9c12ee911dbbdf94ed121bae
3
+ metadata.gz: c9748ecc493f4ee0a58532a66576eb25255f980c9d0b13186a4af80b2345ea29
4
+ data.tar.gz: a791ac2e66daab10f3a4597496017914d53218cc91b5e5b3178d5ab6c2efde14
5
5
  SHA512:
6
- metadata.gz: fd780006874abee068039bc8dd366ea6b86d2422c6d762c4b05203fe3a0cca053ad5977e6438d3150bce7313937aab33c92dc46dfc91f3b78b97b68c1c46999c
7
- data.tar.gz: 1df7408a9932b2154c9a9fa99cd4279ef67d265372a3daf66cee82891fea2156da868bf70855c3eff7be16e80f28af9f52b2283e381850e6ffbbe6acc2c0155c
6
+ metadata.gz: 157afeed76f47e91464592833ca25f95236762530726c41951b7a8e754911522a6c47527d5dacb4e88b937fd4d8ae983c64f4a7bba26a08a428ae0f2f933b0b2
7
+ data.tar.gz: 1c2d46ce5b65aafe2e5d678b55d140d01a6154be7b119e977717932151e827b7b3031c002834e9f14c6136e626cd873bbbb8b4502402b94d3a7b003e7aa2035e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- indirect (0.1.0)
4
+ indirect (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -4,5 +4,5 @@ require "bundler/setup"
4
4
  require "indirect"
5
5
  require "fileutils"
6
6
 
7
- FileUtils.rm Indirect.card_path
7
+ FileUtils.rm Indirect.card_path if File.exist? Indirect.card_path
8
8
  load File.expand_path("../exe/indirect", __dir__)
@@ -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")
@@ -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")
@@ -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: "https://arko.net",
15
- blog: "https://andre.arko.net",
14
+ website: "arko.net",
15
+ blog: "andre.arko.net",
16
16
  twitter: "indirect",
17
17
  github: "indirect",
18
- linkedin: "https://www.linkedin.com/in/andrearko",
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.cyan : nil,
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 ? "npx " << info.card : nil
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
- content = title << "\n\n" << [work, contact, card].map do |section|
52
- section.map{|line| line.join(": ") }.join("\n")
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
- File.write card_path, content
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
@@ -1,3 +1,3 @@
1
1
  module Indirect
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/output CHANGED
@@ -1,13 +1,17 @@
1
- Andrรฉ Arko / indirect
2
-
3
- Work: Vice Minister of Computation at CloudCity.io
4
- Open Source: Founder at Ruby Together and Team Lead of Bundler
5
-
6
- Email: andre@arko.net
7
- Website: https://arko.net
8
- Blog: https://andre.arko.net
9
- Twitter: indirect
10
- GitHub: https://github.com/indirect
11
- LinkedIn: https://www.linkedin.com/in/andrearko
12
-
13
- Card: npx indirect
1
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
2
+ โ”‚ โ”‚
3
+ โ”‚ Andrรฉ Arko / indirect โ”‚
4
+ โ”‚ โ”‚
5
+ โ”‚  Work: Vice Minister of Computation at CloudCity.io โ”‚
6
+ โ”‚ Open Source: Founder at Ruby Together and Team Lead of Bundler โ”‚
7
+ โ”‚ โ”‚
8
+ โ”‚  Email: andre@arko.net โ”‚
9
+ โ”‚  Website: https://arko.net โ”‚
10
+ โ”‚  Blog: https://andre.arko.net โ”‚
11
+ โ”‚  Twitter: https://indirect โ”‚
12
+ โ”‚  GitHub: https://github.com/indirect โ”‚
13
+ โ”‚  LinkedIn: https://linkedin.com/in/andrearko โ”‚
14
+ โ”‚ โ”‚
15
+ โ”‚  Card: gemx indirect โ”‚
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: 0.1.0
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-23 00:00:00.000000000 Z
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