Class: Puppetfactory::Plugins::Gitviz

Inherits:
Puppetfactory::Plugins show all
Defined in:
lib/puppetfactory/plugins/gitviz.rb

Instance Attribute Summary

Attributes inherited from Puppetfactory::Plugins

#weight

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Gitviz

Returns a new instance of Gitviz.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/puppetfactory/plugins/gitviz.rb', line 5

def initialize(options)
  super(options)
  return unless options[:puppetfactory]

  server = options[:puppetfactory]

  # Add a web route to the puppetfactory server. Must happen in the initializer
  server.get '/gitviz' do
    '<iframe id="gitviz" src="/explain-git-with-d3/embed.html" /><script>$("div:has(#gitviz)").css("padding", 0);$("body").css("min-width", "1150px");</script>'
  end

end

Instance Method Details

#tabs(privileged = false) ⇒ Object



18
19
20
21
# File 'lib/puppetfactory/plugins/gitviz.rb', line 18

def tabs(privileged = false)
  # url path => display title
  { 'gitviz' => 'Git Visualization' }
end