human_bytes 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/human_bytes.gemspec +2 -0
- data/lib/human_bytes.rb +3 -10
- data/lib/human_bytes/version.rb +1 -1
- metadata +30 -3
- data/LICENSE.txt +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29686524cea7b40c974ce40a975f7ba48d3253a4
|
4
|
+
data.tar.gz: 16f4da8e7c574c0c62b1f2093a724c13c5ac1530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db0cda2a3124a11e63dc3897e893c6a6efd19cf3cda9d916f3f3105a64ff1c28bffce997b1f7a48af8534d6a87fa2aa5ef54beb45a09e9f451de47e241a20a5
|
7
|
+
data.tar.gz: a4250edc0e0b7e394af5e80c31491d88bb8d0734b8135e5687fe68e8071479df92483ab10f96e5f5db8ce442eb3496bea012c0b1868f71aef93cd4000e4d8525
|
data/README.md
CHANGED
@@ -20,7 +20,6 @@ Arbitrary precision arithmetic is used so that even astronomical bytesizes are h
|
|
20
20
|
## Includable submodule
|
21
21
|
|
22
22
|
Numeric.include(HumanBytes::MethodVersion)
|
23
|
-
#Same as: HumanBytes.monkey_patch!(Numeric)
|
24
23
|
1024.human_bytes #=> '1.00 KiB'
|
25
24
|
1050.human_bytes(places: 10) #=> '1.0253906250 KiB'
|
26
25
|
1050.human_bytes(places: 3, i: false) #=> '1.050 KB'
|
data/human_bytes.gemspec
CHANGED
@@ -19,10 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency 'flt'
|
22
|
+
spec.add_dependency 'attach_function', '~> 0.1'
|
22
23
|
|
23
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
24
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
26
|
spec.add_development_dependency "rspec"
|
26
27
|
spec.add_development_dependency "guard-rspec"
|
28
|
+
spec.add_development_dependency "guard-bundler"
|
27
29
|
spec.add_development_dependency "rspec-mocks"
|
28
30
|
end
|
data/lib/human_bytes.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "human_bytes/version"
|
2
2
|
require 'flt'
|
3
|
+
require 'attach_function'
|
3
4
|
|
4
5
|
module HumanBytes
|
5
6
|
UNIT_SETS = [
|
@@ -58,15 +59,7 @@ module HumanBytes
|
|
58
59
|
module_function :human_bytes
|
59
60
|
|
60
61
|
module MethodVersion
|
61
|
-
|
62
|
-
|
63
|
-
end
|
62
|
+
extend AttachFunction
|
63
|
+
attach_function :human_bytes
|
64
64
|
end
|
65
|
-
|
66
|
-
def self.monkey_patch!(klass)
|
67
|
-
klass.class_eval do
|
68
|
-
self.include HumanBytes::MethodVersion
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
65
|
end
|
data/lib/human_bytes/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: human_bytes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Skocik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flt
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: attach_function
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +94,20 @@ dependencies:
|
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-bundler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: rspec-mocks
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +138,6 @@ files:
|
|
110
138
|
- ".travis.yml"
|
111
139
|
- Gemfile
|
112
140
|
- Guardfile
|
113
|
-
- LICENSE.txt
|
114
141
|
- README.md
|
115
142
|
- Rakefile
|
116
143
|
- bin/console
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015 Petr Skocik
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|