pretty_bytes 1.0.2 → 1.1.4

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
  SHA1:
3
- metadata.gz: 83e77ce46671c2ab3ac7b4ae42f35595daf0462d
4
- data.tar.gz: 5641ac5fbafd5e5fed704300a567687b63fc0c08
3
+ metadata.gz: 395a040dde8f55c8e9ed69970daa8143168f599d
4
+ data.tar.gz: 20b732066abae73e5d4475e1fc3316360d0a6b5e
5
5
  SHA512:
6
- metadata.gz: 53f1d0fe69db8f40f7ce4d923912e1511e8ee3b811944464b2cb08f63d838e443fc734c4753a87e459e5394d112d4304f6f93c394d3ba069e4c89aed69610b12
7
- data.tar.gz: a60379ae0b734581b90490095e40cc5918a7793741b7a813f6954273cfac2283d08279776d79d8f4b2152737f33c3d4d9f3d30890948a404a8e7be8496a3dca4
6
+ metadata.gz: b26d69d9cf9bb1151803777317b4c31c6445c3f70ab46f478395c1bc371798670658353cec6338c49300d0e3324ca49d1e3be4956dff58d84e617c9767c2c742
7
+ data.tar.gz: 1af8c24362739c5dfd9c3ad97734d8055eed9991ee5284606c1e3632e1c684ea05c27b1cc69284602074f0e0e3d57ce6a53161f1f7146de62f563cba6b133780
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # pretty-bytes-rb [![Build Status](https://travis-ci.org/gmontalvoriv/pretty-bytes-rb.svg)](https://travis-ci.org/gmontalvoriv/pretty-bytes-rb)
1
+ # pretty-bytes-rb [![Build Status](https://travis-ci.org/gmontalvoriv/pretty-bytes-rb.svg)](https://travis-ci.org/gmontalvoriv/pretty-bytes-rb) [![Gem Version](https://badge.fury.io/rb/pretty_bytes.svg)](https://badge.fury.io/rb/pretty_bytes)
2
2
 
3
3
  > Convert bytes to a human readable string: 1337 → 1.34 kB
4
4
 
@@ -23,6 +23,21 @@ Or install it yourself as:
23
23
 
24
24
  ## Usage
25
25
 
26
+ #### CLI
27
+
28
+ ```
29
+ $ pretty-bytes help
30
+
31
+ Usage
32
+ $ pretty-bytes <number>
33
+
34
+ Example
35
+ $ pretty-bytes 1337
36
+ 1.34 kB
37
+ ```
38
+
39
+ #### API
40
+
26
41
  ```ruby
27
42
  require "pretty_bytes"
28
43
  pb = PrettyBytes.new
@@ -32,4 +47,4 @@ pb.convert(1337) # => 1.34 kB
32
47
 
33
48
  ## License
34
49
 
35
- [MIT License](http://opensource.org/licenses/MIT)
50
+ [MIT License](http://opensource.org/licenses/MIT)
data/bin/pretty-bytes ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "pretty_bytes"
5
+ pb = PrettyBytes.new
6
+
7
+ option = ARGV[0]
8
+
9
+ if option == "help"
10
+ puts "Usage"
11
+ puts " $ pretty-bytes <number>"
12
+ puts " "
13
+ puts "Example"
14
+ puts " $ pretty-bytes 1337"
15
+ puts " 1.34 kB"
16
+ elsif option.to_i == 0 || option == ''
17
+ puts "Expected a number"
18
+ else
19
+ puts pb.convert(option.to_i)
20
+ end
@@ -1,3 +1,3 @@
1
1
  class PrettyBytes
2
- VERSION = "1.0.2"
2
+ VERSION = "1.1.4"
3
3
  end
Binary file
data/pretty_bytes.gemspec CHANGED
@@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/gmontalvoriv/pretty-bytes-rb"
15
15
  spec.license = "MIT"
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.bindir = "bin"
18
+ spec.executables << "pretty-bytes"
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.11"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_bytes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Montalvo
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-18 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,7 +55,8 @@ dependencies:
55
55
  description: 'Convert bytes to a human readable string: 1337 → 1.34 kB'
56
56
  email:
57
57
  - gmontalvo.riv@gmail.com
58
- executables: []
58
+ executables:
59
+ - pretty-bytes
59
60
  extensions: []
60
61
  extra_rdoc_files: []
61
62
  files:
@@ -68,10 +69,11 @@ files:
68
69
  - README.md
69
70
  - Rakefile
70
71
  - bin/console
72
+ - bin/pretty-bytes
71
73
  - bin/setup
72
74
  - lib/pretty_bytes.rb
73
75
  - lib/pretty_bytes/version.rb
74
- - pretty_bytes-1.0.0.gem
76
+ - pretty_bytes-1.1.3.gem
75
77
  - pretty_bytes.gemspec
76
78
  homepage: https://github.com/gmontalvoriv/pretty-bytes-rb
77
79
  licenses:
Binary file