lib/rumble/cli.rb in rumble-0.6.0 vs lib/rumble/cli.rb in rumble-0.7.0

- old
+ new

@@ -1,8 +1,8 @@ # frozen_string_literal: true -# Copyright (c) 2018-2020 Yegor Bugayenko +# Copyright (c) 2018-2022 Yegor Bugayenko # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -31,11 +31,11 @@ require 'rainbow' require_relative 'version' # Rumble main script. # Author:: Yegor Bugayenko (yegor256@gmail.com) -# Copyright:: Copyright (c) 2018-2020 Yegor Bugayenko +# Copyright:: Copyright (c) 2018-2022 Yegor Bugayenko # License:: MIT class Rumble::CLI # Make an instance. def initialize(opts) @opts = opts @@ -119,10 +119,10 @@ if @opts[:attach] Dir.mktmpdir do |dir| `#{@opts[:attach]} "#{email}" "#{name}" "#{dir}"` raise 'Failed to exec' unless $CHILD_STATUS.success? Dir[File.join(dir, '*')].each do |f| - mail.add_file(filename: File.basename(f), content: IO.read(f)) + mail.add_file(filename: File.basename(f), content: File.read(f)) end end end mail.deliver! unless @opts[:dry] total += 1