rest-ftp-daemon 0.221 → 0.221.1

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: fa2898557667a162460cbbf4c682dfc9bfcf05f7
4
- data.tar.gz: 9f435fbe56c23978e7302649db5eef6312871e14
3
+ metadata.gz: ce65a20b09296045699bc719c74f6e4982427238
4
+ data.tar.gz: b92e66df1a341fa14798138b32a2605aa5ed9f8d
5
5
  SHA512:
6
- metadata.gz: d4690191c0a025de1924e6ff8014c6b2a58fed13bf69766a3cca7f60bf863d91723d831a4d426e6d69c8604f8f52f1263f6908c20d6386c0ffd08bb7faf6b08f
7
- data.tar.gz: 0f8717306bf40859bbeabd0908942170321b8f8912d09e71677a1c2d2b5861c8ad21e9039d81f166f1d4499d1491ef17aa588d9b399b422aaec7c6bf8bd4c626
6
+ metadata.gz: b2de9e872d5bea59c321d017331adbfb00ae59712f8b4abe23f4a2895a0bc3eb6f6f7a508b20b42df67bc684497bb2a033afc4bddfc44f77d04b96a7442e9cfb
7
+ data.tar.gz: 7623cde2c659d870b3e47f73d5b04014cea03d07be9ce44860d1661e3e736b40a8209295aa72c3c68cd6055d108f69205659811a3ffa10fb70c5b7f5113f91cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest-ftp-daemon (0.221)
4
+ rest-ftp-daemon (0.221.1)
5
5
  double-bag-ftps
6
6
  facter
7
7
  get_process_mem
@@ -1,7 +1,7 @@
1
1
  # Terrific constants
2
2
  APP_NAME = "rest-ftp-daemon"
3
3
  APP_NICK = "rftpd"
4
- APP_VER = "0.221"
4
+ APP_VER = "0.221.1"
5
5
 
6
6
 
7
7
  # Jobs and workers
@@ -8,13 +8,15 @@ module RestFtpDaemon
8
8
  config
9
9
  end
10
10
 
11
- def self.format_bytes number, unit=""
11
+ def self.format_bytes number, unit="", decimals = 0
12
12
  return "Ø" if number.nil? || number.to_f.zero?
13
13
 
14
14
  units = ["", "k", "M", "G", "T", "P" ]
15
15
  index = ( Math.log( number ) / Math.log( 2 ) ).to_i / 10
16
- converted = number.to_i / ( 1024 ** index )
17
- "#{converted} #{units[index]}#{unit}"
16
+ converted = number.to_f / ( 1024 ** index )
17
+
18
+ truncated = converted.round(decimals)
19
+ "#{truncated} #{units[index]}#{unit}"
18
20
  end
19
21
 
20
22
  def self.text_or_empty text
@@ -24,6 +24,6 @@
24
24
 
25
25
  .btn-group.btn-group-sm
26
26
  .btn.btn-default.btn-success Transferred
27
- .btn.btn-default= Helpers.format_bytes(trans, "B")
27
+ .btn.btn-default= Helpers.format_bytes(trans, "B", 1)
28
28
 
29
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-ftp-daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.221'
4
+ version: 0.221.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler