Sha256: 4137e104d2251a71942b66312eb30d9079719ad2b49de4aea21d4e34b1229bea

Contents?: true

Size: 970 Bytes

Versions: 13

Compression:

Stored size: 970 Bytes

Contents

# Javascript language module
module Murdoc
  module Languages
    module Javascript
      module Annotator
        def self.included(base)
          base.extend ClassMethods
        end

        module ClassMethods
          protected
          def detect_source_type_from_filename(filename)
            if File.extname(filename) == ".js"
              :javascript
            else
              super if defined?(super)
            end
          end
        end
      end

      module CommentSymbols
        protected
        def comment_symbols
          if source_type == "javascript"
            {:single_line => "//", :multiline => {:begin => "/*", :end => "*/"}}
          else
            super if defined?(super)
          end
        end
      end
    end
  end

  class Annotator
    include Languages::Javascript::Annotator
    include Languages::Javascript::CommentSymbols
  end

  class Paragraph
    include Languages::Javascript::CommentSymbols
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
murdoc-0.1.13 lib/murdoc/languages/javascript.rb
murdoc-0.1.12 lib/murdoc/languages/javascript.rb
murdoc-0.1.11 lib/murdoc/languages/javascript.rb
murdoc-0.1.10 lib/murdoc/languages/javascript.rb
murdoc-0.1.9 lib/murdoc/languages/javascript.rb
murdoc-0.1.8 lib/murdoc/languages/javascript.rb
murdoc-0.1.7 lib/murdoc/languages/javascript.rb
murdoc-0.1.6 lib/murdoc/languages/javascript.rb
murdoc-0.1.5 lib/murdoc/languages/javascript.rb
murdoc-0.1.3 lib/murdoc/languages/javascript.rb
murdoc-0.1.2 lib/murdoc/languages/javascript.rb
murdoc-0.1.1 lib/murdoc/languages/javascript.rb
murdoc-0.1.0 lib/murdoc/languages/javascript.rb