apple-news 0.2.2 → 0.2.3

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: 0c750e8520361db81736ea6f3ff81a95e339f45d
4
- data.tar.gz: 1061eea5f9574edf0e08c1a078521d012002deca
3
+ metadata.gz: 2a2368f1c3e4a9504b17a7b65f8a8c47b6ee1390
4
+ data.tar.gz: bafb7a266fcbf601c2fe7e876899c58f9c94e702
5
5
  SHA512:
6
- metadata.gz: 4c99a55c00daf17d10ce3af5257c8b8a20cc69b17b78b3af92785ca1771912114a7add9ad1f211950676332519ef56603efc1b9dc77e0744a6aa32b9fb08c1a4
7
- data.tar.gz: dbee98d60a05b096c5ba997e8fd00bd8e2920a3b4fdc1fabb036c93811f107cba8325b1b7058969286470c06202e1230504654717e760c22a080b577d28d99b6
6
+ metadata.gz: 8732e4c0cf51edbd981629db77684e61a64bb1b6ce876d56f703bb638c1ef483f36e8c5efb8aa97c71ce1ca8c94ecfcbf363cff79c8b6fb2d285cec2b79322ea
7
+ data.tar.gz: 6f588ee5a9e05fef75508fdda97af14075ff5957c030861d113361f2b87d8a394b91b5bcf9a10f456259a0de2514cdb508b439b0f56ef4ea6a892ffd49d3ee93
data/lib/apple-news.rb CHANGED
@@ -9,6 +9,7 @@ require "json"
9
9
  require 'net/http/post/multipart'
10
10
  require 'apple-news/multipart_post_patch'
11
11
  require 'stringio'
12
+ require 'open-uri'
12
13
 
13
14
  require "apple-news/version"
14
15
  require "apple-news/properties"
@@ -15,8 +15,12 @@ module AppleNews
15
15
  add_file(File.new(path))
16
16
  end
17
17
 
18
- def add_string_as_file(name, contents, type)
19
- @files[name] = UploadIO.new(StringIO.new(contents), type, name)
18
+ def add_string_as_file(name, contents, mime)
19
+ @files[name] = UploadIO.new(StringIO.new(contents), mime, name)
20
+ end
21
+
22
+ def add_file_at_url(name, url, mime)
23
+ @files[name] = UploadIO.new(open(url), mime, name)
20
24
  end
21
25
 
22
26
  private
@@ -1,3 +1,3 @@
1
1
  module AppleNews
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
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.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan LeFevre