diff options
Diffstat (limited to 'lib/rubygems/package/file_source.rb')
| -rw-r--r-- | lib/rubygems/package/file_source.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/rubygems/package/file_source.rb b/lib/rubygems/package/file_source.rb index 1a4dc4c824..d9717e0f2a 100644 --- a/lib/rubygems/package/file_source.rb +++ b/lib/rubygems/package/file_source.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + ## # The primary source of gems is a file on disk, including all usages # internal to rubygems. @@ -7,10 +8,9 @@ # object to `Gem::Package.new`. class Gem::Package::FileSource < Gem::Package::Source # :nodoc: all - attr_reader :path - def initialize path + def initialize(path) @path = path end @@ -22,13 +22,11 @@ class Gem::Package::FileSource < Gem::Package::Source # :nodoc: all File.exist? path end - def with_write_io &block - open path, 'wb', &block + def with_write_io(&block) + File.open path, "wb", &block end - def with_read_io &block - open path, 'rb', &block + def with_read_io(&block) + File.open path, "rb", &block end - end - |
