summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2019-11-12[ruby/psych] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. I'm not sure if the untaint calls in deduplicate are still needed after the removal of tainting in the parser. If they are not needed, they should be removed. https://github.com/ruby/psych/commit/73c1a2b4e0
2019-11-12[ruby/psych] Set required_ruby_version to 2.4.0Jean Boussier
https://github.com/ruby/psych/commit/4f1746a3c6
2019-11-12Monitor#exit: check monitor ownership.Koichi Sasada
Monitor#exit should be called by only onwer Thread. However, there is not check for it.
2019-11-11Removed duplicate fileNobuyoshi Nakada
"./tests/test_helper.rb" and "tests/test_helper.rb" in `s.files` are same.
2019-11-09Remove unneeded exec bits from some filesDavid Rodríguez
I noticed that some files in rubygems were executable, and I could think of no reason why they should be. In general, I think ruby files should never have the executable bit set unless they include a shebang, so I run the following command over the whole repo: ```bash find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \; ``` Notes: Merged: https://github.com/ruby/ruby/pull/2662
2019-11-09Promote readline to default gems named readline-extHiroshi SHIBATA
2019-11-07Suppress unused variable warningNobuyoshi Nakada
2019-11-05Adjust a fucntion signatureNobuyoshi Nakada
2019-11-01Clean up implementation of SOCKSSocket, its confusing and undocumentedJustin McNally
Notes: Merged: https://github.com/ruby/ruby/pull/2539
2019-11-01Prefer libsocksd over libsocksJustin McNally
Notes: Merged: https://github.com/ruby/ruby/pull/2538
2019-11-01Support libsocksd socks library for SOCKSSocketJustin McNally
Notes: Merged: https://github.com/ruby/ruby/pull/2538
2019-11-01[ruby/date] Added update-zonetab targetNobuyoshi Nakada
https://github.com/ruby/date/commit/9bc6e30a82
2019-11-01[ruby/date] Add more timezone abbreviationsJeremy Evans
This gets the time zone abbreviations from https://www.timeanddate.com/time/zones/, and adds unambiguous time zones not already present in zonetab.list. See bin/update-abbr for the program used. This regenerates zonetab.h using prereq.mk (requires gperf). Only one test line is added, just to make sure a new time zone abbreviation is picked up. Fixes Ruby Bug 16286 https://github.com/ruby/date/commit/702e8b3033
2019-10-31[ruby/zlib] Removed no longer used variablesNobuyoshi Nakada
https://github.com/ruby/zlib/commit/3e98e4cac3
2019-10-31[ruby/zlib] Fix setting mtime to zero in GzipWriterAlan Wu
Before this change, it was not possible to write out zero for the timestamp part of a Gzip file's header, as calling GzipWriter#mtime with zero was ignored. Judging from the docs for `GzipWriter#mtime=`, it should be possible to indicate that no timestamp is available by calling the method with zero. https://github.com/ruby/zlib/commit/310be39cac
2019-10-31[ruby/stringio] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/stringio/commit/60ee9ccd95
2019-10-31[ruby/date] Revert "Simplify #inspect"Jeremy Evans
This reverts commit af01edd7d8575f544f647dbe8cde5b6ae535d459. Revert requested by Yui Naruse. https://github.com/ruby/date/commit/875d563557
2019-10-31[ruby/date] introduce Date::Error, raise Date::Error for everyglaszig
"invalid <anything>" type of exception https://github.com/ruby/date/commit/3e55c09ba4
2019-10-31[ruby/gdbm] Use Gemfile instead of ↵Hiroshi SHIBATA
Gem::Specification#add_development_dependency. https://github.com/ruby/gdbm/commit/bd2e7f6647
2019-10-31[ruby/gdbm] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/gdbm/commit/f9aaa1a08d
2019-10-31[ruby/zlib] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/zlib/commit/21711ed0ce
2019-10-30Update the latest versions from upstream repository of raccHiroshi SHIBATA
2019-10-26Update StringIO docs:zverok
* More explanations/examples in class docs; * Fix links to other methods (remove <code> tag); * Fix wording of method docs (remove *stringio* receiver name, as it is not rendered by modern RDoc); * Add option mention to linereading methods (added in 2.4); * Several other small fixes. Notes: Merged: https://github.com/ruby/ruby/pull/2615
2019-10-26[ruby/dbm] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/dbm/commit/1f0ff0bce1
2019-10-24Fix typo causing Date.new(year, month) to failJeremy Evans
Add a test for this case. Notes: Merged: https://github.com/ruby/ruby/pull/2605
2019-10-24Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"Hiroshi SHIBATA
This reverts commit ce6caade7c57a505f73086ccd7b33c14f7715f22. Notes: Merged: https://github.com/ruby/ruby/pull/2603
2019-10-24[ruby/fiddle] Remove taint support (#21)Jeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/fiddle/commit/18d6fb6915
2019-10-24[ruby/fiddle] Use ffi_closure_free by default. (#20)Vít Ondruch
* Use ffi_closure_free unconditionally. The current conditionals reflect historic heritage of FFI. Usage of ffi_closure_free should be better default nowadays, because libffi 3.0.5 fixing issues of ffi_closure_free should be widely available. * RUBY_LIBFFI_MODVERSION is not used anymore. Because `ffi_closure_free()` is not used unconditionally, there is no other use for RUBY_LIBFFI_MODVERSION define, so drop its usage. * Use more meaningful variable name. `ver` variable used to be used to pupulate RUBY_LIBFFI_MODVERSION define. Since the define was removed, the `libffi_dir` variable name should better describe the remaining usage of the variable. https://github.com/ruby/fiddle/commit/c49cc79eb8
2019-10-24[ruby/fiddle] Fiddle::Function must maintain a reference to the closureAaron Patterson
If the first parameter to Fiddle::Function is a closure object (rather than an interger), `rb_Integer` will cast it to an integer but not maintain a reference to the closure. Then if the closure gets GC'd, we have a segv. This commit keeps a reference to the original parameter to initialize so that the object will not be GC'd. Fixes: https://bugs.ruby-lang.org/issues/13286 https://github.com/ruby/fiddle/commit/0fc697bbc5
2019-10-24[ruby/date] Use Gemfile instead of ↵Hiroshi SHIBATA
Gem::Specification#add_development_dependency. https://github.com/ruby/date/commit/13c94362c2
2019-10-24[ruby/date] Update docszverok
https://github.com/ruby/date/commit/8c02586a98
2019-10-24[ruby/date] Simplify #inspectzverok
https://github.com/ruby/date/commit/af01edd7d8
2019-10-24[ruby/date] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous versions. https://github.com/ruby/date/commit/519470dc3b
2019-10-24[ruby/date] Support -Float::INFINITY...date rangesJeremy Evans
Fixes Ruby Bug 12961 https://github.com/ruby/date/commit/7f533c2552
2019-10-24[ruby/date] Check for numeric arguments in constructorsJeremy Evans
Previously, the type of these arguments were not checked, leading to NoMethodErrors in some cases, and TypeErrors in other cases, but not showing what field was having the problems. This change makes it so the field with the problem is included in the error message. For the valid_*? methods, this changes them to return false if one of the arguments that should be numeric is not. Fixes Ruby Bug 11935 Fixes Ruby Misc 15298 https://github.com/ruby/date/commit/a2f4b665f8
2019-10-24[ruby/date] Make julian dates roundtrip through to_time.to_dateJeremy Evans
Previously, julian dates would not round trip through to_time.to_date, because Time is always considered gregorian. This converts the Date instance from julian to gregorian before converting to Time, ensuring that an equal date object will be returned if converting that Time back to Date. This does result in julian Date objects showing different day values if converting to Time. Fixes Ruby Bug 8428. https://github.com/ruby/date/commit/d8df64555e
2019-10-21* expand tabs. [ci skip]git
Tabs were expanded because previously the file did not have any tab indentation. Please update your editor config, and use misc/expand_tabs.rb in the pre-commit hook.
2019-10-21Look up event ID offsets by token as indexNobuyoshi Nakada
2019-10-20Also BDOT2 and BDOT3 are operatorsNobuyoshi Nakada
2019-10-20Native MonitorMixin::ConditionVariable#waitKoichi Sasada
MonitorMixin::ConditionVariable#wait can be interrupted just after Monitor#exit_for_cond. So implementation in C.
2019-10-20delegate synchronize methodKoichi Sasada
Delegate MonitorMixin#synchronize body to Monitor#synchronize. It makes guarantee interrupt safe (because Monitor#synchronize is written in C). I thought Ruby implementation is also safe, but I got stuck failure <http://ci.rvm.jp/results/trunk_test@P895/2327639> so that I introduce this fix to guarantee interrupt safe.
2019-10-20make monitor.so for performance. (#2576)Koichi Sasada
Recent monitor.rb has performance problem because of interrupt handlers. 'Monitor#synchronize' is frequently used primitive so the performance of this method is important. This patch rewrite 'monitor.rb' with 'monitor.so' (C-extension) and make it faster. See [Feature #16255] for details. Monitor class objects are normal object which include MonitorMixin. This patch introduce a Monitor class which is implemented on C and MonitorMixin uses Monitor object as re-entrant (recursive) Mutex. This technique improve performance because we don't need to care atomicity and we don't need accesses to instance variables any more on Monitor class. Notes: Merged-By: ko1 <ko1@atdot.net>
2019-10-19Extend Ripper DSL to set to pseudo variables other than `$$`Nobuyoshi Nakada
2019-10-17Remove unused constant.Aaron Patterson
This constant isn't used, so lets remove it.
2019-10-17Look up constant instead of caching in a globalAaron Patterson
The global can go bad if the compactor runs, so we need to look up the constant instead of caching it in a global.
2019-10-14[flori/json] Add ascii_only option to JSON::Ext::Generator::State.new.Sho Hashimoto
https://github.com/flori/json/commit/0e99a9aac5
2019-10-14[flori/json] Add shortcut converting to StringWatson
In where to convert Hash key to String for json, this patch will add shortcut for String/Symbol in Hash key. ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 65.000 i/100ms Calculating ------------------------------------- json 659.576 (± 1.5%) i/s - 3.315k in 5.027127s ``` ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 78.000 i/100ms Calculating ------------------------------------- json 789.781 (± 2.7%) i/s - 3.978k in 5.041043s ``` ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id" => i, :age => 42, } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ``` https://github.com/flori/json/commit/38c0f6dbe4
2019-10-14[flori/json] Convert Hash object using rb_hash_foreach()Watson
To convert Hash convert, this part was using following pseudo code ``` obj.keys.each do |key| value = obj[key] ... end ``` and `rb_funcall()` was called for `obj.keys`. It might be slightly heavy to call the Ruby method. This patch will iterate to convert Hash object about key/value using `rb_hash_foreach()` Ruby API instead of `rb_funcall()`. ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 55.000 i/100ms Calculating ------------------------------------- json 558.501 (± 1.1%) i/s - 2.805k in 5.022986s ``` ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 65.000 i/100ms Calculating ------------------------------------- json 659.576 (± 1.5%) i/s - 3.315k in 5.027127s ``` ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id" => i, :age => 42, } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ``` https://github.com/flori/json/commit/a73323dc5e
2019-10-14[flori/json] Fixed unexpected illegal/malformed utf-8 errorNobuyoshi Nakada
flori/json@c34d01ff6a18dac04a90b2e0f820cdb1d5c7e1b2 does not consider US-ASCII compatible but non-UTF-8 encodings, and causes an error in RDoc tests. https://github.com/flori/json/commit/4f471bf590
2019-10-14[flori/json] Convert string encoding to UTF-8 only when neededWatson
## Before ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 129.000 i/100ms Calculating ------------------------------------- json 1.300k (± 2.3%) i/s - 6.579k in 5.064656s ``` ## After ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 189.000 i/100ms Calculating ------------------------------------- json 1.964k (± 3.3%) i/s - 9.828k in 5.011237s ``` ## Code ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id" => i, :age => 42, } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ``` https://github.com/flori/json/commit/c34d01ff6a