inkcite 1.3.0 → 1.4.0

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: b0303ddbd80b228a0fd359eb646834a24e0c8e37
4
- data.tar.gz: 720d1a683829b80e35e1b21162ab0e54120763af
3
+ metadata.gz: e86a81af36b5b2bbffcb988a56490d8a9ee23da9
4
+ data.tar.gz: dc884e8f2941dfa011ae9d0c7230ff0b088ed214
5
5
  SHA512:
6
- metadata.gz: 0babd93ce009462a59b296af9c5675d4c41e2d2e96c307bbbc7bac093496bdd523bde613b823a18d450c576ca57a6bfe5e120b35afdbf099188539db39741a57
7
- data.tar.gz: 915e2f2941af36147805a1c0b5ac3383c28b4933bd08eeb20d560eab3b735364b205c236d773f7700556098af3179fffed5f57d7214635a1225b912e81d0d9ef
6
+ metadata.gz: 42992c0a58c7a8fd2fd2425dc64b9bafe5e58a32b9840fda472c86953118a7e3ed5bbba098b8ea80543ff142034c8777976f6f408c6788251d2a688975c75573
7
+ data.tar.gz: 67070964326e186b9652c78fe47b995c148ad7e233757ab208ab7aea5a9814933e439fbb26927f832e7544641fe7acd177829badb8124d6ce1659938ef8e689b
@@ -7,46 +7,31 @@ module Inkcite
7
7
 
8
8
  def self.invoke email, opt
9
9
 
10
+ # Verify that a litmus: section is defined in the config.yml
11
+ config = email.config[:litmus]
12
+ if !config || config.blank?
13
+ puts "Unable to test with Litmus ('litmus:' section not found in config.yml)"
14
+ return false
15
+ end
16
+
17
+ # The new Litmus launched in October, 2015 no longer uses the API for creating
18
+ # tests and instead just accepts emails sent to the account's static email address.
19
+ # Check to see if a test-address has been defined.
20
+ send_to = config[:'test-address']
21
+ if send_to.nil? || send_to.blank?
22
+ puts "Unable to test with Litmus! ('test-address' entry missing from 'litmus:' section in the config.yml)"
23
+ return false
24
+ end
25
+
10
26
  # Push the browser preview up to the server to ensure that the
11
27
  # latest images are available.
12
28
  email.upload
13
29
 
14
- config = email.config[:litmus]
15
-
16
- # Initialize the Litmus base.
17
- Litmus::Base.new(config[:subdomain], config[:username], config[:password], true)
18
-
19
30
  # Send each version to Litmus separately
20
31
  email.versions.each do |version|
21
32
 
22
33
  view = email.view(:preview, :email, version)
23
34
 
24
- # This will hold the Litmus Test Version which provides the GUID (e.g. email)
25
- # to which we will send.
26
- test_version = nil
27
-
28
- # Check to see if this email already has a test ID.
29
- test_id = view.meta(:litmus_test_id)
30
- if test_id.blank? || opt[:new]
31
-
32
- email_test = Litmus::EmailTest.create
33
-
34
- # Store the litmus test ID in the email's meta data.
35
- view.set_meta :litmus_test_id, email_test['id']
36
-
37
- # Extract the email address we need to send the test to.
38
- test_version = email_test["test_set_versions"].first
39
-
40
- else
41
-
42
- # Create a new version of the test using the same ID as before.
43
- test_version = Litmus::TestVersion.create(test_id)
44
-
45
- end
46
-
47
- # Extract the email address to send the test to.
48
- send_to = test_version["url_or_guid"]
49
-
50
35
  puts "Sending '#{view.subject}' to #{send_to} ..."
51
36
 
52
37
  Inkcite::Mailer.litmus(email, version, send_to)
@@ -75,6 +75,10 @@ module Inkcite
75
75
  # The preview version defines the configuration for the server to which
76
76
  # the files will be sftp'd.
77
77
  config = email.config[:sftp]
78
+ if config.nil? || config.blank?
79
+ puts "Unable to upload assets to CDN ('sftp:' section not found in config.yml)"
80
+ return
81
+ end
78
82
 
79
83
  # TODO: Verify SFTP configuration
80
84
  host = config[:host]
@@ -1,3 +1,3 @@
1
1
  module Inkcite
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inkcite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey D. Hoffman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-05 00:00:00.000000000 Z
11
+ date: 2015-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport