Sha256: 6804e2f4d104525b7803c974e71be961805ade52098e3d5a3890c76066293ec8

Contents?: true

Size: 508 Bytes

Versions: 11

Compression:

Stored size: 508 Bytes

Contents


module Geminabox
  module Proxy
    class Copier < FileHandler

      def self.copy(file_name)
        copier = new(file_name)
        copier.get_file
        copier
      end

      def get_file
        return true if proxy_file_exists?
        return copy_local if local_file_exists?
        get_remote
      end

      def copy_local
        FileUtils.cp local_path, proxy_path
      end

      def get_remote
        File.open(proxy_path, 'w'){|f| f.write(remote_content)}
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
geminabox-0.13.0 lib/geminabox/proxy/copier.rb
r5_geminabox-0.0.1 lib/geminabox/proxy/copier.rb
geminabox-0.12.4 lib/geminabox/proxy/copier.rb
geminabox-0.12.3 lib/geminabox/proxy/copier.rb
geminabox-jgraichen-0.12.2.4 lib/geminabox/proxy/copier.rb
geminabox-jgraichen-0.12.2.3 lib/geminabox/proxy/copier.rb
geminabox-jgraichen-0.12.2.2 lib/geminabox/proxy/copier.rb
geminabox-jgraichen-0.12.2.1 lib/geminabox/proxy/copier.rb
geminabox-0.12.2 lib/geminabox/proxy/copier.rb
geminabox-0.12.1 lib/geminabox/proxy/copier.rb
geminabox-0.12.0 lib/geminabox/proxy/copier.rb