Sha256: 3184d659eb4401b02b8eccfd69e381d8ee62e6e2eede5acbedab2571bca6c3f2

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

module WebTranslateIt
  module Safe
    class Stream

      attr_accessor :config, :backup
      def initialize(config, backup)
        @config, @backup = config, backup
      end
      # FIXME: move to Backup
      def expand(path)
        path .
        gsub(/:kind\b/, @backup.kind.to_s) .
        gsub(/:id\b/, @backup.id.to_s) .
        gsub(/:timestamp\b/, @backup.timestamp)
      end

      private

      def verbose?
        config[:verbose]
      end

      def local_only?
        config[:local_only]
      end

      def dry_run?
        config[:dry_run]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webtranslateit-safe-0.4.3 lib/webtranslateit/safe/stream.rb
webtranslateit-safe-0.4.2 lib/webtranslateit/safe/stream.rb
webtranslateit-safe-0.4.1 lib/webtranslateit/safe/stream.rb