Sha256: 26892a709d60a45c8a46ae54bbd70c5e017f40259ef9af762d1fc13e252ce954

Contents?: true

Size: 945 Bytes

Versions: 15

Compression:

Stored size: 945 Bytes

Contents

# !SLIDE :capture_code_output true
# One-way, file log service

require 'example_helper'
begin
  File.unlink(service_log = "#{__FILE__}.service.log") rescue nil
  Email.asir.transport = t =
    ASIR::Transport::File.new(:file => service_log)
  t.encoder =
    ASIR::Coder::Yaml.new(:yaml_options => { :ASCII_8BIT_ok => true })
  pr Email.asir.send_email(:pdf_invoice,
                             :to => "user@email.com",
                             :customer => @customer)
ensure
  t.close
  puts "\x1a\n#{service_log.inspect} contents:"
  puts File.read(service_log)
end

# !SLIDE END
# EXPECT: : client process
# EXPECT: service.log" contents:
# EXPECT: pr: nil
# EXPECT: --- !ruby/object:ASIR::Message
# EXPECT: --- !ruby/object:ASIR::Message
# EXPECT: arguments:
# EXPECT: - :pdf_invoice
# EXPECT:   :to: user@email.com
# EXPECT:   :customer: 123
# EXPECT: receiver: Email
# EXPECT: receiver_class: Module
# EXPECT: selector: :send_email

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
asir-1.2.11 example/ex04.rb
asir-1.2.10 example/ex04.rb
asir-1.2.9 example/ex04.rb
asir-1.2.8 example/ex04.rb
asir-1.2.7 example/ex04.rb
asir-1.2.6 example/ex04.rb
asir-1.2.5 example/ex04.rb
asir-1.2.3 example/ex04.rb
asir-1.2.2 example/ex04.rb
asir-1.2.1 example/ex04.rb
asir-1.2.0 example/ex04.rb
asir-1.1.12 example/ex04.rb
asir-1.1.11 example/ex04.rb
asir-1.1.10 example/ex04.rb
asir-1.1.9 example/ex04.rb