Skip to content

Commit cd89333

Browse files
committed
fixed rubocop codestyle issues
1 parent 56f07b3 commit cd89333

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lib/dump/reader.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ def read_table(table, rows_count)
218218
end
219219

220220
def read_assets
221-
return if Dump::Env[:restore_assets] && Dump::Env[:restore_assets].empty?
222-
return if config[:assets].blank?
221+
return if (Dump::Env[:restore_assets] && Dump::Env[:restore_assets].empty?) || config[:assets].blank?
223222

224223
assets = config[:assets]
225224
if assets.is_a?(Hash)
@@ -260,8 +259,7 @@ def read_assets
260259

261260
def read_asset?(path, prefix)
262261
Dump::Env.filter(:restore_assets, Dump::Assets::SPLITTER).custom_pass? do |value|
263-
File.fnmatch(File.join(prefix, value), path) ||
264-
File.fnmatch(File.join(prefix, value, '**'), path)
262+
File.fnmatch(File.join(prefix, value), path) || File.fnmatch(File.join(prefix, value, '**'), path)
265263
end
266264
end
267265

lib/dump/table_manipulation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def remove_indexes(indexes)
4646
VALID_INDEX_OPTIONS = [:unique, :order, :name, :where, :length, :internal, :using, :algorithm, :type].freeze
4747

4848
def index_options(index)
49-
options = VALID_INDEX_OPTIONS.map{|field| [field, index.members.include?(field) ? index.send(field) : nil]}
50-
non_empty_options = options.select{|pair| !pair[1].nil?}
49+
options = VALID_INDEX_OPTIONS.map{ |field| [field, index.members.include?(field) ? index.send(field) : nil] }
50+
non_empty_options = options.select{ |pair| !pair[1].nil? }
5151

5252
Hash[*non_empty_options.flatten]
5353
end

spec/dump/reader_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def create_entry(rows_count)
479479
@dump.read_table('first', 100)
480480
end
481481

482-
it "should remove indexes around reading/writing table" do
482+
it 'should remove indexes around reading/writing table' do
483483
create_entry(100)
484484
allow(@dump).to receive(:clear_table)
485485
allow(@dump).to receive(:insert_into_table)

0 commit comments

Comments
 (0)