human_size_to_number 0.3.0 → 1.0.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.
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - ruby-head
3
+ - jruby
4
+ - 1.9.3
5
+ - 1.8.7
6
+ - 1.9.2
7
+ - ree
data/README.md CHANGED
@@ -25,7 +25,7 @@ Project Tracking
25
25
  Compatibility
26
26
  -------------
27
27
 
28
- human\_size\_to\_number is tested against REE.
28
+ human\_size\_to\_number is tested against REE, ruby-head, jruby, 1.8.7, 1.9.2, 1.9.3.
29
29
 
30
30
  <img src="https://travis-ci.org/zedtux/human_size_to_number.png?branch=master&.png"/>
31
31
 
@@ -21,11 +21,16 @@ class String
21
21
  end
22
22
  end
23
23
  number = case unit
24
- when "Bytes": number
25
- when "KB": number * 1024
26
- when "MB": number * 1024 * 1024
27
- when "GB": number * 1024 * 1024 * 1024
28
- when "TB": number * 1024 * 1024 * 1024 * 1024
24
+ when "Bytes"
25
+ number
26
+ when "KB"
27
+ number * 1024
28
+ when "MB"
29
+ number * 1024 * 1024
30
+ when "GB"
31
+ number * 1024 * 1024 * 1024
32
+ when "TB"
33
+ number * 1024 * 1024 * 1024 * 1024
29
34
  end
30
35
  number.round
31
36
  end
@@ -1,3 +1,3 @@
1
1
  module HumanSizeToNumber
2
- VERSION = "0.3.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: human_size_to_number
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 3
9
9
  - 0
10
- version: 0.3.0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - zedtux
@@ -72,6 +72,7 @@ files:
72
72
  - .gitignore
73
73
  - .rspec
74
74
  - .rvmrc
75
+ - .travis.yml
75
76
  - Gemfile
76
77
  - README.md
77
78
  - Rakefile