[DRE-commits] [nanoc] 03/07: add missing identifier file

Cédric Boutillier boutil at moszumanska.debian.org
Fri Feb 14 11:17:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository nanoc.

commit 8651fc5fab87c0d7dcbc89ac6a504fa7ef8076cb
Author: Cédric Boutillier <boutil at debian.org>
Date:   Fri Feb 14 11:33:29 2014 +0100

    add missing identifier file
---
 debian/copyright     |  5 +++++
 debian/identifier.rb | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/debian/copyright b/debian/copyright
index bf38a12..054d54f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -11,6 +11,11 @@ Files: debian/*
 Copyright: 2013 Cédric Boutillier <boutil at debian.org>
 License: Expat
 
+Files: debian/identifier.rb
+Copyright: 2007-2013 Denis Defreyne <denis.defreyne at stoneship.org>
+License: Expat
+Comment: this file from the original source is missing from the tarball
+
 License: Expat
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
diff --git a/debian/identifier.rb b/debian/identifier.rb
new file mode 100644
index 0000000..8991f9f
--- /dev/null
+++ b/debian/identifier.rb
@@ -0,0 +1,34 @@
+class NanocIdentifierHandler < ::YARD::Handlers::Ruby::AttributeHandler
+
+  # e.g. identifier :foo, :bar
+
+  handles method_call(:identifier), method_call(:identifiers)
+  namespace_only
+
+  def process
+    identifiers = statement.parameters(false).map { |param| param.jump(:ident)[0] }
+    namespace['nanoc_identifiers'] = identifiers
+  end
+
+end
+
+class NanocRegisterFilterHandler < ::YARD::Handlers::Ruby::AttributeHandler
+
+  # e.g. Nanoc::Filter.register '::Nanoc::Filters::AsciiDoc', :asciidoc
+
+  handles method_call(:register)
+  namespace_only
+
+  def process
+    target = statement.jump(:const_path_ref)
+    return if target != s(:const_path_ref, s(:var_ref, s(:const, "Nanoc")), s(:const, "Filter"))
+
+    class_name = statement.jump(:string_literal).jump(:tstring_content)[0]
+    identifier = statement.jump(:symbol_literal).jump(:ident)[0]
+
+    obj = YARD::Registry.at(class_name.sub(/^::/, ''))
+    obj['nanoc_identifiers'] ||= []
+    obj['nanoc_identifiers'] << identifier
+  end
+
+end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/nanoc.git



More information about the Pkg-ruby-extras-commits mailing list