aboutsummaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unneeded exec bits from some filesDavid Rodríguez2019-11-097-0/+0
| | | | | | | | | | | | | 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' _ {} \; ```
* Promote readline to default gems named readline-extHiroshi SHIBATA2019-11-091-0/+21
|
* Suppress unused variable warningNobuyoshi Nakada2019-11-071-1/+1
|
* Adjust a fucntion signatureNobuyoshi Nakada2019-11-051-2/+8
|
* Clean up implementation of SOCKSSocket, its confusing and undocumentedJustin McNally2019-11-011-4/+10
|
* Prefer libsocksd over libsocksJustin McNally2019-11-011-1/+1
|
* Support libsocksd socks library for SOCKSSocketJustin McNally2019-11-011-1/+1
|
* [ruby/date] Added update-zonetab targetNobuyoshi Nakada2019-11-012-0/+39
| | | | https://github.com/ruby/date/commit/9bc6e30a82
* [ruby/date] Add more timezone abbreviationsJeremy Evans2019-11-012-689/+1460
| | | | | | | | | | | | | | | | 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
* [ruby/zlib] Removed no longer used variablesNobuyoshi Nakada2019-10-311-2/+1
| | | | https://github.com/ruby/zlib/commit/3e98e4cac3
* [ruby/zlib] Fix setting mtime to zero in GzipWriterAlan Wu2019-10-311-1/+3
| | | | | | | | | | | 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
* [ruby/stringio] Remove taint supportJeremy Evans2019-10-311-4/+0
| | | | | | | | 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
* [ruby/date] Revert "Simplify #inspect"Jeremy Evans2019-10-311-2/+5
| | | | | | | | This reverts commit af01edd7d8575f544f647dbe8cde5b6ae535d459. Revert requested by Yui Naruse. https://github.com/ruby/date/commit/875d563557
* [ruby/date] introduce Date::Error, raise Date::Error for everyglaszig2019-10-311-30/+32
| | | | | | "invalid <anything>" type of exception https://github.com/ruby/date/commit/3e55c09ba4
* [ruby/gdbm] Use Gemfile instead of ↵Hiroshi SHIBATA2019-10-311-5/+0
| | | | | | Gem::Specification#add_development_dependency. https://github.com/ruby/gdbm/commit/bd2e7f6647
* [ruby/gdbm] Remove taint supportJeremy Evans2019-10-311-3/+0
| | | | | | | | 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
* [ruby/zlib] Remove taint supportJeremy Evans2019-10-311-35/+1
| | | | | | | | 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
* Update the latest versions from upstream repository of raccHiroshi SHIBATA2019-10-301-1/+1
|
* Update StringIO docs:zverok2019-10-261-41/+56
| | | | | | | | | | | * 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.
* [ruby/dbm] Remove taint supportJeremy Evans2019-10-261-22/+21
| | | | | | | | 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
* Fix typo causing Date.new(year, month) to failJeremy Evans2019-10-241-1/+1
| | | | Add a test for this case.
* Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"Hiroshi SHIBATA2019-10-242-6/+42
| | | | This reverts commit ce6caade7c57a505f73086ccd7b33c14f7715f22.
* [ruby/fiddle] Remove taint support (#21)Jeremy Evans2019-10-243-21/+8
| | | | | | | 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
* [ruby/fiddle] Use ffi_closure_free by default. (#20)Vít Ondruch2019-10-242-42/+6
| | | | | | | | | | | | | | | | | | | | | * 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
* [ruby/fiddle] Fiddle::Function must maintain a reference to the closureAaron Patterson2019-10-241-0/+2
| | | | | | | | | | | | 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
* [ruby/date] Use Gemfile instead of ↵Hiroshi SHIBATA2019-10-241-2/+0
| | | | | | Gem::Specification#add_development_dependency. https://github.com/ruby/date/commit/13c94362c2
* [ruby/date] Update docszverok2019-10-241-2/+2
| | | | https://github.com/ruby/date/commit/8c02586a98
* [ruby/date] Simplify #inspectzverok2019-10-241-5/+2
| | | | https://github.com/ruby/date/commit/af01edd7d8
* [ruby/date] Remove taint supportJeremy Evans2019-10-241-7/+0
| | | | | | | | 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
* [ruby/date] Support -Float::INFINITY...date rangesJeremy Evans2019-10-241-0/+4
| | | | | | Fixes Ruby Bug 12961 https://github.com/ruby/date/commit/7f533c2552
* [ruby/date] Check for numeric arguments in constructorsJeremy Evans2019-10-241-0/+49
| | | | | | | | | | | | | | | 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
* [ruby/date] Make julian dates roundtrip through to_time.to_dateJeremy Evans2019-10-241-5/+12
| | | | | | | | | | | | | | | 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
* * expand tabs. [ci skip]git2019-10-211-155/+155
| | | | | 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.
* Look up event ID offsets by token as indexNobuyoshi Nakada2019-10-211-168/+164
|
* Also BDOT2 and BDOT3 are operatorsNobuyoshi Nakada2019-10-201-0/+2
|
* Native MonitorMixin::ConditionVariable#waitKoichi Sasada2019-10-202-22/+43
| | | | | MonitorMixin::ConditionVariable#wait can be interrupted just after Monitor#exit_for_cond. So implementation in C.
* delegate synchronize methodKoichi Sasada2019-10-201-6/+1
| | | | | | | | 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.
* make monitor.so for performance. (#2576)Koichi Sasada2019-10-204-0/+491
| | | | | | | | | | | | | | | 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.
* Extend Ripper DSL to set to pseudo variables other than `$$`Nobuyoshi Nakada2019-10-191-4/+6
|
* Remove unused constant.Aaron Patterson2019-10-171-2/+1
| | | | This constant isn't used, so lets remove it.
* Look up constant instead of caching in a globalAaron Patterson2019-10-171-6/+3
| | | | | The global can go bad if the compactor runs, so we need to look up the constant instead of caching it in a global.
* [flori/json] Add ascii_only option to JSON::Ext::Generator::State.new.Sho Hashimoto2019-10-141-0/+2
| | | | https://github.com/flori/json/commit/0e99a9aac5
* [flori/json] Add shortcut converting to StringWatson2019-10-141-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [flori/json] Convert Hash object using rb_hash_foreach()Watson2019-10-141-22/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [flori/json] Fixed unexpected illegal/malformed utf-8 errorNobuyoshi Nakada2019-10-141-1/+10
| | | | | | | | 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
* [flori/json] Convert string encoding to UTF-8 only when neededWatson2019-10-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## 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
* [flori/json] Convert String encoding using `rb_str_encode()`Watson2019-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `rb_funcall` might be slightly heavy to call the Ruby method. This patch will convert String encoding using `rb_str_encode()` instead of `rb_funcall()`. ## Before ``` $ 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 ``` ## After ``` $ 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 ``` ## 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/9ae6d2969c
* [flori/json] Does not check whether illegal utf-8 if string has ascii only.Watson2019-10-141-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Before ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 25.000 i/100ms Calculating ------------------------------------- json 250.478 (± 4.8%) i/s - 1.250k in 5.002238s ``` ## After ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 32.000 i/100ms Calculating ------------------------------------- json 360.652 (± 3.6%) i/s - 1.824k in 5.064511s ``` ## Test code ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { :string => "x" * 100, :utf8 => "あ" * 100 } 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/91a24ecac3
* [flori/json] Pass args all #to_json in json/add/*.Sho Hashimoto2019-10-144-8/+8
| | | | https://github.com/flori/json/commit/36a7ef6790
* [flori/json] Only attempt to resize strings not other objectsFlorian Frank2019-10-142-16/+12
| | | | https://github.com/flori/json/commit/167ada8da7