Commit graph

113 commits

Author SHA1 Message Date
Jason Karns
14750a0b93 Extract has_checksum_support predicate function
- Remove unnecessary HAS_X_SUPPORT variables
- Merge conditional for unsetting mirror-url
- Memoize has_checksum_support function
2016-01-18 23:27:01 -05:00
Jason Karns
26af69a9d3 Unknown checksum algorithms (based on length) are errors 2016-01-18 23:27:01 -05:00
Mislav Marohnić
981a34425e Merge pull request #888 from jasonkarns/test-assertions
Leverage assert_success helper
2016-01-19 11:49:37 +11:00
Jason Karns
29a987c9fb Include --version in completions 2016-01-18 12:12:09 -05:00
Jason Karns
9ff6402e43 Leverage assert_success helper
And separate test body into arrange-act-assert blocks via newlines
2016-01-18 11:49:59 -05:00
Tatsuhiko Miyagawa
55ffea164a Skip mirror if the URL is cache.ruby-lang.org (Fastly) and there's no custom mirror set 2015-12-16 16:29:24 +01:00
Mislav Marohnić
eef6a2ed8e Merge pull request #841 from jasonkarns/rbenv-completions
Provide completion of flags for install/uninstall
2015-12-08 10:17:31 +01:00
Chulki Lee
866dacc0b4 update urls to rbenv 2015-12-07 14:17:04 -08:00
Jason Karns
273dab13b3 include flags in nodenv-install completions 2015-12-04 16:44:36 -05:00
Jason Karns
4ff6d72900 safer teardown 2015-12-02 13:55:36 -05:00
Mislav Marohnić
bd222051df Allow space-separated LDFLAGS arguments
Fixes #829, closes #830
2015-11-16 11:07:18 +01:00
Reed Loden
a902621171 Update RUBY_BUILD_MIRROR_URL to use https:// 2015-07-20 12:45:12 -07:00
Erik Michaels-Ober
b7237690e6 Merge pull request #766 from jasonkarns/remove-sed-fallback
remove sed fallback for help/usage
2015-07-19 11:59:57 +02:00
Reed Loden
058917cd1c Fix typo in test/arguments.bats (s/enought/enough/) 2015-07-17 23:50:18 -07:00
Tester
5013fa8b40 use head instead of function w/ sed 2015-06-03 00:19:41 -04:00
Tester
1f4843da56 just mock invocation, not output 2015-06-02 15:42:18 -04:00
Tester
9b240932b9 remove assertions of mocked output 2015-06-02 15:41:12 -04:00
Tester
ddb12e2e8b find bin dir relative to bats test dir 2015-06-02 15:40:13 -04:00
Tester
85a01065d1 assert that rbenv-install/uninstall scripts have usage section preface 2015-06-02 14:53:04 -04:00
Tester
f2f77388ff make the rbenv-help stub strictly match args 2015-06-02 10:11:36 -04:00
Tester
a102309067 fix tests
stub rbenv-help for rbenv-install and rbenv-uninstall help messages
2015-06-02 09:59:13 -04:00
Ben Browning
4c0df6afdb Properly detect OpenJDK versions in bin/ruby-build
OpenJDK reports its version slightly different than Oracle Java, and
this was causing the logic in bin/ruby-build to not detect Java 7 or
higher when OpenJDK was used.
2015-04-29 10:39:40 -04:00
Simon Hürlimann (CyT)
f2a43c5554 Add 'cd -' to proposed steps to upgrade ruby-build
When a target is not found, rbenv-install proposes pulling changes from
upstream. This involves changing the directory to the ruby-build checkout.

This patch adds a '&& cd -' to change the working directory back to where
we've been. Should work on at least Bash and Zsh.
2015-04-14 00:03:00 +02:00
Mislav Marohnić
4c1f8842e6 Avoid double shebangs when fixing Rubinius gem binstubs
This is to fix the error when installing new gems that have executables
which match existing binstubs in the Rubinius bin directory:

    "bundle" from bundler conflicts with PREFIX/gems/bin/bundle

RubyGems is supposed to override the binstub if it detects that the
previous one was also generated by RubyGems for the gem of the same
name, but its detection mechanism gets thrown off by having a double
shebang as a result of our binstubs fixing process.

https://github.com/rubygems/rubygems/blob/v2.2.2/lib/rubygems/installer.rb#L149-L154

This avoids generating binstubs with a double shebang.
2015-01-29 01:36:04 -08:00
Mislav Marohnić
7f1d8df3fe Read Java version number even if it's not on the 1st line
Handles output like:

    Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
    java version "1.8.0_31"

Fixes #710
2015-01-21 16:51:29 -08:00
Mislav Marohnić
34246f9f2e Have rbenv-uninstall respect -h|--help 2014-11-26 20:46:44 -08:00
Mislav Marohnić
96d9cbe77c Move rbenv-install/uninstall tests to rbenv.bats 2014-11-26 20:46:44 -08:00
Mislav Marohnić
3ae43a44e2 Capitalize "Usage:" header for consistency with rbenv help system 2014-11-26 20:46:44 -08:00
Mislav Marohnić
38ae3b56b0 Improve ruby-build test for too many arguments
Use exactly the same arguments that would have `ruby-build` succeed at
executing, but add one more extra to test argument counting.
2014-11-26 20:46:44 -08:00
Ivan Kuchin
fa38b660e2 Abort with usage help on wrong number of CLI arguments
- rbenv-install accepts 0 or 1 argument
- rbenv-uninstall accepts 1 argument
- ruby-build accepts 2 arguments
2014-11-26 20:45:53 -08:00
Mislav Marohnić
ff2b5dc90e Ensure that assert_output_contains receives an argument 2014-11-17 15:07:40 -08:00
Mislav Marohnić
7f1869cbcd Fix error message assertions in JRuby tests
`assert_failure` only accepts an expected message as argument, and only
if it matches the output in full.
2014-11-17 14:56:06 -08:00
Mislav Marohnić
19a59f42cc Ignore RUBY_CONFIGURE_OPTS from environment in testing
Avoids failures caused by somebody's environment possibly having
RUBY_CONFIGURE_OPTS exported to have a value.
2014-11-16 16:07:39 -08:00
Mislav Marohnić
e8a97b10f6 Fix the test suite on Darwin
Setting CC makes sure that we never have to perform the Darwin-specific
check for whether we should default to `CC=clang` and thus break `uname`
stubs in unrelated tests.

