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
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ releases.
* 0.1.12 to [v0.1.13][repl_type_completor-v0.1.13], [v0.1.14][repl_type_completor-v0.1.14], [v0.1.15][repl_type_completor-v0.1.15]
* pstore 0.2.1
* 0.2.0 to [v0.2.1][pstore-v0.2.1]
* rdoc 7.2.0
* rdoc 8.0.0
* 7.0.3 to [v7.0.4][rdoc-v7.0.4], [v7.1.0][rdoc-v7.1.0], [v7.2.0][rdoc-v7.2.0]
* win32ole 1.9.3
* 1.9.2 to [v1.9.3][win32ole-v1.9.3]
Expand Down
25 changes: 24 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,30 @@ yes-test-bundled-gems-spec: yes-test-all-precheck $(PREPARE_BUNDLED_GEMS)
no-test-bundled-gems-spec:


test-syntax-suggest:
test-syntax-suggest-precheck: $(TEST_RUNNABLE)-test-syntax-suggest-precheck
no-test-syntax-suggest-precheck:
yes-test-syntax-suggest-precheck: main

test-syntax-suggest-prepare: $(TEST_RUNNABLE)-test-syntax-suggest-prepare
no-test-syntax-suggest-prepare: no-test-syntax-suggest-precheck
yes-test-syntax-suggest-prepare: yes-test-syntax-suggest-precheck
$(ACTIONS_GROUP)
$(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
--install-dir .bundle --conservative "rspec:~> 3"
$(ACTIONS_ENDGROUP)

RSPECOPTS =
SYNTAX_SUGGEST_SPECS =
PREPARE_SYNTAX_SUGGEST = $(TEST_RUNNABLE)-test-syntax-suggest-prepare
test-syntax-suggest: $(TEST_RUNNABLE)-test-syntax-suggest
yes-test-syntax-suggest: $(PREPARE_SYNTAX_SUGGEST)
$(ACTIONS_GROUP)
$(XRUBY) -C $(srcdir) -Ispec/syntax_suggest$(PATH_SEPARATOR)spec/lib .bundle/bin/rspec \
--require rspec/expectations \
--require spec_helper --require formatter_overrides --require spec_coverage \
$(RSPECOPTS) spec/syntax_suggest/$(SYNTAX_SUGGEST_SPECS)
$(ACTIONS_ENDGROUP)
no-test-syntax-suggest:

check: $(DOT_WAIT) $(PREPARE_SYNTAX_SUGGEST) test-syntax-suggest

Expand Down
7 changes: 7 additions & 0 deletions ext/json/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,13 @@ static inline VALUE json_decode_float(JSON_ParserConfig *config, uint64_t mantis
}

if (RB_UNLIKELY(mantissa_digits > 18 || mantissa_digits + exponent < -307)) {
// If the value is so small that it definitely underflows to 0.0, return early
// to avoid triggering a "Float out of range" warning from rb_cstr_to_dbl.
// When mantissa_digits + exponent < -324, value < 10^(-324) < DBL_TRUE_MIN/2,
// so it rounds to 0 in IEEE 754 round-to-nearest.
if (RB_UNLIKELY(mantissa_digits + exponent < -324)) {
return rb_float_new(negative ? -0.0 : 0.0);
}
return json_decode_large_float(start, end - start);
}

Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ostruct 0.6.3 https://github.com/ruby/ostruct
pstore 0.2.1 https://github.com/ruby/pstore
benchmark 0.5.0 https://github.com/ruby/benchmark
logger 1.7.0 https://github.com/ruby/logger
rdoc 7.2.0 https://github.com/ruby/rdoc a8df5c5d03b63cf05425bf676644688ac673a329
rdoc 8.0.0 https://github.com/ruby/rdoc
win32ole 1.9.3 https://github.com/ruby/win32ole
irb 1.18.0 https://github.com/ruby/irb
reline 0.6.3 https://github.com/ruby/reline
Expand Down
62 changes: 39 additions & 23 deletions set.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,14 +750,16 @@ set_i_add(VALUE set, VALUE item)

/*
* call-seq:
* add?(obj) -> self or nil
* add?(object) -> self or nil
*
* Adds the given object to the set and returns self. If the object is
* already in the set, returns nil.
* Like #add, but returns +nil+ if +object+ is already in +self+:
*
* Set[1, 2].add?(3) #=> Set[1, 2, 3]
* Set[1, 2].add?([3, 4]) #=> Set[1, 2, [3, 4]]
* Set[1, 2].add?(2) #=> nil
* set = Set[0, 1, 2]
* set.add?(:foo) # => Set[0, 1, 2, :foo]
* set.add?(0..9) # => Set[0, 1, 2, :foo, 0..9]
* set.add?(2) # => nil
*
* Related: see {Methods for Assigning}[rdoc-ref:Set@Methods+for+Assigning].
*/
static VALUE
set_i_add_p(VALUE set, VALUE item)
Expand Down Expand Up @@ -875,21 +877,23 @@ set_classify_i(st_data_t key, st_data_t tmp)

/*
* call-seq:
* classify { |o| ... } -> hash
* classify {|element| ... } -> hash
* classify -> enumerator
*
* Classifies the set by the return value of the given block and
* returns a hash of {value => set of elements} pairs. The block is
* called once for each element of the set, passing the element as
* parameter.
* With a block given, calls the block with each element of +self+;
* returns a hash whose keys are the block's return values.
* The value for each key is a set containing the elements
* for which the block returned that key.
*
* files = Set.new(Dir.glob("*.rb"))
* hash = files.classify { |f| File.mtime(f).year }
* hash #=> {2000 => Set["a.rb", "b.rb"],
* # 2001 => Set["c.rb", "d.rb", "e.rb"],
* # 2002 => Set["f.rb"]}
* This example classifies elements by their classes:
*
* Returns an enumerator if no block is given.
* set = Set[*(5..7), *%w[foo bar]] # => Set[5, 6, 7, "foo", "bar"]
* set.classify {|element| element.class }
* # => {Integer => Set[5, 6, 7], String => Set["foo", "bar"]}
*
* With no block given, returns an Enumerator.
*
* Related: see {Methods for Converting}[rdoc-ref:Set@Methods+for+Converting].
*/
static VALUE
set_i_classify(VALUE set)
Expand Down Expand Up @@ -1313,14 +1317,26 @@ set_xor_i(st_data_t key, st_data_t data)

/*
* call-seq:
* set ^ enum -> new_set
* self ^ enumerable -> new_set
*
* Returns a new set containing elements exclusive between the set and the
* given enumerable object. <tt>(set ^ enum)</tt> is equivalent to
* <tt>((set | enum) - (set & enum))</tt>.
* Returns a new \Set object containing
* the {exclusive OR}[https://en.wikipedia.org/wiki/Exclusive_or]
* of +self+ and the given +enumerable+;
* that is, containing each element that is in either +self+ or +enumerable+,
* but not in both:
*
* set = Set[0, 1, 2]
* set ^ Set[1, 2, 3] # => Set[0, 3]
* set ^ Set[2, 1] # => Set[0]
* set ^ Set[2, *('a'..'c')] # => Set[0, 1, "a", "b", "c"]
* set ^ Set[2, 1, 0] # => Set[]
*
* Set[1, 2] ^ Set[2, 3] #=> Set[3, 1]
* Set[1, 'b', 'c'] ^ ['b', 'd'] #=> Set["d", 1, "c"]
* For \Set +set+ and \Enumerable +enumerable+, these expressions are equivalent:
*
* set ^ enumerable
* ((set | enumerable) - (set & enumerable))
*
* Related: see {Methods for Set Operations}[rdoc-ref:Set@Methods+for+Set+Operations].
*/
static VALUE
set_i_xor(VALUE set, VALUE other)
Expand Down
25 changes: 0 additions & 25 deletions template/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -733,30 +733,5 @@ yes-test-leaked-globals: yes-test-leaked-globals-precheck
$(COMMONOBJS) $(LIBRUBY_FOR_LEAKED_GLOBALS:yes=$(LIBRUBY_SO))
$(ACTIONS_ENDGROUP)

test-syntax-suggest-precheck: $(TEST_RUNNABLE)-test-syntax-suggest-precheck
no-test-syntax-suggest-precheck:
yes-test-syntax-suggest-precheck: main

test-syntax-suggest-prepare: $(TEST_RUNNABLE)-test-syntax-suggest-prepare
no-test-syntax-suggest-prepare: no-test-syntax-suggest-precheck
yes-test-syntax-suggest-prepare: yes-test-syntax-suggest-precheck
$(ACTIONS_GROUP)
$(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
--install-dir .bundle --conservative "rspec:~> 3"
$(ACTIONS_ENDGROUP)

RSPECOPTS =
SYNTAX_SUGGEST_SPECS =
PREPARE_SYNTAX_SUGGEST = $(TEST_RUNNABLE)-test-syntax-suggest-prepare
test-syntax-suggest: $(TEST_RUNNABLE)-test-syntax-suggest
yes-test-syntax-suggest: $(PREPARE_SYNTAX_SUGGEST)
$(ACTIONS_GROUP)
$(XRUBY) -C $(srcdir) -Ispec/syntax_suggest:spec/lib .bundle/bin/rspec \
--require rspec/expectations \
--require spec_helper --require formatter_overrides --require spec_coverage \
$(RSPECOPTS) spec/syntax_suggest/$(SYNTAX_SUGGEST_SPECS)
$(ACTIONS_ENDGROUP)
no-test-syntax-suggest:

yesterday:
$(GIT_IN_SRC) reset --hard `TZ=UTC-9 $(GIT_LOG_FORMAT)%H -1 --before=00:00`