Skip to content

Commit

Permalink
Fix Gemfile, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jules2689 committed Dec 9, 2017
1 parent da45882 commit 36895d2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Gemfile
@@ -1,6 +1,8 @@
# NOTE: These are development-only dependencies
source "https://rubygems.org"

gemspec

group :development, :test do
gem 'rubocop'
gem 'byebug'
Expand Down
12 changes: 10 additions & 2 deletions Gemfile.lock
@@ -1,3 +1,8 @@
PATH
remote: .
specs:
dev-ui (0.1.0)

GEM
remote: https://rubygems.org/
specs:
Expand All @@ -21,7 +26,7 @@ GEM
powerpack (0.1.1)
rainbow (2.2.2)
rake
rake (12.0.0)
rake (10.5.0)
rubocop (0.49.1)
parallel (~> 1.10)
parser (>= 2.3.3.1, < 3.0)
Expand All @@ -36,12 +41,15 @@ PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.15)
byebug
dev-ui!
method_source
minitest (>= 5.0.0)
minitest-reporters
mocha
rake (~> 10.0)
rubocop

BUNDLED WITH
1.15.0
1.16.0
36 changes: 34 additions & 2 deletions README.md
@@ -1,3 +1,27 @@
Dev UI
---

Dev UI is a small framework who's only responsibility is to print pretty to the terminal

- [Documentation](http://www.rubydoc.info/gems/dev-ui/)
- [Rubygems](https://rubygems.org/gems/dev-ui)

## Features

This may not be an exhaustive list. Please check our [documentation](http://www.rubydoc.info/gems/dev-ui/) for more information.

- Nested framing to handle content flow (see example below)
- Interactive Prompts (prompt user with options, using arrow keys, numbers, or vim bindings, choose)
- Free form text prompts
- Spinner groups to handle many multi-threaded processes (see example below)
- Text Color formatting (e.g. `{{red:Red}} {{green:Green}}`)
- Symbol Formatting (e.g. `{{*}}` => a yellow ⭑)
- Progress Bar

## Example Usage

The following code makes use of nested-framing, multi-threaded spinners, formatted text, and more.

```ruby
require 'dev/ui'

Expand All @@ -7,16 +31,24 @@ Dev::UI::Frame.open('{{*}} {{bold:a}}', color: :green) do
Dev::UI::Frame.open('{{i}} b', color: :magenta) do
Dev::UI::Frame.open('{{?}} c', color: :cyan) do
sg = Dev::UI::SpinGroup.new
sg.add('wow') { sleep(2.5) }
sg.add('wow') do |spinner|
sleep(2.5)
spinner.update_title('second round!')
sleep (1.0)
end
sg.add('such spin') { sleep(1.6) }
sg.add('many glyph') { sleep(2.0) }
sg.wait
end
end
Dev::UI::Frame.divider('{{v}} lol')
puts 'words'
puts Dev::UI.fmt '{{info:words}} {{red:oh no!}} {{green:success!}}'
sg = Dev::UI::SpinGroup.new
sg.add('more spins') { sleep(0.5) ; raise 'oh no' }
sg.wait
end
```

Output:

![Example Output](https://user-images.githubusercontent.com/3074765/33797758-7a54c7cc-dcdb-11e7-918e-a47c9689f068.gif)

0 comments on commit 36895d2

Please sign in to comment.