Class: MotionBlender::RakeTasks

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

Instance Method Summary collapse

Instance Method Details

#analyzeObject



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

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



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/motion_blender/rake_tasks.rb', line 23

def apply
  analyzer = analyze
  verify_dependencies analyzer.dependencies
  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



10
11
12
# File 'lib/motion_blender/rake_tasks.rb', line 10

def config
  MotionBlender.config
end

#dumpObject



35
36
37
38
# File 'lib/motion_blender/rake_tasks.rb', line 35

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

#graph(options = {}) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/motion_blender/rake_tasks.rb', line 40

def graph options = {}
  analyzer = analyze
  graph_maker = GraphMaker.new analyzer.dependencies, options
  graph_maker.title = Motion::Project::App.config.name
  graph_maker.build
  Motion::Project::App.info('Create', graph_maker.output)
end