apple-news 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9d7cd19f246e56cf2f9f34e75a9f13e4b04af03
4
- data.tar.gz: 035e174af117ae59fb88c0cb7ad7853a46c992e0
3
+ metadata.gz: de3fdbc1154ac00409f1f03c3495a9a1f10b2291
4
+ data.tar.gz: abbec25056b10948124f7f87a3ec75c3e78967d7
5
5
  SHA512:
6
- metadata.gz: bb0246860bc592b2c3998f271af6c408ddce0700f0f249a968867764306596530661248ffd2788271accc3e445e415ec525d5b5342107c818fcd5b37dca1cb9b
7
- data.tar.gz: 34243c49afbcbeac6263777b5dfeb5ae021c7427f53c5fcc2a1a3d1f15ae5ea1d4dd0516114ec9f0691217cdacefb117fc60f0298d9087583056bab4dcfeb40f
6
+ metadata.gz: 2b24bb67f5328e9c62e8619b1451031650aab44d6dd11d1e726de4c177acf16aee8308f302825a3fc84cd18e993b09760d6c679e46bc83a4616c177b985e37f1
7
+ data.tar.gz: 810be4d53f7692042199ae669663d3f712bdd7dc873df293665bb52fbd63e882295eee4857b83e395e042e21071919d814ad1cd645aa1ec163cb94143ff8cead
@@ -12,11 +12,11 @@ module AppleNews
12
12
  end
13
13
 
14
14
  def add_file_at_path(path)
15
- add_file(File.new(path))
15
+ add_file(File.new(path, 'rb'))
16
16
  end
17
17
 
18
18
  def add_string_as_file(name, contents, mime)
19
- @files[name] = UploadIO.new(StringIO.new(contents), mime, name)
19
+ @files[name] = UploadIO.new(StringIO.new(contents, 'rb'), mime, name)
20
20
  end
21
21
 
22
22
  def add_file_at_url(name, url, mime)
@@ -44,7 +44,16 @@ module AppleNews
44
44
 
45
45
  # Write all of the bundled files
46
46
  @files.each do |name, file|
47
- File.write(File.join(path, name), file.read)
47
+ if file.respond_to?(:path)
48
+ FileUtils.cp(file.path, File.join(path, name))
49
+ else
50
+ infile = file.io.is_a?(StringIO) ? file.io : File.new(file.io, 'rb')
51
+ outfile = File.new(File.join(path, name), 'wb')
52
+
53
+ outfile.write(infile.read)
54
+ infile.close
55
+ outfile.close
56
+ end
48
57
  end
49
58
 
50
59
  true
@@ -1,3 +1,3 @@
1
1
  module AppleNews
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple-news
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan LeFevre