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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e40cce37f3887352faf5af1a973b233365765f02c23e9c57ea93921c47fc304f
4
- data.tar.gz: ef6af0a4b53e24517657e09d8bfcccd5e89030ba9c12ee911dbbdf94ed121bae
3
+ metadata.gz: 60369d41e255aa8031709f6d103fbbfe542d8ae99486046b9f84188acb67c7c3
4
+ data.tar.gz: 176f39153efbc4200ac1d7f6a846e8657dc2c338075ffcf0c8fbca6c399eb766
5
5
  SHA512:
6
- metadata.gz: fd780006874abee068039bc8dd366ea6b86d2422c6d762c4b05203fe3a0cca053ad5977e6438d3150bce7313937aab33c92dc46dfc91f3b78b97b68c1c46999c
7
- data.tar.gz: 1df7408a9932b2154c9a9fa99cd4279ef67d265372a3daf66cee82891fea2156da868bf70855c3eff7be16e80f28af9f52b2283e381850e6ffbbe6acc2c0155c
6
+ metadata.gz: 615d79f607c369a72737b6f4d8e699224629c2e81e5d67642c277bb18a6a743996b760d9ba602cfd945ef7db8aed648a7b9d489655f021e87c656adb18c4fbdf
7
+ data.tar.gz: abc16b9f1580fe7015671a434e40e7da614c023f1f6f54d6b967565fc4b885c8769b4747ad3179fc7ca3ad05c03085de90aced9f528631b10e327e3b04c5fede
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in indirect.gemspec
6
6
  gemspec
7
+
8
+ gem "bump", "~> 0.10.0"
data/Gemfile.lock CHANGED
@@ -1,14 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- indirect (0.1.0)
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 (10.5.0)
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
- bundler (~> 1.17)
31
+ bump (~> 0.10.0)
32
+ bundler (~> 2.1)
31
33
  colorize (~> 0.8)
32
34
  indirect!
33
- rake (~> 10.0)
35
+ rake (~> 13.0)
34
36
  rspec (~> 3.0)
35
37
 
36
38
  BUNDLED WITH
37
- 1.17.2
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
@@ -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__)
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.17"
32
- spec.add_development_dependency "rake", "~> 10.0"
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
@@ -1,3 +1,3 @@
1
1
  module Indirect
2
- VERSION = "0.1.0"
2
+ VERSION = "1.1.0"
3
3
  end
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 CloudCity.io",
12
- oss: "Founder at Ruby Together and Team Lead of Bundler",
11
+ job: "Vice Minister of Computation at cloudcity.io",
12
+ oss: "RubyGems Coordinator at Ruby Central",
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
+ 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
- "Twitter" => info.twitter,
42
- "GitHub" => info.github ? "https://github.com/" << info.github.cyan : nil,
43
- "LinkedIn" => info.linkedin,
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 ? "npx " << info.card : nil
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
- content = title << "\n\n" << [work, contact, card].map do |section|
52
- section.map{|line| line.join(": ") }.join("\n")
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
- File.write card_path, content
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
- 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: RubyGems Coordinator at Ruby Central โ”‚
7
+ โ”‚ โ”‚
8
+ โ”‚  Email: andre@arko.net โ”‚
9
+ โ”‚  Website: https://arko.net โ”‚
10
+ โ”‚  Blog: https://andre.arko.net โ”‚
11
+ โ”‚  GitHub: https://github.com/indirect โ”‚
12
+ โ”‚  Mastodon: https://fiasco.social/@indirect โ”‚
13
+ โ”‚  Twitter: https://twitter.com/indirect โ”‚
14
+ โ”‚  LinkedIn: https://linkedin.com/in/andrearko โ”‚
15
+ โ”‚ โ”‚
16
+ โ”‚  Card: gem exec indirect โ”‚
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: 0.1.0
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: 2019-02-23 00:00:00.000000000 Z
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.17'
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.17'
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: '10.0'
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: '10.0'
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.1
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: []