Class: DepsGrapher::Context
- Inherits:
-
Object
- Object
- DepsGrapher::Context
- Extended by:
- Forwardable
- Defined in:
- lib/deps_grapher/context.rb
Instance Attribute Summary collapse
-
#advanced_const_resolver ⇒ Object
Returns the value of attribute advanced_const_resolver.
-
#event_processors ⇒ Object
Returns the value of attribute event_processors.
Instance Method Summary collapse
- #clean_dir! ⇒ Object
- #create_graph ⇒ Object
- #create_visualizer ⇒ Object
- #create_writer ⇒ Object
- #generate_graphile(dest) ⇒ Object
- #generate_temp_graphile ⇒ Object
-
#initialize(config) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(config) ⇒ Context
Returns a new instance of Context.
16 17 18 19 |
# File 'lib/deps_grapher/context.rb', line 16 def initialize(config) @config = config @event_processors = {} end |
Instance Attribute Details
#advanced_const_resolver ⇒ Object
Returns the value of attribute advanced_const_resolver.
14 15 16 |
# File 'lib/deps_grapher/context.rb', line 14 def advanced_const_resolver @advanced_const_resolver end |
#event_processors ⇒ Object
Returns the value of attribute event_processors.
14 15 16 |
# File 'lib/deps_grapher/context.rb', line 14 def event_processors @event_processors end |
Instance Method Details
#clean_dir! ⇒ Object
21 22 23 24 25 |
# File 'lib/deps_grapher/context.rb', line 21 def clean_dir! return unless @config.clean FileUtils.rm_rf @config.output_dir end |
#create_graph ⇒ Object
44 45 46 |
# File 'lib/deps_grapher/context.rb', line 44 def create_graph target_path ? Graph.new : NullGraph.new end |
#create_visualizer ⇒ Object
39 40 41 42 |
# File 'lib/deps_grapher/context.rb', line 39 def create_visualizer downloader = Visualizer::Downloader.new @config.output_dir Visualizer.fetch(@config.visualizer).new downloader, @config. end |
#create_writer ⇒ Object
35 36 37 |
# File 'lib/deps_grapher/context.rb', line 35 def create_writer HtmlWriter.new @config.output_dir end |
#generate_graphile(dest) ⇒ Object
27 28 29 |
# File 'lib/deps_grapher/context.rb', line 27 def generate_graphile(dest) Graphile::Generator.new(@config).call dest end |
#generate_temp_graphile ⇒ Object
31 32 33 |
# File 'lib/deps_grapher/context.rb', line 31 def generate_temp_graphile generate_graphile nil end |