diff --git a/lib/dorian/bin.rb b/lib/dorian/bin.rb index 28234b5..bb096c1 100644 --- a/lib/dorian/bin.rb +++ b/lib/dorian/bin.rb @@ -272,9 +272,11 @@ def command_dir def command_submodules puts( - File.read(".gitmodules").lines.grep(/path = /).map do |path| - path.split("=").last.strip - end + File + .read(".gitmodules") + .lines + .grep(/path = /) + .map { |path| path.split("=").last.strip } ) puts "." if self? @@ -287,17 +289,18 @@ def self? def command_compare file_1, file_2 = files key_1, key_2 = arguments - read_1, read_2 = files.map.with_index do |file, index| - read = reads(File.read(file)) - - if arguments[index] && read.from_deep_struct.has_key?(arguments[index]) - read[arguments[index]] - elsif arguments[index] - nil - else - read + read_1, read_2 = + files.map.with_index do |file, index| + read = reads(File.read(file)) + + if arguments[index] && read.from_deep_struct.key?(arguments[index]) + read[arguments[index]] + elsif arguments[index] + nil + else + read + end end - end compare(read_1, read_2, file_1:, file_2:) end @@ -813,7 +816,7 @@ def post(url, headers: {}, body: {}) http.request(request).body end - def compare(content_1, content_2, path: ".", file_1:, file_2:) + def compare(content_1, content_2, file_1:, file_2:, path: ".") content_1 = content_1.from_deep_struct content_2 = content_2.from_deep_struct @@ -830,7 +833,8 @@ def compare(content_1, content_2, path: ".", file_1:, file_2:) end compare( - content_1[key], content_2[key], + content_1[key], + content_2[key], path: new_path, file_1:, file_2: @@ -848,7 +852,8 @@ def compare(content_1, content_2, path: ".", file_1:, file_2:) end compare( - content_1[index], content_2[index], + content_1[index], + content_2[index], path: new_path, file_1:, file_2: