1
0
mirror of https://github.com/bitwarden/help synced 2025-12-18 01:03:27 +00:00
Files
help/vendor/bundle/ruby/2.6.0/gems/terminal-table-2.0.0/examples/examples.rb
fred_the_tech_writer 906e2ca0dd Promote to Master (#748)
* initial commit

* adding quotes for the array error

* Create Gemfile

* Create Gemfile.lock

* add .nvmrc and .node-version

* removed /article from URL

* update links to work with netlify

* more fixed links

* link fixes

* update bad links

* Update netlify.toml

toml test for redirects

* article redirect

* link fixes

* Update index.html

* Update netlify.toml

* Update _config.yml

* Update netlify.toml

* Update netlify.toml

* Update netlify.toml

* Update netlify.toml

* Update netlify.toml

* add article back into URL for launch

* Update netlify.toml

* Update netlify.toml

* add order to categories front matter

* Update netlify.toml

* update

* sidemenu update

* Revert "sidemenu update"

This reverts commit 5441c3d35c.

* update order prop

* Navbar updates per Gary and compiler warnings

* font/style tweaks

* Update sidebar.html

* Stage Release Documentation (#739)

* initial drafts

* rewrite Custom Fields article to prioritize new context-menu option & better organize ancillary information

* edit

* edit

* Custom Field Context Menu & CAPTCHA item in release notes

* SSO relink event

* update rn

* small edits

* improve release notes titles

* fix side menu

* Edits courtest of mportune!

* update order

* link fixes

* link cleanup

* image updates and a link

* fix trailing slash

Co-authored-by: DanHillesheim <79476558+DanHillesheim@users.noreply.github.com>
2021-09-21 13:21:11 -04:00

84 lines
2.2 KiB
Ruby

$:.unshift File.dirname(__FILE__) + '/../lib'
require 'terminal-table/import'
puts
puts table(['a', 'b'], [1, 2], [3, 4])
puts
puts table(['name', 'content'], ['ftp.example.com', '1.1.1.1'], ['www.example.com', '|lalalala|lalala|'])
puts
t = table ['a', 'b']
t.style = {:padding_left => 2, :width => 80}
t << [1, 2]
t << [3, 4]
t << :separator
t << [4, 6]
puts t
puts
user_table = table do |v|
v.title = "Contact Information"
v.headings = 'First Name', 'Last Name', 'Email'
v << %w( TJ Holowaychuk tj@vision-media.ca )
v << %w( Bob Someone bob@vision-media.ca )
v << %w( Joe Whatever bob@vision-media.ca )
end
puts user_table
puts
user_table = table do |v|
v.style.width = 80
v.headings = 'First Name', 'Last Name', 'Email'
v << %w( TJ Holowaychuk tj@vision-media.ca )
v << %w( Bob Someone bob@vision-media.ca )
v << %w( Joe Whatever bob@vision-media.ca )
end
puts user_table
puts
user_table = table do
self.headings = 'First Name', 'Last Name', 'Email'
add_row ['TJ', 'Holowaychuk', 'tj@vision-media.ca']
add_row ['Bob', 'Someone', 'bob@vision-media.ca']
add_row ['Joe', 'Whatever', 'joe@vision-media.ca']
add_separator
add_row ['Total', { :value => '3', :colspan => 2, :alignment => :right }]
align_column 1, :center
end
puts user_table
puts
user_table = table do
self.headings = ['First Name', 'Last Name', {:value => 'Phones', :colspan => 2, :alignment => :center}]
add_row ['Bob', 'Someone', '123', '456']
add_row :separator
add_row ['TJ', 'Holowaychuk', {:value => "No phones\navaiable", :colspan => 2, :alignment => :center}]
add_row :separator
add_row ['Joe', 'Whatever', '4324', '343242']
end
puts user_table
rows = []
rows << ['Lines', 100]
rows << ['Comments', 20]
rows << ['Ruby', 70]
rows << ['JavaScript', 30]
puts table([nil, 'Lines'], *rows)
rows = []
rows << ['Lines', 100]
rows << ['Comments', 20]
rows << ['Ruby', 70]
rows << ['JavaScript', 30]
puts table(nil, *rows)
rows = []
rows << ['Lines', 100]
rows << ['Comments', 20]
rows << ['Ruby', 70]
rows << ['JavaScript', 30]
table = table([{ :value => 'Stats', :colspan => 2, :alignment => :center }], *rows)
table.align_column 1, :right
puts table