Sha256: ea64f92a882c417452ab92e57d04aa598e16d42b166185847a96f8858fdd4f1b

Contents?: true

Size: 614 Bytes

Versions: 9

Compression:

Stored size: 614 Bytes

Contents

module WebTranslateIt

  module Safe

    class Stream

      attr_accessor :config, :backup

      def initialize(config, backup)
        @config = config
        @backup = 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

9 entries across 9 versions & 1 rubygems

Version Path
webtranslateit-safe-0.4.11 lib/web_translate_it/safe/stream.rb
webtranslateit-safe-0.4.10 lib/web_translate_it/safe/stream.rb
webtranslateit-safe-0.4.9 lib/web_translate_it/safe/stream.rb
webtranslateit-safe-0.4.8 lib/web_translate_it/safe/stream.rb
webtranslateit-safe-0.4.7 lib/web_translate_it/safe/stream.rb
webtranslateit-safe-0.4.6 lib/web_translate_it/safe/stream.rb
webtranslateit-safe-0.4.5 lib/webtranslateit/safe/stream.rb
webtranslateit-safe-0.4.4 lib/webtranslateit/safe/stream.rb
webtranslateit-safe-0.4.0 lib/webtranslateit/safe/stream.rb