scss.tmbundle

https://github.com/marioricalde/scss.tmbundle

The TextMate SCSS Official Bundle. Now Compatible with SublimeText2.

ExtractsPath#extract_ref

Given a string containing both a Git tree-ish, such as a branch or tag, and
a filesystem path joined by forward slashes, attempts to separate the two.

Expects a @project instance variable to contain the active project. This is
used to check the input against a list of valid repository refs.

Examples

  # No @project available
  extract_ref('master')
  # => ['', '']

  extract_ref('master')
  # => ['master', '']

  extract_ref("f4b14494ef6abf3d144c28e4af0c20143383e062/CHANGELOG")
  # => ['f4b14494ef6abf3d144c28e4af0c20143383e062', 'CHANGELOG']

  extract_ref("v2.0.0/README.md")
  # => ['v2.0.0', 'README.md']

  extract_ref('master/app/models/project.rb')
  # => ['master', 'app/models/project.rb']

  extract_ref('issues/1234/app/models/project.rb')
  # => ['issues/1234', 'app/models/project.rb']

  # Given an invalid branch, we fall back to just splitting on the first slash
  extract_ref('non/existent/branch/README.md')
  # => ['non', 'existent/branch/README.md']

Returns an Array where the first value is the tree-ish and the second is the
path

Source | Google | Stack overflow

Edit

git clone [email protected]:marioricalde/scss.tmbundle.git

cd scss.tmbundle

open

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-ExtractsPath-extract_ref-for-pr


# Commit to git

git add git commit -m "better docs for ExtractsPath#extract_ref"


# Open pull request

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

hub fork

git push <your name> -your-name--update-docs-ExtractsPath-extract_ref-for-pr

hub pull-request


# Celebrate!