sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::DirectiveProcessor#extract_directives

Returns an Array of directive structures. Each structure
is an Array with the line number as the first element, the
directive name as the second element, followed by any
arguments.

    [[1, "require", "foo"], [2, "require", "bar"]]

Source | Google | Stack overflow

Edit

git clone [email protected]:rails/sprockets.git

cd sprockets

open lib/sprockets/directive_processor.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--DirectiveProcessor-extract_directives-for-pr


# Commit to git

git add lib/sprockets/directive_processor.rbgit commit -m "better docs for Sprockets::DirectiveProcessor#extract_directives"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Sprockets--DirectiveProcessor-extract_directives-for-pr

hub pull-request


# Celebrate!