Sha256: 0b3a21241960235e169806211f7d7f2c5c2cc7c695110de46a2bd429334907ec

Contents?: true

Size: 707 Bytes

Versions: 2

Compression:

Stored size: 707 Bytes

Contents

# -*- coding: utf-8 -*-
module TreeRb

  class SqliteOutput

    def run(directory_tree_walker, output, options)

      begin
        require 'sqlite3'
        require 'tree_rb/output_plugins/sqlite/sqlite_dir_tree_visitor'
      rescue LoadError
        $stderr.puts 'You must gem install sqlite3 to use this output format'
        exit(1)
      end

      unless options[:output]
        $stderr.puts 'need to specify the -o options'
      else
        output.close
        filename = options[:output]
        visitor  = SqliteDirTreeVisitor.new(filename)
        #start = Time.now
        #me    = self
        #bytes = 0
        directory_tree_walker.run(visitor)
      end

    end

  end
end # module

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tree.rb-0.3.13 lib/tree_rb/output_plugins/sqlite/sqlite_output.rb
tree.rb-0.3.12 lib/tree_rb/output_plugins/sqlite/sqlite_output.rb