Module: FileTreeProfiler

Defined in:
lib/file_tree_profiler.rb,
lib/file_tree_profiler/file.rb,
lib/file_tree_profiler/merge.rb,
lib/file_tree_profiler/profile.rb,
lib/file_tree_profiler/version.rb,
lib/file_tree_profiler/dir_file.rb,
lib/file_tree_profiler/data_file.rb,
lib/file_tree_profiler/export/csv.rb,
lib/file_tree_profiler/export/sql.rb,
lib/file_tree_profiler/merge/pairing.rb

Defined Under Namespace

Modules: Export Classes: DataFile, DirFile, File, Merge, Profile

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.csv(profile, basename) ⇒ Object



34
35
36
# File 'lib/file_tree_profiler.rb', line 34

def self.csv profile, basename
  Export::CSV.new profile, basename
end

.monitor_report(*args) ⇒ Object



13
14
15
# File 'lib/file_tree_profiler.rb', line 13

def self.monitor_report(*args)
  @@monitor.report(*args) if monitoring?
end

.monitoring?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/file_tree_profiler.rb', line 17

def self.monitoring?
  defined?(@@monitoring) && @@monitoring == true
end

.profile(path) ⇒ Object



30
31
32
# File 'lib/file_tree_profiler.rb', line 30

def self.profile path
  Profile.new path
end

.sql(profile, config) ⇒ Object



38
39
40
# File 'lib/file_tree_profiler.rb', line 38

def self.sql profile, config
  Export::SQL.new profile, config
end

.with_monitoring(monitor) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/file_tree_profiler.rb', line 21

def self.with_monitoring(monitor)
  @@monitor = monitor
  @@monitoring = true
  yield
ensure
  @@monitor = false
  @@monitoring = false
end