This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Step 1. Obtain token | |
| curl -X POST \ | |
| -F "client_id=b6394b15282889398719c67983594d20" \ | |
| -F "client_secret=4aee41059af4d350a6ead3a285f0c438de146857d4134b6e63d5b1291971b12f" \ | |
| -F "grant_type=client_credentials" \ | |
| -F "scope=write_partner_users" \ | |
| 'https://berlin.staging.wimdu.com/api/v3/oauth/token' | |
| # Step 2. Create user. | |
| # fill out <token> (obtained in Step.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| include CliSpinnable | |
| def call | |
| with_spinner do |cli| | |
| #... | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CliSpinnable.with_spinner do |cli| | |
| cli.print('Text') #=> / Text | |
| cli.tick #=> ✓ Text | |
| cli.fail #=> × Text | |
| 1 / 0 #=> × Text # exceptions raised within the block also triggers printing fail mark | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'cli_spinnable' | |
| module Cli | |
| extend CliSpinnable | |
| end | |
| puts 'HAPPY RUN (should succeed):' | |
| Cli.with_spinner do |cli| | |
| cli.print 'Downloading something' | |
| sleep 1 |
NewerOlder