Class: Inkcite::Cli::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/inkcite/cli/test.rb

Class Method Summary collapse

Class Method Details

.invoke(email, opts) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/inkcite/cli/test.rb', line 8

def self.invoke email, opts

  # Check to see if the test-address has been specified.
  send_to = email.config[TEST_ADDRESS]
  if send_to.blank?

    # Deprecated check for the test address buried in the Litmus section.
    litmus_config = email.config[:litmus]
    send_to = litmus_config[TEST_ADDRESS] unless litmus_config.blank?

  end

  if send_to.blank?
    abort "\n      Oops! Inkcite can't start a compatibility test because of a missing\n      configuration value. In config.yml, please add or uncomment this line\n      and insert your Litmus or Email on Acid static testing email address:\n\n        test-address: '([email protected])'\n\n    USAGE\n  end\n\n  # Unless disabled, push the browser preview up to the server to ensure\n  # that the latest images are available.\n  email.upload unless opts[:'no-upload']\n\n  Inkcite::Mailer.send(email, opts.merge({ :to => send_to }))\n\n  true\nend\n".strip_heredoc