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: 9b4d8e960d74
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 86c8313b28f1
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Jan 29, 2015

  1. Copy the full SHA
    d70d45e View commit details
  2. Copy the full SHA
    ec4d2af View commit details
  3. MSpec: do not add a tag if there is already one with the same tag and…

    … description.
    
    * So adding comments do not provoke duplication of tags with `mspec tag`.
    * Reuse existing logic to read tags.
    eregon committed Jan 29, 2015
    Copy the full SHA
    86c8313 View commit details
Showing with 13 additions and 9 deletions.
  1. +9 −8 spec/mspec/lib/mspec/runner/mspec.rb
  2. +4 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/DirNodes.java
17 changes: 9 additions & 8 deletions spec/mspec/lib/mspec/runner/mspec.rb
Original file line number Diff line number Diff line change
@@ -293,7 +293,7 @@ def self.read_tags(keys)
f.each_line do |line|
line.chomp!
next if line.empty?
tag = SpecTag.new line.chomp
tag = SpecTag.new line
tags << tag if keys.include? tag.tag
end
end
@@ -315,16 +315,17 @@ def self.write_tags(tags)
# Writes +tag+ to the tag file if it does not already exist.
# Returns +true+ if the tag is written, +false+ otherwise.
def self.write_tag(tag)
string = tag.to_s
tags = read_tags([tag.tag])
tags.each do |t|
if t.tag == tag.tag and t.description == tag.description
return false
end
end

file = tags_file
path = File.dirname file
FileUtils.mkdir_p path unless File.exist? path
if File.exist? file
File.open(file, "rb") do |f|
f.each_line { |line| return false if line.chomp == string }
end
end
File.open(file, "ab") { |f| f.puts string }
File.open(file, "ab") { |f| f.puts tag.to_s }
return true
end

Original file line number Diff line number Diff line change
@@ -145,8 +145,11 @@ private static RubyArray glob(final RubyContext context, String glob) {
// Get the first star
final int firstStar = absoluteGlob.indexOf('*');

// If there's no star, there's nothing to glob. Return an empty result set.
// If there's no star, it behaves similarly to [glob if File.exist?(glob)].compact
if (firstStar == -1) {
if (new File(glob).exists()) {
array.slowPush(context.makeString(glob));
}
return array;
}