Sha256: 5d5bac57367188720f15b918d0bacaabf9f37d5513fb2ded4dcdce33ab8b50bd

Contents?: true

Size: 1.29 KB

Versions: 27

Compression:

Stored size: 1.29 KB

Contents

module YARD
  module Server
    
    class Adapter
      
      class << self
      
        alias_method :yard_setup, :setup
      
        #
        # To provide the templates necessary for `yard-cucumber` to integrate
        # with YARD the adapter has to around-alias the setup method to place
        # the `yard-cucumber` server templates as the last template in the list.
        #
        # When they are normally loaded with the plugin they cause an error with 
        # the `yardoc` command. They are also not used because the YARD server
        # templates are placed after all plugin templates. 
        #
        def setup
          yard_setup
          YARD::Templates::Engine.template_paths += 
          [File.dirname(__FILE__) + '/../../templates',File.dirname(__FILE__) + '/../../docserver']
        end
        
        alias_method :yard_shutdown, :shutdown

        #
        # Similar to the addition, it is good business to tear down the templates
        # that were added by again around-aliasing the shutdown method.
        #
        def shutdown
          yard_shutdown
          YARD::Templates::Engine.template_paths -= 
          [File.dirname(__FILE__) + '/../../templates',File.dirname(__FILE__) + '/../../docserver']
        end  
        
      end
      

    end
    
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
yard-cucumber-2.1.3 lib/yard/server/adapter.rb
yard-cucumber-2.1.2 lib/yard/server/adapter.rb
yard-cucumber-2.1.1 lib/yard/server/adapter.rb
yard-cucumber-2.1.0 lib/yard/server/adapter.rb
yard-cucumber-2.0.3 lib/yard/server/adapter.rb
yard-cucumber-2.0.2 lib/yard/server/adapter.rb
yard-cucumber-2.0.1 lib/yard/server/adapter.rb