https://github.com/geemus/formatador
STDOUT text formatting
https://github.com/geemus/formatador
Keywords from Contributors
crash-reporting rubygems activerecord sinatra rack ruby-gem feature-flag mvc activejob test-coverage
Last synced: about 2 hours ago
JSON representation
Repository metadata
STDOUT text formatting
- Host: GitHub
- URL: https://github.com/geemus/formatador
- Owner: geemus
- License: mit
- Created: 2009-11-27T05:06:28.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2025-11-24T14:00:32.000Z (3 months ago)
- Last Synced: 2026-02-20T20:02:53.577Z (11 days ago)
- Language: Ruby
- Homepage:
- Size: 148 KB
- Stars: 449
- Watchers: 7
- Forks: 30
- Open Issues: 0
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.txt
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: SECURITY.md
README.md
formatador
STDOUT text formatting
Quick and dirty
You can call class methods to print out single lines like this:
Formatador.display_line('Hello World')
You use tags, similar to html, to set formatting options:
Formatador.display_line('[green]Hello World[/]')
[/] resets everything to normal, colors are supported and [_color_] sets the background color.
Standard options
- format - and adds color codes if STDOUT.tty? is true
- display - calls format on the input and prints it
- display_line - calls display, but adds on a newline (\n)
- redisplay - Displays text, prepended with \r which will overwrite the last existing line
Extensions
- display_table: takes an array of hashes. Each hash is a row, with the keys being the headers and values being the data. An optional second argument can specify which headers/columns to include and in what order they should appear.
- display_compact_table: Same as display_table, execpt that split lines are not drawn by default in the body of the table. If you need a split line, put a :split constant in the body array.
- redisplay_progressbar: takes the current and total values as its first two arguments and redisplays a progressbar (until current = total and then it display_lines). An optional third argument represents the start time and will add an elapsed time counter.
Progress Bar examples
total = 1000
progress = Formatador::ProgressBar.new(total)
1000.times do
progress.increment
end
#=> 978/1000 |************************************************* |
# Change the color of the bar
total = 1000
progress = Formatador::ProgressBar.new(total, :color => "light_blue")
1000.times do
progress.increment
end
# Change the color of a completed progress bar
total = 1000
progress = Formatador::ProgressBar.new(total) { |b| b.opts[:color] = "green" }
1000.times do
progress.increment
end
Table examples
table_data = [
{ :name => "Joe", :food => "Burger" },
{ :name => "Bill", :food => "French fries" }
]
Formatador.display_table(table_data)
#=> +------+--------------+
# | name | food |
# +------+--------------+
# | Joe | Burger |
# +------+--------------+
# | Bill | French fries |
# +------+--------------+
table_data = [
{
:name => "Joe",
:meal => {
:main_dish => "Burger",
:drink => "water"
}
},
{
:name => "Bill",
:meal => {
:main_dish => "Chicken",
:drink => "soda"
}
}
]
Formatador.display_table(table_data, [:name, :"meal.drink"])
#=> +------+------------+
# | name | meal.drink |
# +------+------------+
# | Joe | water |
# +------+------------+
# | Bill | soda |
# +------+------------+
Indentation
By initializing a formatador object you can keep track of indentation:
formatador = Formatador.new
formatador.display_line('one level of indentation')
formatador.indent {
formatador.display_line('two levels of indentation')
}
formatador.display_line('one level of indentation')
Copyright
(The MIT License)
Copyright (c) 2022 geemus (Wesley Beary)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Owner metadata
- Name: Wesley Beary
- Login: geemus
- Email:
- Kind: user
- Description: Parent, org designer, gamer, futurist, community organizer, woodworker, angel, aspiring chef and gymnast. Evolves org strategy, culture, and practices.
- Website: http://geemus.com
- Location: Iowa City, IA
- Twitter: geemus
- Company: Freelance
- Icon url: https://avatars.githubusercontent.com/u/4138?v=4
- Repositories: 76
- Last ynced at: 2023-04-10T09:50:54.744Z
- Profile URL: https://github.com/geemus
GitHub Events
Total
- Pull request event: 1
- Fork event: 1
- Issues event: 4
- Watch event: 1
- Issue comment event: 10
- Push event: 5
- Create event: 2
Last Year
- Pull request event: 1
- Fork event: 1
- Issues event: 4
- Issue comment event: 10
- Push event: 5
- Create event: 2
Committers metadata
Last synced: 1 day ago
Total Commits: 176
Total Committers: 26
Avg Commits per committer: 6.769
Development Distribution Score (DDS): 0.58
Commits in past year: 21
Committers in past year: 2
Avg Commits per committer in past year: 10.5
Development Distribution Score (DDS) in past year: 0.095
| Name | Commits | |
|---|---|---|
| geemus | g****s@g****m | 74 |
| geemus (Wesley Beary) | w****y@e****m | 38 |
| dependabot[bot] | 4****] | 10 |
| Mal Curtis | m****l@s****m | 7 |
| Matt Petty | m****t@k****m | 7 |
| Michael Mior | m****r@u****a | 5 |
| Olle Jonsson | o****n@g****m | 5 |
| Yoshiki Takagi | y****g@g****m | 5 |
| Matt Bridges | m****1@g****m | 4 |
| sawanoboly | s****u@h****m | 3 |
| Chris Howe | c****s@h****m | 2 |
| takanamito | t****8@g****m | 2 |
| Jhonny Moreira | x****s@g****m | 1 |
| Akira Matsuda | r****e@d****p | 1 |
| Ben Fritsch | b****e@b****e | 1 |
| Ben Morrall | b****6@h****m | 1 |
| Bohuslav Kabrda | b****a@r****m | 1 |
| Damien Pollet | d****t@g****m | 1 |
| Daniel Lv | l****t@g****m | 1 |
| Gabe Martin-Dempesy | g****e@m****m | 1 |
| Kevin Menard | n****m@g****m | 1 |
| Manther | j****g@g****m | 1 |
| Nathaniel Eliot | t****9@t****m | 1 |
| Piotr Szmielew | p****w@a****l | 1 |
| mikoto2000 | m****0@g****m | 1 |
| swamp09 | s****a@e****p | 1 |
Committer domains:
- esm.co.jp: 1
- ava.waw.pl: 1
- t9productions.com: 1
- mudbugmedia.com: 1
- redhat.com: 1
- benle.de: 1
- dio.jp: 1
- howeville.com: 1
- higanworks.com: 1
- uwaterloo.ca: 1
- kizmeta.com: 1
- sitepoint.com: 1
- engineyard.com: 1
Issue and Pull Request metadata
Last synced: about 1 month ago
Total issues: 19
Total pull requests: 41
Average time to close issues: about 2 years
Average time to close pull requests: 3 months
Total issue authors: 17
Total pull request authors: 26
Average comments per issue: 2.58
Average comments per pull request: 1.54
Merged pull request: 39
Bot issues: 0
Bot pull requests: 9
Past year issues: 3
Past year pull requests: 2
Past year average time to close issues: 11 days
Past year average time to close pull requests: about 11 hours
Past year issue authors: 3
Past year pull request authors: 2
Past year average comments per issue: 0.33
Past year average comments per pull request: 0.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 1
Top Issue Authors
- bkabrda (2)
- ytkg (2)
- dreua (1)
- jhonnymoreira (1)
- micwoj92 (1)
- shideneyu (1)
- kbarber (1)
- michaelmior (1)
- rnestler (1)
- rking (1)
- zmillman (1)
- bastelfreak (1)
- voxik (1)
- coreyhaines (1)
- jorgefuertes (1)
Top Pull Request Authors
- dependabot[bot] (9)
- olleolleolle (4)
- howech (2)
- lodestone (2)
- ytkg (2)
- michaelmior (2)
- snikch (1)
- temujin9 (1)
- bkabrda (1)
- jhonnymoreira (1)
- cdlm (1)
- manther (1)
- bmorrall (1)
- esse (1)
- takanamito (1)
Top Issue Labels
- no-issue-activity (5)
Top Pull Request Labels
- dependencies (9)
- github_actions (9)
- no-pr-activity (2)
Package metadata
- Total packages: 14
-
Total downloads:
- rubygems: 527,734,919 total
- Total docker downloads: 1,613,859,788
- Total dependent packages: 106 (may contain duplicates)
- Total dependent repositories: 86,056 (may contain duplicates)
- Total versions: 102
- Total maintainers: 1
gem.coop: formatador
STDOUT text formatting
- Homepage: https://github.com/geemus/formatador
- Documentation: http://www.rubydoc.info/gems/formatador/
- Licenses: MIT
- Latest release: 1.2.3 (published 4 months ago)
- Last Synced: 2026-03-02T15:02:21.359Z (1 day ago)
- Versions: 34
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 263,830,625 Total
- Docker Downloads: 806,929,894
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.032%
- Downloads: 0.095%
- Maintainers (1)
rubygems.org: formatador
STDOUT text formatting
- Homepage: https://github.com/geemus/formatador
- Documentation: http://www.rubydoc.info/gems/formatador/
- Licenses: MIT
- Latest release: 1.2.3 (published 4 months ago)
- Last Synced: 2026-03-03T04:01:32.871Z (about 19 hours ago)
- Versions: 34
- Dependent Packages: 106
- Dependent Repositories: 86,056
- Downloads: 263,904,294 Total
- Docker Downloads: 806,929,894
-
Rankings:
- Downloads: 0.09%
- Dependent repos count: 0.127%
- Docker downloads count: 0.154%
- Dependent packages count: 0.305%
- Average: 1.357%
- Stargazers count: 2.664%
- Forks count: 4.803%
- Maintainers (1)
proxy.golang.org: github.com/geemus/formatador
- Homepage:
- Documentation: https://pkg.go.dev/github.com/geemus/formatador#section-documentation
- Licenses: mit
- Latest release: v1.2.3 (published 4 months ago)
- Last Synced: 2026-03-01T20:02:05.075Z (2 days ago)
- Versions: 23
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.456%
- Average: 6.674%
- Dependent repos count: 6.892%
debian-10: ruby-formatador
- Homepage: https://github.com/geemus/formatador
- Documentation: https://packages.debian.org/buster/ruby-formatador
- Licenses:
- Latest release: 0.2.5-2 (published 20 days ago)
- Last Synced: 2026-02-13T04:21:26.656Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-formatador
- Homepage: https://github.com/geemus/formatador
- Documentation: https://packages.debian.org/bullseye/ruby-formatador
- Licenses:
- Latest release: 0.2.5-2.1 (published 21 days ago)
- Last Synced: 2026-02-13T08:20:27.484Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
guix: ruby-formatador
Ruby library to format text on stdout
- Homepage: https://github.com/geemus/formatador
- Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/ruby-xyz.scm#n3511
- Licenses: expat
- Latest release: 0.2.5 (published 1 day ago)
- Last Synced: 2026-03-02T18:57:24.608Z (1 day ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-formatador
- Homepage: https://github.com/geemus/formatador
- Documentation: https://packages.debian.org/bookworm/ruby-formatador
- Licenses:
- Latest release: 0.2.5-4 (published 19 days ago)
- Last Synced: 2026-02-12T23:29:51.851Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: ruby-formatador
- Homepage: https://github.com/geemus/formatador
- Licenses: mit
- Latest release: 0.2.5-3 (published 18 days ago)
- Last Synced: 2026-02-13T13:17:20.671Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-formatador
- Homepage: https://github.com/geemus/formatador
- Documentation: https://packages.debian.org/trixie/ruby-formatador
- Licenses:
- Latest release: 1.1.0-1 (published 19 days ago)
- Last Synced: 2026-02-13T13:15:47.362Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- rake >= 0 development
- rdoc >= 0 development
- shindo >= 0 development
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
- actions/stale v6 composite
Score: 30.849977039815137