sphyg 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2848658d5b40c87c179d97114d9c5436fda7c2622bcaee0ecaa738d72f1c8ce
4
- data.tar.gz: 063e17dce0f642c6b0844a6f6aadc57673b4b82135f63ae6bd80f66bf63ff7ab
3
+ metadata.gz: 13e0fcf2c3419135646ab226f0ade0d32737330efc77e8c3d410f03c5a3345ae
4
+ data.tar.gz: 0f3b3ac10c36be44cdd2bf4639aa187ca0e5e746e22b4025b8dbed52d077f30a
5
5
  SHA512:
6
- metadata.gz: 5f71fc602645b2143ac9eb0bbe88ca5f43d9a1d16467eba7d242be334646615adf7a5558377ced7136387c03981729027b370003ae2963a2bceb3804f0d45743
7
- data.tar.gz: 572959d26091368ac1f628b88cb25ec3d5eccae71a8020c41775189dd037c40a7716285f4653c8445bf6d092948a040c41691ef7551626439f4ad5b4bde6b027
6
+ metadata.gz: 8e34ddd9e7caa9f18e8ce56c3c8ae8e16a29320cc41304c11c45c1c2461af316e5b12557885bcf51b49d0ef34a51d7940c963bfb6f0748ddfed4932fe9815957
7
+ data.tar.gz: 5c0e3bfd8cefd0d397464b7a7859ef948223829a41ec465a6336e561879a1a5c747626e218fa19f5ca9d13e069d94a773e4847086a9264b05cf5e9429d8e4090
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## Unreleased
8
+ ### Added
9
+ - None
10
+
11
+ ### Changed
12
+ - None
13
+
14
+ ### Fixed
15
+
16
+ ## 0.2.0 (2017-12-30)
17
+ ### Added
18
+ - Convenience method `::Sphyg.pulse`
19
+
20
+ ### Changed
21
+ - None
22
+
23
+ ### Fixed
24
+ - None
25
+
26
+ ## 0.1.0 (2017-12-29)
27
+ ### Added
28
+ - Everything
29
+
30
+ ### Changed
31
+ - None
32
+
33
+ ### Fixed
34
+ - None
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sphyg (0.1.0)
4
+ sphyg (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Sphyg
2
2
 
3
3
  'Sphygmos' is the Greek word for 'pulse'. Sphyg provides [throbbers](https://en.wikipedia.org/wiki/Throbber)
4
- for command line programs.
4
+ to indicate that your long-running command line program still has a pulse.
5
5
 
6
6
  ## Installation
7
7
 
@@ -21,16 +21,31 @@ Or install it yourself as:
21
21
 
22
22
  ## Usage
23
23
 
24
+ Pass the _message_ you want to display while your command is running
25
+ and a _block_ containing your long-running command to `Sphyg.pulse`.
26
+
24
27
  ```ruby
25
- > ::Sphyg::Pulse.new('Please wait', { kind: :wave }).run { while true; sleep 1; end }
28
+ > ::Sphyg.pulse('Please wait') { sleep }
26
29
  Please wait ⡀ ⠄ ⠂ ⠁ ⠂ ⠄ # animated
27
30
  ```
28
31
 
29
32
  ### Options
30
33
 
31
- #### Kind
34
+ You can also pass an _options_ hash to `::Sphyg.pulse` using the following keys:
35
+
36
+ #### `:kind`
37
+
38
+ Configure which kind of throbber you would like to use. Available kinds and their associated frames:
32
39
 
33
- See [`Sphyg::FRAMES`](sphyg/frames.rb) for throbber kinds and their associated animation frames.
40
+ | Kind | Frames |
41
+ | ---- | ------ |
42
+ | `:ascii` | \| / - \ |
43
+ | `:elipsis` | . .. ... .. |
44
+ | `:heart` | ❤️ 🧡 💛 💚 💙 💜 |
45
+ | `:heroku` | ⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷ |
46
+ | `:moon` | 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 |
47
+ | `:time` | 🕛 🕐 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 |
48
+ | `:wave` | ⡀ ⠄ ⠂ ⠁ ⠂ ⠄ |
34
49
 
35
50
  ## Development
36
51
 
@@ -1,4 +1,8 @@
1
1
  require "sphyg/pulse"
2
2
  require "sphyg/version"
3
3
 
4
- module Sphyg; end
4
+ module Sphyg
5
+ def self.pulse(message, options = nil, &blk)
6
+ ::Sphyg::Pulse.new(message, options).run { yield blk }
7
+ end
8
+ end
@@ -2,10 +2,10 @@ require 'sphyg/frames'
2
2
 
3
3
  module Sphyg
4
4
  class Pulse
5
- def initialize(message, options = {})
5
+ def initialize(message, options = { kind: :wave })
6
6
  @message = message
7
7
  @options = options
8
- @frames = Sphyg::FRAMES[options[:kind]] || Sphyg::FRAMES[:wave]
8
+ @frames = Sphyg::FRAMES[options[:kind]]
9
9
  end
10
10
 
11
11
  def run(&blk)
@@ -1,3 +1,3 @@
1
1
  module Sphyg
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sphyg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Cavanaugh
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - CODE_OF_CONDUCT.md
64
65
  - Gemfile
65
66
  - Gemfile.lock