sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::PathUtils#split_subpath

Internal: Get relative path for root path and subpath.

path    - String path
subpath - String subpath of path

Returns relative String path if subpath is a subpath of path, or nil if
subpath is outside of path.

Source | Google | Stack overflow

Edit

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

cd sprockets

open lib/sprockets/path_utils.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--PathUtils-split_subpath-for-pr


# Commit to git

git add lib/sprockets/path_utils.rbgit commit -m "better docs for Sprockets::PathUtils#split_subpath"


# 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--PathUtils-split_subpath-for-pr

hub pull-request


# Celebrate!