apple-news 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/apple-news/article/attachments.rb +2 -2
- data/lib/apple-news/article/persistence.rb +10 -1
- data/lib/apple-news/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3fdbc1154ac00409f1f03c3495a9a1f10b2291
|
4
|
+
data.tar.gz: abbec25056b10948124f7f87a3ec75c3e78967d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/apple-news/version.rb
CHANGED