This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Enumerable | |
| module Ordonned | |
| def [](arg) | |
| case arg | |
| when Numeric | |
| detect.with_index { |_, index| index == arg } | |
| when Range | |
| result = [] | |
| each.with_index do |object, index| | |
| result << object if arg.include?(index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function remaining(args) { | |
| return Array.prototype.slice.call(args, args.callee.length); | |
| } | |
| function example(first) { | |
| alert("I was given : " + first); | |
| alert("but also : " + remaining(arguments)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require 'rubygems' | |
| require 'active_record' | |
| require 'active_support' | |
| require 'parseconfig' | |
| config = ParseConfig.new( '/path/to/conf/file.conf' ) | |
| db_number = Integer(config.get_value( 'database_count' )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Integrate SyntaxHighlighter with CodeRay and Pygments support | |
| # Please enter the commit message for your changes. Lines starting | |
| # with '#' will be ignored, and an empty message aborts the commit. | |
| # On branch syntax_highlighter | |
| # Changes to be committed: | |
| # (use "git reset HEAD^1 <file>..." to unstage) | |
| # | |
| # modified: lib/pdoc/generators/html/helpers.rb | |
| # modified: lib/pdoc/generators/html/syntax_highlighter.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/pdoc/generators/html/helpers.rb b/lib/pdoc/generators/html/helpers.rb | |
| index 625ab23..e92643d 100644 | |
| --- a/lib/pdoc/generators/html/helpers.rb | |
| +++ b/lib/pdoc/generators/html/helpers.rb | |
| @@ -21,6 +21,7 @@ module PDoc | |
| end | |
| def htmlize(markdown) | |
| + markdown = Website.syntax_highlighter.parse(markdown) | |
| Maruku.new(markdown).to_html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/pdoc/generators/html/helpers.rb b/lib/pdoc/generators/html/helpers.rb | |
| index 625ab23..e92643d 100644 | |
| --- a/lib/pdoc/generators/html/helpers.rb | |
| +++ b/lib/pdoc/generators/html/helpers.rb | |
| @@ -21,6 +21,7 @@ module PDoc | |
| end | |
| def htmlize(markdown) | |
| + markdown = Website.syntax_highlighter.parse(markdown) | |
| Maruku.new(markdown).to_html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/pdoc/generators/html/helpers.rb b/lib/pdoc/generators/html/helpers.rb | |
| index 625ab23..e92643d 100644 | |
| --- a/lib/pdoc/generators/html/helpers.rb | |
| +++ b/lib/pdoc/generators/html/helpers.rb | |
| @@ -21,6 +21,7 @@ module PDoc | |
| end | |
| def htmlize(markdown) | |
| + markdown = Website.syntax_highlighter.parse(markdown) | |
| Maruku.new(markdown).to_html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/pdoc/generators/html/website.rb b/lib/pdoc/generators/html/website.rb | |
| index 8f24872..26e5dc3 100644 | |
| --- a/lib/pdoc/generators/html/website.rb | |
| +++ b/lib/pdoc/generators/html/website.rb | |
| @@ -12,8 +12,8 @@ module PDoc | |
| def initialize(parser_output, options = {}) | |
| super | |
| - @templates_directory = options[:templates] || TEMPLATES_DIRECTORY | |
| - @index_page = options[:index_page] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Bouncer.tokenize(expression) -> [Array...] | |
| * - expression (String): Valid stripped CSS selector expression. | |
| * | |
| * Splits the given expression in an array whose elements represents | |
| * comma-separated grouped rules as specified in the | |
| * [CSS Specification](http://www.w3.org/TR/CSS2/selector.html#grouping). | |
| * | |
| * Each rule is in turn split into tokens which are objects with `symbol`, | |
| * `lexeme`, and `captures` properties : |