Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ext/strscan/strscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,7 @@ strscan_must_ascii_compat(VALUE str)
rb_must_asciicompat(str);
}

/* :nodoc: */
static VALUE
strscan_scan_base10_integer(VALUE self)
{
Expand Down Expand Up @@ -1315,6 +1316,7 @@ strscan_scan_base10_integer(VALUE self)
return strscan_parse_integer(p, 10, len);
}

/* :nodoc: */
static VALUE
strscan_scan_base16_integer(VALUE self)
{
Expand Down Expand Up @@ -2190,6 +2192,13 @@ strscan_named_captures(VALUE self)
Ruby Interface
======================================================================= */

/*
* Document-class: StringScanner::Error
*
* The error class for StringScanner.
* See StringScanner#unscan.
*/

/*
* Document-class: StringScanner
*
Expand Down Expand Up @@ -2226,6 +2235,7 @@ Init_strscan(void)
tmp = rb_str_new2("$Id$");
rb_obj_freeze(tmp);
rb_const_set(StringScanner, rb_intern("Id"), tmp);
rb_deprecate_constant(StringScanner, "Id");

rb_define_alloc_func(StringScanner, strscan_s_allocate);
rb_define_private_method(StringScanner, "initialize", strscan_initialize, -1);
Expand Down
5 changes: 0 additions & 5 deletions test/strscan/test_stringscanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ def test_const_Version
assert_equal(true, StringScanner::Version.frozen?)
end

def test_const_Id
assert_instance_of(String, StringScanner::Id)
assert_equal(true, StringScanner::Id.frozen?)
end

def test_inspect
str = 'test string'.dup
s = create_string_scanner(str, false)
Expand Down
9 changes: 3 additions & 6 deletions tool/sync_default_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def sync_default_gems(gem)
end

porcelain_status().each do |line|
/\A(?<x>.)(?<y>.) (?<path>.*)\z/ =~ line or raise
/\A(?:.)(?:.) (?<path>.*)\z/ =~ line or raise
if config.excluded?(path)
puts "Restoring excluded file: #{path}"
IO.popen(%W"git checkout --" + [path], "rb", &:read)
Expand Down Expand Up @@ -553,7 +553,7 @@ def resolve_conflicts(gem, sha, edit)
end

def collect_cacheinfo(tree)
cacheinfo = pipe_readlines(%W"git ls-tree -r -t -z #{tree}").filter_map do |line|
pipe_readlines(%W"git ls-tree -r -t -z #{tree}").filter_map do |line|
fields, path = line.split("\t", 2)
mode, type, object = fields.split(" ", 3)
next unless type == "blob"
Expand Down Expand Up @@ -640,12 +640,11 @@ def make_and_fixup_commit(gem, original_commit, cacheinfo, parent: nil, message:
end

def rewrite_commit(gem, sha)
config = REPOSITORIES[gem]
author, message = make_commit_info(gem, sha)
new_blobs = collect_cacheinfo("#{sha}")
new_rewritten, new_ignored = rewrite_cacheinfo(gem, new_blobs)

headers, orig_message = IO.popen(%W[git cat-file commit #{sha}], "rb", &:read).split("\n\n", 2)
headers, _ = IO.popen(%W[git cat-file commit #{sha}], "rb", &:read).split("\n\n", 2)
first_parent = headers[/^parent (.{40})$/, 1]
unless first_parent
# Root commit, first time to sync this repo
Expand Down Expand Up @@ -674,8 +673,6 @@ def rewrite_commit(gem, sha)
end

def pickup_commit(gem, sha, edit)
config = REPOSITORIES[gem]

rewritten = rewrite_commit(gem, sha)

# No changes remaining after rewriting
Expand Down