fog-local-0.6.0/0000755000004100000410000000000013365412524013415 5ustar www-datawww-datafog-local-0.6.0/.travis.yml0000644000004100000410000000037213365412524015530 0ustar www-datawww-datalanguage: ruby sudo: false script: bundle exec rake test before_install: - gem install bundler rvm: - 1.9.3 - 2.0.0 - 2.1.10 - 2.2.6 - 2.3.3 - 2.4.0 - 2.5.1 - jruby-19mode - jruby-9.1.7.0 env: - FOG_MOCK=true - FOG_MOCK=false fog-local-0.6.0/README.md0000644000004100000410000000206513365412524014677 0ustar www-datawww-data# Fog::Local ![Gem Version](https://badge.fury.io/rb/fog-local.svg) [![Build Status](https://travis-ci.org/fog/fog-local.svg?branch=master)](https://travis-ci.org/fog/fog-local) [![Dependency Status](https://gemnasium.com/fog/fog-local.svg)](https://gemnasium.com/fog/fog-local) ## Installation Add this line to your application's Gemfile: ```ruby gem 'fog-local' ``` And then execute: $ bundle Or install it yourself as: $ gem install fog-local ## Usage Initialise a `Fog::Local::Storage` object: ```ruby storage = Fog::Local::Storage.new(local_root: '~/fog') ``` This can then be used like any other [Fog storage](http://fog.io/storage/). ```ruby directory = storage.directories.create(key: 'data') directory.files.create(body: 'Hello World!', key: 'hello_world.txt') ``` ## Contributing 1. Fork it ( https://github.com/fog/fog-local/fork) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request fog-local-0.6.0/tests/0000755000004100000410000000000013365412524014557 5ustar www-datawww-datafog-local-0.6.0/tests/helper.rb0000644000004100000410000000147213365412524016367 0ustar www-datawww-databegin require "codeclimate-test-reporter" CodeClimate::TestReporter.start rescue LoadError => e $stderr.puts "not recording test coverage: #{e.inspect}" end $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'fog/local' Bundler.require(:test) require 'tmpdir' Excon.defaults.merge!(:debug_request => true, :debug_response => true) require File.expand_path(File.join(File.dirname(__FILE__), 'helpers', 'mock_helper')) # This overrides the default 600 seconds timeout during live test runs if Fog.mocking? Fog.timeout = ENV['FOG_TEST_TIMEOUT'] || 2000 Fog::Logger.warning "Setting default fog timeout to #{Fog.timeout} seconds" end def lorem_file File.open(File.dirname(__FILE__) + '/lorem.txt', 'r') end def array_differences(array_a, array_b) (array_a - array_b) | (array_b - array_a) end fog-local-0.6.0/tests/helpers/0000755000004100000410000000000013365412524016221 5ustar www-datawww-datafog-local-0.6.0/tests/helpers/collection_helper.rb0000644000004100000410000000502713365412524022244 0ustar www-datawww-datadef collection_tests(collection, params = {}, mocks_implemented = true) tests('success') do tests("#new(#{params.inspect})").succeeds do pending if Fog.mocking? && !mocks_implemented collection.new(params) end tests("#create(#{params.inspect})").succeeds do pending if Fog.mocking? && !mocks_implemented @instance = collection.create(params) end # FIXME: work around for timing issue on AWS describe_instances mocks if Fog.mocking? && @instance.respond_to?(:ready?) @instance.wait_for { ready? } end tests("#all").succeeds do pending if Fog.mocking? && !mocks_implemented collection.all end if !Fog.mocking? || mocks_implemented @identity = @instance.identity end tests("#get(#{@identity})").succeeds do pending if Fog.mocking? && !mocks_implemented collection.get(@identity) end tests('Enumerable') do pending if Fog.mocking? && !mocks_implemented methods = [ 'all?', 'any?', 'find', 'detect', 'collect', 'map', 'find_index', 'flat_map', 'collect_concat', 'group_by', 'none?', 'one?' ] # JRuby 1.7.5+ issue causes a SystemStackError: stack level too deep # https://github.com/jruby/jruby/issues/1265 if RUBY_PLATFORM == "java" and JRUBY_VERSION =~ /1\.7\.[5-8]/ methods.delete('all?') end methods.each do |enum_method| if collection.respond_to?(enum_method) tests("##{enum_method}").succeeds do block_called = false collection.send(enum_method) {|x| block_called = true } block_called end end end [ 'max_by','min_by' ].each do |enum_method| if collection.respond_to?(enum_method) tests("##{enum_method}").succeeds do block_called = false collection.send(enum_method) {|x| block_called = true; 0 } block_called end end end end if block_given? yield(@instance) end if !Fog.mocking? || mocks_implemented @instance.destroy end end tests('failure') do if !Fog.mocking? || mocks_implemented @identity = @identity.to_s @identity = @identity.gsub(/[a-zA-Z]/) { Fog::Mock.random_letters(1) } @identity = @identity.gsub(/\d/) { Fog::Mock.random_numbers(1) } @identity end tests("#get('#{@identity}')").returns(nil) do pending if Fog.mocking? && !mocks_implemented collection.get(@identity) end end end fog-local-0.6.0/tests/helpers/mock_helper.rb0000644000004100000410000000017413365412524021040 0ustar www-datawww-data# Use so you can run in mock mode from the command line # # FOG_MOCK=true fog if ENV["FOG_MOCK"] == "true" Fog.mock! end fog-local-0.6.0/tests/helpers/model_helper.rb0000644000004100000410000000141413365412524021205 0ustar www-datawww-datadef model_tests(collection, params = {}, mocks_implemented = true) tests('success') do @instance = collection.new(params) tests("#save").succeeds do pending if Fog.mocking? && !mocks_implemented @instance.save end if block_given? yield(@instance) end tests("#destroy").succeeds do pending if Fog.mocking? && !mocks_implemented @instance.destroy end end end # Generates a unique identifier with a random differentiator. # Useful when rapidly re-running tests, so we don't have to wait # serveral minutes for deleted objects to disappear from the API # E.g. 'fog-test-1234' def uniq_id(base_name = 'fog-test') # random_differentiator suffix = rand(65536).to_s(16).rjust(4, '0') [base_name, suffix] * '-' end fog-local-0.6.0/tests/helpers/succeeds_helper.rb0000644000004100000410000000020613365412524021701 0ustar www-datawww-datamodule Shindo class Tests def succeeds test('succeeds') do !!instance_eval(&Proc.new) end end end end fog-local-0.6.0/tests/local/0000755000004100000410000000000013365412524015651 5ustar www-datawww-datafog-local-0.6.0/tests/local/storage_tests.rb0000644000004100000410000000206213365412524021064 0ustar www-datawww-dataShindo.tests('Local | storage') do pending if Fog.mocking? before do @options = { :local_root => Dir.mktmpdir('fog-tests') } end after do FileUtils.remove_entry_secure @options[:local_root] end tests('#endpoint') do tests('when no endpoint is provided'). returns(nil) do Fog::Local::Storage.new(@options).endpoint end tests('when no host is provided'). returns(nil) do @options[:scheme] = 'http' @options[:path] = '/files' @options[:port] = 80 Fog::Local::Storage.new(@options).endpoint end tests('when endpoint is provided'). returns('http://example.com/files') do @options[:endpoint] = 'http://example.com/files' Fog::Local::Storage.new(@options).endpoint end tests('when at least host option is provided'). returns('http://example.com/files') do @options[:scheme] = 'http' @options[:host] = 'example.com' @options[:path] = '/files' Fog::Local::Storage.new(@options).endpoint end end end fog-local-0.6.0/tests/local/models/0000755000004100000410000000000013365412524017134 5ustar www-datawww-datafog-local-0.6.0/tests/local/models/file_tests.rb0000644000004100000410000001036013365412524021622 0ustar www-datawww-dataShindo.tests('Storage[:local] | file', ["local"]) do pending if Fog.mocking? before do @options = { :local_root => Dir.mktmpdir('fog-tests') } end after do FileUtils.remove_entry_secure @options[:local_root] end tests('#public_url') do tests('when connection has an endpoint'). returns('http://example.com/files/directory/file.txt') do @options[:endpoint] = 'http://example.com/files' connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'directory') file = directory.files.new(:key => 'file.txt') file.public_url end tests('when connection has no endpoint'). returns(nil) do @options[:endpoint] = nil connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'directory') file = directory.files.new(:key => 'file.txt') file.public_url end tests('when file path has escapable characters'). returns('http://example.com/files/my%20directory/my%20file.txt') do @options[:endpoint] = 'http://example.com/files' connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'my directory') file = directory.files.new(:key => 'my file.txt') file.public_url end end tests('#save') do tests('creates non-existent subdirs') do returns(true) do connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'path1') file = directory.files.new(:key => 'path2/file.rb', :body => "my contents") file.save File.exists?(@options[:local_root] + "/path1/path2/file.rb") end end tests('with tempfile').returns('tempfile') do connection = Fog::Local::Storage.new(@options) directory = connection.directories.create(:key => 'directory') tempfile = Tempfile.new(['file', '.txt']) tempfile.write('tempfile') tempfile.rewind tempfile.instance_eval do def read raise 'must not be read' end end file = directory.files.new(:key => 'tempfile.txt', :body => tempfile) file.save tempfile.close tempfile.unlink directory.files.get('tempfile.txt').body end end tests('#destroy') do # - removes dir if it contains no files # - keeps dir if it contains non-hidden files # - keeps dir if it contains hidden files # - stays in the same directory tests('removes enclosing dir if it is empty') do returns(false) do connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'path1') file = directory.files.new(:key => 'path2/file.rb', :body => "my contents") file.save file.destroy File.exists?(@options[:local_root] + "/path1/path2") end end tests('keeps enclosing dir if it is not empty') do returns(true) do connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'path1') file = directory.files.new(:key => 'path2/file.rb', :body => "my contents") file.save file = directory.files.new(:key => 'path2/file2.rb', :body => "my contents") file.save file.destroy File.exists?(@options[:local_root] + "/path1/path2") end end tests('keeps enclosing dir if contains only hidden files') do returns(true) do connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'path1') file = directory.files.new(:key => 'path2/.file.rb', :body => "my contents") file.save file = directory.files.new(:key => 'path2/.file2.rb', :body => "my contents") file.save file.destroy File.exists?(@options[:local_root] + "/path1/path2") end end tests('it stays in the same directory') do returns(Dir.pwd) do connection = Fog::Local::Storage.new(@options) directory = connection.directories.new(:key => 'path1') file = directory.files.new(:key => 'path2/file2.rb', :body => "my contents") file.save file.destroy Dir.pwd end end end end fog-local-0.6.0/tests/local/models/directories_tests.rb0000644000004100000410000000105313365412524023216 0ustar www-datawww-dataShindo.tests('Storage[:local] | directories', ["local"]) do pending if Fog.mocking? @options = { :local_root => Dir.mktmpdir('fog-tests') } @collection = Fog::Local::Storage.new(@options).directories collection_tests(@collection, {:key => "fogdirtests"}, true) tests("#all") do tests("succeeds when :local_root does not exist").succeeds do FileUtils.remove_entry_secure(@options[:local_root]) @collection.all end end FileUtils.remove_entry_secure(@options[:local_root]) if File.directory?(@options[:local_root]) end fog-local-0.6.0/tests/local/models/files_tests.rb0000644000004100000410000000102513365412524022003 0ustar www-datawww-dataShindo.tests('Storage[:local] | files', ["local"]) do pending if Fog.mocking? before do @options = { :local_root => Dir.mktmpdir('fog-tests') } end after do FileUtils.remove_entry_secure(@options[:local_root]) if File.directory?(@options[:local_root]) end tests("#is_truncated") do returns(false) do connection = Fog::Local::Storage.new(@options) directory = connection.directories.create(:key => 'directory') collection = directory.files collection.is_truncated end end end fog-local-0.6.0/tests/local/models/directory_tests.rb0000644000004100000410000000073313365412524022712 0ustar www-datawww-dataShindo.tests('Storage[:local] | directory', ["local"]) do pending if Fog.mocking? before do @options = { :local_root => Dir.mktmpdir('fog-tests') } end after do FileUtils.remove_entry_secure @options[:local_root] end tests('save') do returns('directory') do connection = Fog::Local::Storage.new(@options) connection.directories.create(:key => 'directory') connection.directories.create(:key => 'directory').key end end end fog-local-0.6.0/tests/watchr.rb0000644000004100000410000000070713365412524016400 0ustar www-datawww-dataENV['FOG_MOCK'] ||= 'true' ENV['AUTOTEST'] = 'true' ENV['WATCHR'] = '1' def file2shindo(file) result = file.sub('lib/fog/', 'tests/').gsub(/\.rb$/, '_tests.rb') end def run_shindo_test(file) if File.exist? file system("shindont #{file}") else puts "FIXME: No test #{file} [#{Time.now}]" end end watch( 'tests/.*_tests\.rb' ) do |md| run_shindo_test(md[0]) end watch( 'lib/.*\.rb' ) do |md| run_shindo_test(file2shindo(md[0])) end fog-local-0.6.0/LICENSE.md0000644000004100000410000000216413365412524015024 0ustar www-datawww-dataThe MIT License (MIT) Copyright (c) 2015 [CONTRIBUTORS.md](https://github.com/fog/fog/blob/master/CONTRIBUTORS.md) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. fog-local-0.6.0/CONTRIBUTORS.md0000644000004100000410000000131213365412524015671 0ustar www-datawww-data* geemus * Lance Ivy * Paul Thornthwaite * Benjamin Manns * Sjoerd Andringa * Juris Galang * Paul Thornthwaite * Jamie Paton * Thomas Wright * Wesley Beary * Karl Freeman * Andy Lindeman * Athir Nuaimi * Brian D. Burns * Jade Tucker * James Herdman * Adam Tanner * Mark Yen * Kevin Deisz fog-local-0.6.0/.gitignore0000644000004100000410000000020113365412524015376 0ustar www-datawww-data/.bundle/ /.yardoc /Gemfile.lock /_yardoc/ /coverage/ /doc/ /pkg/ /spec/reports/ /tmp/ *.bundle *.so *.o *.a mkmf.log tests/.fog fog-local-0.6.0/Rakefile0000644000004100000410000000026313365412524015063 0ustar www-datawww-datarequire "bundler/gem_tasks" task :default => :test mock = ENV['FOG_MOCK'] || 'false' desc "Run tests" task :test do sh("export FOG_MOCK=#{mock} && bundle exec shindont") end fog-local-0.6.0/lib/0000755000004100000410000000000013365412524014163 5ustar www-datawww-datafog-local-0.6.0/lib/fog/0000755000004100000410000000000013365412524014736 5ustar www-datawww-datafog-local-0.6.0/lib/fog/bin/0000755000004100000410000000000013365412524015506 5ustar www-datawww-datafog-local-0.6.0/lib/fog/bin/local.rb0000644000004100000410000000125413365412524017127 0ustar www-datawww-dataclass Local < Fog::Bin class << self def class_for(key) case key when :storage Fog::Local::Storage else raise ArgumentError, "Unsupported #{self} service: #{key}" end end def [](service) @@connections ||= Hash.new do |hash, key| hash[key] = case key when :storage Fog::Logger.warning("Local[:storage] is not recommended, use Storage[:local] for portability") Fog::Local::Storage.new else raise ArgumentError, "Unrecognized service: #{key.inspect}" end end @@connections[service] end def services Fog::Local.services end end end fog-local-0.6.0/lib/fog/local/0000755000004100000410000000000013365412524016030 5ustar www-datawww-datafog-local-0.6.0/lib/fog/local/version.rb0000644000004100000410000000007213365412524020041 0ustar www-datawww-datamodule Fog module Local VERSION = '0.6.0' end end fog-local-0.6.0/lib/fog/local/models/0000755000004100000410000000000013365412524017313 5ustar www-datawww-datafog-local-0.6.0/lib/fog/local/models/directories.rb0000644000004100000410000000142313365412524022154 0ustar www-datawww-datamodule Fog module Local class Storage class Directories < Fog::Collection model Directory def all data = if ::File.directory?(service.local_root) Dir.entries(service.local_root).select do |entry| entry[0...1] != '.' && ::File.directory?(service.path_to(entry)) end.map do |entry| {:key => entry} end else [] end load(data) end def get(key, options = {}) create_directory(key, options) if ::File.directory?(service.path_to(key)) end private def create_directory(key, options) options[:path] ? new(key: key + options[:path]) : new(key: key) end end end end end fog-local-0.6.0/lib/fog/local/models/files.rb0000644000004100000410000000413213365412524020742 0ustar www-datawww-datamodule Fog module Local class Storage class Files < Fog::Collection attribute :directory model File def all requires :directory if directory.collection.get(directory.key) data = [] Dir.chdir(service.path_to(directory.key)) { data = Dir.glob('**/*').reject do |file| ::File.directory?(file) end.map do |key| path = file_path(key) { :content_length => ::File.size(path), :key => key, :last_modified => ::File.mtime(path) } end } load(data) else nil end end def get(key, &block) requires :directory path = file_path(key) if ::File.exist?(path) data = { :content_length => ::File.size(path), :key => key, :last_modified => ::File.mtime(path) } body = "" ::File.open(path) do |file| while (chunk = file.read(Excon::CHUNK_SIZE)) && (!block_given? || (block_given? && yield(chunk))) body << chunk end end data.merge!(:body => body) if !block_given? new(data) else nil end end def head(key) requires :directory path = file_path(key) if ::File.exist?(path) new({ :content_length => ::File.size(path), :key => key, :last_modified => ::File.mtime(path) }) else nil end end def new(attributes = {}) requires :directory super({ :directory => directory }.merge!(attributes)) end def is_truncated false end private def file_path(key) service.path_to(::File.join(directory.key, key)) end end end end end fog-local-0.6.0/lib/fog/local/models/file.rb0000644000004100000410000000765113365412524020570 0ustar www-datawww-datamodule Fog module Local class Storage class File < Fog::Model identity :key, :aliases => 'Key' attribute :content_length, :aliases => 'Content-Length', :type => :integer # attribute :content_type, :aliases => 'Content-Type' attribute :last_modified, :aliases => 'Last-Modified' require 'uri' def body attributes[:body] ||= if last_modified collection.get(identity).body else '' end end def body=(new_body) attributes[:body] = new_body end def content_type @content_type ||= begin unless (mime_types = ::MIME::Types.of(key)).empty? mime_types.first.content_type end end end def directory @directory end def copy(target_directory_key, target_file_key, options={}) requires :directory, :key service.copy_object(directory.key, key, target_directory_key, target_file_key) target_directory = service.directories.new(:key => target_directory_key) target_directory.files.get(target_file_key) end def destroy requires :directory, :key ::File.delete(path) if ::File.exist?(path) dirs = path.split(::File::SEPARATOR)[0...-1] dirs.length.times do |index| dir_path = dirs[0..-index].join(::File::SEPARATOR) if dir_path.empty? # path starts with ::File::SEPARATOR next end # don't delete the containing directory or higher if dir_path == service.path_to(directory.key) break end rm_if_empty_dir(dir_path) end true end def public=(new_public) new_public end def public_url requires :directory, :key if service.endpoint escaped_directory = URI.escape(directory.key) escaped_key = URI.escape(key) ::File.join(service.endpoint, escaped_directory, escaped_key) else nil end end def save(options = {}) requires :body, :directory, :key # Once 1.9.3 support is dropped, the following two lines # can be replaced with `File.dirname(path)` dirs = path.split(::File::SEPARATOR)[0...-1] dir_path = dirs.join(::File::SEPARATOR) # Create all directories in file path that do not yet exist FileUtils.mkdir_p(dir_path) if (body.is_a?(::File) || body.is_a?(Tempfile)) && ::File.exist?(body.path) FileUtils.cp(body.path, path) else write_file(path, body) end merge_attributes( :content_length => Fog::Storage.get_body_size(body), :last_modified => ::File.mtime(path) ) true end private def directory=(new_directory) @directory = new_directory end def path service.path_to(::File.join(directory.key, key)) end def write_file(path, content) input_io = StringIO.new(content) if content.is_a?(String) input_io ||= content ::File.open(path, 'wb') do |file| IO.copy_stream(input_io, file) end end def rm_if_empty_dir(dir_path) if ::File.directory?(dir_path) Dir.rmdir(dir_path) if dir_empty?(dir_path) end end def dir_empty?(dir_path) # NOTE: There’s Dir.empty?, but it is only available on Ruby 2.4+ # NOTE: `entries` will be empty on Windows, and contain . and .. on # unix-like systems (macOS, Linux, BSD, …) entries = Dir.entries(dir_path) entries.empty? || entries.all? { |e| ['.', '..'].include?(e) } end end end end end fog-local-0.6.0/lib/fog/local/models/directory.rb0000644000004100000410000000130713365412524021645 0ustar www-datawww-datamodule Fog module Local class Storage class Directory < Fog::Model identity :key def destroy requires :key if ::File.directory?(path) Dir.rmdir(path) true else false end end def files @files ||= Files.new(directory: self, service: service) end def public=(new_public) new_public end def public_url nil end def save requires :key FileUtils.mkpath(path) true end private def path service.path_to(key) end end end end end fog-local-0.6.0/lib/fog/local/storage.rb0000644000004100000410000000462113365412524020024 0ustar www-datawww-datamodule Fog module Local class Storage < Fog::Service autoload :Directories, 'fog/local/models/directories' autoload :Directory, 'fog/local/models/directory' autoload :File, 'fog/local/models/file' autoload :Files, 'fog/local/models/files' requires :local_root recognizes :endpoint, :scheme, :host, :port, :path model_path 'fog/local/models' collection :directories model :directory model :file collection :files require 'uri' class Mock attr_reader :endpoint def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end def self.reset @data = nil end def initialize(options={}) Fog::Mock.not_implemented @local_root = ::File.expand_path(options[:local_root]) @endpoint = options[:endpoint] || build_endpoint_from_options(options) end def data self.class.data[@local_root] end def local_root @local_root end def path_to(partial) ::File.join(@local_root, partial) end def reset_data self.class.data.delete(@local_root) end private def build_endpoint_from_options(options) return unless options[:host] URI::Generic.build(options).to_s end end class Real attr_reader :endpoint def initialize(options={}) @local_root = ::File.expand_path(options[:local_root]) @endpoint = options[:endpoint] || build_endpoint_from_options(options) end def local_root @local_root end def path_to(partial) ::File.join(@local_root, partial) end def copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, options={}) source_path = path_to(::File.join(source_directory_name, source_object_name)) target_path = path_to(::File.join(target_directory_name, target_object_name)) ::FileUtils.mkdir_p(::File.dirname(target_path)) ::FileUtils.copy_file(source_path, target_path) end private def build_endpoint_from_options(options) return unless options[:host] URI::Generic.build(options).to_s end end end end end fog-local-0.6.0/lib/fog/local.rb0000644000004100000410000000042613365412524016357 0ustar www-datawww-datarequire 'fog/core' require 'fileutils' require 'tempfile' require 'fog/local/version' module Fog module Local extend Provider autoload :Storage, 'fog/local/storage' service :storage, :Storage end end Fog::Storage::Local = Fog::Local::Storage # legacy compat fog-local-0.6.0/CONTRIBUTING.md0000644000004100000410000000147113365412524015651 0ustar www-datawww-data## Getting Involved New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another. ### Coding * Pick a task: * Offer feedback on open [pull requests](https://github.com/fog/fog/pulls). * Review open [issues](https://github.com/fog/fog/issues) for things to help on. * [Create an issue](https://github.com/fog/fog/issues/new) to start a discussion on additions or features. * Fork the project, add your changes and tests to cover them in a topic branch. * Commit your changes and rebase against `fog/fog` to ensure everything is up to date. * [Submit a pull request](https://github.com/fog/fog/compare/). ### Non-Coding * Offer feedback on open [issues](https://github.com/fog/fog/issues). * Organize or volunteer at events. fog-local-0.6.0/.ruby-gemset0000644000004100000410000000001213365412524015652 0ustar www-datawww-datafog-local fog-local-0.6.0/Gemfile0000644000004100000410000000013613365412524014710 0ustar www-datawww-datasource 'https://rubygems.org' # Specify your gem's dependencies in fog-local.gemspec gemspec fog-local-0.6.0/fog-local.gemspec0000644000004100000410000000216713365412524016633 0ustar www-datawww-data# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'fog/local/version' Gem::Specification.new do |spec| spec.name = "fog-local" spec.version = Fog::Local::VERSION spec.authors = ["Wesley Beary", "Ville Lautanala"] spec.email = ["geemus@gmail.com", "lautis@gmail.com"] spec.summary = %q{Module for the 'fog' gem to support local filesystem storage.} spec.description = %q{This library can be used as a module for `fog` or as standalone provider to use local filesystem storage.} spec.homepage = "https://github.com/fog/fog-local" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] spec.add_development_dependency 'bundler', '~> 1.7' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'shindo', '~> 0.3' spec.add_dependency 'fog-core', '>= 1.27', '< 3.0' end