Class: MotionBlender::RakeTasks

Inherits:
Object
  • Object
show all
Defined in:
lib/motion_blender/rake_tasks.rb

Instance Method Summary collapse

Instance Method Details

#analyzeObject



12
13
14
15
16
17
18
19
# File 'lib/motion_blender/rake_tasks.rb', line 12

def analyze
  analyzer = Analyzer.new
  files = config.incepted_files + Motion::Project::App.config.files
  files.flatten.each do |file|
    analyzer.analyze file
  end
  analyzer
end

#applyObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/motion_blender/rake_tasks.rb', line 21

def apply
  analyzer = analyze
  Motion::Project::App.setup do |app|
    new_files = analyzer.files - app.files
    app.exclude_from_detect_dependencies += new_files
    app.files = new_files + app.files
    app.files -= app.spec_files
    app.files_dependencies analyzer.dependencies
  end
end

#configObject



8
9
10
# File 'lib/motion_blender/rake_tasks.rb', line 8

def config
  MotionBlender.config
end

#dumpObject



32
33
34
35
# File 'lib/motion_blender/rake_tasks.rb', line 32

def dump
  analyzer = analyze
  YAML.dump %w(files dependencies).map { |k| [k, analyzer.send(k)] }.to_h
end