CI never caught this because Travis already has CC set to gcc-4.6.
2014-10-31 04:13:57 +01:00
Mislav Marohnić
fc6e0ae69d Fix comparing OS X version when it has 3 components 2014-10-31 04:08:00 +01:00
Mislav Marohnić
ffcb7ed67f Add test that ensures duplicate Ruby definitions don't get displayed 2014-10-28 19:30:01 +01:00
Mislav Marohnić
194e007e62 Merge branch 'yosemite'
Fixes #651, fixes #648
2014-10-28 18:52:50 +01:00
Mislav Marohnić
84d61e8675 Unset CC to isolate from CI build environment 2014-10-28 18:03:14 +01:00
Mislav Marohnić
f104098909 Fix rbx-1.2.4 setup phase
Rubinius back then didn't have a Gemfile, so don't try to invoke `bundle`.
Instead, rely on the host Ruby to already have rake installed.
2014-10-28 15:41:09 +01:00
Mislav Marohnić
6e39eb52a8 Use CC=clang by default on Yosemite to avoid gcc-4.2
Newer MRIs will pick up gcc-4.2 from PATH and use that instead of
`/usr/bin/gcc`. While this worked up till now, it will not work in
Yosemite anymore since Homebrew's apple-gcc42 is generally not
compatible with 10.10.

So when CC has not explicitly been set, set it to `clang` to avoid
searching the PATH for any other gcc versions. This fixes MRI builds on
systems where apple-gcc42 is installed.
2014-10-28 15:28:07 +01:00
Mislav Marohnić
dafba300b1 Silence warnings when testing gccs
This silences the warning that gcc-4.2 produces on Yosemite:

    couldn't understand kern.osversion `14.0.0'
2014-10-28 10:59:01 +01:00
Mislav Marohnić
10fd04909d Fix Yosemite builds that use gcc-4.2 through require_gcc
The definitions that use `require_gcc` are not compatible with Apple's
clang-powered `gcc` and need gcc-4.2 from Homebrew. However, builds
using gcc-4.2 fail on Yosemite with a warning:

    couldn't understand kern.osversion `14.0.0'

Although the warning is non-fatal, the build goes to shit from there. It
seems that setting the magical value `MACOSX_DEPLOYMENT_TARGET=10.9`
makes the build work and doesn't seem to have negative consequences.
2014-10-28 10:58:38 +01:00
Mislav Marohnić
4ef4ed4cd1 Merge pull request #633 from sstephenson/upgrade-instructions
Show specific upgrade instructions based on environment
2014-09-11 10:30:47 -07:00
Mislav Marohnić
e754d67e14 Fix test to compensate for different ls output on Fedora/Centos 2014-09-09 00:03:18 -07:00
Mislav Marohnić
aa4a237f79 Show specific upgrade instructions based on environment
Because ruby-build is both a Homebrew formula and an rbenv plugin, some
people end up with both installed. In these cases, executing
`rbenv install` vs. `ruby-build` might not use the same install. Users
end up being unsure where `rbenv install` is coming from and upgrading
it from the wrong location.

This detect whether ruby-build is contained in Homebrew or git and shows
upgrade instructions accordingly. Example:

    See all available versions with \`rbenv install --list'.

    If the version you need is missing, try upgrading ruby-build:

      brew update && brew upgrade ruby-build
2014-09-08 22:23:23 -07:00
Mislav Marohnić
56c8f296ce rbenv install completion includes definitions from plugins
Before, `ruby-build --definitions` was invoked sooner than
RUBY_BUILD_DEFINITIONS was built up with paths from rbenv plugins.
2014-09-08 20:14:33 -07:00
Mislav Marohnić
0170728de9 Merge pull request #630 from sstephenson/freebsd-make
On FreeBSD 10, stop defaulting to MAKE=gmake
2014-09-08 13:38:01 -07:00
Mislav Marohnić
323c2b778b Sort Ruby versions when listing available definitions
Stable releases should now be sorted as a higher version than preview
releases or RCs. For instance:

- 1.9.3-preview < 1.9.3-rc1 < 1.9.3-p0
- 2.1.0-dev < 2.1.0-rc1 < 2.1.0
- jruby-1.7.0-preview1 < jruby-1.7.0-rc1 < jruby-1.7.0
2014-09-08 13:06:48 -07:00
Mislav Marohnić
0e58079d66 On FreeBSD, stop defaulting to MAKE=gmake
It appears that regular `make` that ships on FreeBSD 10 is compatible
enough to build Rubies. This enables ruby-build on fresh FreeBSD
installs (which don't have `gmake` by default) without having to
explicitly set `MAKE=make`.
2014-09-08 09:52:15 -07:00
Mislav Marohnić
f4c2fe67e3 Fix detecting of CPU cores on FreeBSD
On FreeBSD, use the same approach as OS X with `sysctl`.
2014-09-08 09:11:39 -07:00