Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5b57945b3c17
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 088e62c74f95
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 27, 2014

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    nomadium Miguel Landaeta
    Copy the full SHA
    f765750 View commit details
  2. Support the highly desired $-0

    enebo committed Oct 27, 2014

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    nomadium Miguel Landaeta
    Copy the full SHA
    088e62c View commit details
Showing with 3 additions and 15 deletions.
  1. +1 −10 bin/ast
  2. +2 −0 core/src/main/java/org/jruby/RubyGlobal.java
  3. +0 −5 spec/tags/ruby/language/predefined_tags.txt
11 changes: 1 addition & 10 deletions bin/ast
Original file line number Diff line number Diff line change
@@ -14,15 +14,6 @@ options = {
:dot_format => false
}

def get_ir_passes
ir_manager = org.jruby.ir.IRManager
ir_manager.DEFAULT_COMPILER_PASSES.split(',').map do |pass|
pass.to_sym
end
end

ir_passes = get_ir_passes

OptionParser.new do |opts|
opts.banner = "Usage: #{$0} [options]"

@@ -39,7 +30,7 @@ OptionParser.new do |opts|
options[:print_ir] = true
end

opts.on('-p', "--pass #{ir_passes}", ir_passes, 'Dump IR after running a pass') do |pass|
opts.on('-p', '--pass passes_list', 'Dump IR after running a pass') do |pass|
options[:print_pass] = pass
end

2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/RubyGlobal.java
Original file line number Diff line number Diff line change
@@ -245,6 +245,8 @@ public static void createGlobals(ThreadContext context, Ruby runtime) {
// ARGF, $< object
RubyArgsFile.initArgsFile(runtime);

globals.alias("$-0", "$/");

// Define aliases originally in the "English.rb" stdlib
globals.alias("$ERROR_INFO", "$!");
globals.alias("$ERROR_POSITION", "$@");
5 changes: 0 additions & 5 deletions spec/tags/ruby/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -29,9 +29,4 @@ fails:Predefined global $' sets an empty result to the encoding of the source St
fails:Predefined global $+ sets the encoding to the encoding of the source String
fails:Predefined globals $1..N sets the encoding to the encoding of the source String
fails:Global variable $0 raises a TypeError when not given an object that can be coerced to a String
fails:Predefined global $/ changes $-0
fails:Predefined global $-0 changes $/
fails:Predefined global $-0 does not call #to_str to convert the object to a String
fails:Predefined global $-0 raises a TypeError if assigned a Fixnum
fails:Predefined global $-0 raises a TypeError if assigned a boolean
fails:Global variable $0 actually sets the program name