rharriso / bower-rails

Bundler-like DSL + rake tasks for Bower on Rails
MIT License
1.46k stars 128 forks source link

`github: 'my/own_branch'` is somehow ignored #80

Closed jmuheim closed 10 years ago

jmuheim commented 10 years ago

I have forked BootstrapFormHelpers and added the main directive to it and created a PR.

As long as the PR isn't merged, I'd like to use my own branch.

asset 'bootstrap-formhelpers', github: 'jmuheim/BootstrapFormHelpers'

When installing, it seems that bower uses the correct repo:

bower bootstrap-formhelpers#*       not-cached git://github.com/jmuheim/BootstrapFormHelpers.git#*
bower bootstrap-formhelpers#*          resolve git://github.com/jmuheim/BootstrapFormHelpers.git#*
bower bootstrap-formhelpers#*         download https://github.com/jmuheim/BootstrapFormHelpers/archive/2.3.0.tar.gz

Sadly, in the vendor/assets/bower_components/bootstrap-formhelpers/bower.json file, the main directive is still missing!

But in the used branch it clearly is there, see: https://github.com/jmuheim/BootstrapFormHelpers/blob/master/bower.json

What could have gone wrong here?

SergeyKishenin commented 10 years ago

Seems like it's fetching the latest 2.3.0 release, because branch is not specified.

SergeyKishenin commented 10 years ago

But specifying branch is a bad practice: http://stackoverflow.com/a/15786541/532252.

Try asset 'bootstrap-formhelpers', 'git://github.com/someone/some-package.git#<sha>' unless sha option is supported for bower-rails.

SergeyKishenin commented 10 years ago

Actually, now you can pass SHA as version like:

asset 'bootstrap-formhelpers', '<sha>', github: 'someone/some-package.git'

jmuheim commented 10 years ago

At the time being, I decided to do as described above:

asset 'bootstrap-formhelpers', # A set of JavaScript to help create user friendly forms
      'b69c70158c077449ae2a83f8ac13024944278356',
      github: 'jmuheim/BootstrapFormHelpers' # Use this until https://github.com/winmarkltd/BootstrapFormHelpers/pull/219 is merged

Still, I'd rather just use a branch name. I understand that this is risky, but Bundler allows it, too.