Skip to content
This repository has been archived by the owner. It is now read-only.

Require version file for checking capistrano version #2616

Merged
merged 3 commits into from Sep 1, 2013

Conversation

@sanemat
Copy link
Contributor

@sanemat sanemat commented Aug 30, 2013

bundler-1.4.0.pre.1 works fine, but bundler-1.4.0.pre.2 shows error below:

$ bundle exec cap production deploy
/path/to/bundler-1.4.0.pre.2/lib/bundler/capistrano.rb:7:in `<top (required)>': uninitialized constant Capistrano::Version (NameError)

This commit brings this error, so I add require version file.
1d7a789

bundler: 1.4.0.pre.2
capistrano: 2.14.2

bundler-1.4.0.pre.1 works fine, but bundler-1.4.0.pre.2 shows error below:
```
$ bundle exec cap production deploy
/path/to/bundler-1.4.0.pre.2/lib/bundler/capistrano.rb:7:in `<top (required)>': uninitialized constant Capistrano::Version (NameError)
```

This commit brings this error, so I add require version file.
1d7a789

bundler: 1.4.0.pre.2
capistrano: 2.14.2
@sanemat
Copy link
Contributor Author

@sanemat sanemat commented Aug 30, 2013

@kirs
Copy link
Contributor

@kirs kirs commented Aug 30, 2013

Sorry, my bad :(

@indirect
Copy link
Member

@indirect indirect commented Aug 30, 2013

Do all versions of capistrano supply capistrano/version? Or do we need to rescue the potential LoadError?

@sanemat
Copy link
Contributor Author

@sanemat sanemat commented Aug 30, 2013

@indirect
Ignore LoadError and check defined? const Capistrano::Version.

Future:
capistrano v3(at least 3.0.0.pre14)
capistrano/version exists, but I don't know this exists as ever.
(require 'capistrano' requires capistrano/version)

Past:
capistrano v1.3.0(2006-12-24) already had capistrano/version.
(require 'capistrano' does not require capistrano/version)

@indirect
Copy link
Member

@indirect indirect commented Aug 30, 2013

Sounds like we can simply check defined?(Capsitrano::VERSION) instead of requiring it ourselves, then, since we only care about the version if it's required automatically already.

@sanemat
Copy link
Contributor Author

@sanemat sanemat commented Aug 30, 2013

I agree 😃

@sanemat
Copy link
Contributor Author

@sanemat sanemat commented Aug 30, 2013

oops, I don't know capistrano v3 and later require 'capistrano requires capistrano/version as ever.

@sanemat
Copy link
Contributor Author

@sanemat sanemat commented Aug 30, 2013

It is not problem, so I simply check Capistrano::Version.

@sanemat
Copy link
Contributor Author

@sanemat sanemat commented Sep 1, 2013

@indirect Would you merge this?

@indirect
Copy link
Member

@indirect indirect commented Sep 1, 2013

I was waiting for the specs to be green, but I see it was a random failure. Thanks for the patch!

indirect added a commit that referenced this pull request Sep 1, 2013
Require version file for checking capistrano version
@indirect indirect merged commit 0ab0cd9 into rubygems:master Sep 1, 2013
1 check was pending
1 check was pending
default The Travis CI build is in progress
Details
@sanemat
Copy link
Contributor Author

@sanemat sanemat commented Sep 1, 2013

Thanks! 😍😍

@sanemat sanemat deleted the sanemat:fix/if-capistrano branch Sep 1, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.