Sha256: 4c0f93a0ed30b75b4a00f798b76c682aef5e9fc8533252c5e1e0b80c92b024f0

Contents?: true

Size: 345 Bytes

Versions: 14

Compression:

Stored size: 345 Bytes

Contents

require 'json'

class Alerty
  class Plugin
    class File
      def initialize(config)
        raise ConfigError.new('file: path is not configured') unless config.path
        @path = config.path
      end

      def alert(record)
        ::File.open(@path, 'a') do |io|
          io.puts record.to_json
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
alerty-0.4.0 lib/alerty/plugin/file.rb
alerty-0.3.0 lib/alerty/plugin/file.rb
alerty-0.2.3 lib/alerty/plugin/file.rb
alerty-0.2.2 lib/alerty/plugin/file.rb
alerty-0.2.1 lib/alerty/plugin/file.rb
alerty-0.2.0 lib/alerty/plugin/file.rb
alerty-0.1.1 lib/alerty/plugin/file.rb
alerty-0.1.0 lib/alerty/plugin/file.rb
alerty-0.0.9 lib/alerty/plugin/file.rb
alerty-0.0.8 lib/alerty/plugin/file.rb
alerty-0.0.7 lib/alerty/plugin/file.rb
alerty-0.0.6 lib/alerty/plugin/file.rb
alerty-0.0.5 lib/alerty/plugin/file.rb
alerty-0.0.4 lib/alerty/plugin/file.rb