filecluster 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fc/item.rb +3 -1
  3. data/lib/fc/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64e0a0eaa5236b7655114f5bf118901a952e316a
4
- data.tar.gz: c243b1d8382c59b1168103fbbdcf8c3be533e439
3
+ metadata.gz: 513efeda9b8bc064c2ac65cff2b96f96ab3f2a13
4
+ data.tar.gz: a91430765fbf496273b7c25bed7c0f3fb1b89172
5
5
  SHA512:
6
- metadata.gz: 0740caba745e485f4d7d029153bad3ef7b54081d87717e6a294bc9d0dbb8e9ea103e04abcc304a51cb4053e87b2dda73d94f61e3bbf4f04cee929c34262699dc
7
- data.tar.gz: 42eee976acc2d1f7449f55bb26c25b3b5a045dd2250c819cc9c031fb8dafb9f793a149258113a901923effb463322405ee9fbac6677d62ab7c000d3770dfe5d0
6
+ metadata.gz: c452b42e5e0ef6ff4611b7d111a3b9f07ad351411636ebef0b50389463457a7d9796c3a104759da9d53bf66e48cb47ecde7ccc643cfb47303b9073fd5fd51416
7
+ data.tar.gz: 35a68af5f2165b48310777dcd9f1f5de141fee06e5625b1c77831859d6c07392879cd6f11f54e95489a5ffa0be80a1df3b0220919043a187fc112605d7d87c3c
@@ -12,6 +12,7 @@ module FC
12
12
  # :remove_local=true - delete local_path file/dir after add
13
13
  # :additional_fields - hash of additional FC:Item fields
14
14
  # :no_md5 - don't use md5
15
+ # :speed_limit - limit copy speed
15
16
  # If item_name is part of local_path it processed as inplace - local_path is valid path to the item for policy
16
17
  def self.create_from_local(local_path, item_name, policy, options={}, &block)
17
18
  raise 'Path not exists' unless File.exists?(local_path)
@@ -77,7 +78,8 @@ module FC
77
78
  FC::DB.query("UPDATE #{FC::ItemStorage.table_name} SET status='delete' WHERE item_id = #{item.id} AND storage_name <> '#{storage.name}'") if options[:replace]
78
79
 
79
80
  item_storage = item.make_item_storage(storage)
80
- item.copy_item_storage(local_path, storage, item_storage, options[:remove_local])
81
+ speed_limit = options[:speed_limit].present? ? options[:speed_limit] : nil
82
+ item.copy_item_storage(local_path, storage, item_storage, options[:remove_local], speed_limit)
81
83
  end
82
84
 
83
85
  return item
@@ -1,3 +1,3 @@
1
1
  module FC
2
- VERSION = '0.5.6'.freeze
2
+ VERSION = '0.5.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filecluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - sh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-23 00:00:00.000000000 Z
11
+ date: 2017-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2