mdap 0.1.0 → 0.2.1

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: 7c85375e955bfcd2daebfe1feb781545035f4a7b32431f335f3e5268478dcd52
4
- data.tar.gz: deb440016ec5a084dc8462788ef35d0a63ca26403cdad9bc6e39bffa2a709678
3
+ metadata.gz: 39c6ae233ca8da1473620ebd68f838891679e484d62d20bb8b99f91097cd2feb
4
+ data.tar.gz: fa685297ee1c3dadd8ecaea20259e1594077406c113c1421c9e349dd49468ef5
5
5
  SHA512:
6
- metadata.gz: e90ac5f44c50680812b2b21200db470d3c47d39042ab61e36ce7325089e74515aa29daabfc2660d48d47ecf09d5d13216a56154852efe7d020eff543b924e26a
7
- data.tar.gz: cce4537a408ebed4d0bccfaca28c00375db8deb4543f59d1f5b60fb639390259a64a0960f08ea50fbdb9378c654272303d2b883e19ed48bc327d4ec8d83316a4
6
+ metadata.gz: be44c238a3191bd3e379b865af0cf8c50e89711511a2a27efb02f43f776139b48705b7e61383733c47a38772ec5d3f9992d4bb6d98896e707d6b2755d2748c6c
7
+ data.tar.gz: c2ef8e244c090dd6817b72d4a88df7e48dc357deb3ed1781f1322621b039845f9d0d437573ee8a410c83ce4d7df343189015933f2f069c9e6f8e506489cf03c5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mdap (0.1.0)
4
+ mdap (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  mdap
2
2
  ====
3
3
 
4
- [![Build Status](https://api.travis-ci.org/AjxLab/mdap.svg?branch=master)](https://travis-ci.org/AjxLab/mdap)
5
4
  [![Gem Version](https://badge.fury.io/rb/mdap.svg)](https://rubygems.org/gems/mdap/)
6
5
  [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE.txt)
7
6
 
@@ -10,6 +9,11 @@ A displaying progress utility for Ruby.
10
9
 
11
10
  ![](demo.gif)
12
11
 
12
+
13
+ ## Requirement
14
+ - Ruby 2.3 or above
15
+
16
+
13
17
  ## Usage
14
18
  ### Description of Constructors's Argument
15
19
  name |Description
@@ -52,7 +56,12 @@ mdap(100, indicator:"-\\|/")
52
56
  # [#########################──────────] -21% (72/100) [37:26-37:29 64.371566it/s]
53
57
  ```
54
58
 
59
+
55
60
  ## Installation
56
61
  ```sh
57
62
  $ gem install mdap
58
63
  ```
64
+
65
+
66
+ ## Contributing
67
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/AjxLab/mdap](https://github.com/AjxLab/mdap).
Binary file
@@ -0,0 +1,17 @@
1
+ require './mdap.rb'
2
+
3
+ # 100 Loop
4
+ puts "100 Loop"
5
+ mdap(300) { sleep 0.01 }
6
+
7
+ # Specify Desc
8
+ puts "Specify Desc"
9
+ mdap(300, desc: 'Download') { sleep 0.01 }
10
+
11
+ # Specify Datetime Format
12
+ puts "Specify Datetime Format"
13
+ mdap(300, datetime_format: "%H:%M:%S") { sleep 0.01 }
14
+
15
+ # Specify Bar Shape
16
+ puts "Specify Bar Shape"
17
+ mdap(300, bar_shape: ["=", "."]) { sleep 0.01 }
@@ -3,7 +3,7 @@ require 'time'
3
3
  require "mdap/version"
4
4
 
5
5
 
6
- def mdap(n, desc:nil, bar_shape:["\e[42m \e[0m", "─"],
6
+ def mdap(n, echo_bar: true, desc:nil, bar_shape:["\e[42m \e[0m", "─"],
7
7
  indicator:"⠻⠽⠾⠷⠯⠟", datetime_format:"%M:%S"
8
8
  )
9
9
  ## -----*----- Progress Bar -----*----- ##
@@ -49,14 +49,14 @@ def mdap(n, desc:nil, bar_shape:["\e[42m \e[0m", "─"],
49
49
  Timer::timer {
50
50
  i_indicator += 1
51
51
  c_indicator = indicator[i_indicator%indicator.length]
52
- outer.call
52
+ outer.call if echo_bar
53
53
  }
54
54
  end
55
55
 
56
56
  1.upto(n) do |i|
57
57
  begin
58
58
  progress = i
59
- outer.call
59
+ outer.call if echo_bar
60
60
  yield i-1
61
61
  rescue => e
62
62
  p e
@@ -1,3 +1,4 @@
1
1
  module Mdap
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.1"
3
3
  end
4
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Abe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-31 00:00:00.000000000 Z
11
+ date: 2020-03-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This utility can display the progress bar of the process.
14
14
  email:
@@ -29,6 +29,8 @@ files:
29
29
  - Rakefile
30
30
  - bin/console
31
31
  - bin/setup
32
+ - demo.gif
33
+ - example/output.rb
32
34
  - lib/mdap.rb
33
35
  - lib/mdap/version.rb
34
36
  - mdap.gemspec