Sha256: e0217d1e5f5e293dabdb9d5c7022229004fd66eaefff52ebfa663a95266f030c

Contents?: true

Size: 480 Bytes

Versions: 7

Compression:

Stored size: 480 Bytes

Contents

module NightcrawlerSwift
  class Sync < Command

    def initialize
      @upload = Upload.new
      @logger = NightcrawlerSwift.logger
    end

    def execute dir_path
      @logger.info "dir_path: #{dir_path}"
      Dir["#{dir_path}/**/**"].each do |fullpath|
        path = fullpath.gsub("#{dir_path}/", "")

        unless File.directory?(fullpath)
          @logger.info path
          @upload.execute path, File.open(fullpath, "r")
        end
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nightcrawler_swift-0.3.0 lib/nightcrawler_swift/sync.rb
nightcrawler_swift-0.2.3 lib/nightcrawler_swift/sync.rb
nightcrawler_swift-0.2.2 lib/nightcrawler_swift/sync.rb
nightcrawler_swift-0.2.1 lib/nightcrawler_swift/sync.rb
nightcrawler_swift-0.2.0 lib/nightcrawler_swift/sync.rb
nightcrawler_swift-0.1.1 lib/nightcrawler_swift/sync.rb
nightcrawler_swift-0.1.0 lib/nightcrawler_swift/sync.rb