rssendy 0.1.0 → 0.1.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: 52603befc01bbf23eb601acca00df56fedea0c22
4
- data.tar.gz: 9cec5aef5133042e83ed91e1ec85267b2bd6a4cf
3
+ metadata.gz: 35b3365c604f7421fa17cff71495ad9eb176cc9d
4
+ data.tar.gz: f4e6386f2c64705c39ee7f4aed1125d5f4493241
5
5
  SHA512:
6
- metadata.gz: b19456cc07b88566b237b558c03d673b9b6bd8a24c006d5eeea5f5a2cb4326e9579e1f2a57d5c78df1a9191154278e0afdcd3460456cc534842eebe91633ac07
7
- data.tar.gz: 404acc03610ef9ec3110e03f1e2d24629fb8d7ee4a8858048df249db2143842cf1dd2fcff72db7d1418b3f360a191ea8bea41613928ea4d28dedd894d585b5d3
6
+ metadata.gz: 3267f8ca9e712a8c1055a3a03120166783ad4193d8375b5c6143440502a76d16019429cbe5361a3b1ddf953afa6b5bec5abbd60ab25abc16cd3d50561fc79821
7
+ data.tar.gz: 3b73e16f3d873705194fc39ceaf6d0ef0cb5005dd6b9398957bb862643a7cfa946277ffd3734fd11aa3823c74fc86dc778665a2a1a590f85a2b8010890d6f5c3
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ *.gem
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2
4
+ - ruby-head
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
2
3
 
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/rssendy CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require './lib/rssendy'
3
+ require_relative '../lib/rssendy'
4
4
  require 'slop'
5
5
  require 'yaml'
6
6
 
@@ -1,3 +1,3 @@
1
1
  module RSSendy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/rssendy.rb CHANGED
@@ -5,6 +5,26 @@ require "open-uri"
5
5
  require "cindy"
6
6
  require "erb"
7
7
 
8
+ Cindy::Client.class_eval do
9
+ def create_campaign(opts={})
10
+ post_opts = {}
11
+ req_opts = %i(from_name from_email reply_to subject html_text)
12
+ optional_opts = %i(plain_text list_ids brand_id send_campaign)
13
+
14
+ req_opts.each do |opt|
15
+ post_opts[opt] = opts.delete(opt) || raise(ArgumentError, "opt :#{opt} required")
16
+ end
17
+ post_opts.merge!(Hash[optional_opts.zip(opts.values_at(*optional_opts))])
18
+ post_opts[:api_key] = @key
19
+
20
+ response = connection.post "api/campaigns/create.php" do |req|
21
+ req.body = post_opts
22
+ end
23
+
24
+ response.body
25
+ end
26
+ end
27
+
8
28
  module RSSendy
9
29
  class Feed
10
30
  PROPERTIES = %i{
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rssendy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jonah honeyman
@@ -105,6 +105,7 @@ extra_rdoc_files: []
105
105
  files:
106
106
  - ".gitignore"
107
107
  - ".rspec"
108
+ - ".travis.yml"
108
109
  - Gemfile
109
110
  - LICENSE.txt
110
111
  - README.md