gain 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14dd93081f35705f66df6dd84f07a2cdce51a7fb
4
- data.tar.gz: 3389bd3efd402366948619f48dc3170e74d589c2
3
+ metadata.gz: fdf90497f6676a864b1d7f2d8960b7b0a54b32e1
4
+ data.tar.gz: 2b586db93123cafe29c3cc4524bad3b12fd7d284
5
5
  SHA512:
6
- metadata.gz: 36ff947f05fdb179e0b74683854e8725d64f95ca9b5db761f21b60d478a6b4afe1ecabaf1756fad7d050967b4fa4f9006a99dbb83a217fdf4d860e82388a692a
7
- data.tar.gz: a0626f4180ae463a38346f87e2300eec46190e1ccdeec2012351eaa053b90e4030a75f188229b98e585d2279afcf2e1b38581011764d6851fd654bf21f43a057
6
+ metadata.gz: f93d634a80cdc47a0dbeb5a974cb6d74a29f56229e1b78bd1be7cd522d8dab9eb01daa006b392bf76ff832f37c6a548cd74fb6e9f119396f25dd28451a822379
7
+ data.tar.gz: cf2a3f07ea23eb2e4aa278f3149a1c040c88f426b9b7b5ec045252a34a1f885af3de2827f1b37f17821ba2e294b88c7ede0a5ce54164bb1f92db45fdea3db967
data/lib/gain.rb CHANGED
@@ -14,6 +14,13 @@ class Gain
14
14
  @@progress_count = 0
15
15
  @progress_print = 1 if @progress_print == nil
16
16
  @@progress_mod = (@total * @progress_print.to_f / 100.0).to_i
17
+
18
+ if @@progress_mod > 1.0
19
+ @@progress_mod = @@progress_mod.to_i
20
+ else
21
+ @@progress_mod = 1
22
+ end
23
+
17
24
  @progress_print.to_s.include?(".") ? @@round = @progress_print.to_s.split(".")[1].length : @@round = 0
18
25
 
19
26
  puts @title if @title != nil
data/lib/gain/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Gain
2
- VERSION = "0.2"
2
+ VERSION = "0.3"
3
3
  end
data/spec/gain_spec.rb CHANGED
@@ -24,4 +24,12 @@ describe Gain do
24
24
  gain.progress
25
25
  end
26
26
  end
27
+
28
+ it "test with 47 total progress" do
29
+ gain = Gain.new :title => "Start 47 Progress", :total => 47, :progress_print => 0.1
30
+
31
+ for i in 1..47 do
32
+ gain.progress
33
+ end
34
+ end
27
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gain
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sukit Sunama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-13 00:00:00.000000000 Z
11
+ date: 2014-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler