From 722a045475996e34e28b4d4dd419f812be8c4064 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sat, 8 Feb 2014 11:11:25 -0500 Subject: [PATCH] Update CoffeeScript documentation (1.7.1) --- .../templates/pages/about_tmpl.coffee | 2 +- lib/docs/filters/coffeescript/entries.rb | 18 ++++++++++++++++-- lib/docs/scrapers/coffeescript.rb | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index e2d2e55f..03be6460 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -85,7 +85,7 @@ credits = [ 'https://raw.github.com/jashkenas/backbone/master/LICENSE' ], [ 'CoffeeScript', - '2009-2013 Jeremy Ashkenas', + '2009-2014 Jeremy Ashkenas', 'MIT', 'https://raw.github.com/jashkenas/coffee-script/master/LICENSE' ], [ diff --git a/lib/docs/filters/coffeescript/entries.rb b/lib/docs/filters/coffeescript/entries.rb index a229d4f2..3367f4ae 100644 --- a/lib/docs/filters/coffeescript/entries.rb +++ b/lib/docs/filters/coffeescript/entries.rb @@ -13,12 +13,14 @@ module Docs ['... splats', 'splats', 'Language'], ['for...in', 'loops', 'Statements'], ['for...in...by', 'loops', 'Statements'], + ['for...in...when', 'loops', 'Statements'], ['for...of', 'loops', 'Statements'], ['while', 'loops', 'Statements'], ['until', 'loops', 'Statements'], ['loop', 'loops', 'Statements'], ['do', 'loops', 'Statements'], ['Array slicing and splicing', 'slices', 'Language'], + ['Ranges', 'slices', 'Language'], ['Expressions', 'expressions', 'Language'], ['?', 'the-existential-operator', 'Operators'], ['?=', 'the-existential-operator', 'Operators'], @@ -35,8 +37,10 @@ module Docs ['Chained comparisons', 'comparisons', 'Language'], ['#{} interpolation', 'strings', 'Language'], ['Block strings', 'strings', 'Language'], + ['"""', 'strings', 'Language'], ['Block comments', 'strings', 'Language'], - ['Block regular expressions', 'regexes', 'Language'], + ['###', 'strings', 'Language'], + ['Block regexes', 'regexes', 'Language'], ['cake command', 'cake', 'Miscellaneous'], ['Cakefile', 'cake', 'Miscellaneous'], ['Source maps', 'source-maps', 'Miscellaneous'] @@ -49,7 +53,8 @@ module Docs css('.definitions td:first-child > code').each do |node| node.content.split(', ').each do |name| next if %w(true false yes no on off this).include?(name) - id = name.parameterize + name.sub! %r{\Aa (.+) b\z}, '\1' + id = name_to_id(name) node['id'] = id entries << [name, id, 'Operators'] end @@ -57,6 +62,15 @@ module Docs entries end + + def name_to_id(name) + case name + when '**' then 'pow' + when '//' then 'floor' + when '%%' then 'mod' + else name.parameterize + end + end end end end diff --git a/lib/docs/scrapers/coffeescript.rb b/lib/docs/scrapers/coffeescript.rb index ecd45040..51e9dcd1 100644 --- a/lib/docs/scrapers/coffeescript.rb +++ b/lib/docs/scrapers/coffeescript.rb @@ -2,7 +2,7 @@ module Docs class Coffeescript < UrlScraper self.name = 'CoffeeScript' self.type = 'coffeescript' - self.version = '1.6.3' + self.version = '1.7.1' self.base_url = 'http://coffeescript.org' html_filters.push 'coffeescript/clean_html', 'coffeescript/entries', 'title' @@ -12,7 +12,7 @@ module Docs options[:skip_links] = true options[:attribution] = <<-HTML - © 2009–2013 Jeremy Ashkenas
+ © 2009–2014 Jeremy Ashkenas
Licensed under the MIT License. HTML end