Sha256: eb9b85df35543df9ea91854d99ca7f84b05ecc09f552338eb53011b79a99cf48

Contents?: true

Size: 525 Bytes

Versions: 11

Compression:

Stored size: 525 Bytes

Contents

module NightcrawlerSwift
  class Sync < Command

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

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

        unless File.directory?(fullpath)
          @logger.info "[NightcrawlerSwift] #{path}"
          @upload.execute path, File.open(fullpath, "r")
        end
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nightcrawler_swift-1.0.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.11.1 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.11.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.10.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.9.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.8.1 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.8.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.7.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.6.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.5.0 lib/nightcrawler_swift/commands/sync.rb
nightcrawler_swift-0.4.0 lib/nightcrawler_swift/commands/sync.rb