content_type
stringclasses
8 values
main_lang
stringclasses
7 values
message
stringlengths
1
50
sha
stringlengths
40
40
patch
stringlengths
52
962k
file_count
int64
1
300
Ruby
Ruby
place alias adjacent to aliased method
be1822dd728b4ca3d6b3be528ae067de482810e4
<ide><path>Library/Homebrew/compilers.rb <ide> class CompilerFailure <ide> attr_reader :compiler, :major_version <ide> attr_rw :cause, :version <ide> <add> # Allows Apple compiler `fails_with` statements to keep using `build` <add> # even though `build` and `version` are the same internally <add> alias_method :build, :version <add> <ide> MESSAGES = { <ide> :cxx11 => 'This compiler does not support C++11' <ide> } <ide> def initialize compiler, &block <ide> @version = @version.to_i <ide> end <ide> end <del> <del> # Allows Apple compiler `fails_with` statements to keep using `build` <del> # even though `build` and `value` are the same internally <del> alias_method :build, :version <ide> end <ide> <ide> class CompilerQueue
1
Python
Python
add a check on export stats
e33f11f1d57bf1ff434769ec5ec327155051439f
<ide><path>glances/exports/glances_export.py <ide> def __build_export(self, stats): <ide> if isinstance(stats, dict): <ide> # Stats is a dict <ide> # Is there a key ? <del> if 'key' in iterkeys(stats): <add> if 'key' in iterkeys(stats) and stats['key'] in iterkeys(stats): <ide> pre_key = '{}.'.format(stats[stats['key']]) <ide> else: <ide> pre_key = ''
1
Text
Text
fix changelog_v8 indentation
737239a053bb8b1f368625cceb72c3c467335481
<ide><path>doc/changelogs/CHANGELOG_V8.md <ide> * [io.js](CHANGELOG_IOJS.md) <ide> * [Archive](CHANGELOG_ARCHIVE.md) <ide> <del> <a id="8.8.1"></a> <del> ## 2017-10-25, Version 8.8.1 (Current), @cjihrig <del> <del> ### Notable Changes <del> <del> * **net**: <del> - Fix timeout with null handle issue. This is a regression in Node 8.8.0 [#16489](https://github.com/nodejs/node/pull/16489) <del> <del> ### Commits <del> <del> * [[`db8c92fb42`](https://github.com/nodejs/node/commit/db8c92fb42)] - **doc**: fix spelling in v8.8.0 changelog (Myles Borins) [#16477](https://github.com/nodejs/node/pull/16477) <del> * [[`c8396b8370`](https://github.com/nodejs/node/commit/c8396b8370)] - **doc**: remove loader hooks from unsupported features (Teppei Sato) [#16465](https://github.com/nodejs/node/pull/16465) <del> * [[`2b0bb57055`](https://github.com/nodejs/node/commit/2b0bb57055)] - **doc**: fix wrong URL (Jon Moss) [#16470](https://github.com/nodejs/node/pull/16470) <del> * [[`9ffc32974e`](https://github.com/nodejs/node/commit/9ffc32974e)] - **doc**: fix typo in changelog for 8.8.0 (Alec Perkins) [#16462](https://github.com/nodejs/node/pull/16462) <del> * [[`7facaa5031`](https://github.com/nodejs/node/commit/7facaa5031)] - **doc**: fix missing newline character (Daijiro Wachi) [#16447](https://github.com/nodejs/node/pull/16447) <del> * [[`16eb7d3a5f`](https://github.com/nodejs/node/commit/16eb7d3a5f)] - **doc**: fix doc styles (Daijiro Wachi) [#16385](https://github.com/nodejs/node/pull/16385) <del> * [[`99fdc1d04f`](https://github.com/nodejs/node/commit/99fdc1d04f)] - **doc**: add recommendations for first timers (Refael Ackermann) [#16350](https://github.com/nodejs/node/pull/16350) <del> * [[`6fbef7f350`](https://github.com/nodejs/node/commit/6fbef7f350)] - **doc**: fix typo in zlib.md (Luigi Pinca) [#16480](https://github.com/nodejs/node/pull/16480) <del> * [[`655e017e40`](https://github.com/nodejs/node/commit/655e017e40)] - **net**: fix timeout with null handle (Anatoli Papirovski) [#16489](https://github.com/nodejs/node/pull/16489) <del> * [[`7fad10cc7e`](https://github.com/nodejs/node/commit/7fad10cc7e)] - **test**: make test-v8-serdes work without stdin (Anna Henningsen) <del> * [[`12dc06e3e1`](https://github.com/nodejs/node/commit/12dc06e3e1)] - **test**: call toLowerCase on the resolved module (Daniel Bevenius) [#16486](https://github.com/nodejs/node/pull/16486) <del> * [[`10894c3835`](https://github.com/nodejs/node/commit/10894c3835)] - **test**: allow for different nsswitch.conf settings (Daniel Bevenius) [#16378](https://github.com/nodejs/node/pull/16378) <del> * [[`2a53165aa0`](https://github.com/nodejs/node/commit/2a53165aa0)] - **test**: add missing assertion (cjihrig) [#15519](https://github.com/nodejs/node/pull/15519) <add><a id="8.8.1"></a> <add>## 2017-10-25, Version 8.8.1 (Current), @cjihrig <add> <add>### Notable Changes <add> <add>* **net**: <add> - Fix timeout with null handle issue. This is a regression in Node 8.8.0 [#16489](https://github.com/nodejs/node/pull/16489) <add> <add>### Commits <add> <add>* [[`db8c92fb42`](https://github.com/nodejs/node/commit/db8c92fb42)] - **doc**: fix spelling in v8.8.0 changelog (Myles Borins) [#16477](https://github.com/nodejs/node/pull/16477) <add>* [[`c8396b8370`](https://github.com/nodejs/node/commit/c8396b8370)] - **doc**: remove loader hooks from unsupported features (Teppei Sato) [#16465](https://github.com/nodejs/node/pull/16465) <add>* [[`2b0bb57055`](https://github.com/nodejs/node/commit/2b0bb57055)] - **doc**: fix wrong URL (Jon Moss) [#16470](https://github.com/nodejs/node/pull/16470) <add>* [[`9ffc32974e`](https://github.com/nodejs/node/commit/9ffc32974e)] - **doc**: fix typo in changelog for 8.8.0 (Alec Perkins) [#16462](https://github.com/nodejs/node/pull/16462) <add>* [[`7facaa5031`](https://github.com/nodejs/node/commit/7facaa5031)] - **doc**: fix missing newline character (Daijiro Wachi) [#16447](https://github.com/nodejs/node/pull/16447) <add>* [[`16eb7d3a5f`](https://github.com/nodejs/node/commit/16eb7d3a5f)] - **doc**: fix doc styles (Daijiro Wachi) [#16385](https://github.com/nodejs/node/pull/16385) <add>* [[`99fdc1d04f`](https://github.com/nodejs/node/commit/99fdc1d04f)] - **doc**: add recommendations for first timers (Refael Ackermann) [#16350](https://github.com/nodejs/node/pull/16350) <add>* [[`6fbef7f350`](https://github.com/nodejs/node/commit/6fbef7f350)] - **doc**: fix typo in zlib.md (Luigi Pinca) [#16480](https://github.com/nodejs/node/pull/16480) <add>* [[`655e017e40`](https://github.com/nodejs/node/commit/655e017e40)] - **net**: fix timeout with null handle (Anatoli Papirovski) [#16489](https://github.com/nodejs/node/pull/16489) <add>* [[`7fad10cc7e`](https://github.com/nodejs/node/commit/7fad10cc7e)] - **test**: make test-v8-serdes work without stdin (Anna Henningsen) <add>* [[`12dc06e3e1`](https://github.com/nodejs/node/commit/12dc06e3e1)] - **test**: call toLowerCase on the resolved module (Daniel Bevenius) [#16486](https://github.com/nodejs/node/pull/16486) <add>* [[`10894c3835`](https://github.com/nodejs/node/commit/10894c3835)] - **test**: allow for different nsswitch.conf settings (Daniel Bevenius) [#16378](https://github.com/nodejs/node/pull/16378) <add>* [[`2a53165aa0`](https://github.com/nodejs/node/commit/2a53165aa0)] - **test**: add missing assertion (cjihrig) [#15519](https://github.com/nodejs/node/pull/15519) <ide> <ide> <a id="8.8.0"></a> <ide> ## 2017-10-24, Version 8.8.0 (Current), @MylesBorins
1
Javascript
Javascript
remove un-needed tostring
690dfdf06f621619540cee333dd3557dfbbc8ac9
<ide><path>packages/ember-routing/lib/helpers/action.js <ide> Ember.onLoad('Ember.Handlebars', function(Handlebars) { <ide> }; <ide> <ide> ActionHelper.registerAction = function(actionNameOrPath, options, allowedKeys) { <del> var actionId = (++Ember.uuid).toString(); <add> var actionId = ++Ember.uuid; <ide> <ide> ActionHelper.registeredActions[actionId] = { <ide> eventName: options.eventName,
1
Text
Text
add a description about like conditions
4dc71e2880c87ac423da773884163c15c3688c81
<ide><path>guides/source/active_record_querying.md <ide> Book.where("created_at >= :start_date AND created_at <= :end_date", <ide> <ide> This makes for clearer readability if you have a large number of variable conditions. <ide> <add>#### Conditions That Use `LIKE` <add> <add>Although condition arguments are automatically escaped to prevent SQL injection, SQL `LIKE` wildcards (i.e., `%` and `_`) are **not** escaped. This may cause unexpected behavior if an unsanitized value is used in an argument. For example: <add> <add>```ruby <add>Book.where("title LIKE ?", params[:title] + "%") <add>``` <add> <add>In the above code, the intent is to match titles that start with a user-specified string. However, any occurrences of `%` or `_` in `params[:title]` will be treated as wildcards, leading to surprising query results. In some circumstances, this may also prevent the database from using an intended index, leading to a much slower query. <add> <add>To avoid these problems, use [`sanitize_sql_like`][] to escape wildcard characters in the relevant portion of the argument: <add> <add>```ruby <add>Book.where("title LIKE ?", <add> Book.sanitize_sql_like(params[:title]) + "%") <add>``` <add> <add>[`sanitize_sql_like`]: https://api.rubyonrails.org/classes/ActiveRecord/Sanitization/ClassMethods.html#method-i-sanitize_sql_like <add> <ide> ### Hash Conditions <ide> <ide> Active Record also allows you to pass in hash conditions which can increase the readability of your conditions syntax. With hash conditions, you pass in a hash with keys of the fields you want qualified and the values of how you want to qualify them:
1
Text
Text
add changes " print value using abs function" .
f7f69fca06b0aea36b1a6131cfcb26ba3eac6446
<ide><path>guide/english/python/abs-function/index.md <ide> The return value would be a positive number or zero. Even if a complex number is <ide> print(abs(3.4)) # prints 3.4 <ide> print(abs(-6)) # prints 6 <ide> print(abs(3 + 4j)) # prints 5.0, because |3 + 4j| = 5 <add>print(abs(-4.6)) # prints 4.6 <ide> print(abs(3 + 4 - 6 * 3.4)) # prints 13.4, because |3 + 4 - (6 * 3.4)| = |3 + 4 - 20.4| = |-13.4| = 13.4 <ide> print(abs(3 - 4j - 3 - 4j)) # prints 8.0, because |(3 - 3) + (- 4j - 4j)| = 8.0 <ide> ``` <ide> print(abs(3 - 4j - 3 - 4j)) # prints 8.0, because |(3 - 3) + (- 4j - 4j)| = 8.0 <ide> <a href='https://docs.python.org/3/library/functions.html#abs' target='_blank' rel='nofollow'>Official Docs</a> <ide> <ide> ### Sources <del>1. <a href='https://www.mathsisfun.com/numbers/absolute-value.html' target='_blank'>Math Is Fun. Accessed: October 25, 2017</a> <ide>\ No newline at end of file <add> <add>1. <a href='https://www.mathsisfun.com/numbers/absolute-value.html' target='_blank'>Math Is Fun. Accessed: October 25, 2017</a>
1
Javascript
Javascript
remove unneeded get
55a30aabc15c92d376d3208d029132740b7a56a9
<ide><path>packages/ember-handlebars/lib/helpers/each.js <ide> Ember.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, { <ide> <ide> // If {{#each}} is looping over an array of controllers, <ide> // point each child view at their respective controller. <del> if (content && get(content, 'isController')) { <add> if (content && content.isController) { <ide> set(view, 'controller', content); <ide> } <ide>
1
Text
Text
clarify workdir in docs
e87c6dd3e48135637d12067dd158252b5c27349b
<ide><path>docs/reference/builder.md <ide> For example: <ide> The output of the final `pwd` command in this `Dockerfile` would be <ide> `/path/$DIRNAME` <ide> <add>On Windows, `WORKDIR` behaves differently depending on whether using Windows <add>Server containers or Hyper-V containers. For Hyper-V containers, the engine <add>is, for architectural reasons, unable to create the directory if it does not <add>previously exist. For Windows Server containers, the directory is created <add>if it does not exist. Hence, for consistency between Windows Server and <add>Hyper-V containers, it is strongly recommended to include an explict instruction <add>to create the directory in the Dockerfile. For example: <add> <add> # escape=` <add> FROM microsoft/nanoserver <add> RUN mkdir c:\myapp <add> WORKDIR c:\myapp <add> <ide> ## ARG <ide> <ide> ARG <name>[=<default value>]
1
Text
Text
add docs for zlib#close()
562ea8986fc7ea94db3a901710eff0ffe53b4bde
<ide><path>doc/api/zlib.md <ide> The `zlib.bytesRead` property specifies the number of bytes read by the engine <ide> before the bytes are processed (compressed or decompressed, as appropriate for <ide> the derived class). <ide> <add>### zlib.close([callback]) <add><!-- YAML <add>added: v0.9.4 <add>--> <add> <add>Close the underlying handle. <add> <ide> ### zlib.flush([kind], callback) <ide> <!-- YAML <ide> added: v0.5.8
1
PHP
PHP
apply fixes from styleci
a9f00e68699001a46c7655dfd35c0fd3dcd5e0e2
<ide><path>src/Illuminate/Foundation/Console/EventGenerateCommand.php <ide> <ide> use Illuminate\Support\Str; <ide> use Illuminate\Console\Command; <del>use Illuminate\Foundation\Support\Providers\EventServiceProvider; <ide> <ide> class EventGenerateCommand extends Command <ide> {
1
Ruby
Ruby
enable sandbox by default
0c20957f5bdf93737107e4502aaec498ac0e6ba8
<ide><path>Library/Homebrew/cmd/test.rb <ide> def test <ide> args << "--devel" <ide> end <ide> <del> if Sandbox.available? && ARGV.sandbox? <add> if Sandbox.available? && !ARGV.no_sandbox? <ide> if Sandbox.auto_disable? <ide> Sandbox.print_autodisable_warning <ide> else <ide> def test <ide> end <ide> <ide> Utils.safe_fork do <del> if Sandbox.available? && ARGV.sandbox? && !Sandbox.auto_disable? <add> if Sandbox.available? && !ARGV.no_sandbox? && !Sandbox.auto_disable? <ide> sandbox = Sandbox.new <ide> f.logs.mkpath <ide> sandbox.record_log(f.logs/"sandbox.test.log")
1
Ruby
Ruby
add more test
b62a2c7e7f9fc7f45931b61d7a534a6d6b02f391
<ide><path>Library/Homebrew/test/test_formulary.rb <ide> def test_factory_from_alias <ide> alias_dir.rmtree <ide> end <ide> <del> def test_factory_from_rack <add> def test_factory_from_rack_and_from_keg <ide> formula = Formulary.factory(@path) <ide> installer = FormulaInstaller.new(formula) <ide> shutup { installer.install } <ide> keg = Keg.new(formula.prefix) <del> assert_kind_of Formula, Formulary.from_rack(formula.rack) <add> f = Formulary.from_rack(formula.rack) <add> assert_kind_of Formula, f <add> assert_kind_of Tab, f.build <add> f = Formulary.from_keg(keg) <add> assert_kind_of Formula, f <add> assert_kind_of Tab, f.build <ide> ensure <ide> keg.unlink <ide> keg.uninstall <ide><path>Library/Homebrew/test/test_tab.rb <ide> def test_defaults <ide> assert_empty tab.used_options <ide> refute_predicate tab, :built_as_bottle <ide> refute_predicate tab, :poured_from_bottle <add> assert_predicate tab, :stable? <add> refute_predicate tab, :devel? <add> refute_predicate tab, :head? <ide> assert_nil tab.tap <ide> assert_nil tab.time <ide> assert_nil tab.HEAD <ide> def test_from_old_version_file <ide> assert_equal @unused.sort, tab.unused_options.sort <ide> refute_predicate tab, :built_as_bottle <ide> assert_predicate tab, :poured_from_bottle <add> assert_predicate tab, :stable? <add> refute_predicate tab, :devel? <add> refute_predicate tab, :head? <ide> assert_equal "homebrew/core", tab.tap.name <ide> assert_equal :stable, tab.spec <ide> refute_nil tab.time <ide> def test_from_file <ide> assert_equal @unused.sort, tab.unused_options.sort <ide> refute_predicate tab, :built_as_bottle <ide> assert_predicate tab, :poured_from_bottle <add> assert_predicate tab, :stable? <add> refute_predicate tab, :devel? <add> refute_predicate tab, :head? <ide> assert_equal "homebrew/core", tab.tap.name <ide> assert_equal :stable, tab.spec <ide> refute_nil tab.time
2
Text
Text
fix typo in 5_0_release_notes.md doc [ci skip]
86c0dccac13d469ae148a8365ac008c380acf935
<ide><path>guides/source/5_0_release_notes.md <ide> Please refer to the [Changelog][active-record] for detailed changes. <ide> <ide> * Removed support for the legacy `mysql` database adapter from core. Most users should <ide> be able to use `mysql2`. It will be converted to a separate gem when when we find someone <del> to maintain it. ([Pull Request 1](https://github.com/rails/rails/pull/22642)], <add> to maintain it. ([Pull Request 1](https://github.com/rails/rails/pull/22642), <ide> [Pull Request 2](https://github.com/rails/rails/pull/22715)) <ide> <ide> * Removed support for the `protected_attributes` gem.
1
Javascript
Javascript
add a couple of `linkannotation` unit-tests
171f908b892e43062586c25418c722861f98f6b0
<ide><path>test/unit/annotation_layer_spec.js <ide> /* globals expect, it, describe, Dict, Name, Annotation, AnnotationBorderStyle, <del> AnnotationBorderStyleType, AnnotationFlag, PDFJS, <del> beforeEach, afterEach, stringToBytes */ <add> AnnotationBorderStyleType, AnnotationType, AnnotationFlag, PDFJS, <add> beforeEach, afterEach, stringToBytes, AnnotationFactory, Ref, <add> beforeAll, afterAll */ <ide> <ide> 'use strict'; <ide> <ide> describe('Annotation layer', function() { <add> function XrefMock(queue) { <add> this.queue = queue || []; <add> } <add> XrefMock.prototype = { <add> fetchIfRef: function() { <add> return this.queue.shift(); <add> } <add> }; <add> <ide> describe('Annotation', function() { <ide> it('should set and get flags', function() { <ide> var dict = new Dict(); <ide> describe('Annotation layer', function() { <ide> }); <ide> }); <ide> <add> describe('LinkAnnotation', function() { <add> var annotationFactory; <add> <add> beforeAll(function (done) { <add> annotationFactory = new AnnotationFactory(); <add> done(); <add> }); <add> <add> afterAll(function () { <add> annotationFactory = null; <add> }); <add> <add> it('should correctly parse a URI action', function() { <add> var actionDict = new Dict(); <add> actionDict.set('Type', Name.get('Action')); <add> actionDict.set('S', Name.get('URI')); <add> actionDict.set('URI', 'http://www.ctan.org/tex-archive/info/lshort'); <add> <add> var annotationDict = new Dict(); <add> annotationDict.set('Type', Name.get('Annot')); <add> annotationDict.set('Subtype', Name.get('Link')); <add> annotationDict.set('A', actionDict); <add> <add> var xrefMock = new XrefMock([annotationDict]); <add> var annotationRef = new Ref(820, 0); <add> <add> var annotation = annotationFactory.create(xrefMock, annotationRef); <add> var data = annotation.data; <add> expect(data.annotationType).toEqual(AnnotationType.LINK); <add> <add> expect(data.url).toEqual('http://www.ctan.org/tex-archive/info/lshort'); <add> expect(data.dest).toBeUndefined(); <add> }); <add> <add> it('should correctly parse a URI action, where the URI entry ' + <add> 'is missing a protocol', function() { <add> var actionDict = new Dict(); <add> actionDict.set('Type', Name.get('Action')); <add> actionDict.set('S', Name.get('URI')); <add> actionDict.set('URI', 'www.hmrc.gov.uk'); <add> <add> var annotationDict = new Dict(); <add> annotationDict.set('Type', Name.get('Annot')); <add> annotationDict.set('Subtype', Name.get('Link')); <add> annotationDict.set('A', actionDict); <add> <add> var xrefMock = new XrefMock([annotationDict]); <add> var annotationRef = new Ref(353, 0); <add> <add> var annotation = annotationFactory.create(xrefMock, annotationRef); <add> var data = annotation.data; <add> expect(data.annotationType).toEqual(AnnotationType.LINK); <add> <add> expect(data.url).toEqual('http://www.hmrc.gov.uk'); <add> expect(data.dest).toBeUndefined(); <add> }); <add> <add> it('should correctly parse a GoTo action', function() { <add> var actionDict = new Dict(); <add> actionDict.set('Type', Name.get('Action')); <add> actionDict.set('S', Name.get('GoTo')); <add> actionDict.set('D', 'page.157'); <add> <add> var annotationDict = new Dict(); <add> annotationDict.set('Type', Name.get('Annot')); <add> annotationDict.set('Subtype', Name.get('Link')); <add> annotationDict.set('A', actionDict); <add> <add> var xrefMock = new XrefMock([annotationDict]); <add> var annotationRef = new Ref(798, 0); <add> <add> var annotation = annotationFactory.create(xrefMock, annotationRef); <add> var data = annotation.data; <add> expect(data.annotationType).toEqual(AnnotationType.LINK); <add> <add> expect(data.url).toBeUndefined(); <add> expect(data.dest).toEqual('page.157'); <add> }); <add> <add> it('should correctly parse a GoToR action, where the FileSpec entry ' + <add> 'is a string containing a relative URL', function() { <add> var actionDict = new Dict(); <add> actionDict.set('Type', Name.get('Action')); <add> actionDict.set('S', Name.get('GoToR')); <add> actionDict.set('F', '../../0021/002156/215675E.pdf'); <add> actionDict.set('D', '15'); <add> <add> var annotationDict = new Dict(); <add> annotationDict.set('Type', Name.get('Annot')); <add> annotationDict.set('Subtype', Name.get('Link')); <add> annotationDict.set('A', actionDict); <add> <add> var xrefMock = new XrefMock([annotationDict]); <add> var annotationRef = new Ref(489, 0); <add> <add> var annotation = annotationFactory.create(xrefMock, annotationRef); <add> var data = annotation.data; <add> expect(data.annotationType).toEqual(AnnotationType.LINK); <add> <add> expect(data.url).toBeUndefined(); <add> expect(data.dest).toBeUndefined(); <add> expect(data.newWindow).toBeFalsy(); <add> }); <add> <add> it('should correctly parse a Named action', function() { <add> var actionDict = new Dict(); <add> actionDict.set('Type', Name.get('Action')); <add> actionDict.set('S', Name.get('Named')); <add> actionDict.set('N', Name.get('GoToPage')); <add> <add> var annotationDict = new Dict(); <add> annotationDict.set('Type', Name.get('Annot')); <add> annotationDict.set('Subtype', Name.get('Link')); <add> annotationDict.set('A', actionDict); <add> <add> var xrefMock = new XrefMock([annotationDict]); <add> var annotationRef = new Ref(12, 0); <add> <add> var annotation = annotationFactory.create(xrefMock, annotationRef); <add> var data = annotation.data; <add> expect(data.annotationType).toEqual(AnnotationType.LINK); <add> <add> expect(data.url).toBeUndefined(); <add> expect(data.action).toEqual('GoToPage'); <add> }); <add> <add> it('should correctly parse a simple Dest', function() { <add> var annotationDict = new Dict(); <add> annotationDict.set('Type', Name.get('Annot')); <add> annotationDict.set('Subtype', Name.get('Link')); <add> annotationDict.set('Dest', Name.get('LI0')); <add> <add> var xrefMock = new XrefMock([annotationDict]); <add> var annotationRef = new Ref(583, 0); <add> <add> var annotation = annotationFactory.create(xrefMock, annotationRef); <add> var data = annotation.data; <add> expect(data.annotationType).toEqual(AnnotationType.LINK); <add> <add> expect(data.url).toBeUndefined(); <add> expect(data.dest).toEqual('LI0'); <add> }); <add> }); <add> <ide> describe('FileAttachmentAnnotation', function() { <ide> var loadingTask; <ide> var annotations; <ide> <ide> beforeEach(function(done) { <del> var pdfUrl = new URL('../pdfs/annotation-fileattachment.pdf', <add> var pdfUrl = new URL('../pdfs/annotation-fileattachment.pdf', <ide> window.location).href; <ide> loadingTask = PDFJS.getDocument(pdfUrl); <ide> loadingTask.promise.then(function(pdfDocument) {
1
Ruby
Ruby
use include_blank value as option label
d611036c7709d7c30cbab3110e20e248283af364
<ide><path>actionview/lib/action_view/helpers/form_tag_helper.rb <ide> def select_tag(name, option_tags = nil, options = {}) <ide> option_tags ||= "" <ide> html_name = (options[:multiple] == true && !name.to_s.ends_with?("[]")) ? "#{name}[]" : name <ide> <del> if options.delete(:include_blank) <del> option_tags = content_tag(:option, '', :value => '').safe_concat(option_tags) <add> <add> if options.include?(:include_blank) <add> include_blank = options.delete(:include_blank) <add> if include_blank == true <add> include_blank = '' <add> end <add> <add> option_tags = content_tag(:option, include_blank, :value => '').safe_concat(option_tags) <ide> end <ide> <ide> if prompt = options.delete(:prompt) <ide><path>actionview/test/template/form_tag_helper_test.rb <ide> def test_select_tag_with_include_blank <ide> expected = %(<select id="places" name="places"><option value=""></option><option>Home</option><option>Work</option><option>Pub</option></select>) <ide> assert_dom_equal expected, actual <ide> end <add> <add> def test_select_tag_with_include_blank_string <add> actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, :include_blank => 'Choose' <add> expected = %(<select id="places" name="places"><option value="">Choose</option><option>Home</option><option>Work</option><option>Pub</option></select>) <add> assert_dom_equal expected, actual <add> end <ide> <ide> def test_select_tag_with_prompt <ide> actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, :prompt => "string"
2
Javascript
Javascript
remove inlineblockneedslayout and shrinkwrapblocks
aa529696fb91eaa167ed4dad9c63957b3466a45c
<ide><path>src/effects.js <ide> function defaultPrefilter( elem, props, opts ) { <ide> if ( jQuery.css( elem, "display" ) === "inline" && <ide> jQuery.css( elem, "float" ) === "none" ) { <ide> <del> // inline-level elements accept inline-block; <del> // block-level elements need to be inline with layout <del> if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { <del> style.display = "inline-block"; <del> <del> } else { <del> style.zoom = 1; <del> } <add> style.display = "inline-block"; <ide> } <ide> } <ide> <ide> if ( opts.overflow ) { <ide> style.overflow = "hidden"; <del> if ( !jQuery.support.shrinkWrapBlocks ) { <del> anim.done(function() { <del> style.overflow = opts.overflow[ 0 ]; <del> style.overflowX = opts.overflow[ 1 ]; <del> style.overflowY = opts.overflow[ 2 ]; <del> }); <del> } <add> anim.done(function() { <add> style.overflow = opts.overflow[ 0 ]; <add> style.overflowX = opts.overflow[ 1 ]; <add> style.overflowY = opts.overflow[ 2 ]; <add> }); <ide> } <ide> <ide> <ide><path>src/support.js <ide> jQuery.support = (function() { <ide> // Will be defined later <ide> deleteExpando: true, <ide> noCloneEvent: true, <del> inlineBlockNeedsLayout: false, <del> shrinkWrapBlocks: false, <ide> reliableMarginRight: true, <ide> boxSizingReliable: true, <ide> pixelPosition: false <ide> jQuery.support = (function() { <ide> !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); <ide> } <ide> <del> if ( typeof div.style.zoom !== "undefined" ) { <del> // Support: IE<8 <del> // Check if natively block-level elements act like inline-block <del> // elements when setting their display to 'inline' and giving <del> // them layout <del> div.innerHTML = ""; <del> div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; <del> support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); <del> <del> // Support: IE6 <del> // Check if elements with layout shrink-wrap their children <del> div.style.display = "block"; <del> div.innerHTML = "<div></div>"; <del> div.firstChild.style.width = "5px"; <del> support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); <del> <del> // Prevent IE 6 from affecting layout for positioned elements #11048 <del> // Prevent IE from shrinking the body in IE 7 mode #12869 <del> body.style.zoom = 1; <del> } <del> <ide> body.removeChild( container ); <ide> <ide> // Null elements to avoid leaks in IE <ide><path>test/unit/effects.js <ide> test("animate negative padding", function() { <ide> test("animate block as inline width/height", function() { <ide> expect(3); <ide> <del> var span = jQuery("<span>").css("display", "inline-block").appendTo("body"), <del> expected = span.css("display"); <del> <del> span.remove(); <del> <del> if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) { <del> stop(); <del> <del> jQuery("#foo").css({ display: "inline", width: "", height: "" }).animate({ width: 42, height: 42 }, 100, function() { <del> equal( jQuery(this).css("display"), jQuery.support.inlineBlockNeedsLayout ? "inline" : "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); <del> equal( this.offsetWidth, 42, "width was animated" ); <del> equal( this.offsetHeight, 42, "height was animated" ); <del> start(); <del> }); <add> stop(); <ide> <del> // Browser doesn't support inline-block <del> } else { <del> ok( true, "Browser doesn't support inline-block" ); <del> ok( true, "Browser doesn't support inline-block" ); <del> ok( true, "Browser doesn't support inline-block" ); <del> } <add> jQuery("#foo").css({ display: "inline", width: "", height: "" }).animate({ width: 42, height: 42 }, 100, function() { <add> equal( jQuery(this).css("display"), "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); <add> equal( this.offsetWidth, 42, "width was animated" ); <add> equal( this.offsetHeight, 42, "height was animated" ); <add> start(); <add> }); <ide> }); <ide> <ide> test("animate native inline width/height", function() { <ide> expect(3); <ide> <del> var span = jQuery("<span>").css("display", "inline-block").appendTo("body"), <del> expected = span.css("display"); <del> <del> span.remove(); <del> <del> if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) { <del> stop(); <del> jQuery("#foo").css({ display: "", width: "", height: "" }) <del> .append("<span>text</span>") <del> .children("span") <del> .animate({ width: 42, height: 42 }, 100, function() { <del> equal( jQuery(this).css("display"), "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); <del> equal( this.offsetWidth, 42, "width was animated" ); <del> equal( this.offsetHeight, 42, "height was animated" ); <del> start(); <del> }); <del> <del> // Browser doesn't support inline-block <del> } else { <del> ok( true, "Browser doesn't support inline-block" ); <del> ok( true, "Browser doesn't support inline-block" ); <del> ok( true, "Browser doesn't support inline-block" ); <del> } <add> stop(); <add> jQuery("#foo").css({ display: "", width: "", height: "" }) <add> .append("<span>text</span>") <add> .children("span") <add> .animate({ width: 42, height: 42 }, 100, function() { <add> equal( jQuery(this).css("display"), "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); <add> equal( this.offsetWidth, 42, "width was animated" ); <add> equal( this.offsetHeight, 42, "height was animated" ); <add> start(); <add> }); <ide> }); <ide> <ide> test("animate block width/height", function() { <ide> jQuery.each({ <ide> <ide> asyncTest("Effects chaining", function() { <ide> var remaining = 16, <del> shrinkwrap = jQuery.support.shrinkWrapBlocks, <ide> props = [ "opacity", "height", "width", "display", "overflow" ], <del> setup = function( name, selector, hiddenOverflow ) { <add> setup = function( name, selector ) { <ide> var $el = jQuery( selector ); <del> return $el.data( getProps( $el[0], hiddenOverflow ) ).data( "name", name ); <add> return $el.data( getProps( $el[0] ) ).data( "name", name ); <ide> }, <ide> assert = function() { <ide> var data = jQuery.data( this ), <ide> asyncTest("Effects chaining", function() { <ide> start(); <ide> } <ide> }, <del> getProps = function( el, hiddenOverflow ) { <add> getProps = function( el ) { <ide> var obj = {}; <ide> jQuery.each( props, function( i, prop ) { <del> obj[ prop ] = prop === "overflow" && hiddenOverflow ? "hidden" : el.style[ prop ] || jQuery.css( el, prop ); <add> obj[ prop ] = prop === "overflow" && el.style[ prop ] || jQuery.css( el, prop ); <ide> }); <ide> return obj; <ide> }; <ide> <ide> expect( remaining ); <ide> <del> // We need to pass jQuery.support.shrinkWrapBlocks for all methods that <del> // set overflow hidden (slide* and show/hide with speed) <ide> setup( ".fadeOut().fadeIn()", "#fadein div" ).fadeOut("fast").fadeIn( "fast", assert ); <ide> setup( ".fadeIn().fadeOut()", "#fadeout div" ).fadeIn("fast").fadeOut( "fast", assert ); <del> setup( ".hide().show()", "#show div", shrinkwrap ).hide("fast").show( "fast", assert ); <del> setup( ".show().hide()", "#hide div", shrinkwrap ).show("fast").hide( "fast", assert ); <del> setup( ".show().hide(easing)", "#easehide div", shrinkwrap ).show("fast").hide( "fast", "linear", assert ); <del> setup( ".toggle().toggle() - in", "#togglein div", shrinkwrap ).toggle("fast").toggle( "fast", assert ); <del> setup( ".toggle().toggle() - out", "#toggleout div", shrinkwrap ).toggle("fast").toggle( "fast", assert ); <del> setup( ".toggle().toggle(easing) - out", "#easetoggleout div", shrinkwrap ).toggle("fast").toggle( "fast", "linear", assert ); <del> setup( ".slideDown().slideUp()", "#slidedown div", shrinkwrap ).slideDown("fast").slideUp( "fast", assert ); <del> setup( ".slideUp().slideDown()", "#slideup div", shrinkwrap ).slideUp("fast").slideDown( "fast", assert ); <del> setup( ".slideUp().slideDown(easing)", "#easeslideup div", shrinkwrap ).slideUp("fast").slideDown( "fast", "linear", assert ); <del> setup( ".slideToggle().slideToggle() - in", "#slidetogglein div", shrinkwrap ).slideToggle("fast").slideToggle( "fast", assert ); <del> setup( ".slideToggle().slideToggle() - out", "#slidetoggleout div", shrinkwrap ).slideToggle("fast").slideToggle( "fast", assert ); <add> setup( ".hide().show()", "#show div" ).hide("fast").show( "fast", assert ); <add> setup( ".show().hide()", "#hide div" ).show("fast").hide( "fast", assert ); <add> setup( ".show().hide(easing)", "#easehide div" ).show("fast").hide( "fast", "linear", assert ); <add> setup( ".toggle().toggle() - in", "#togglein div" ).toggle("fast").toggle( "fast", assert ); <add> setup( ".toggle().toggle() - out", "#toggleout div" ).toggle("fast").toggle( "fast", assert ); <add> setup( ".toggle().toggle(easing) - out", "#easetoggleout div" ).toggle("fast").toggle( "fast", "linear", assert ); <add> setup( ".slideDown().slideUp()", "#slidedown div" ).slideDown("fast").slideUp( "fast", assert ); <add> setup( ".slideUp().slideDown()", "#slideup div" ).slideUp("fast").slideDown( "fast", assert ); <add> setup( ".slideUp().slideDown(easing)", "#easeslideup div" ).slideUp("fast").slideDown( "fast", "linear", assert ); <add> setup( ".slideToggle().slideToggle() - in", "#slidetogglein div" ).slideToggle("fast").slideToggle( "fast", assert ); <add> setup( ".slideToggle().slideToggle() - out", "#slidetoggleout div" ).slideToggle("fast").slideToggle( "fast", assert ); <ide> setup( ".fadeToggle().fadeToggle() - in", "#fadetogglein div" ).fadeToggle("fast").fadeToggle( "fast", assert ); <ide> setup( ".fadeToggle().fadeToggle() - out", "#fadetoggleout div" ).fadeToggle("fast").fadeToggle( "fast", assert ); <ide> setup( ".fadeTo(0.5).fadeTo(1.0, easing)", "#fadeto div" ).fadeTo( "fast", 0.5 ).fadeTo( "fast", 1.0, "linear", assert );
3
Go
Go
fix typo in overlay documentation
f1f6738d974a5bb4f798a1f01fd074bfb45f681f
<ide><path>daemon/graphdriver/overlay/overlay.go <ide> func (d *naiveDiffDriverWithApply) ApplyDiff(id, parent string, diff archive.Rea <ide> // data with the parent. <ide> <ide> // ActiveMount contains information about the count, path and whether is mounted or not. <del>// This information is part of the Driver, that contains list of active mounts taht are part of this overlay. <add>// This information is part of the Driver, that contains list of active mounts that are part of this overlay. <ide> type ActiveMount struct { <ide> count int <ide> path string
1
Text
Text
use proper link in docs issue template
19206efaaf31ee3368a42c51d0825db03d8490d2
<ide><path>.github/ISSUE_TEMPLATE/4_Documentation_issue.md <ide> --- <ide> name: "📚 Documentation Issue" <del>about: 'For documentation issues, see: https://github.com/laravel/docs/issues' <add>about: 'For documentation issues, open a pull request at https://github.com/laravel/docs' <ide> <ide> --- <ide>
1
Javascript
Javascript
add node.error(); p() outputs to stderr
949f24305b06617487d4d13b81d4ce756c6a224c
<ide><path>src/util.js <ide> puts = function (x) { <ide> print(x.toString() + "\n"); <ide> }; <ide> <add>node.debug = function (x) { <add> node.stdio.writeError("DEBUG: " + x.toString() + "\n"); <add>}; <add> <add>node.error = function (x) { <add> node.stdio.writeError(x.toString() + "\n"); <add>}; <add> <ide> p = function (x) { <ide> if (x === null) { <del> puts("null"); <add> node.error("null"); <ide> } else if (x === NaN) { <del> puts("NaN"); <add> node.error("NaN"); <ide> } else { <del> puts(JSON.stringify(x) || "undefined"); <add> node.error(JSON.stringify(x) || "undefined"); <ide> } <ide> }; <del> <del>node.debug = function (x) { <del> node.stdio.writeError("DEBUG: " + x.toString() + "\n"); <del>};
1
Python
Python
use single backticks around parameter names
fad2c4d391d6a14a01ef9fc17c45cdf011164992
<ide><path>numpy/testing/_private/utils.py <ide> def assert_allclose(actual, desired, rtol=1e-7, atol=0, equal_nan=True, <ide> <ide> Notes <ide> ----- <del> When one of ``actual`` and ``desired`` is a scalar and the other is <add> When one of `actual` and `desired` is a scalar and the other is <ide> array_like, the function checks that each element of the array_like <ide> object is equal to the scalar. <ide>
1
Text
Text
improve explanation for directory with fs.rename()
e7ca3987a2d88cee3523abe72e38f1ddc6cb13db
<ide><path>doc/api/fs.md <ide> changes: <ide> <ide> Asynchronously rename file at `oldPath` to the pathname provided <ide> as `newPath`. In the case that `newPath` already exists, it will <del>be overwritten. No arguments other than a possible exception are <add>be overwritten. If there is a directory at `newPath`, an error will <add>be raised instead. No arguments other than a possible exception are <ide> given to the completion callback. <ide> <ide> See also: rename(2).
1
PHP
PHP
fix missing property
54d2e2cd25304040eb34ae02c30d405a38d92a4a
<ide><path>src/Controller/ControllerFactory.php <ide> */ <ide> class ControllerFactory implements ControllerFactoryInterface <ide> { <add> /** <add> * @var \Psr\Container\ContainerInterface <add> */ <add> protected $container; <add> <ide> /** <ide> * Constructor <ide> *
1
Go
Go
add aaron swartz to the names generator
5b8c8b1819d0f2dcbe7d708b1ae8f579a73401bd
<ide><path>pkg/namesgenerator/names-generator.go <ide> var ( <ide> // Richard Matthew Stallman - the founder of the Free Software movement, the GNU project, the Free Software Foundation, and the League for Programming Freedom. He also invented the concept of copyleft to protect the ideals of this movement, and enshrined this concept in the widely-used GPL (General Public License) for software. https://en.wikiquote.org/wiki/Richard_Stallman <ide> "stallman", <ide> <add> // Aaron Swartz was influential in creating RSS, Markdown, Creative Commons, Reddit, and much of the internet as we know it today. He was devoted to freedom of information on the web. https://en.wikiquote.org/wiki/Aaron_Swartz <add> "swartz", <add> <ide> // Nikola Tesla invented the AC electric system and every gadget ever used by a James Bond villain. https://en.wikipedia.org/wiki/Nikola_Tesla <ide> "tesla", <ide>
1
Go
Go
fix empty-lines (revive)
0695a910c6bededc23ba6fd102528e40f0f9c445
<ide><path>daemon/logger/adapter_test.go <ide> func (l *mockLoggingPlugin) StartLogging(file string, info Info) error { <ide> <ide> l.c.Broadcast() <ide> return <del> <ide> } <ide> <ide> l.c.L.Lock() <ide> l.logs = append(l.logs, &msg) <ide> l.c.L.Unlock() <ide> l.c.Broadcast() <ide> } <del> <ide> }() <ide> return nil <ide> } <ide> func TestAdapterReadLogs(t *testing.T) { <ide> assert.Check(t, !ok, "expected message channel to be closed") <ide> case <-time.After(10 * time.Second): <ide> t.Fatal("timeout waiting for message channel to close") <del> <ide> } <ide> lw.ConsumerGone() <ide> <ide><path>daemon/logger/awslogs/cloudwatchlogs_test.go <ide> func TestCollectBatchTicker(t *testing.T) { <ide> assert.Equal(t, logline+" 3", aws.StringValue(argument.LogEvents[0].Message)) <ide> <ide> stream.Close() <del> <ide> } <ide> <ide> func TestCollectBatchMultilinePattern(t *testing.T) { <ide><path>daemon/logger/loggertest/logreader.go <ide> func makeTestMessages() []*logger.Message { <ide> {Source: "stderr", Timestamp: time.Now().Add(-1 * 10 * time.Minute), Line: []byte("just one more message")}, <ide> {Source: "stdout", Timestamp: time.Now().Add(-1 * 90 * time.Minute), Line: []byte("someone adjusted the clock")}, <ide> } <del> <ide> } <ide> <ide> func (tr Reader) testTail(t *testing.T, live bool) { <ide><path>daemon/logger/loggerutils/sharedtemp.go <ide> func (c *sharedTempFileConverter) openExisting(st stfcState, id stfID, v sharedT <ide> <ide> res := <-wait <ide> return res.fr, res.err <del> <ide> } <ide> <ide> func (c *sharedTempFileConverter) convert(f *os.File) (converted *os.File, size int64, err error) { <ide><path>daemon/logger/loggerutils/sharedtemp_test.go <ide> func TestSharedTempFileConverter(t *testing.T) { <ide> assert.Check(t, src.Close()) <ide> assert.NilError(t, os.Remove(name)) <ide> checkDirEmpty(t, dir) <del> <ide> }) <ide> } <ide> <ide><path>daemon/logger/ring_test.go <ide> func TestRingDrain(t *testing.T) { <ide> if len(ls) != 0 { <ide> t.Fatalf("expected 0 messages on 2nd drain: %v", ls) <ide> } <del> <ide> } <ide> <ide> type nopLogger struct{} <ide><path>daemon/logger/syslog/syslog.go <ide> func parseLogFormat(logFormat, proto string) (syslog.Formatter, syslog.Framer, e <ide> default: <ide> return nil, nil, errors.New("Invalid syslog format") <ide> } <del> <ide> }
7
Python
Python
set default loglevel to info
ddeb3a3ed750d2cbddee9abb78832f169efd8880
<ide><path>celery/bin/celeryev.py <ide> class EvCommand(Command): <ide> <ide> def run(self, dump=False, camera=None, frequency=1.0, maxrate=None, <del> loglevel="WARNING", logfile=None, **kwargs): <add> loglevel="INFO", logfile=None, **kwargs): <ide> if dump: <ide> return self.run_evdump() <ide> if camera: <ide> def get_options(self): <ide> action="store", dest="maxrate", default=None, <ide> help="Recording: Shutter rate limit (e.g. 10/m)"), <ide> Option('-l', '--loglevel', <del> action="store", dest="loglevel", default="WARNING", <add> action="store", dest="loglevel", default="INFO", <ide> help="Loglevel. Default is WARNING."), <ide> Option('-f', '--logfile', <ide> action="store", dest="logfile", default=None,
1
Text
Text
improve the git instructions to update a pr
18a8bcf0720b394e22e28b1389589f1ebbdc5cfc
<ide><path>docs/sources/project/review-pr.md <ide> need to update your pull request with additional changes. <ide> <ide> To update your existing pull request: <ide> <del>1. Change one or more files in your local `docker-fork` repository. <add>1. Checkout the PR branch in your local `docker-fork` repository. <ide> <del>2. Commit the change with the `git commit --amend` command. <add> This is the branch associated with your request. <add> <add>2. Change one or more files and then stage your changes. <add> <add> The command syntax is: <add> <add> git add <path_or_filename> <add> <add>3. Commit the change. <ide> <ide> $ git commit --amend <ide> <ide> Git opens an editor containing your last commit message. <ide> <del>3. Adjust your last comment to reflect this new change. <add>4. Adjust your last comment to reflect this new change. <ide> <ide> Added a new sentence per Anaud's suggestion <ide> <ide> To update your existing pull request: <ide> # modified: docs/sources/installation/mac.md <ide> # modified: docs/sources/installation/rhel.md <ide> <del>4. Push to your origin. <add>5. Force push the change to your origin. <add> <add> The command syntax is: <ide> <del> $ git push origin <add> git push -f origin <branch_name> <ide> <del>5. Open your browser to your pull request on GitHub. <add>6. Open your browser to your pull request on GitHub. <ide> <ide> You should see your pull request now contains your newly pushed code. <ide> <del>6. Add a comment to your pull request. <add>7. Add a comment to your pull request. <ide> <ide> GitHub only notifies PR participants when you comment. For example, you can <ide> mention that you updated your PR. Your comment alerts the maintainers that
1
Ruby
Ruby
handle empty formula body in various cops
6ede5d2dd5cf378729669dc02e8b324b86986dde
<ide><path>Library/Homebrew/rubocops/class.rb <ide> module FormulaAuditStrict <ide> # <ide> # @api private <ide> class TestPresent < FormulaCop <del> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> def audit_formula(_node, class_node, _parent_class_node, body_node) <ide> return if find_block(body_node, :test) <ide> <add> offending_node(class_node) if body_node.nil? <ide> problem "A `test do` test block should be added" <ide> end <ide> end <ide><path>Library/Homebrew/rubocops/components_order.rb <ide> class ComponentsOrder < FormulaCop <ide> extend AutoCorrector <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> @present_components, @offensive_nodes = check_order(FORMULA_COMPONENT_PRECEDENCE_LIST, body_node) <ide> <ide> component_problem @offensive_nodes[0], @offensive_nodes[1] if @offensive_nodes <ide><path>Library/Homebrew/rubocops/components_redundancy.rb <ide> class ComponentsRedundancy < FormulaCop <ide> STABLE_MSG = "`stable do` should not be present without a `head` spec" <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> urls = find_method_calls_by_name(body_node, :url) <ide> <ide> urls.each do |url| <ide><path>Library/Homebrew/rubocops/conflicts.rb <ide> class Conflicts < FormulaCop <ide> "Use `keg_only :versioned_formula` instead." <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> find_method_calls_by_name(body_node, :conflicts_with).each do |conflicts_with_call| <ide> next unless parameters(conflicts_with_call).last.respond_to? :values <ide> <ide><path>Library/Homebrew/rubocops/extend/formula.rb <ide> def audit_urls(urls, regex) <ide> # <ide> # @param dependency_name dependency's name <ide> def depends_on?(dependency_name, *types) <add> return if @body.nil? <add> <ide> types = [:any] if types.empty? <ide> dependency_nodes = find_every_method_call_by_name(@body, :depends_on) <ide> idx = dependency_nodes.index do |n| <ide> def depends_on_name_type?(node, name = nil, type = :required) <ide> <ide> # Return all the caveats' string nodes in an array. <ide> def caveats_strings <add> return [] if @body.nil? <add> <ide> find_strings(find_method_def(@body, :caveats)) <ide> end <ide> <ide><path>Library/Homebrew/rubocops/formula_desc.rb <ide> class Desc < FormulaCop <ide> include DescHelper <ide> extend AutoCorrector <ide> <del> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> def audit_formula(_node, class_node, _parent_class_node, body_node) <ide> @name = @formula_name <ide> desc_call = find_node_method_by_name(body_node, :desc) <add> offending_node(class_node) if body_node.nil? <ide> audit_desc(:formula, @name, desc_call) <ide> end <ide> end <ide><path>Library/Homebrew/rubocops/homepage.rb <ide> module FormulaAudit <ide> class Homepage < FormulaCop <ide> extend AutoCorrector <ide> <del> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> def audit_formula(_node, class_node, _parent_class_node, body_node) <ide> homepage_node = find_node_method_by_name(body_node, :homepage) <ide> <ide> if homepage_node.nil? <add> offending_node(class_node) if body_node.nil? <ide> problem "Formula should have a homepage." <ide> return <ide> end <ide><path>Library/Homebrew/rubocops/lines.rb <ide> def audit_formula(_node, _class_node, _parent_class_node, _body_node) <ide> # @api private <ide> class AssertStatements < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> find_every_method_call_by_name(body_node, :assert).each do |method| <ide> if method_called_ever?(method, :include?) && !method_called_ever?(method, :!) <ide> problem "Use `assert_match` instead of `assert ...include?`" <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> # @api private <ide> class OptionDeclarations < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> problem "Use new-style option definitions" if find_method_def(body_node, :options) <ide> <ide> if formula_tap == "homebrew-core" <ide> class MpiCheck < FormulaCop <ide> extend AutoCorrector <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> # Enforce use of OpenMPI for MPI dependency in core <ide> return unless formula_tap == "homebrew-core" <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> # @api private <ide> class PyoxidizerCheck < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> # Disallow use of PyOxidizer as a dependency in core <ide> return unless formula_tap == "homebrew-core" <ide> <ide> class SafePopenCommands < FormulaCop <ide> extend AutoCorrector <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> test = find_block(body_node, :test) <ide> <ide> [:popen_read, :popen_write].each do |unsafe_command| <ide> class ShellVariables < FormulaCop <ide> extend AutoCorrector <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> popen_commands = [ <ide> :popen, <ide> :popen_read, <ide> class LicenseArrays < FormulaCop <ide> extend AutoCorrector <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> license_node = find_node_method_by_name(body_node, :license) <ide> return unless license_node <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> # @api private <ide> class Licenses < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> license_node = find_node_method_by_name(body_node, :license) <ide> return unless license_node <ide> return if license_node.source.include?("\n") <ide> class PythonVersions < FormulaCop <ide> extend AutoCorrector <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> python_formula_node = find_every_method_call_by_name(body_node, :depends_on).find do |dep| <ide> string_content(parameters(dep).first).start_with? "python@" <ide> end <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> # @api private <ide> class Miscellaneous < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> # FileUtils is included in Formula <ide> # encfs modifies a file with this name, so check for some leading characters <ide> find_instance_method_call(body_node, "FileUtils", nil) do |method_node| <ide><path>Library/Homebrew/rubocops/options.rb <ide> class Options < FormulaCop <ide> OPTION = "Formulae in homebrew/core should not use `option`." <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> option_call_nodes = find_every_method_call_by_name(body_node, :option) <ide> option_call_nodes.each do |option_call| <ide> option = parameters(option_call).first <ide><path>Library/Homebrew/rubocops/patches.rb <ide> class Patches < FormulaCop <ide> def audit_formula(node, _class_node, _parent_class_node, body) <ide> @full_source_content = source_buffer(node).source <ide> <add> return if body.nil? <add> <ide> external_patches = find_all_blocks(body, :patch) <ide> external_patches.each do |patch_block| <ide> url_node = find_every_method_call_by_name(patch_block, :url).first <ide><path>Library/Homebrew/rubocops/text.rb <ide> def audit_formula(node, _class_node, _parent_class_node, body_node) <ide> end <ide> end <ide> <add> return if body_node.nil? <add> <ide> if !find_node_method_by_name(body_node, :plist_options) && <ide> find_method_def(body_node, :plist) <ide> problem "Please set plist_options when using a formula-defined plist." <ide> module FormulaAuditStrict <ide> # @api private <ide> class Text < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> find_method_with_args(body_node, :go_resource) do <ide> problem "`go_resource`s are deprecated. Please ask upstream to implement Go vendoring" <ide> end <ide><path>Library/Homebrew/rubocops/urls.rb <ide> module FormulaAudit <ide> # @api private <ide> class Urls < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> urls = find_every_func_call_by_name(body_node, :url) <ide> mirrors = find_every_func_call_by_name(body_node, :mirror) <ide> <ide> class PyPiUrls < FormulaCop <ide> extend T::Sig <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> urls = find_every_func_call_by_name(body_node, :url) <ide> mirrors = find_every_func_call_by_name(body_node, :mirror) <ide> urls += mirrors <ide> def get_pypi_url(url) <ide> # @api private <ide> class GitUrls < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <ide> return unless formula_tap == "homebrew-core" <ide> <ide> find_method_calls_by_name(body_node, :url).each do |url| <ide> module FormulaAuditStrict <ide> # @api private <ide> class GitUrls < FormulaCop <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <ide> return unless formula_tap == "homebrew-core" <ide> <ide> find_method_calls_by_name(body_node, :url).each do |url| <ide><path>Library/Homebrew/rubocops/uses_from_macos.rb <ide> class ProvidedByMacos < FormulaCop <ide> ].freeze <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> find_method_with_args(body_node, :keg_only, :provided_by_macos) do <ide> return if PROVIDED_BY_MACOS_FORMULAE.include? @formula_name <ide> <ide> class UsesFromMacos < FormulaCop <ide> ].freeze <ide> <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> return if body_node.nil? <add> <ide> find_method_with_args(body_node, :uses_from_macos, /^"(.+)"/).each do |method| <ide> dep = if parameters(method).first.instance_of?(RuboCop::AST::StrNode) <ide> parameters(method).first
13
PHP
PHP
add new report helper
2b676191b1688b8edc9d43317a2989642fe95b5d
<ide><path>src/Illuminate/Foundation/helpers.php <ide> use Illuminate\Contracts\Auth\Access\Gate; <ide> use Illuminate\Contracts\Routing\UrlGenerator; <ide> use Illuminate\Foundation\Bus\PendingDispatch; <add>use Illuminate\Contracts\Debug\ExceptionHandler; <ide> use Illuminate\Contracts\Routing\ResponseFactory; <ide> use Illuminate\Contracts\Auth\Factory as AuthFactory; <ide> use Illuminate\Contracts\View\Factory as ViewFactory; <ide> function redirect($to = null, $status = 302, $headers = [], $secure = null) <ide> } <ide> } <ide> <add>if (! function_exists('report')) { <add> /** <add> * Report an exception. <add> * <add> * @param \Exception $e <add> * @return void <add> */ <add> function report($exception) <add> { <add> app(ExceptionHandler::class)->report($exception); <add> } <add>} <add> <ide> if (! function_exists('request')) { <ide> /** <ide> * Get an instance of the current request or an input item from the request.
1
Text
Text
improve grammar in .force_authenticate() docs
971bc066c5d41b001a134b95b6fe357c726135c9
<ide><path>docs/api-guide/testing.md <ide> The `credentials` method is appropriate for testing APIs that require authentica <ide> <ide> #### .force_authenticate(user=None, token=None) <ide> <del>Sometimes you may want to bypass authentication, and simple force all requests by the test client to be automatically treated as authenticated. <add>Sometimes you may want to bypass authentication entirely and force all requests by the test client to be automatically treated as authenticated. <ide> <ide> This can be a useful shortcut if you're testing the API but don't want to have to construct valid authentication credentials in order to make test requests. <ide>
1
Javascript
Javascript
fix rest of locale comments
8e081f145b3096fae0b61e6b3ef16c788de30191
<ide><path>src/locale/ar.js <ide> //! moment.js locale configuration <del>//! Locale: Arabic [ar] <del>//! Author: Abdel Said: https://github.com/abdelsaid <del>//! Changes in months, weekdays: Ahmed Elkhatib <add>//! locale : Arabic [ar] <add>//! author : Abdel Said: https://github.com/abdelsaid <add>//! changes in months, weekdays: Ahmed Elkhatib <ide> //! Native plural forms: forabi https://github.com/forabi <ide> <ide> import moment from '../moment'; <ide><path>src/locale/ms.js <ide> //! moment.js locale configuration <del>//! locale : Malay (ms) <add>//! locale : Malay [ms] <ide> //! author : Weldan Jamili : https://github.com/weldan <ide> <ide> import moment from '../moment'; <ide><path>src/locale/tlh.js <ide> //! moment.js locale configuration <del>//! locale : Klingon (tlh) <add>//! locale : Klingon [tlh] <ide> //! author : Dominika Kruk : https://github.com/amaranthrose <ide> <ide> import moment from '../moment';
3
Text
Text
fix mistake in path.relative
2ff23c5622c9738f48c19f078ba140efe2699871
<ide><path>doc/api/path.md <ide> path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'); <ide> // Returns: '..\\..\\impl\\bbb' <ide> ``` <ide> <del>A [`TypeError`][] is thrown if neither `from` nor `to` is a string. <add>A [`TypeError`][] is thrown if either `from` or `to` is not a string. <ide> <ide> ## path.resolve([...paths]) <ide> <!-- YAML
1
Java
Java
fix javadoc in uricomponentsbuilder
654e14a86a5035d5cc061fb8f6bb44cdc3b41e7c
<ide><path>spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java <ide> public static UriComponentsBuilder fromUriString(String uri) { <ide> * be parsed unambiguously. Such values should be substituted for URI <ide> * variables to enable correct parsing: <ide> * <pre class="code"> <del> * String uriString = &quot;/hotels/42?filter={value}&quot;; <del> * UriComponentsBuilder.fromUriString(uriString).buildAndExpand(&quot;hot&amp;cold&quot;); <add> * String urlString = &quot;https://example.com/hotels/42?filter={value}&quot;; <add> * UriComponentsBuilder.fromHttpUrl(urlString).buildAndExpand(&quot;hot&amp;cold&quot;); <ide> * </pre> <ide> * @param httpUrl the source URI <ide> * @return the URI components of the URI
1
Javascript
Javascript
add traceback to unhandled promise rejections
316f60fd1433cc83f63c64fadfcde5cdf0033de5
<ide><path>src/ng/q.js <ide> function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) { <ide> if (!toCheck.pur) { <ide> toCheck.pur = true; <ide> var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value); <del> exceptionHandler(errorMessage); <add> if (toCheck.value instanceof Error) { <add> exceptionHandler(toCheck.value, errorMessage); <add> } else { <add> exceptionHandler(errorMessage); <add> } <ide> } <ide> } <ide> } <ide><path>test/ng/qSpec.js <ide> describe('q', function() { <ide> }; <ide> <ide> <del> function exceptionHandler(reason) { <del> exceptionHandlerCalls.push(reason); <del> } <del> <del> <del> function exceptionHandlerStr() { <del> return exceptionHandlerCalls.join('; '); <add> function exceptionHandler(exception, reason) { <add> if (typeof reason === 'undefined') { <add> exceptionHandlerCalls.push({ reason: exception }); <add> } else { <add> exceptionHandlerCalls.push({ reason: reason, exception: exception }); <add> } <ide> } <ide> <del> <ide> beforeEach(function() { <ide> q = qFactory(mockNextTick.nextTick, exceptionHandler, true); <ide> q_no_error = qFactory(mockNextTick.nextTick, exceptionHandler, false); <ide> describe('q', function() { <ide> <ide> <ide> describe('when exceptionHandler is called', function() { <del> it('should log an unhandled rejected promise', function() { <del> var defer = q.defer(); <del> defer.reject('foo'); <del> mockNextTick.flush(); <del> expect(exceptionHandlerStr()).toBe('Possibly unhandled rejection: foo'); <del> }); <add> function CustomError() { } <add> CustomError.prototype = Object.create(Error.prototype); <ide> <add> var errorEg = new Error('Fail'); <add> var errorStr = toDebugString(errorEg); <ide> <del> it('should not log an unhandled rejected promise if disabled', function() { <del> var defer = q_no_error.defer(); <del> defer.reject('foo'); <del> expect(exceptionHandlerStr()).toBe(''); <del> }); <add> var customError = new CustomError('Custom'); <add> var customErrorStr = toDebugString(customError); <ide> <add> var nonErrorObj = { isATest: 'this is' }; <add> var nonErrorObjStr = toDebugString(nonErrorObj); <ide> <del> it('should log a handled rejected promise on a promise without rejection callbacks', function() { <del> var defer = q.defer(); <del> defer.promise.then(noop); <del> defer.reject('foo'); <del> mockNextTick.flush(); <del> expect(exceptionHandlerStr()).toBe('Possibly unhandled rejection: foo'); <del> }); <add> var fixtures = [ <add> { <add> type: 'Error object', <add> value: errorEg, <add> expected: { <add> exception: errorEg, <add> reason: 'Possibly unhandled rejection: ' + errorStr <add> } <add> }, <add> { <add> type: 'custom Error object', <add> value: customError, <add> expected: { <add> exception: customError, <add> reason: 'Possibly unhandled rejection: ' + customErrorStr <add> } <add> }, <add> { <add> type: 'non-Error object', <add> value: nonErrorObj, <add> expected: { <add> reason: 'Possibly unhandled rejection: ' + nonErrorObjStr <add> } <add> }, <add> { <add> type: 'string primitive', <add> value: 'foo', <add> expected: { <add> reason: 'Possibly unhandled rejection: foo' <add> } <add> } <add> ]; <add> forEach(fixtures, function(fixture) { <add> var type = fixture.type; <add> var value = fixture.value; <add> var expected = fixture.expected; <ide> <add> describe('with ' + type, function() { <ide> <del> it('should not log a handled rejected promise', function() { <del> var defer = q.defer(); <del> defer.promise.catch(noop); <del> defer.reject('foo'); <del> mockNextTick.flush(); <del> expect(exceptionHandlerStr()).toBe(''); <del> }); <add> it('should log an unhandled rejected promise', function() { <add> var defer = q.defer(); <add> defer.reject(value); <add> mockNextTick.flush(); <add> expect(exceptionHandlerCalls).toEqual([expected]); <add> }); <ide> <ide> <del> it('should not log a handled rejected promise that is handled in a future tick', function() { <del> var defer = q.defer(); <del> defer.promise.catch(noop); <del> defer.resolve(q.reject('foo')); <del> mockNextTick.flush(); <del> expect(exceptionHandlerStr()).toBe(''); <add> it('should not log an unhandled rejected promise if disabled', function() { <add> var defer = q_no_error.defer(); <add> defer.reject(value); <add> expect(exceptionHandlerCalls).toEqual([]); <add> }); <add> <add> <add> it('should log a handled rejected promise on a promise without rejection callbacks', function() { <add> var defer = q.defer(); <add> defer.promise.then(noop); <add> defer.reject(value); <add> mockNextTick.flush(); <add> expect(exceptionHandlerCalls).toEqual([expected]); <add> }); <add> <add> <add> it('should not log a handled rejected promise', function() { <add> var defer = q.defer(); <add> defer.promise.catch(noop); <add> defer.reject(value); <add> mockNextTick.flush(); <add> expect(exceptionHandlerCalls).toEqual([]); <add> }); <add> <add> <add> it('should not log a handled rejected promise that is handled in a future tick', function() { <add> var defer = q.defer(); <add> defer.promise.catch(noop); <add> defer.resolve(q.reject(value)); <add> mockNextTick.flush(); <add> expect(exceptionHandlerCalls).toEqual([]); <add> }); <add> }); <ide> }); <ide> }); <ide> });
2
Java
Java
improve performance of formcontentfilter
932f771380db98f80c75ccb16cd122db1bfdc970
<ide><path>spring-web/src/main/java/org/springframework/web/filter/FormContentFilter.java <ide> public InputStream getBody() throws IOException { <ide> } <ide> <ide> private boolean shouldParse(HttpServletRequest request) { <del> if (!HTTP_METHODS.contains(request.getMethod())) { <del> return false; <del> } <del> try { <del> MediaType mediaType = MediaType.parseMediaType(request.getContentType()); <del> return MediaType.APPLICATION_FORM_URLENCODED.includes(mediaType); <del> } <del> catch (IllegalArgumentException ex) { <del> return false; <add> String contentType = request.getContentType(); <add> String method = request.getMethod(); <add> if (StringUtils.hasLength(contentType) && HTTP_METHODS.contains(method)) { <add> try { <add> MediaType mediaType = MediaType.parseMediaType(contentType); <add> return MediaType.APPLICATION_FORM_URLENCODED.includes(mediaType); <add> } <add> catch (IllegalArgumentException ex) { <add> } <ide> } <add> return false; <ide> } <ide> <ide>
1
Text
Text
remove trailing spaces from docs
bba29e591604fed8c1e3bc4cf911273d4c5e0f42
<ide><path>docs/axes/README.md <ide> There are a number of config callbacks that can be used to change parameters in <ide> | Name | Arguments | Description <ide> | ---- | --------- | ----------- <ide> | `beforeUpdate` | `axis` | Callback called before the update process starts. <del>| `beforeSetDimensions` | `axis` | Callback that runs before dimensions are set. <add>| `beforeSetDimensions` | `axis` | Callback that runs before dimensions are set. <ide> | `afterSetDimensions` | `axis` | Callback that runs after dimensions are set. <ide> | `beforeDataLimits` | `axis` | Callback that runs before data limits are determined. <ide> | `afterDataLimits` | `axis` | Callback that runs after data limits are determined. <ide> | `beforeBuildTicks` | `axis` | Callback that runs before ticks are created. <ide> | `afterBuildTicks` | `axis` | Callback that runs after ticks are created. Useful for filtering ticks. <ide> | `beforeTickToLabelConversion` | `axis` | Callback that runs before ticks are converted into strings. <del>| `afterTickToLabelConversion` | `axis` | Callback that runs after ticks are converted into strings. <add>| `afterTickToLabelConversion` | `axis` | Callback that runs after ticks are converted into strings. <ide> | `beforeCalculateTickRotation` | `axis` | Callback that runs before tick rotation is determined. <ide> | `afterCalculateTickRotation` | `axis` | Callback that runs after tick rotation is determined. <del>| `beforeFit` | `axis` | Callback that runs before the scale fits to the canvas. <del>| `afterFit` | `axis` | Callback that runs after the scale fits to the canvas. <add>| `beforeFit` | `axis` | Callback that runs before the scale fits to the canvas. <add>| `afterFit` | `axis` | Callback that runs after the scale fits to the canvas. <ide> | `afterUpdate` | `axis` | Callback that runs at the end of the update process. <ide> <ide> ## Updating Axis Defaults <ide><path>docs/axes/cartesian/time.md <ide> The `ticks.source` property controls the ticks generation <ide> * `'labels'`: generates ticks from user given `data.labels` values ONLY <ide> <ide> ### Parser <del>If this property is defined as a string, it is interpreted as a custom format to be used by moment to parse the date. <add>If this property is defined as a string, it is interpreted as a custom format to be used by moment to parse the date. <ide> <ide> If this is a function, it must return a moment.js object given the appropriate data value. <ide><path>docs/charts/bar.md <ide> A bar chart provides a way of showing data values represented as vertical bars. <ide> "type": "bar", <ide> "data": { <ide> "labels": [ <del> "January", <del> "February", <del> "March", <del> "April", <del> "May", <del> "June", <add> "January", <add> "February", <add> "March", <add> "April", <add> "May", <add> "June", <ide> "July" <ide> ], <ide> "datasets": [{ <ide><path>docs/charts/mixed.md <ide> At this point we have a chart rendering how we'd like. It's important to note th <ide> "type": "bar", <ide> "data": { <ide> "labels": [ <del> "January", <del> "February", <del> "March", <add> "January", <add> "February", <add> "March", <ide> "April" <ide> ], <ide> "datasets": [{ <ide><path>docs/charts/radar.md <ide> They are often useful for comparing the points of two or more different data set <ide> "type": "radar", <ide> "data": { <ide> "labels": [ <del> "Eating", <del> "Drinking", <del> "Sleeping", <add> "Eating", <add> "Drinking", <add> "Sleeping", <ide> "Designing", <ide> "Coding", <ide> "Cycling", <ide> The style of point. Options are: <ide> * 'circle' <ide> * 'cross' <ide> * 'crossRot' <del>* 'dash'. <add>* 'dash'. <ide> * 'line' <ide> * 'rect' <ide> * 'rectRounded' <ide> It is common to want to apply a configuration setting to all created radar chart <ide> <ide> ## Data Structure <ide> <del>The `data` property of a dataset for a radar chart is specified as a an array of numbers. Each point in the data array corresponds to the label at the same index on the x axis. <add>The `data` property of a dataset for a radar chart is specified as a an array of numbers. Each point in the data array corresponds to the label at the same index on the x axis. <ide> <ide> ```javascript <ide> data: [20, 10] <ide><path>docs/configuration/legend.md <ide> The legend configuration is passed into the `options.legend` namespace. The glob <ide> | `display` | `Boolean` | `true` | is the legend shown <ide> | `position` | `String` | `'top'` | Position of the legend. [more...](#position) <ide> | `fullWidth` | `Boolean` | `true` | Marks that this box should take the full width of the canvas (pushing down other boxes). This is unlikely to need to be changed in day-to-day use. <del>| `onClick` | `Function` | | A callback that is called when a click event is registered on a label item <add>| `onClick` | `Function` | | A callback that is called when a click event is registered on a label item <ide> | `onHover` | `Function` | | A callback that is called when a 'mousemove' event is registered on top of a label item <ide> | `reverse` | `Boolean` | `false` | Legend will show datasets in reverse order. <ide> | `labels` | `Object` | | See the [Legend Label Configuration](#legend-label-configuration) section below. <ide><path>docs/configuration/tooltip.md <ide> Example: <ide> Chart.Tooltip.positioners.custom = function(elements, eventPosition) { <ide> /** @type {Chart.Tooltip} */ <ide> var tooltip = this; <del> <add> <ide> /* ... */ <del> <add> <ide> return { <ide> x: 0, <ide> y: 0 <ide><path>docs/developers/charts.md <ide> The built in controller types are: <ide> For example, to derive a new chart type that extends from a bubble chart, you would do the following. <ide> <ide> ```javascript <del>// Sets the default config for 'derivedBubble' to be the same as the bubble defaults. <add>// Sets the default config for 'derivedBubble' to be the same as the bubble defaults. <ide> // We look for the defaults by doing Chart.defaults[chartType] <ide> // It looks like a bug exists when the defaults don't exist <ide> Chart.defaults.derivedBubble = Chart.defaults.bubble; <ide> var custom = Chart.controllers.bubble.extend({ <ide> <ide> // Stores the controller so that the chart initialization routine can look it up with <ide> // Chart.controllers[type] <del>Chart.controllers.derivedBubble = custom; <add>Chart.controllers.derivedBubble = custom; <ide> <ide> // Now we can create and use our new chart type <ide> new Chart(ctx, { <ide><path>docs/general/colors.md <ide> You can also pass a [CanvasGradient](https://developer.mozilla.org/en-US/docs/We <ide> <ide> ## Patterns and Gradients <ide> <del>An alternative option is to pass a [CanvasPattern](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern) or [CanvasGradient](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient) object instead of a string colour. <add>An alternative option is to pass a [CanvasPattern](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern) or [CanvasGradient](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient) object instead of a string colour. <ide> <ide> For example, if you wanted to fill a dataset with a pattern from an image you could do the following. <ide> <ide><path>docs/general/interactions/README.md <ide> # Interactions <ide> <del>The hover configuration is passed into the `options.hover` namespace. The global hover configuration is at `Chart.defaults.global.hover`. To configure which events trigger chart interactions, see [events](./events.md#events). <add>The hover configuration is passed into the `options.hover` namespace. The global hover configuration is at `Chart.defaults.global.hover`. To configure which events trigger chart interactions, see [events](./events.md#events). <ide> <ide> | Name | Type | Default | Description <ide> | ---- | ---- | ------- | ----------- <ide><path>docs/general/interactions/events.md <ide> The following properties define how the chart interacts with events. <ide> | `onHover` | `Function` | `null` | Called when any of the events fire. Called in the context of the chart and passed the event and an array of active elements (bars, points, etc). <ide> | `onClick` | `Function` | `null` | Called if the event is of type 'mouseup' or 'click'. Called in the context of the chart and passed the event and an array of active elements <ide> <del>## Event Option <add>## Event Option <ide> For example, to have the chart only respond to click events, you could do <ide> ```javascript <ide> var chart = new Chart(ctx, { <ide><path>docs/general/interactions/modes.md <ide> Finds the first item that intersects the point and returns it. Behaves like 'nea <ide> See `'index'` mode <ide> <ide> ## index <del>Finds item at the same index. If the `intersect` setting is true, the first intersecting item is used to determine the index in the data. If `intersect` false the nearest item, in the x direction, is used to determine the index. <add>Finds item at the same index. If the `intersect` setting is true, the first intersecting item is used to determine the index in the data. If `intersect` false the nearest item, in the x direction, is used to determine the index. <ide> <ide> ```javascript <ide> var chart = new Chart(ctx, {
12
Text
Text
add retry ci in collaborator guide
3ec88760e6a69419a6fc22a3b14bfeba137df666
<ide><path>doc/contributing/collaborator-guide.md <ide> current job but re-run everything else. Start a fresh CI if more than seven days <ide> have elapsed since the original failing CI as the compiled binaries for the <ide> Windows and ARM platforms are only kept for seven days. <ide> <add>If new commits are pushed to the pull request branch after the latest Jenkins <add>CI run, a fresh CI run is required. It can be started by pressing "Retry" on <add>the left sidebar, or by adding the `request-ci` label to the pull request. <add> <ide> #### Useful Jenkins CI jobs <ide> <ide> * [`node-test-pull-request`](https://ci.nodejs.org/job/node-test-pull-request/)
1
Python
Python
add image_name assignment to _to_node()
1f1433fdcfda399c96cc398b045a498ec5119a30
<ide><path>libcloud/container/drivers/kubernetes.py <ide> def _to_node(self, data): <ide> cpu = data["status"].get("capacity", {}).get("cpu", "1") <ide> if isinstance(cpu, str) and not cpu.isnumeric(): <ide> cpu = to_n_cpus_from_cpu_str(cpu) <del> # TODO: Find image <del> image_name = "undefined" <add> image_name = data["status"]["nodeInfo"]["osImage"] <ide> image = NodeImage(image_name, image_name, driver) <ide> size_name = f"{cpu} vCPUs, {memory} Ram" <ide> size_id = hashlib.md5(size_name.encode("utf-8")).hexdigest()
1
Javascript
Javascript
add setoverridemimetype() to xhrloader
0d47a62f8df511929057023f3884dbad1d4ebfba
<ide><path>src/loaders/FileLoader.js <ide> Object.assign( FileLoader.prototype, { <ide> if ( this.responseType !== undefined ) request.responseType = this.responseType; <ide> if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials; <ide> <del> if ( request.overrideMimeType ) request.overrideMimeType( 'text/plain' ); <add> if ( request.overrideMimeType ) request.overrideMimeType( this.mimeType !== undefined ? this.mimeType : 'text/plain' ); <ide> <ide> request.send( null ); <ide> <ide> Object.assign( FileLoader.prototype, { <ide> this.withCredentials = value; <ide> return this; <ide> <add> }, <add> <add> setMimeType: function ( value ) { <add> <add> this.mimeType = value; <add> return this; <add> <ide> } <ide> <ide> } );
1
Python
Python
replace getters/setters with properties
929b832b74ba874d4add74c6478fafab859db998
<ide><path>glances/core/glances_client.py <ide> def __init__(self, config=None, args=None, timeout=7, return_to_browser=False): <ide> self.args = args <ide> self.config = config <ide> <del> # Client mode: <del> self.set_mode() <add> # Default client mode <add> self._client_mode = 'glances' <ide> <ide> # Return to browser or exit <ide> self.return_to_browser = return_to_browser <ide> def log_and_exit(self, msg=''): <ide> else: <ide> logger.error(msg) <ide> <del> def set_mode(self, mode='glances'): <del> """Set the client mode. <del> <del> - 'glances' = Glances server (default) <del> - 'snmp' = SNMP (fallback) <del> """ <del> self.mode = mode <add> @property <add> def client_mode(self): <add> """Get the client mode.""" <add> return self._client_mode <ide> <del> def get_mode(self): <del> """Get the client mode. <add> @client_mode.setter <add> def client_mode(self, mode): <add> """Set the client mode. <ide> <ide> - 'glances' = Glances server (default) <ide> - 'snmp' = SNMP (fallback) <ide> """ <del> return self.mode <add> self._client_mode = mode <ide> <ide> def login(self): <ide> """Logon to the server.""" <ide> ret = True <ide> <ide> if not self.args.snmp_force: <ide> # First of all, trying to connect to a Glances server <del> self.set_mode('glances') <ide> client_version = None <ide> try: <ide> client_version = self.client.init() <ide> except socket.error as err: <ide> # Fallback to SNMP <del> logger.error("Connection to Glances server failed (%s)" % err) <del> self.set_mode('snmp') <del> fallbackmsg = _("Trying fallback to SNMP...") <add> self.client_mode = 'snmp' <add> logger.error("Connection to Glances server failed: {0}".format(err)) <add> fallbackmsg = _("No Glances server found. Trying fallback to SNMP...") <ide> if not self.return_to_browser: <ide> print(fallbackmsg) <ide> else: <ide> def login(self): <ide> self.log_and_exit(msg) <ide> return False <ide> <del> if self.get_mode() == 'glances' and version.split('.')[0] == client_version.split('.')[0]: <del> # Init stats <del> self.stats = GlancesStatsClient(config=self.config, args=self.args) <del> self.stats.set_plugins(json.loads(self.client.getAllPlugins())) <del> logger.debug( <del> "Client version: %s / Server version: %s" % (version, client_version)) <del> elif self.get_mode() == 'glances': <del> self.log_and_exit("Client and server not compatible: Client version: %s / Server version: %s" % (version, client_version)) <del> return False <add> if self.client_mode == 'glances': <add> # Check that both client and server are in the same major version <add> if version.split('.')[0] == client_version.split('.')[0]: <add> # Init stats <add> self.stats = GlancesStatsClient(config=self.config, args=self.args) <add> self.stats.set_plugins(json.loads(self.client.getAllPlugins())) <add> logger.debug("Client version: {0} / Server version: {1}".format(version, client_version)) <add> else: <add> self.log_and_exit("Client and server not compatible: \ <add> Client version: {0} / Server version: {1}".format(version, client_version)) <add> return False <ide> <ide> else: <del> self.set_mode('snmp') <add> self.client_mode = 'snmp' <ide> <del> if self.get_mode() == 'snmp': <add> # SNMP mode <add> if self.client_mode == 'snmp': <ide> logger.info("Trying to grab stats by SNMP...") <del> # Fallback to SNMP if needed <add> <ide> from glances.core.glances_stats import GlancesStatsClientSNMP <ide> <ide> # Init stats <ide> def login(self): <ide> <ide> def update(self): <ide> """Update stats from Glances/SNMP server.""" <del> if self.get_mode() == 'glances': <add> if self.client_mode == 'glances': <ide> return self.update_glances() <del> elif self.get_mode() == 'snmp': <add> elif self.client_mode == 'snmp': <ide> return self.update_snmp() <ide> else: <ide> self.end() <del> logger.critical("Unknown server mode: {0}".format(self.get_mode())) <add> logger.critical("Unknown server mode: {0}".format(self.client_mode)) <ide> sys.exit(2) <ide> <ide> def update_glances(self): <ide> def serve_forever(self): <ide> # Export stats using export modules <ide> self.stats.export(self.stats) <ide> <del> return self.get_mode() <add> return self.client_mode <ide> <ide> def end(self): <ide> """End of the client session."""
1
Javascript
Javascript
add warningfilter handling for yellowbox
e295f4a39466eab6353fff08b7b7558f7fa54396
<ide><path>Libraries/YellowBox/Data/YellowBoxRegistry.js <ide> <ide> const YellowBoxWarning = require('./YellowBoxWarning'); <ide> <del>import type {Category} from './YellowBoxCategory'; <del> <add>import type {Category, Message} from './YellowBoxCategory'; <add>import type {Stack} from './YellowBoxSymbolication'; <ide> export type Registry = Map<Category, $ReadOnlyArray<YellowBoxWarning>>; <ide> <ide> export type Observer = (registry: Registry) => void; <ide> let disabled = false; <ide> let projection = new Map(); <ide> let updateTimeout = null; <ide> <del>function isWarningIgnored(warning: YellowBoxWarning): boolean { <del> for (const pattern of ignorePatterns) { <del> if (pattern instanceof RegExp && pattern.test(warning.message.content)) { <del> return true; <del> } else if ( <del> typeof pattern === 'string' && <del> warning.message.content.includes(pattern) <del> ) { <del> return true; <del> } <del> } <del> return false; <del>} <del> <ide> function handleUpdate(): void { <ide> projection = new Map(); <ide> if (!disabled) { <ide> for (const [category, warnings] of registry) { <del> const filtered = warnings.filter(warning => !isWarningIgnored(warning)); <add> const filtered = warnings.filter( <add> warning => !YellowBoxRegistry.isWarningIgnored(warning.message), <add> ); <ide> if (filtered.length > 0) { <ide> projection.set(category, filtered); <ide> } <ide> function handleUpdate(): void { <ide> } <ide> <ide> const YellowBoxRegistry = { <add> isWarningIgnored(message: Message): boolean { <add> for (const pattern of ignorePatterns) { <add> if (pattern instanceof RegExp && pattern.test(message.content)) { <add> return true; <add> } else if ( <add> typeof pattern === 'string' && <add> message.content.includes(pattern) <add> ) { <add> return true; <add> } <add> } <add> return false; <add> }, <ide> add({ <del> args, <add> category, <add> message, <add> stack, <ide> }: $ReadOnly<{| <del> args: $ReadOnlyArray<mixed>, <add> category: Category, <add> message: Message, <add> stack: Stack, <ide> |}>): void { <del> if (typeof args[0] === 'string' && args[0].startsWith('(ADVICE)')) { <del> return; <del> } <del> const {category, message, stack} = YellowBoxWarning.parse({ <del> args, <del> }); <del> <ide> let warnings = registry.get(category); <ide> if (warnings == null) { <ide> warnings = []; <ide><path>Libraries/YellowBox/Data/__tests__/YellowBoxRegistry-test.js <ide> <ide> 'use strict'; <ide> <add>const YellowBoxWarning = require('../YellowBoxWarning'); <ide> const YellowBoxCategory = require('../YellowBoxCategory'); <ide> const YellowBoxRegistry = require('../YellowBoxRegistry'); <ide> <ide> describe('YellowBoxRegistry', () => { <ide> }); <ide> <ide> it('adds and deletes warnings', () => { <del> YellowBoxRegistry.add({args: ['A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <ide> const {category: categoryA} = YellowBoxCategory.parse(['A']); <ide> <ide> expect(registry().size).toBe(1); <ide> describe('YellowBoxRegistry', () => { <ide> }); <ide> <ide> it('clears all warnings', () => { <del> YellowBoxRegistry.add({args: ['A']}); <del> YellowBoxRegistry.add({args: ['B']}); <del> YellowBoxRegistry.add({args: ['C']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['B']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['C']})); <ide> <ide> expect(registry().size).toBe(3); <ide> <ide> describe('YellowBoxRegistry', () => { <ide> }); <ide> <ide> it('sorts warnings in chronological order', () => { <del> YellowBoxRegistry.add({args: ['A']}); <del> YellowBoxRegistry.add({args: ['B']}); <del> YellowBoxRegistry.add({args: ['C']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['B']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['C']})); <ide> <ide> const {category: categoryA} = YellowBoxCategory.parse(['A']); <ide> const {category: categoryB} = YellowBoxCategory.parse(['B']); <ide> describe('YellowBoxRegistry', () => { <ide> categoryC, <ide> ]); <ide> <del> YellowBoxRegistry.add({args: ['A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <ide> <ide> // Expect `A` to be hoisted to the end of the registry. <ide> expect(Array.from(registry().keys())).toEqual([ <ide> describe('YellowBoxRegistry', () => { <ide> }); <ide> <ide> it('ignores warnings matching patterns', () => { <del> YellowBoxRegistry.add({args: ['A!']}); <del> YellowBoxRegistry.add({args: ['B?']}); <del> YellowBoxRegistry.add({args: ['C!']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A!']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['B?']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['C!']})); <ide> expect(registry().size).toBe(3); <ide> <ide> YellowBoxRegistry.addIgnorePatterns(['!']); <ide> describe('YellowBoxRegistry', () => { <ide> }); <ide> <ide> it('ignores warnings matching regexs or pattern', () => { <del> YellowBoxRegistry.add({args: ['There are 4 dogs']}); <del> YellowBoxRegistry.add({args: ['There are 3 cats']}); <del> YellowBoxRegistry.add({args: ['There are H cats']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['There are 4 dogs']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['There are 3 cats']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['There are H cats']})); <ide> expect(registry().size).toBe(3); <ide> <ide> YellowBoxRegistry.addIgnorePatterns(['dogs']); <ide> describe('YellowBoxRegistry', () => { <ide> }); <ide> <ide> it('ignores all warnings when disabled', () => { <del> YellowBoxRegistry.add({args: ['A!']}); <del> YellowBoxRegistry.add({args: ['B?']}); <del> YellowBoxRegistry.add({args: ['C!']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A!']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['B?']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['C!']})); <ide> expect(registry().size).toBe(3); <ide> <ide> YellowBoxRegistry.setDisabled(true); <ide> describe('YellowBoxRegistry', () => { <ide> }); <ide> <ide> it('groups warnings by simple categories', () => { <del> YellowBoxRegistry.add({args: ['A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <ide> expect(registry().size).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <ide> expect(registry().size).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['B']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['B']})); <ide> expect(registry().size).toBe(2); <ide> }); <ide> <ide> it('groups warnings by format string categories', () => { <del> YellowBoxRegistry.add({args: ['%s', 'A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['%s', 'A']})); <ide> expect(registry().size).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['%s', 'B']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['%s', 'B']})); <ide> expect(registry().size).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <ide> expect(registry().size).toBe(2); <ide> <del> YellowBoxRegistry.add({args: ['B']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['B']})); <ide> expect(registry().size).toBe(3); <ide> }); <ide> <ide> it('groups warnings with consideration for arguments', () => { <del> YellowBoxRegistry.add({args: ['A', 'B']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A', 'B']})); <ide> expect(registry().size).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['A', 'B']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A', 'B']})); <ide> expect(registry().size).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['A', 'C']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A', 'C']})); <ide> expect(registry().size).toBe(2); <ide> <del> YellowBoxRegistry.add({args: ['%s', 'A', 'A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['%s', 'A', 'A']})); <ide> expect(registry().size).toBe(3); <ide> <del> YellowBoxRegistry.add({args: ['%s', 'B', 'A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['%s', 'B', 'A']})); <ide> expect(registry().size).toBe(3); <ide> <del> YellowBoxRegistry.add({args: ['%s', 'B', 'B']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['%s', 'B', 'B']})); <ide> expect(registry().size).toBe(4); <ide> }); <ide> <del> it('ignores warnings starting with "(ADVICE)"', () => { <del> YellowBoxRegistry.add({args: ['(ADVICE) ...']}); <del> expect(registry().size).toBe(0); <del> }); <del> <ide> it('does not ignore warnings formatted to start with "(ADVICE)"', () => { <del> YellowBoxRegistry.add({args: ['%s ...', '(ADVICE)']}); <add> YellowBoxRegistry.add( <add> YellowBoxWarning.parse({args: ['%s ...', '(ADVICE)']}), <add> ); <ide> expect(registry().size).toBe(1); <ide> }); <ide> <ide> describe('YellowBoxRegistry', () => { <ide> const {observer} = observe(); <ide> expect(observer.mock.calls.length).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['A']}); <del> YellowBoxRegistry.add({args: ['B']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['B']})); <ide> jest.runAllImmediates(); <ide> expect(observer.mock.calls.length).toBe(2); <ide> }); <ide> describe('YellowBoxRegistry', () => { <ide> const {observer} = observe(); <ide> expect(observer.mock.calls.length).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <ide> jest.runAllImmediates(); <ide> expect(observer.mock.calls.length).toBe(2); <ide> <ide> describe('YellowBoxRegistry', () => { <ide> const {observer} = observe(); <ide> expect(observer.mock.calls.length).toBe(1); <ide> <del> YellowBoxRegistry.add({args: ['A']}); <add> YellowBoxRegistry.add(YellowBoxWarning.parse({args: ['A']})); <ide> jest.runAllImmediates(); <ide> expect(observer.mock.calls.length).toBe(2); <ide> <ide><path>Libraries/YellowBox/YellowBox.js <ide> const React = require('react'); <ide> <ide> import type {Registry, IgnorePattern} from './Data/YellowBoxRegistry'; <add>import YellowBoxWarning from './Data/YellowBoxWarning'; <add> <ide> import * as LogBoxData from '../LogBox/Data/LogBoxData'; <ide> import NativeLogBox from '../NativeModules/specs/NativeLogBox'; <ide> <ide> if (__DEV__) { <ide> return; <ide> } <ide> errorImpl = function(...args) { <del> error.call(console, ...args); <del> // Show YellowBox for the `warning` module. <del> if (typeof args[0] === 'string' && args[0].startsWith('Warning: ')) { <del> registerWarning(...args); <del> } <add> registerError(...args); <ide> }; <ide> <ide> warnImpl = function(...args) { <del> warn.call(console, ...args); <ide> registerWarning(...args); <ide> }; <ide> <ide> if (__DEV__) { <ide> }; <ide> <ide> const registerWarning = (...args): void => { <del> YellowBoxRegistry.add({args}); <add> if (typeof args[0] === 'string' && args[0].startsWith('(ADVICE)')) { <add> return; <add> } <add> <add> const {category, message, stack} = YellowBoxWarning.parse({ <add> args, <add> }); <add> <add> if (!YellowBoxRegistry.isWarningIgnored(message)) { <add> YellowBoxRegistry.add({category, message, stack}); <add> warn.call(console, ...args); <add> } <add> }; <add> <add> const registerError = (...args): void => { <add> // Only show YellowBox for the `warning` module, otherwise pass through and skip. <add> if (typeof args[0] !== 'string' || !args[0].startsWith('Warning: ')) { <add> error.call(console, ...args); <add> return; <add> } <add> <add> const format = args[0].replace('Warning: ', ''); <add> const filterResult = LogBoxData.checkWarningFilter(format); <add> if (filterResult.suppressCompletely) { <add> return; <add> } <add> <add> args[0] = filterResult.finalFormat; <add> const {category, message, stack} = YellowBoxWarning.parse({ <add> args, <add> }); <add> <add> if (YellowBoxRegistry.isWarningIgnored(message)) { <add> return; <add> } <add> <add> if (filterResult.forceDialogImmediately === true) { <add> // This will pop a redbox. Do not downgrade. These are real bugs with same severity as throws. <add> error.call(console, message.content); <add> } else { <add> // Unfortunately, we need to add the Warning: prefix back so we don't show a redbox later. <add> args[0] = `Warning: ${filterResult.finalFormat}`; <add> <add> // Note: YellowBox has no concept of "soft errors" so we're showing YellowBox for those. <add> YellowBoxRegistry.add({category, message, stack}); <add> error.call(console, ...args); <add> } <ide> }; <ide> } else { <ide> YellowBox = class extends React.Component<Props, State> { <ide><path>Libraries/YellowBox/__tests__/YellowBox-test.js <ide> 'use strict'; <ide> <ide> import * as React from 'react'; <del>const YellowBox = require('../YellowBox'); <ide> const YellowBoxRegistry = require('../Data/YellowBoxRegistry'); <ide> const LogBoxData = require('../../LogBox/Data/LogBoxData'); <ide> const render = require('../../../jest/renderer'); <ide> jest.mock('../../LogBox/LogBoxNotificationContainer', () => ({ <ide> default: 'LogBoxNotificationContainer', <ide> })); <ide> <add>type Overrides = {| <add> forceDialogImmediately?: boolean, <add> suppressDialog_LEGACY?: boolean, <add> suppressCompletely?: boolean, <add>|}; <add> <add>const setFilter = (options?: Overrides) => { <add> LogBoxData.setWarningFilter(format => ({ <add> finalFormat: format, <add> forceDialogImmediately: false, <add> suppressDialog_LEGACY: false, <add> suppressCompletely: false, <add> monitorEvent: null, <add> monitorListVersion: 0, <add> monitorSampleRate: 0, <add> ...options, <add> })); <add>}; <add> <add>const install = () => { <add> const YellowBox = require('../YellowBox'); <add> YellowBox.install(); <add>}; <add> <add>const uninstall = () => { <add> const YellowBox = require('../YellowBox'); <add> YellowBox.uninstall(); <add>}; <add> <ide> describe('YellowBox', () => { <ide> const {error, warn} = console; <add> const mockError = jest.fn(); <add> const mockWarn = jest.fn(); <ide> <ide> beforeEach(() => { <ide> jest.resetModules(); <del> (console: any).error = jest.fn(); <del> (console: any).warn = jest.fn(); <add> <add> mockError.mockClear(); <add> mockWarn.mockClear(); <add> <add> (console: any).error = mockError; <add> (console: any).warn = mockWarn; <ide> }); <ide> <ide> afterEach(() => { <del> YellowBox.uninstall(); <add> uninstall(); <ide> (console: any).error = error; <ide> (console: any).warn = warn; <ide> }); <ide> <ide> it('can set `disableYellowBox` after installing', () => { <ide> expect((console: any).disableYellowBox).toBe(undefined); <ide> <del> YellowBox.install(); <add> install(); <ide> <ide> expect((console: any).disableYellowBox).toBe(false); <ide> expect(YellowBoxRegistry.isDisabled()).toBe(false); <ide> describe('YellowBox', () => { <ide> expect((console: any).disableYellowBox).toBe(undefined); <ide> <ide> (console: any).disableYellowBox = true; <del> YellowBox.install(); <add> install(); <ide> <ide> expect((console: any).disableYellowBox).toBe(true); <ide> expect(YellowBoxRegistry.isDisabled()).toBe(true); <ide> describe('YellowBox', () => { <ide> it('registers warnings', () => { <ide> jest.mock('../Data/YellowBoxRegistry'); <ide> <del> YellowBox.install(); <add> install(); <ide> <ide> expect(YellowBoxRegistry.add).not.toBeCalled(); <ide> (console: any).warn('...'); <ide> expect(YellowBoxRegistry.add).toBeCalled(); <add> expect(mockWarn).toBeCalledTimes(1); <add> expect(mockWarn).toBeCalledWith('...'); <ide> }); <ide> <del> it('registers errors beginning with "Warning: "', () => { <add> it('registers errors', () => { <ide> jest.mock('../Data/YellowBoxRegistry'); <ide> <del> YellowBox.install(); <add> install(); <ide> <ide> (console: any).error('...'); <ide> expect(YellowBoxRegistry.add).not.toBeCalled(); <add> expect(mockError).toBeCalledTimes(1); <add> expect(mockError).toBeCalledWith('...'); <add> }); <add> <add> it('skips ADVICE warnings', () => { <add> jest.mock('../Data/YellowBoxRegistry'); <add> <add> install(); <add> <add> (console: any).warn('(ADVICE) Ignore me'); <add> expect(YellowBoxRegistry.add).not.toBeCalled(); <add> expect(mockWarn).not.toBeCalled(); <add> }); <add> <add> it('skips ignored warnings', () => { <add> jest.mock('../Data/YellowBoxRegistry'); <add> <add> install(); <add> <add> (YellowBoxRegistry: any).isWarningIgnored.mockReturnValue(true); <add> (console: any).warn('Ignore me'); <add> expect(YellowBoxRegistry.add).not.toBeCalled(); <add> expect(mockWarn).not.toBeCalled(); <add> }); <add> <add> it('registers Warning module errors with default options to YellowBox', () => { <add> jest.mock('../Data/YellowBoxRegistry'); <add> <add> setFilter(); <add> install(); <ide> <ide> (console: any).error('Warning: ...'); <ide> expect(YellowBoxRegistry.add).toBeCalled(); <add> expect(mockError).toBeCalled(); <add> expect(mockError).toBeCalledTimes(1); <add> expect(mockWarn).not.toBeCalled(); <add> }); <add> <add> it('skips Warning module errors with forceDialogImmediately', () => { <add> jest.mock('../Data/YellowBoxRegistry'); <add> <add> setFilter({ <add> suppressCompletely: true, <add> }); <add> install(); <add> <add> (console: any).error('Warning: ...'); <add> expect(YellowBoxRegistry.add).not.toBeCalled(); <add> expect(mockError).not.toBeCalled(); <add> expect(mockWarn).not.toBeCalled(); <add> }); <add> <add> it('registers Warning errors with forceDialogImmediately as console.error (with interpolation)', () => { <add> jest.mock('../Data/YellowBoxRegistry'); <add> <add> setFilter({ <add> forceDialogImmediately: true, <add> }); <add> <add> install(); <add> <add> (console: any).error('Warning: %s', 'Something'); <add> expect(YellowBoxRegistry.add).not.toBeCalled(); <add> expect(mockWarn).not.toBeCalled(); <add> expect(mockError).toBeCalledTimes(1); <add> <add> // We expect this to be the interpolated value because we don't do interpolation downstream. <add> // We also strip the "Warning" prefix, otherwise the redbox would be skipped downstream. <add> expect(mockError).toBeCalledWith('Something'); <add> }); <add> <add> it('registers Warning errors with suppressDialog_LEGACY to YellowBox', () => { <add> jest.mock('../Data/YellowBoxRegistry'); <add> <add> setFilter({ <add> suppressDialog_LEGACY: true, <add> }); <add> <add> install(); <add> <add> (console: any).error('Warning: Something'); <add> expect(YellowBoxRegistry.add).toBeCalledTimes(1); <add> expect(mockWarn).not.toBeCalled(); <add> expect(mockError).toBeCalledTimes(1); <add> <add> // We cannot strip the "Warning" prefix or it would pop a redbox. <add> expect(mockError).toBeCalledWith('Warning: Something'); <add> }); <add> <add> it('skips Warning errors sent to YellowBox but ignored by patterns', () => { <add> jest.mock('../Data/YellowBoxRegistry'); <add> <add> setFilter({ <add> suppressDialog_LEGACY: true, <add> }); <add> <add> install(); <add> (YellowBoxRegistry: any).isWarningIgnored.mockReturnValue(true); <add> <add> (console: any).error('Warning: ...'); <add> expect(YellowBoxRegistry.add).not.toBeCalled(); <add> expect(mockWarn).not.toBeCalled(); <add> expect(mockError).not.toBeCalled(); <ide> }); <ide> <ide> it('if LogBox is enabled, installs and uninstalls LogBox', () => { <ide> jest.mock('../../LogBox/Data/LogBoxData'); <ide> jest.mock('../Data/YellowBoxRegistry'); <del> <add> const YellowBox = require('../YellowBox'); <ide> YellowBox.__unstable_enableLogBox(); <del> YellowBox.install(); <add> install(); <ide> <ide> (console: any).warn('Some warning'); <ide> expect(YellowBoxRegistry.add).not.toBeCalled(); <ide> expect(LogBoxData.addLog).toBeCalled(); <del> expect(YellowBox.__unstable_isLogBoxEnabled()).toBe(true); <add> expect(require('../YellowBox').__unstable_isLogBoxEnabled()).toBe(true); <ide> <del> YellowBox.uninstall(); <add> uninstall(); <ide> (LogBoxData.addLog: any).mockClear(); <ide> <ide> (console: any).warn('Some warning'); <ide> describe('YellowBox', () => { <ide> <ide> it('throws if LogBox is enabled after YellowBox is installed', () => { <ide> jest.mock('../Data/YellowBoxRegistry'); <del> <del> YellowBox.install(); <add> const YellowBox = require('../YellowBox'); <add> install(); <ide> <ide> expect(() => YellowBox.__unstable_enableLogBox()).toThrow( <ide> 'LogBox must be enabled before AppContainer is required so that it can properly wrap the console methods.\n\nPlease enable LogBox earlier in your app.\n\n', <ide> ); <ide> }); <ide> <ide> it('should render YellowBoxContainer by default', () => { <add> const YellowBox = require('../YellowBox'); <add> <ide> const output = render.shallowRender(<YellowBox />); <ide> <ide> expect(output).toMatchSnapshot(); <ide> }); <ide> <ide> it('should render LogBoxNotificationContainer when LogBox is enabled', () => { <add> const YellowBox = require('../YellowBox'); <add> <ide> YellowBox.__unstable_enableLogBox(); <ide> <ide> const output = render.shallowRender(<YellowBox />);
4
Ruby
Ruby
remove proc handling from buildenvironment
7ee49db51e27b4403d3f24747262d9c9891c8477
<ide><path>Library/Homebrew/build_environment.rb <ide> require 'set' <ide> <ide> class BuildEnvironment <del> attr_accessor :proc <del> <ide> def initialize(*settings) <ide> @settings = Set.new(*settings) <ide> end <ide> def std? <ide> def userpaths? <ide> @settings.include? :userpaths <ide> end <del> <del> def modify_build_environment(receiver) <del> receiver.instance_eval(&proc) if self.proc <del> end <del> <del> def marshal_dump <del> @settings <del> end <del> <del> def marshal_load(data) <del> @settings = data <del> end <del> <del> def _dump(*) <del> Marshal.dump(marshal_dump) <del> end <del> <del> def self._load(s) <del> new(Marshal.load(s)) <del> end <ide> end <ide> <ide> module BuildEnvironmentDSL <del> def env(*settings, &block) <add> def env(*settings) <ide> @env ||= BuildEnvironment.new <del> if block_given? <del> @env.proc = block <del> else <del> @env.merge(settings) <del> end <del> @env <add> @env.merge(settings) <ide> end <ide> end <ide><path>Library/Homebrew/test/test_build_environment.rb <ide> def test_userpaths? <ide> @env << :userpaths <ide> assert_predicate @env, :userpaths? <ide> end <del> <del> def test_modify_build_environment <del> @env.proc = Proc.new { raise StandardError } <del> assert_raises(StandardError) do <del> @env.modify_build_environment(self) <del> end <del> end <del> <del> def test_marshal <del> @env << :userpaths <del> @env.proc = Proc.new {} <del> assert_predicate Marshal.load(Marshal.dump(@env)), :userpaths? <del> end <del> <del> def test_env_block <del> error = Class.new(StandardError) <del> @env.proc = Proc.new { raise error } <del> assert_raises(error) { @env.modify_build_environment(self) } <del> end <del> <del> def test_env_block_with_argument <del> error = Class.new(StandardError) <del> @env.proc = Proc.new { |x| raise x } <del> assert_raises(error) { @env.modify_build_environment(error) } <del> end <ide> end <ide> <ide> class BuildEnvironmentDSLTests < Homebrew::TestCase
2
Javascript
Javascript
define shader name
9d9fbee78e1fb22e0a128f68e00052a6020e3aaf
<ide><path>src/renderers/webgl/plugins/SpritePlugin.js <ide> function SpritePlugin( renderer, sprites ) { <ide> <ide> 'precision ' + renderer.getPrecision() + ' float;', <ide> <add> '#define SHADER_NAME ' + 'SpriteMaterial', <add> <ide> 'uniform mat4 modelViewMatrix;', <ide> 'uniform mat4 projectionMatrix;', <ide> 'uniform float rotation;', <ide> function SpritePlugin( renderer, sprites ) { <ide> <ide> 'precision ' + renderer.getPrecision() + ' float;', <ide> <add> '#define SHADER_NAME ' + 'SpriteMaterial', <add> <ide> 'uniform vec3 color;', <ide> 'uniform sampler2D map;', <ide> 'uniform float opacity;',
1
Javascript
Javascript
add method `preventdefault()` to `navigationevent`
326a66ba077a790211bf8d8842fdb784f1b38aac
<ide><path>Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js <ide> /** <del> * Copyright 2004-present Facebook. All Rights Reserved. <add> * Copyright (c) 2015, Facebook, Inc. All rights reserved. <add> * <add> * Facebook, Inc. (“Facebook”) owns all right, title and interest, including <add> * all intellectual property and other proprietary rights, in and to the React <add> * Native CustomComponents software (the “Software”). Subject to your <add> * compliance with these terms, you are hereby granted a non-exclusive, <add> * worldwide, royalty-free copyright license to (1) use and copy the Software; <add> * and (2) reproduce and distribute the Software as part of your own software <add> * (“Your Software”). Facebook reserves all rights not expressly granted to <add> * you in this license agreement. <add> * <add> * THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS <add> * OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES <add> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. <add> * IN NO EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR <add> * EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, <add> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, <add> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; <add> * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, <add> * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR <add> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF <add> * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <ide> * <ide> * @providesModule NavigationEvent <ide> * @flow <ide> */ <ide> 'use strict'; <ide> <add>var invariant = require('invariant'); <add> <add>class NavigationEventPool { <add> _list: Array<any>; <add> <add> constructor() { <add> this._list = []; <add> } <add> <add> get(type: String, target: Object, data: any): NavigationEvent { <add> var event; <add> if (this._list.length > 0) { <add> event = this._list.pop(); <add> event.constructor.call(event, type, target, data); <add> } else { <add> event = new NavigationEvent(type, target, data); <add> } <add> return event; <add> } <add> <add> put(event: NavigationEvent) { <add> this._list.push(event); <add> } <add>} <add> <add>var _navigationEventPool = new NavigationEventPool(); <add> <ide> class NavigationEvent { <del> type: String; <del> target: Object; <del> data: any; <add> _data: any; <add> _defaultPrevented: boolean; <add> _disposed: boolean; <add> _target: ?Object; <add> _type: ?String; <add> <add> static pool(type: String, target: Object, data: any): NavigationEvent { <add> return _navigationEventPool.get(type, target, data); <add> } <ide> <ide> constructor(type: String, target: Object, data: any) { <del> this.type = type; <del> this.target = target; <del> this.data = data; <add> this._type = type; <add> this._target = target; <add> this._data = data; <add> this._defaultPrevented = false; <add> this._disposed = false; <add> } <add> <add> /* $FlowFixMe - get/set properties not yet supported */ <add> get type(): string { <add> return this._type; <add> } <add> <add> /* $FlowFixMe - get/set properties not yet supported */ <add> get target(): Object { <add> return this._target; <add> } <add> <add> /* $FlowFixMe - get/set properties not yet supported */ <add> get data(): any { <add> return this._data; <add> } <add> <add> /* $FlowFixMe - get/set properties not yet supported */ <add> get defaultPrevented(): boolean { <add> return this._defaultPrevented; <add> } <add> <add> preventDefault(): void { <add> this._defaultPrevented = true; <add> } <add> <add> /** <add> * Dispose the event. <add> * NavigationEvent shall be disposed after being emitted by <add> * `NavigationEventEmitter`. <add> */ <add> dispose(): void { <add> invariant(!this._disposed, 'NavigationEvent is already disposed'); <add> this._disposed = true; <add> <add> // Clean up. <add> this._type = null; <add> this._target = null; <add> this._data = null; <add> this._defaultPrevented = false; <add> <add> // Put this back to the pool to reuse the instance. <add> _navigationEventPool.put(this); <ide> } <ide> } <ide> <ide><path>Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEvent-test.js <add> <add>/** <add> * Copyright (c) 2015, Facebook, Inc. All rights reserved. <add> * <add> * Facebook, Inc. (“Facebook”) owns all right, title and interest, including <add> * all intellectual property and other proprietary rights, in and to the React <add> * Native CustomComponents software (the “Software”). Subject to your <add> * compliance with these terms, you are hereby granted a non-exclusive, <add> * worldwide, royalty-free copyright license to (1) use and copy the Software; <add> * and (2) reproduce and distribute the Software as part of your own software <add> * (“Your Software”). Facebook reserves all rights not expressly granted to <add> * you in this license agreement. <add> * <add> * THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS <add> * OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES <add> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. <add> * IN NO EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR <add> * EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, <add> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, <add> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; <add> * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, <add> * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR <add> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF <add> * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <add> */ <add>'use strict'; <add> <add>jest <add> .dontMock('NavigationEvent') <add> .dontMock('invariant'); <add> <add>var NavigationEvent = require('NavigationEvent'); <add> <add>describe('NavigationEvent', () => { <add> it('constructs', () => { <add> var target = {}; <add> var event = new NavigationEvent('foo', target, 123); <add> expect(event.type).toBe('foo'); <add> expect(event.target).toBe(target); <add> expect(event.data).toBe(123); <add> }); <add> <add> it('constructs from pool', () => { <add> var target = {}; <add> var event = NavigationEvent.pool('foo', target, 123); <add> expect(event.type).toBe('foo'); <add> expect(event.target).toBe(target); <add> expect(event.data).toBe(123); <add> }); <add> <add> it('prevents default', () => { <add> var event = new NavigationEvent('foo', {}, 123); <add> expect(event.defaultPrevented).toBe(false); <add> event.preventDefault(); <add> expect(event.defaultPrevented).toBe(true); <add> }); <add> <add> it('recycles', () => { <add> var event1 = NavigationEvent.pool('foo', {}, 123); <add> event1.dispose(); <add> expect(event1.type).toBe(null); <add> expect(event1.data).toBe(null); <add> expect(event1.target).toBe(null); <add> <add> var event2 = NavigationEvent.pool('bar', {}, 456); <add> expect(event2.type).toBe('bar'); <add> expect(event2).toBe(event1); <add> }); <add>}); <add> <add>
2
Python
Python
fix await_container_completion condition
42abbf0d61f94ec50026af0c0f95eb378e403042
<ide><path>airflow/providers/cncf/kubernetes/utils/pod_manager.py <ide> def consume_logs(*, since_time: Optional[DateTime] = None, follow: bool = True) <ide> time.sleep(1) <ide> <ide> def await_container_completion(self, pod: V1Pod, container_name: str) -> None: <del> while not self.container_is_running(pod=pod, container_name=container_name): <add> while self.container_is_running(pod=pod, container_name=container_name): <ide> time.sleep(1) <ide> <ide> def await_pod_completion(self, pod: V1Pod) -> V1Pod:
1
Java
Java
add httpserviceproxyfactory builder
b1384ddafa9c6aac76312c103ba69c901f7b75f1
<ide><path>spring-web/src/main/java/org/springframework/web/service/invoker/HttpServiceProxyFactory.java <ide> <ide> import java.lang.reflect.Method; <ide> import java.time.Duration; <del>import java.util.HashMap; <add>import java.util.ArrayList; <ide> import java.util.List; <ide> import java.util.Map; <add>import java.util.function.Function; <add>import java.util.stream.Collectors; <ide> <ide> import org.aopalliance.intercept.MethodInterceptor; <ide> import org.aopalliance.intercept.MethodInvocation; <ide> import org.springframework.core.MethodIntrospector; <ide> import org.springframework.core.ReactiveAdapterRegistry; <ide> import org.springframework.core.annotation.AnnotatedElementUtils; <add>import org.springframework.core.convert.ConversionService; <add>import org.springframework.format.support.DefaultFormattingConversionService; <add>import org.springframework.lang.Nullable; <add>import org.springframework.util.Assert; <ide> import org.springframework.web.service.annotation.HttpExchange; <ide> <ide> <ide> /** <del> * Factory to create a proxy for an HTTP service with {@link HttpExchange} methods. <add> * Factory for creating a client proxy given an HTTP service interface with <add> * {@link HttpExchange @HttpExchange} methods. <ide> * <ide> * @author Rossen Stoyanchev <ide> * @since 6.0 <ide> */ <del>public class HttpServiceProxyFactory { <del> <del> private final List<HttpServiceArgumentResolver> argumentResolvers; <add>public final class HttpServiceProxyFactory { <ide> <ide> private final HttpClientAdapter clientAdapter; <ide> <add> private final List<HttpServiceArgumentResolver> argumentResolvers; <add> <ide> private final ReactiveAdapterRegistry reactiveAdapterRegistry; <ide> <ide> private final Duration blockTimeout; <ide> <ide> <del> public HttpServiceProxyFactory( <del> List<HttpServiceArgumentResolver> argumentResolvers, HttpClientAdapter clientAdapter, <add> private HttpServiceProxyFactory( <add> HttpClientAdapter clientAdapter, List<HttpServiceArgumentResolver> argumentResolvers, <ide> ReactiveAdapterRegistry reactiveAdapterRegistry, Duration blockTimeout) { <ide> <del> this.argumentResolvers = argumentResolvers; <ide> this.clientAdapter = clientAdapter; <add> this.argumentResolvers = argumentResolvers; <ide> this.reactiveAdapterRegistry = reactiveAdapterRegistry; <ide> this.blockTimeout = blockTimeout; <ide> } <ide> <ide> <ide> /** <del> * Create a proxy for executing requests to the given HTTP service. <add> * Return a proxy that implements the given HTTP service interface to perform <add> * HTTP requests and retrieves responses through an HTTP client. <ide> * @param serviceType the HTTP service to create a proxy for <del> * @param <S> the service type <add> * @param <S> the HTTP service type <ide> * @return the created proxy <ide> */ <ide> public <S> S createClient(Class<S> serviceType) { <ide> <ide> List<HttpServiceMethod> methods = <del> MethodIntrospector.selectMethods(serviceType, this::isHttpRequestMethod) <add> MethodIntrospector.selectMethods(serviceType, this::isExchangeMethod) <ide> .stream() <del> .map(method -> initServiceMethod(method, serviceType)) <add> .map(method -> <add> new HttpServiceMethod( <add> method, serviceType, this.argumentResolvers, <add> this.clientAdapter, this.reactiveAdapterRegistry, this.blockTimeout)) <ide> .toList(); <ide> <ide> return ProxyFactory.getProxy(serviceType, new HttpServiceMethodInterceptor(methods)); <ide> } <ide> <del> private boolean isHttpRequestMethod(Method method) { <add> private boolean isExchangeMethod(Method method) { <ide> return AnnotatedElementUtils.hasAnnotation(method, HttpExchange.class); <ide> } <ide> <del> private HttpServiceMethod initServiceMethod(Method method, Class<?> serviceType) { <del> return new HttpServiceMethod( <del> method, serviceType, this.argumentResolvers, <del> this.clientAdapter, this.reactiveAdapterRegistry, this.blockTimeout); <add> <add> /** <add> * Return a builder for an {@link HttpServiceProxyFactory}. <add> * @param adapter an adapter for the underlying HTTP client <add> * @return the builder <add> */ <add> public static Builder builder(HttpClientAdapter adapter) { <add> return new Builder(adapter); <add> } <add> <add> <add> /** <add> * Builder for {@link HttpServiceProxyFactory}. <add> */ <add> public final static class Builder { <add> <add> private final HttpClientAdapter clientAdapter; <add> <add> private final List<HttpServiceArgumentResolver> customResolvers = new ArrayList<>(); <add> <add> @Nullable <add> private ConversionService conversionService; <add> <add> private ReactiveAdapterRegistry reactiveAdapterRegistry = ReactiveAdapterRegistry.getSharedInstance(); <add> <add> private Duration blockTimeout = Duration.ofSeconds(5); <add> <add> private Builder(HttpClientAdapter clientAdapter) { <add> Assert.notNull(clientAdapter, "HttpClientAdapter is required"); <add> this.clientAdapter = clientAdapter; <add> } <add> <add> /** <add> * Register a custom argument resolver. This will be inserted ahead of <add> * default resolvers. <add> * @return the same builder instance <add> */ <add> public Builder addCustomResolver(HttpServiceArgumentResolver resolver) { <add> this.customResolvers.add(resolver); <add> return this; <add> } <add> <add> /** <add> * Set the {@link ConversionService} to use where input values need to <add> * be formatted as Strings. <add> * <p>By default this is {@link DefaultFormattingConversionService}. <add> * @return the same builder instance <add> */ <add> public Builder setConversionService(ConversionService conversionService) { <add> this.conversionService = conversionService; <add> return this; <add> } <add> <add> /** <add> * Set the {@link ReactiveAdapterRegistry} to use to support different <add> * asynchronous types for HTTP Service method return values. <add> * <p>By default this is {@link ReactiveAdapterRegistry#getSharedInstance()}. <add> * @return the same builder instance <add> */ <add> public Builder setReactiveAdapterRegistry(ReactiveAdapterRegistry registry) { <add> this.reactiveAdapterRegistry = registry; <add> return this; <add> } <add> <add> /** <add> * Configure how long to wait for a response for an HTTP Service method <add> * with a synchronous (blocking) method signature. <add> * <p>By default this is 5 seconds. <add> * @param blockTimeout the timeout value <add> * @return the same builder instance <add> */ <add> public Builder setBlockTimeout(Duration blockTimeout) { <add> this.blockTimeout = blockTimeout; <add> return this; <add> } <add> <add> /** <add> * Build and return the {@link HttpServiceProxyFactory} instance. <add> */ <add> public HttpServiceProxyFactory build() { <add> <add> ConversionService conversionService = initConversionService(); <add> List<HttpServiceArgumentResolver> resolvers = initArgumentResolvers(conversionService); <add> <add> return new HttpServiceProxyFactory( <add> this.clientAdapter, resolvers, this.reactiveAdapterRegistry, this.blockTimeout); <add> } <add> <add> private ConversionService initConversionService() { <add> return (this.conversionService != null ? <add> this.conversionService : new DefaultFormattingConversionService()); <add> } <add> <add> private List<HttpServiceArgumentResolver> initArgumentResolvers(ConversionService conversionService) { <add> List<HttpServiceArgumentResolver> resolvers = new ArrayList<>(this.customResolvers); <add> resolvers.add(new HttpMethodArgumentResolver()); <add> resolvers.add(new PathVariableArgumentResolver(conversionService)); <add> return resolvers; <add> } <add> <ide> } <ide> <ide> <ide> private HttpServiceMethod initServiceMethod(Method method, Class<?> serviceType) <ide> */ <ide> private static final class HttpServiceMethodInterceptor implements MethodInterceptor { <ide> <del> private final Map<Method, HttpServiceMethod> httpServiceMethods = new HashMap<>(); <add> private final Map<Method, HttpServiceMethod> httpServiceMethods; <ide> <ide> private HttpServiceMethodInterceptor(List<HttpServiceMethod> methods) { <del> methods.forEach(serviceMethod -> this.httpServiceMethods.put(serviceMethod.getMethod(), serviceMethod)); <add> this.httpServiceMethods = methods.stream() <add> .collect(Collectors.toMap(HttpServiceMethod::getMethod, Function.identity())); <ide> } <ide> <ide> @Override <ide> public Object invoke(MethodInvocation invocation) { <ide> HttpServiceMethod httpServiceMethod = this.httpServiceMethods.get(method); <ide> return httpServiceMethod.invoke(invocation.getArguments()); <ide> } <del> <ide> } <ide> <ide> } <ide><path>spring-web/src/test/java/org/springframework/web/service/invoker/HttpMethodArgumentResolverTests.java <ide> public class HttpMethodArgumentResolverTests { <ide> <ide> private final TestHttpClientAdapter clientAdapter = new TestHttpClientAdapter(); <ide> <del> private final Service service = this.clientAdapter.createService(Service.class, new HttpMethodArgumentResolver()); <add> private final Service service = this.clientAdapter.createService(Service.class); <ide> <ide> <ide> @Test <ide><path>spring-web/src/test/java/org/springframework/web/service/invoker/PathVariableArgumentResolverTests.java <ide> <ide> import org.junit.jupiter.api.Test; <ide> <del>import org.springframework.core.convert.support.DefaultConversionService; <ide> import org.springframework.lang.Nullable; <ide> import org.springframework.web.bind.annotation.PathVariable; <ide> import org.springframework.web.service.annotation.GetExchange; <ide> class PathVariableArgumentResolverTests { <ide> <ide> private final TestHttpClientAdapter clientAdapter = new TestHttpClientAdapter(); <ide> <del> private final Service service = this.clientAdapter.createService( <del> Service.class, new PathVariableArgumentResolver(new DefaultConversionService())); <add> private final Service service = this.clientAdapter.createService(Service.class); <ide> <ide> <ide> @Test <ide><path>spring-web/src/test/java/org/springframework/web/service/invoker/TestHttpClientAdapter.java <ide> <ide> package org.springframework.web.service.invoker; <ide> <del>import java.time.Duration; <del>import java.util.Arrays; <del> <ide> import reactor.core.publisher.Flux; <ide> import reactor.core.publisher.Mono; <ide> <ide> import org.springframework.core.ParameterizedTypeReference; <del>import org.springframework.core.ReactiveAdapterRegistry; <ide> import org.springframework.http.HttpHeaders; <ide> import org.springframework.http.ResponseEntity; <ide> import org.springframework.lang.Nullable; <ide> class TestHttpClientAdapter implements HttpClientAdapter { <ide> /** <ide> * Create the proxy for the give service type. <ide> */ <del> public <S> S createService(Class<S> serviceType, HttpServiceArgumentResolver... resolvers) { <del> <del> HttpServiceProxyFactory factory = new HttpServiceProxyFactory( <del> Arrays.asList(resolvers), this, ReactiveAdapterRegistry.getSharedInstance(), Duration.ofSeconds(5)); <del> <add> public <S> S createService(Class<S> serviceType) { <add> HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(this).build(); <ide> return factory.createClient(serviceType); <ide> } <ide> <ide><path>spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientHttpServiceProxyTests.java <ide> <ide> import java.io.IOException; <ide> import java.time.Duration; <del>import java.util.Collections; <ide> import java.util.function.Consumer; <ide> <ide> import okhttp3.mockwebserver.MockResponse; <ide> import reactor.core.publisher.Mono; <ide> import reactor.test.StepVerifier; <ide> <del>import org.springframework.core.ReactiveAdapterRegistry; <ide> import org.springframework.http.client.reactive.ReactorClientHttpConnector; <ide> import org.springframework.web.reactive.function.client.WebClient; <ide> import org.springframework.web.service.annotation.GetExchange; <ide> void setUp() { <ide> .baseUrl(this.server.url("/").toString()) <ide> .build(); <ide> <del> WebClientAdapter webClientAdapter = new WebClientAdapter(webClient); <del> <del> HttpServiceProxyFactory proxyFactory = new HttpServiceProxyFactory( <del> Collections.emptyList(), webClientAdapter, ReactiveAdapterRegistry.getSharedInstance(), <del> Duration.ofSeconds(5)); <add> WebClientAdapter clientAdapter = new WebClientAdapter(webClient); <add> HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(clientAdapter).build(); <ide> <ide> this.httpService = proxyFactory.createClient(TestHttpService.class); <ide> }
5
Text
Text
use gfm footnotes in webcrypto.md
a749c1f20c79d09b890cff91961126f84ff345ec
<ide><path>doc/api/webcrypto.md <ide> async function digest(data, algorithm = 'SHA-512') { <ide> The table details the algorithms supported by the Node.js Web Crypto API <ide> implementation and the APIs supported for each: <ide> <del>| Algorithm | `generateKey` | `exportKey` | `importKey` | `encrypt` | `decrypt` | `wrapKey` | `unwrapKey` | `deriveBits` | `deriveKey` | `sign` | `verify` | `digest` | <del>| ---------------------------- | ------------- | ----------- | ----------- | --------- | --------- | --------- | ----------- | ------------ | ----------- | ------ | -------- | -------- | <del>| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <del>| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <del>| `'RSA-OAEP'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <del>| `'ECDSA'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <del>| `'ECDH'` | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | <del>| `'AES-CTR'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <del>| `'AES-CBC'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <del>| `'AES-GCM'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <del>| `'AES-KW'` | ✔ | ✔ | ✔ | | | ✔ | ✔ | | | | | | <del>| `'HMAC'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <del>| `'HKDF'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | <del>| `'PBKDF2'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | <del>| `'SHA-1'` | | | | | | | | | | | | ✔ | <del>| `'SHA-256'` | | | | | | | | | | | | ✔ | <del>| `'SHA-384'` | | | | | | | | | | | | ✔ | <del>| `'SHA-512'` | | | | | | | | | | | | ✔ | <del>| `'NODE-DSA'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <del>| `'NODE-DH'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | <del>| `'NODE-ED25519'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <del>| `'NODE-ED448'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <del> <del><sup>1</sup> Node.js-specific extension <add>| Algorithm | `generateKey` | `exportKey` | `importKey` | `encrypt` | `decrypt` | `wrapKey` | `unwrapKey` | `deriveBits` | `deriveKey` | `sign` | `verify` | `digest` | <add>| --------------------- | ------------- | ----------- | ----------- | --------- | --------- | --------- | ----------- | ------------ | ----------- | ------ | -------- | -------- | <add>| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <add>| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <add>| `'RSA-OAEP'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <add>| `'ECDSA'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <add>| `'ECDH'` | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | <add>| `'AES-CTR'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <add>| `'AES-CBC'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <add>| `'AES-GCM'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | <add>| `'AES-KW'` | ✔ | ✔ | ✔ | | | ✔ | ✔ | | | | | | <add>| `'HMAC'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <add>| `'HKDF'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | <add>| `'PBKDF2'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | <add>| `'SHA-1'` | | | | | | | | | | | | ✔ | <add>| `'SHA-256'` | | | | | | | | | | | | ✔ | <add>| `'SHA-384'` | | | | | | | | | | | | ✔ | <add>| `'SHA-512'` | | | | | | | | | | | | ✔ | <add>| `'NODE-DSA'`[^1] | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <add>| `'NODE-DH'`[^1] | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | <add>| `'NODE-ED25519'`[^1] | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <add>| `'NODE-ED448'`[^1] | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | <ide> <ide> ## Class: `Crypto` <ide> <ide> The possible usages are: <ide> Valid key usages depend on the key algorithm (identified by <ide> `cryptokey.algorithm.name`). <ide> <del>| Key Type | `'encrypt'` | `'decrypt'` | `'sign'` | `'verify'` | `'deriveKey'` | `'deriveBits'` | `'wrapKey'` | `'unwrapKey'` | <del>| ----------------------------- | ----------- | ----------- | -------- | ---------- | ------------- | -------------- | ----------- | ------------- | <del>| `'AES-CBC'` | ✔ | ✔ | | | | | ✔ | ✔ | <del>| `'AES-CTR'` | ✔ | ✔ | | | | | ✔ | ✔ | <del>| `'AES-GCM'` | ✔ | ✔ | | | | | ✔ | ✔ | <del>| `'AES-KW'` | | | | | | | ✔ | ✔ | <del>| `'ECDH'` | | | | | ✔ | ✔ | | | <del>| `'ECDSA'` | | | ✔ | ✔ | | | | | <del>| `'HDKF'` | | | | | ✔ | ✔ | | | <del>| `'HMAC'` | | | ✔ | ✔ | | | | | <del>| `'PBKDF2'` | | | | | ✔ | ✔ | | | <del>| `'RSA-OAEP'` | ✔ | ✔ | | | | | ✔ | ✔ | <del>| `'RSA-PSS'` | | | ✔ | ✔ | | | | | <del>| `'RSASSA-PKCS1-v1_5'` | | | ✔ | ✔ | | | | | <del>| `'NODE-DSA'` <sup>1</sup> | | | ✔ | ✔ | | | | | <del>| `'NODE-DH'` <sup>1</sup> | | | | | ✔ | ✔ | | | <del>| `'NODE-SCRYPT'` <sup>1</sup> | | | | | ✔ | ✔ | | | <del>| `'NODE-ED25519'` <sup>1</sup> | | | ✔ | ✔ | | | | | <del>| `'NODE-ED448'` <sup>1</sup> | | | ✔ | ✔ | | | | | <del> <del><sup>1</sup> Node.js-specific extension. <add>| Key Type | `'encrypt'` | `'decrypt'` | `'sign'` | `'verify'` | `'deriveKey'` | `'deriveBits'` | `'wrapKey'` | `'unwrapKey'` | <add>| --------------------- | ----------- | ----------- | -------- | ---------- | ------------- | -------------- | ----------- | ------------- | <add>| `'AES-CBC'` | ✔ | ✔ | | | | | ✔ | ✔ | <add>| `'AES-CTR'` | ✔ | ✔ | | | | | ✔ | ✔ | <add>| `'AES-GCM'` | ✔ | ✔ | | | | | ✔ | ✔ | <add>| `'AES-KW'` | | | | | | | ✔ | ✔ | <add>| `'ECDH'` | | | | | ✔ | ✔ | | | <add>| `'ECDSA'` | | | ✔ | ✔ | | | | | <add>| `'HDKF'` | | | | | ✔ | ✔ | | | <add>| `'HMAC'` | | | ✔ | ✔ | | | | | <add>| `'PBKDF2'` | | | | | ✔ | ✔ | | | <add>| `'RSA-OAEP'` | ✔ | ✔ | | | | | ✔ | ✔ | <add>| `'RSA-PSS'` | | | ✔ | ✔ | | | | | <add>| `'RSASSA-PKCS1-v1_5'` | | | ✔ | ✔ | | | | | <add>| `'NODE-DSA'`[^1] | | | ✔ | ✔ | | | | | <add>| `'NODE-DH'`[^1] | | | | | ✔ | ✔ | | | <add>| `'NODE-SCRYPT'`[^1] | | | | | ✔ | ✔ | | | <add>| `'NODE-ED25519'`[^1] | | | ✔ | ✔ | | | | | <add>| `'NODE-ED448'`[^1] | | | ✔ | ✔ | | | | | <ide> <ide> ## Class: `CryptoKeyPair` <ide> <ide> The algorithms currently supported include: <ide> * `'ECDH'` <ide> * `'HKDF'` <ide> * `'PBKDF2'` <del>* `'NODE-DH'`<sup>1</sup> <del>* `'NODE-SCRYPT'`<sup>1</sup> <del> <del><sup>1</sup> Node.js-specific extension <add>* `'NODE-DH'`[^1] <add>* `'NODE-SCRYPT'`[^1] <ide> <ide> ### `subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)` <ide> <ide> The algorithms currently supported include: <ide> * `'ECDH'` <ide> * `'HKDF'` <ide> * `'PBKDF2'` <del>* `'NODE-DH'`<sup>1</sup> <del>* '`NODE-SCRYPT'`<sup>1</sup> <del> <del><sup>1</sup> Node.js-specific extension <add>* `'NODE-DH'`[^1] <add>* '`NODE-SCRYPT'`[^1] <ide> <ide> ### `subtle.digest(algorithm, data)` <ide> <ide> specification. <ide> The special `'node.keyObject'` value for `format` is a Node.js-specific <ide> extension that allows converting a {CryptoKey} into a Node.js {KeyObject}. <ide> <del>| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | <del>| ----------------------------- | -------- | --------- | ------- | ------- | <del>| `'AES-CBC'` | | | ✔ | ✔ | <del>| `'AES-CTR'` | | | ✔ | ✔ | <del>| `'AES-GCM'` | | | ✔ | ✔ | <del>| `'AES-KW'` | | | ✔ | ✔ | <del>| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | <del>| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | <del>| `'HDKF'` | | | | | <del>| `'HMAC'` | | | ✔ | ✔ | <del>| `'PBKDF2'` | | | | | <del>| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | <del>| `'RSA-PSS'` | ✔ | ✔ | ✔ | | <del>| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | <del>| `'NODE-DSA'` <sup>1</sup> | ✔ | ✔ | | | <del>| `'NODE-DH'` <sup>1</sup> | ✔ | ✔ | | | <del>| `'NODE-SCRYPT'` <sup>1</sup> | | | | | <del>| `'NODE-ED25519'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | <del>| `'NODE-ED448'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | <del> <del><sup>1</sup> Node.js-specific extension <add>| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | <add>| --------------------- | -------- | --------- | ------- | ------- | <add>| `'AES-CBC'` | | | ✔ | ✔ | <add>| `'AES-CTR'` | | | ✔ | ✔ | <add>| `'AES-GCM'` | | | ✔ | ✔ | <add>| `'AES-KW'` | | | ✔ | ✔ | <add>| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | <add>| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | <add>| `'HDKF'` | | | | | <add>| `'HMAC'` | | | ✔ | ✔ | <add>| `'PBKDF2'` | | | | | <add>| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | <add>| `'RSA-PSS'` | ✔ | ✔ | ✔ | | <add>| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | <add>| `'NODE-DSA'`[^1] | ✔ | ✔ | | | <add>| `'NODE-DH'`[^1] | ✔ | ✔ | | | <add>| `'NODE-SCRYPT'`[^1] | | | | | <add>| `'NODE-ED25519'`[^1] | ✔ | ✔ | ✔ | ✔ | <add>| `'NODE-ED448'`[^1] | ✔ | ✔ | ✔ | ✔ | <ide> <ide> ### `subtle.generateKey(algorithm, extractable, keyUsages)` <ide> <ide> include: <ide> * `'RSA-OAEP'` <ide> * `'ECDSA'` <ide> * `'ECDH'` <del>* `'NODE-DSA'` <sup>1</sup> <del>* `'NODE-DH'` <sup>1</sup> <del>* `'NODE-ED25519'` <sup>1</sup> <del>* `'NODE-ED448'` <sup>1</sup> <add>* `'NODE-DSA'`[^1] <add>* `'NODE-DH'`[^1] <add>* `'NODE-ED25519'`[^1] <add>* `'NODE-ED448'`[^1] <ide> <ide> The {CryptoKey} (secret key) generating algorithms supported include: <ide> <ide> The {CryptoKey} (secret key) generating algorithms supported include: <ide> * `'AES-GCM'` <ide> * `'AES-KW'` <ide> <del><sup>1</sup> Non-standard Node.js extension <del> <ide> ### `subtle.importKey(format, keyData, algorithm, extractable, keyUsages)` <ide> <ide> <!-- YAML <ide> If importing a `'PBKDF2'` key, `extractable` must be `false`. <ide> <ide> The algorithms currently supported include: <ide> <del>| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | <del>| ----------------------------- | -------- | --------- | ------- | ------- | <del>| `'AES-CBC'` | | | ✔ | ✔ | <del>| `'AES-CTR'` | | | ✔ | ✔ | <del>| `'AES-GCM'` | | | ✔ | ✔ | <del>| `'AES-KW'` | | | ✔ | ✔ | <del>| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | <del>| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | <del>| `'HDKF'` | | | | ✔ | <del>| `'HMAC'` | | | ✔ | ✔ | <del>| `'PBKDF2'` | | | | ✔ | <del>| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | <del>| `'RSA-PSS'` | ✔ | ✔ | ✔ | | <del>| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | <del>| `'NODE-DSA'` <sup>1</sup> | ✔ | ✔ | | | <del>| `'NODE-DH'` <sup>1</sup> | ✔ | ✔ | | | <del>| `'NODE-SCRYPT'` <sup>1</sup> | | | | ✔ | <del>| `'NODE-ED25519'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | <del>| `'NODE-ED448'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | <del> <del><sup>1</sup> Node.js-specific extension <add>| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | <add>| --------------------- | -------- | --------- | ------- | ------- | <add>| `'AES-CBC'` | | | ✔ | ✔ | <add>| `'AES-CTR'` | | | ✔ | ✔ | <add>| `'AES-GCM'` | | | ✔ | ✔ | <add>| `'AES-KW'` | | | ✔ | ✔ | <add>| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | <add>| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | <add>| `'HDKF'` | | | | ✔ | <add>| `'HMAC'` | | | ✔ | ✔ | <add>| `'PBKDF2'` | | | | ✔ | <add>| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | <add>| `'RSA-PSS'` | ✔ | ✔ | ✔ | | <add>| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | <add>| `'NODE-DSA'`[^1] | ✔ | ✔ | | | <add>| `'NODE-DH'`[^1] | ✔ | ✔ | | | <add>| `'NODE-SCRYPT'`[^1] | | | | ✔ | <add>| `'NODE-ED25519'`[^1] | ✔ | ✔ | ✔ | ✔ | <add>| `'NODE-ED448'`[^1] | ✔ | ✔ | ✔ | ✔ | <ide> <ide> ### `subtle.sign(algorithm, key, data)` <ide> <ide> The algorithms currently supported include: <ide> * `'RSA-PSS'` <ide> * `'ECDSA'` <ide> * `'HMAC'` <del>* `'NODE-DSA'`<sup>1</sup> <del>* `'NODE-ED25519'`<sup>1</sup> <del>* `'NODE-ED448'`<sup>1</sup> <del> <del><sup>1</sup> Non-standard Node.js extension <add>* `'NODE-DSA'`[^1] <add>* `'NODE-ED25519'`[^1] <add>* `'NODE-ED448'`[^1] <ide> <ide> ### `subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)` <ide> <ide> promise is resolved with a {CryptoKey} object. <ide> The wrapping algorithms currently supported include: <ide> <ide> * `'RSA-OAEP'` <del>* `'AES-CTR'`<sup>1</sup> <del>* `'AES-CBC'`<sup>1</sup> <del>* `'AES-GCM'`<sup>1</sup> <del>* `'AES-KW'`<sup>1</sup> <add>* `'AES-CTR'`[^1] <add>* `'AES-CBC'`[^1] <add>* `'AES-GCM'`[^1] <add>* `'AES-KW'`[^1] <ide> <ide> The unwrapped key algorithms supported include: <ide> <ide> The unwrapped key algorithms supported include: <ide> * `'AES-CBC'` <ide> * `'AES-GCM'` <ide> * `'AES-KW'` <del>* `'NODE-DSA'`<sup>1</sup> <del>* `'NODE-DH'`<sup>1</sup> <del> <del><sup>1</sup> Non-standard Node.js extension <add>* `'NODE-DSA'`[^1] <add>* `'NODE-DH'`[^1] <ide> <ide> ### `subtle.verify(algorithm, key, signature, data)` <ide> <ide> The algorithms currently supported include: <ide> * `'RSA-PSS'` <ide> * `'ECDSA'` <ide> * `'HMAC'` <del>* `'NODE-DSA'`<sup>1</sup> <del>* `'NODE-ED25519'`<sup>1</sup> <del>* `'NODE-ED448'`<sup>1</sup> <del> <del><sup>1</sup> Non-standard Node.js extension <add>* `'NODE-DSA'`[^1] <add>* `'NODE-ED25519'`[^1] <add>* `'NODE-ED448'`[^1] <ide> <ide> ### `subtle.wrapKey(format, key, wrappingKey, wrapAlgo)` <ide> <ide> added: v15.0.0 <ide> <ide> * Type: {string|ArrayBuffer|Buffer|TypedArray|DataView} <ide> <add>[^1]: Non-standard Node.js-specific extension <add> <ide> [JSON Web Key]: https://tools.ietf.org/html/rfc7517 <ide> [Key usages]: #cryptokeyusages <ide> [RFC 4122]: https://www.rfc-editor.org/rfc/rfc4122.txt
1
Javascript
Javascript
fix jshint errors in grunt tasks
4e7d258065c9737113ff9c510574dea00a524a14
<ide><path>tasks/bump_version.js <ide> module.exports = function (grunt) { <ide> grunt.registerTask('bump_version', function (version) { <ide> if (!version || version.split('.').length !== 3) { <del> grunt.fail.fatal('malformed version. Use\n\n grunt bump_version:1.2.3') <add> grunt.fail.fatal('malformed version. Use\n\n grunt bump_version:1.2.3'); <ide> } <ide> <ide> grunt.config('string-replace.moment-js', { <ide><path>tasks/component.js <ide> module.exports = function (grunt) { <ide> <ide> grunt.file.write('component.json', JSON.stringify(config, true, 2) + '\n'); <ide> }); <del>} <add>}; <ide><path>tasks/embed_locales.js <ide> module.exports = function (grunt) { <ide> grunt.file.write(config.dest, modifiedContents); <ide> }); <ide> <del> var languageReset = 'moment.locale(\'en\');' <add> var languageReset = 'moment.locale(\'en\');'; <ide> <ide> function determineEmbeddedContent(files) { <ide> var embeddedContent = ''; <ide><path>tasks/history.js <ide> function makeBar(length) { <ide> } <ide> <ide> function normalize() { <del> var i, <add> var i, <ide> max = 0, <ide> max2 = 0; <ide> for (i = 0; i < count; i ++) { <ide> function getSizeAtVersion(version, path) { <ide> } <ide> <ide> function getRemote() { <del> var old_versions = '1.0.1 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.4.0'.split(' '), <del> new_versions = '1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.7.1'.split(' '), <add> var oldVersions = '1.0.1 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.4.0'.split(' '), <add> newVersions = '1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.7.1'.split(' '), <ide> i; <ide> <del> for (i = 0; i < old_versions.length; i++) { <del> getSizeAtVersion(old_versions[i], '/moment.min.js'); <add> for (i = 0; i < oldVersions.length; i++) { <add> getSizeAtVersion(oldVersions[i], '/moment.min.js'); <ide> } <del> for (i = 0; i < new_versions.length; i++) { <del> getSizeAtVersion(new_versions[i], '/min/moment.min.js'); <add> for (i = 0; i < newVersions.length; i++) { <add> getSizeAtVersion(newVersions[i], '/min/moment.min.js'); <ide> } <ide> } <ide> <ide> module.exports = function (grunt) { <ide> getRemote(); <ide> getLocal(); <ide> }); <del>}; <ide>\ No newline at end of file <add>}; <ide><path>tasks/nuget.js <ide> module.exports = function (grunt) { <ide> grunt.registerTask('nuget-publish', [ <ide> 'nugetpack', 'nugetpush', 'clean:nuget' <ide> ]); <del>} <add>}; <ide><path>tasks/qtest.js <ide> module.exports = function (grunt) { <ide> done(err); <ide> return; <ide> } <del> var err = null; <add> err = null; <ide> if (report.failed !== 0) { <ide> err = new Error(report.failed + " tests failed"); <ide> } <ide><path>tasks/transpile.js <ide> module.exports = function (grunt) { <ide> var TMP_DIR = "build/tmp"; <ide> <ide> function moveComments(code) { <del> var comments = code.split('\n') <del> .map(function(line) { <del> return line.trim(); <del> }) <del> .filter(function(line) { <del> return line.slice(0, 3) === '//!'; <del> }); <del> <ide> var comments = [], rest = []; <ide> code.split('\n').forEach(function (line) { <ide> if (line.trim().slice(0, 3) === '//!') { <ide> module.exports = function (grunt) { <ide> var batchSize = 50, <ide> promise = Promise.resolve(null), <ide> files = grunt.file.expand({cwd: opts.base}, opts.pattern), <del> i; <del> <del> for (i = 0; i < files.length; i += batchSize) { <del> (function(i) { <add> i, <add> transpileOne = function (i) { <ide> promise = promise.then(function() { <ide> grunt.log.writeln("transpiling from", opts.pattern, i); <ide> return Promise.all(files.slice(i, i + batchSize).map(function(file) { <ide> module.exports = function (grunt) { <ide> }); <ide> })); <ide> }); <del> }(i)); <add> }; <add> <add> for (i = 0; i < files.length; i += batchSize) { <add> transpileOne(i); <ide> } <add> <ide> return promise; <ide> } <ide> <ide><path>tasks/zones.js <ide> module.exports = function (grunt) { <ide> // country code TAB coordinates TAB timezone <ide> .map(function (line) { return line.split('\t')[2]; })); <ide> }); <del> }; <add> } <ide> <ide> function runTestsInZone (zone, next) { <ide> grunt.log.ok('Running tests in zone ' + zone); <ide> module.exports = function (grunt) { <ide> }, function (err, result, code) { <ide> if (code !== 0) { <ide> grunt.log.error(result.stdout.split(/\r\n|\r|\n/) <del> .filter(function (line) { return /^(>>|Warning:|$)/.test(line) }) <add> .filter(function (line) { return /^(>>|Warning:|$)/.test(line); }) <ide> .map(function (line) { return (line.substr(0, 3) === '>> ' ? line.substr(3) : line); }) <ide> .join('\n')); <ide> } <ide> next(); <ide> }); <del> }; <add> } <ide> };
8
Javascript
Javascript
remove flaky setinterval test
cfb2e0683972e0b0f09f431483e2672640da0b0f
<ide><path>test/parallel/test-timers-promisified.js <ide> process.on('multipleResolves', common.mustNotCall()); <ide> assert.strictEqual(loopCount, 5); <ide> })); <ide> } <del> <del> { <del> // Check that if we abort when we have some callbacks left, <del> // we actually call them. <del> const controller = new AbortController(); <del> const { signal } = controller; <del> const delay = 10; <del> let totalIterations = 0; <del> const timeoutLoop = runInterval(async (iterationNumber) => { <del> if (iterationNumber === 2) { <del> await setTimeout(delay * 2); <del> controller.abort(); <del> } <del> if (iterationNumber > totalIterations) { <del> totalIterations = iterationNumber; <del> } <del> }, delay, signal); <del> <del> timeoutLoop.catch(common.mustCall(() => { <del> assert.ok(totalIterations >= 3, `iterations was ${totalIterations} < 3`); <del> })); <del> } <ide> } <ide> <ide> {
1
Python
Python
add tests for sentence segmentation presetting
5a67efecccb91f68efbe7b14406a14c8151a2e9e
<ide><path>spacy/tests/parser/test_preset_sbd.py <add>'''Test that the parser respects preset sentence boundaries.''' <add>import pytest <add>from thinc.neural.optimizers import Adam <add>from thinc.neural.ops import NumpyOps <add> <add>from ...attrs import NORM <add>from ...gold import GoldParse <add>from ...vocab import Vocab <add>from ...tokens import Doc <add>from ...pipeline import NeuralDependencyParser <add> <add>@pytest.fixture <add>def vocab(): <add> return Vocab(lex_attr_getters={NORM: lambda s: s}) <add> <add>@pytest.fixture <add>def parser(vocab): <add> parser = NeuralDependencyParser(vocab) <add> parser.cfg['token_vector_width'] = 4 <add> parser.cfg['hidden_width'] = 32 <add> #parser.add_label('right') <add> parser.add_label('left') <add> parser.begin_training([], **parser.cfg) <add> sgd = Adam(NumpyOps(), 0.001) <add> <add> for i in range(10): <add> losses = {} <add> doc = Doc(vocab, words=['a', 'b', 'c', 'd']) <add> gold = GoldParse(doc, heads=[1, 1, 3, 3], <add> deps=['left', 'ROOT', 'left', 'ROOT']) <add> parser.update([doc], [gold], sgd=sgd, losses=losses) <add> return parser <add> <add>def test_no_sentences(parser): <add> doc = Doc(parser.vocab, words=['a', 'b', 'c', 'd']) <add> doc = parser(doc) <add> assert len(list(doc.sents)) == 2 <add> <add> <add>def test_sents_1(parser): <add> doc = Doc(parser.vocab, words=['a', 'b', 'c', 'd']) <add> doc[2].sent_start = True <add> doc = parser(doc) <add> assert len(list(doc.sents)) == 3 <add> doc = Doc(parser.vocab, words=['a', 'b', 'c', 'd']) <add> doc[1].sent_start = False <add> doc[2].sent_start = True <add> doc[3].sent_start = False <add> doc = parser(doc) <add> assert len(list(doc.sents)) == 2 <add> <add> <add>def test_sents_1_2(parser): <add> doc = Doc(parser.vocab, words=['a', 'b', 'c', 'd']) <add> doc[1].sent_start = True <add> doc[2].sent_start = True <add> doc = parser(doc) <add> assert len(list(doc.sents)) == 3 <add> <add> <add>def test_sents_1_3(parser): <add> doc = Doc(parser.vocab, words=['a', 'b', 'c', 'd']) <add> doc[1].sent_start = True <add> doc[3].sent_start = True <add> doc = parser(doc) <add> assert len(list(doc.sents)) == 4 <add> doc = Doc(parser.vocab, words=['a', 'b', 'c', 'd']) <add> doc[1].sent_start = True <add> doc[2].sent_start = False <add> doc[3].sent_start = True <add> doc = parser(doc) <add> assert len(list(doc.sents)) == 3
1
PHP
PHP
add method for getting associations by type
f3f5bc938cb80aabe3efd4696d7defd9f2024da5
<ide><path>Cake/ORM/Associations.php <ide> public function keys() { <ide> return array_keys($this->_items); <ide> } <ide> <add>/** <add> * Get an array of associations matching a specific type. <add> * <add> * @return array <add> */ <add> public function type($class) { <add> $out = array_filter($this->_items, function ($assoc) use ($class) { <add> return strpos(get_class($assoc), $class) !== false; <add> }); <add> return array_values($out); <add> } <add> <ide> /** <ide> * Drop/remove an association. <ide> * <ide> public function keys() { <ide> * @param string The alias name. <ide> * @return void <ide> */ <del> public function drop($alias) { <add> public function remove($alias) { <ide> unset($this->_items[strtolower($alias)]); <ide> } <ide> <ide><path>Cake/Test/TestCase/ORM/AssociationsTest.php <ide> public function setUp() { <ide> * <ide> * @return void <ide> */ <del> public function testAddHasAndGet() { <add> public function testAddHasRemoveAndGet() { <ide> $this->assertFalse($this->associations->has('users')); <ide> $this->assertFalse($this->associations->has('Users')); <ide> <ide> public function testAddHasAndGet() { <ide> <ide> $this->assertSame($belongsTo, $this->associations->get('users')); <ide> $this->assertSame($belongsTo, $this->associations->get('Users')); <add> <add> $this->assertNull($this->associations->remove('Users')); <add> <add> $this->assertFalse($this->associations->has('users')); <add> $this->assertFalse($this->associations->has('Users')); <add> $this->assertNull($this->associations->get('users')); <add> $this->assertNull($this->associations->get('Users')); <add> } <add> <add>/** <add> * Test keys() <add> * <add> * @return void <add> */ <add> public function testKeys() { <add> $belongsTo = new BelongsTo([]); <add> $this->associations->add('Users', $belongsTo); <add> $this->associations->add('Categories', $belongsTo); <add> $this->assertEquals(['users', 'categories'], $this->associations->keys()); <add> <add> $this->associations->remove('Categories'); <add> $this->assertEquals(['users'], $this->associations->keys()); <add> } <add> <add>/** <add> * Test getting association names by type. <add> */ <add> public function testType() { <add> $belongsTo = new BelongsTo([]); <add> $this->associations->add('Users', $belongsTo); <add> <add> $this->assertSame([$belongsTo], $this->associations->type('BelongsTo')); <add> $this->assertSame([], $this->associations->type('HasMany')); <ide> } <ide> <ide> /**
2
Javascript
Javascript
replace flag with option
3f01710d3ce89518825c7216975d544d6e78afb2
<ide><path>test/parallel/test-https-agent-additional-options.js <del>// Flags: --tls-min-v1.1 <ide> 'use strict'; <ide> const common = require('../common'); <ide> if (!common.hasCrypto) <ide> const fixtures = require('../common/fixtures'); <ide> const options = { <ide> key: fixtures.readKey('agent1-key.pem'), <ide> cert: fixtures.readKey('agent1-cert.pem'), <del> ca: fixtures.readKey('ca1-cert.pem') <add> ca: fixtures.readKey('ca1-cert.pem'), <add> minVersion: 'TLSv1.1', <ide> }; <ide> <ide> const server = https.Server(options, function(req, res) {
1
Python
Python
limit yandexcloud to < 0.142
5e7ad0b5133db6014b2996db8efd60664369c8cc
<ide><path>setup.py <ide> def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version <ide> 'pywinrm>=0.4', <ide> ] <ide> yandex = [ <del> # Yandexcloud 0.145 broke logging of the yandexcloud provider. The limitation can be removed once <add> # Yandexcloud 0.142 broke logging of the yandexcloud provider. The limitation can be removed once <ide> # https://github.com/yandex-cloud/python-sdk/issues/47 is fixed. <del> 'yandexcloud>=0.122.0, <0.145.0', <add> 'yandexcloud>=0.122.0, <0.142.0', <ide> ] <ide> zendesk = [ <ide> 'zenpy>=2.0.24',
1
PHP
PHP
send optional fields to unfurl links and media
418137f61e5a57d122145c301224564f7f5a4727
<ide><path>src/Illuminate/Notifications/Channels/SlackWebhookChannel.php <ide> protected function buildJsonPayload(SlackMessage $message) <ide> 'icon_emoji' => data_get($message, 'icon'), <ide> 'icon_url' => data_get($message, 'image'), <ide> 'link_names' => data_get($message, 'linkNames'), <add> 'unfurl_links' => data_get($message, 'unfurlLinks'), <add> 'unfurl_media' => data_get($message, 'unfurlMedia'), <ide> 'username' => data_get($message, 'username'), <ide> ]); <ide>
1
Text
Text
apply suggestions from code review
a2d4aaee70947219f5968f039400c63da759b41f
<ide><path>website/docs/usage/projects.md <ide> $ python -m spacy project push <ide> ``` <ide> <ide> The `remotes` section in your `project.yml` lets you assign names to the <del>different storages. To download a state from a remote storage, you can use the <add>different storages. To download state from a remote storage, you can use the <ide> [`spacy project pull`](/api/cli#project-pull) command. For more details, see the <ide> docs on [remote storage](#remote). <ide> <ide> commands: <ide> <ide> When your custom project is ready and you want to share it with others, you can <ide> use the [`spacy project document`](/api/cli#project-document) command to <del>**auto-generate** a pretty, markdown-formatted `README` file based on your <add>**auto-generate** a pretty, Markdown-formatted `README` file based on your <ide> project's `project.yml`. It will list all commands, workflows and assets defined <ide> in the project and include details on how to run the project, as well as links <ide> to the relevant spaCy documentation to make it easy for others to get started <ide><path>website/docs/usage/saving-loading.md <ide> entry_points={ <ide> } <ide> ``` <ide> <del>The factory can also implement other pipeline components like `to_disk` and <add>The factory can also implement other pipeline component methods like `to_disk` and <ide> `from_disk` for serialization, or even `update` to make the component trainable. <ide> If a component exposes a `from_disk` method and is included in a pipeline, spaCy <ide> will call it on load. This lets you ship custom data with your pipeline package.
2
Javascript
Javascript
move image proptypes to a new file
67656991b32075e8b4a99c6409b0a131206c6941
<ide><path>Libraries/Image/Image.ios.js <ide> 'use strict'; <ide> <ide> const EdgeInsetsPropType = require('EdgeInsetsPropType'); <add>const ImageProps = require('ImageProps'); <ide> const ImageResizeMode = require('ImageResizeMode'); <ide> const ImageSourcePropType = require('ImageSourcePropType'); <ide> const ImageStylePropTypes = require('ImageStylePropTypes'); <ide> const ImageViewManager = NativeModules.ImageViewManager; <ide> */ <ide> const Image = createReactClass({ <ide> displayName: 'Image', <del> propTypes: { <del> /** <del> * See https://facebook.github.io/react-native/docs/image.html#style <del> */ <del> style: StyleSheetPropType(ImageStylePropTypes), <del> /** <del> * The image source (either a remote URL or a local file resource). <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#source <del> */ <del> source: ImageSourcePropType, <del> /** <del> * A static image to display while loading the image source. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#defaultsource <del> */ <del> defaultSource: PropTypes.oneOfType([ <del> PropTypes.shape({ <del> uri: PropTypes.string, <del> width: PropTypes.number, <del> height: PropTypes.number, <del> scale: PropTypes.number, <del> }), <del> PropTypes.number, <del> ]), <del> /** <del> * When true, indicates the image is an accessibility element. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#accessible <del> */ <del> accessible: PropTypes.bool, <del> /** <del> * The text that's read by the screen reader when the user interacts with <del> * the image. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#accessibilitylabel <del> */ <del> accessibilityLabel: PropTypes.node, <del> /** <del> * blurRadius: the blur radius of the blur filter added to the image <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#blurradius <del> */ <del> blurRadius: PropTypes.number, <del> /** <del> * See https://facebook.github.io/react-native/docs/image.html#capinsets <del> */ <del> capInsets: EdgeInsetsPropType, <del> /** <del> * See https://facebook.github.io/react-native/docs/image.html#resizemethod <del> */ <del> resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']), <del> /** <del> * Determines how to resize the image when the frame doesn't match the raw <del> * image dimensions. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#resizemode <del> */ <del> resizeMode: PropTypes.oneOf([ <del> 'cover', <del> 'contain', <del> 'stretch', <del> 'repeat', <del> 'center', <del> ]), <del> /** <del> * A unique identifier for this element to be used in UI Automation <del> * testing scripts. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#testid <del> */ <del> testID: PropTypes.string, <del> /** <del> * Invoked on mount and layout changes with <del> * `{nativeEvent: {layout: {x, y, width, height}}}`. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#onlayout <del> */ <del> onLayout: PropTypes.func, <del> /** <del> * Invoked on load start. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#onloadstart <del> */ <del> onLoadStart: PropTypes.func, <del> /** <del> * Invoked on download progress with `{nativeEvent: {loaded, total}}`. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#onprogress <del> */ <del> onProgress: PropTypes.func, <del> /** <del> * Invoked on load error with `{nativeEvent: {error}}`. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#onerror <del> */ <del> onError: PropTypes.func, <del> /** <del> * Invoked when a partial load of the image is complete. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#onpartialload <del> */ <del> onPartialLoad: PropTypes.func, <del> /** <del> * Invoked when load completes successfully. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#onload <del> */ <del> onLoad: PropTypes.func, <del> /** <del> * Invoked when load either succeeds or fails. <del> * <del> * See https://facebook.github.io/react-native/docs/image.html#onloadend <del> */ <del> onLoadEnd: PropTypes.func, <del> }, <add> propTypes: ImageProps, <ide> <ide> statics: { <ide> resizeMode: ImageResizeMode, <ide><path>Libraries/Image/ImageProps.js <add>/** <add> * Copyright (c) 2015-present, Facebook, Inc. <add> * <add> * This source code is licensed under the MIT license found in the <add> * LICENSE file in the root directory of this source tree. <add> * <add> * @providesModule ImageProps <add> * @flow <add> */ <add> <add>'use strict'; <add> <add>const EdgeInsetsPropType = require('EdgeInsetsPropType'); <add>const ImageSourcePropType = require('ImageSourcePropType'); <add>const ImageStylePropTypes = require('ImageStylePropTypes'); <add>const PropTypes = require('prop-types'); <add>const StyleSheetPropType = require('StyleSheetPropType'); <add> <add>module.exports = { <add> /** <add> * See https://facebook.github.io/react-native/docs/image.html#style <add> */ <add> style: StyleSheetPropType(ImageStylePropTypes), <add> /** <add> * The image source (either a remote URL or a local file resource). <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#source <add> */ <add> source: ImageSourcePropType, <add> /** <add> * A static image to display while loading the image source. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#defaultsource <add> */ <add> defaultSource: PropTypes.oneOfType([ <add> PropTypes.shape({ <add> uri: PropTypes.string, <add> width: PropTypes.number, <add> height: PropTypes.number, <add> scale: PropTypes.number, <add> }), <add> PropTypes.number, <add> ]), <add> /** <add> * When true, indicates the image is an accessibility element. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#accessible <add> */ <add> accessible: PropTypes.bool, <add> /** <add> * The text that's read by the screen reader when the user interacts with <add> * the image. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#accessibilitylabel <add> */ <add> accessibilityLabel: PropTypes.node, <add> /** <add> * blurRadius: the blur radius of the blur filter added to the image <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#blurradius <add> */ <add> blurRadius: PropTypes.number, <add> /** <add> * See https://facebook.github.io/react-native/docs/image.html#capinsets <add> */ <add> capInsets: EdgeInsetsPropType, <add> /** <add> * See https://facebook.github.io/react-native/docs/image.html#resizemethod <add> */ <add> resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']), <add> /** <add> * Determines how to resize the image when the frame doesn't match the raw <add> * image dimensions. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#resizemode <add> */ <add> resizeMode: PropTypes.oneOf([ <add> 'cover', <add> 'contain', <add> 'stretch', <add> 'repeat', <add> 'center', <add> ]), <add> /** <add> * A unique identifier for this element to be used in UI Automation <add> * testing scripts. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#testid <add> */ <add> testID: PropTypes.string, <add> /** <add> * Invoked on mount and layout changes with <add> * `{nativeEvent: {layout: {x, y, width, height}}}`. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#onlayout <add> */ <add> onLayout: PropTypes.func, <add> /** <add> * Invoked on load start. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#onloadstart <add> */ <add> onLoadStart: PropTypes.func, <add> /** <add> * Invoked on download progress with `{nativeEvent: {loaded, total}}`. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#onprogress <add> */ <add> onProgress: PropTypes.func, <add> /** <add> * Invoked on load error with `{nativeEvent: {error}}`. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#onerror <add> */ <add> onError: PropTypes.func, <add> /** <add> * Invoked when a partial load of the image is complete. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#onpartialload <add> */ <add> onPartialLoad: PropTypes.func, <add> /** <add> * Invoked when load completes successfully. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#onload <add> */ <add> onLoad: PropTypes.func, <add> /** <add> * Invoked when load either succeeds or fails. <add> * <add> * See https://facebook.github.io/react-native/docs/image.html#onloadend <add> */ <add> onLoadEnd: PropTypes.func, <add>};
2
Ruby
Ruby
fix typo in eagerloadpolymorphicerror [ci skip]
26f2447252176e347091a04b26942b61e121f740
<ide><path>activerecord/lib/active_record/associations.rb <ide> class HasManyThroughNestedAssociationsAreReadonly < ThroughNestedAssociationsAre <ide> class HasOneThroughNestedAssociationsAreReadonly < ThroughNestedAssociationsAreReadonly #:nodoc: <ide> end <ide> <del> # This error is raised when trying to eager load a poloymorphic association using a JOIN. <add> # This error is raised when trying to eager load a polymorphic association using a JOIN. <ide> # Eager loading polymorphic associations is only possible with <ide> # {ActiveRecord::Relation#preload}[rdoc-ref:QueryMethods#preload]. <ide> class EagerLoadPolymorphicError < ActiveRecordError
1
Javascript
Javascript
fix error handling in listen()
d6191f593df6c4e09f4a1dba14a868ddb74dfe75
<ide><path>lib/net.js <ide> var createServerHandle = exports._createServerHandle = <ide> if (r) { <ide> handle.close(); <ide> handle = null; <del> <del> process.nextTick(function() { <del> self.emit('error', errnoException(errno, 'listen')); <del> }); <del> return; <ide> } <ide> <ide> return handle; <ide> Server.prototype._listen2 = function(address, port, addressType) { <ide> // In the case of a server sent via IPC, we don't need to do this. <ide> if (!self._handle) { <ide> self._handle = createServerHandle(address, port, addressType); <del> if (!self._handle) return; <add> if (!self._handle) { <add> process.nextTick(function() { <add> self.emit('error', errnoException(errno, 'listen')); <add> }); <add> return; <add> } <ide> } <ide> <ide> self._handle.onconnection = onconnection; <ide><path>test/simple/test-net-listen-error.js <add>// Copyright Joyent, Inc. and other Node contributors. <add>// <add>// Permission is hereby granted, free of charge, to any person obtaining a <add>// copy of this software and associated documentation files (the <add>// "Software"), to deal in the Software without restriction, including <add>// without limitation the rights to use, copy, modify, merge, publish, <add>// distribute, sublicense, and/or sell copies of the Software, and to permit <add>// persons to whom the Software is furnished to do so, subject to the <add>// following conditions: <add>// <add>// The above copyright notice and this permission notice shall be included <add>// in all copies or substantial portions of the Software. <add>// <add>// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS <add>// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF <add>// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN <add>// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, <add>// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR <add>// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE <add>// USE OR OTHER DEALINGS IN THE SOFTWARE. <add> <add>var common = require('../common'); <add>var assert = require('assert'); <add>var net = require('net'); <add>var gotError = false; <add> <add>var server = net.createServer(function(socket) { <add>}); <add>server.listen(1, '1.1.1.1', function() { // EACCESS or EADDRNOTAVAIL <add> assert(false); <add>}); <add>server.on('error', function(error) { <add> common.debug(error); <add> gotError = true; <add>}); <add> <add>process.on('exit', function() { <add> assert(gotError); <add>});
2
Java
Java
stream custom types in jackson2jsonencoder
727ca4514a1886c0e8739417536382d534844f59
<ide><path>spring-web/src/main/java/org/springframework/http/codec/json/Jackson2JsonEncoder.java <ide> public Flux<DataBuffer> encode(Publisher<?> inputStream, DataBufferFactory buffe <ide> return Flux.from(inputStream).map(value -> <ide> encodeValue(value, mimeType, bufferFactory, elementType, hints)); <ide> } <del> else if (MediaType.APPLICATION_STREAM_JSON.isCompatibleWith(mimeType)) { <add> else if (this.streamingMediaTypes.stream().anyMatch(streamingMediaType -> streamingMediaType.isCompatibleWith(mimeType))) { <ide> return Flux.from(inputStream).map(value -> { <ide> DataBuffer buffer = encodeValue(value, mimeType, bufferFactory, elementType, hints); <ide> buffer.write(new byte[]{'\n'}); <ide><path>spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonEncoderTests.java <ide> <ide> package org.springframework.http.codec.json; <ide> <add>import java.util.Arrays; <ide> import java.util.Map; <ide> <ide> import com.fasterxml.jackson.annotation.JsonTypeInfo; <ide> import org.springframework.core.ResolvableType; <ide> import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase; <ide> import org.springframework.core.io.buffer.DataBuffer; <add>import org.springframework.http.MediaType; <ide> import org.springframework.http.codec.Pojo; <ide> import org.springframework.http.codec.ServerSentEvent; <ide> <ide> public void encodeAsStream() throws Exception { <ide> .verifyComplete(); <ide> } <ide> <add> @Test // SPR-15727 <add> public void encodeAsStreamWithCustomStreamingType() throws Exception { <add> MediaType fooMediaType = new MediaType("application", "foo"); <add> MediaType barMediaType = new MediaType("application", "bar"); <add> this.encoder.setStreamingMediaTypes(Arrays.asList(fooMediaType, barMediaType)); <add> Flux<Pojo> source = Flux.just( <add> new Pojo("foo", "bar"), <add> new Pojo("foofoo", "barbar"), <add> new Pojo("foofoofoo", "barbarbar") <add> ); <add> ResolvableType type = ResolvableType.forClass(Pojo.class); <add> Flux<DataBuffer> output = this.encoder.encode(source, this.bufferFactory, type, barMediaType, emptyMap()); <add> <add> StepVerifier.create(output) <add> .consumeNextWith(stringConsumer("{\"foo\":\"foo\",\"bar\":\"bar\"}\n")) <add> .consumeNextWith(stringConsumer("{\"foo\":\"foofoo\",\"bar\":\"barbar\"}\n")) <add> .consumeNextWith(stringConsumer("{\"foo\":\"foofoofoo\",\"bar\":\"barbarbar\"}\n")) <add> .verifyComplete(); <add> } <add> <ide> @Test <ide> public void fieldLevelJsonView() throws Exception { <ide> JacksonViewBean bean = new JacksonViewBean();
2
Javascript
Javascript
convert test from latest master merge
740e460942a638e2b70e2f4182cb74400004cea5
<ide><path>test/configCases/parsing/import-ignore/index.js <ide> const fs = require("fs"); <ide> const path = require("path"); <del>const should = require("should"); <ide> <ide> it("should be able to ignore import()", () => { <ide> const source = fs.readFileSync(path.join(__dirname, "bundle1.js"), "utf-8"); <del> should(source).containEql(`import(/* webpackIgnore: true */ "./other2.js")`); <del> should(source).not.containEql(`import(/* webpackIgnore: false */ "./other3.js")`); <add> expect(source).toMatch(`import(/* webpackIgnore: true */ "./other2.js")`); <add> expect(source).not.toMatch(`import(/* webpackIgnore: false */ "./other3.js")`); <ide> });
1
PHP
PHP
use new response class within tests
56965febc43b69e89289a37b1d8620c449a1d4a3
<ide><path>tests/Fixture/AssertIntegrationTestCase.php <ide> <?php <ide> namespace Cake\Test\Fixture; <ide> <del>use Cake\Network\Response; <add>use Cake\Http\Response; <ide> use Cake\TestSuite\IntegrationTestCase; <ide> <ide> /** <ide><path>tests/TestCase/Auth/BasicAuthenticateTest.php <ide> <ide> use Cake\Auth\BasicAuthenticate; <ide> use Cake\Controller\ComponentRegistry; <add>use Cake\Http\Response; <ide> use Cake\I18n\Time; <ide> use Cake\Network\Exception\UnauthorizedException; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Auth/DigestAuthenticateTest.php <ide> use Cake\Auth\DigestAuthenticate; <ide> use Cake\Controller\ComponentRegistry; <ide> use Cake\Core\Configure; <add>use Cake\Http\Response; <ide> use Cake\I18n\Time; <ide> use Cake\Network\Exception\UnauthorizedException; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Auth/FormAuthenticateTest.php <ide> use Cake\Auth\FormAuthenticate; <ide> use Cake\Controller\ComponentRegistry; <ide> use Cake\Core\Plugin; <add>use Cake\Http\Response; <ide> use Cake\I18n\Time; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\ORM\Entity; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Auth/Storage/SessionStorageTest.php <ide> namespace Cake\Test\TestCase\Auth\Storage; <ide> <ide> use Cake\Auth\Storage\SessionStorage; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Network\Session; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/BasicsTest.php <ide> <ide> use Cake\Core\Configure; <ide> use Cake\Event\EventManager; <del>use Cake\Network\Response; <add>use Cake\Http\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> require_once CAKE . 'basics.php'; <ide><path>tests/TestCase/Controller/Component/AuthComponentTest.php <ide> use Cake\Core\Configure; <ide> use Cake\Event\Event; <ide> use Cake\Event\EventManager; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\Routing\Router; <ide> use Cake\Routing\Route\InflectedRoute; <ide> public function setUp() <ide> $request = new Request(); <ide> $request->env('REQUEST_METHOD', 'GET'); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['stop']) <ide> ->getMock(); <ide> <ide> public function testAuthorizeFalse() <ide> $this->Controller->Auth->storage()->delete(); <ide> $result = $this->Controller->Auth->startup($event); <ide> $this->assertTrue($event->isStopped()); <del> $this->assertInstanceOf('Cake\Network\Response', $result); <add> $this->assertInstanceOf('Cake\Http\Response', $result); <ide> $this->assertTrue($this->Auth->session->check('Flash.flash')); <ide> <ide> $this->Controller->request->addParams(Router::parse('auth_test/camelCase')); <ide> $result = $this->Controller->Auth->startup($event); <del> $this->assertInstanceOf('Cake\Network\Response', $result); <add> $this->assertInstanceOf('Cake\Http\Response', $result); <ide> } <ide> <ide> /** <ide> public function testAllowDenyAll() <ide> $this->assertNull($this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->request['action'] = 'add'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->request['action'] = 'camelCase'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->allow(); <ide> $this->Controller->Auth->deny(['add', 'camelCase']); <ide> public function testAllowDenyAll() <ide> $this->assertNull($this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->request['action'] = 'camelCase'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->allow(); <ide> $this->Controller->Auth->deny(); <ide> <ide> $this->Controller->request['action'] = 'camelCase'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->request['action'] = 'add'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->allow('camelCase'); <ide> $this->Controller->Auth->deny(); <ide> <ide> $this->Controller->request['action'] = 'camelCase'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->request['action'] = 'login'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->deny(); <ide> $this->Controller->Auth->allow(null); <ide> public function testAllowDenyAll() <ide> $this->Controller->Auth->deny(null); <ide> <ide> $this->Controller->request['action'] = 'camelCase'; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> } <ide> <ide> /** <ide> public function testDenyWithCamelCaseMethods() <ide> $this->Controller->request->addParams(Router::parse($url)); <ide> $this->Controller->request->query['url'] = Router::normalize($url); <ide> <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $url = '/auth_test/CamelCase'; <ide> $this->Controller->request->addParams(Router::parse($url)); <ide> $this->Controller->request->query['url'] = Router::normalize($url); <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> } <ide> <ide> /** <ide> public function testAllowedActionsWithCamelCaseMethods() <ide> $this->assertNull($result, 'startup() should return null, as action is allowed. %s'); <ide> <ide> $this->Controller->Auth->allowedActions = ['delete', 'add']; <del> $this->assertInstanceOf('Cake\Network\Response', $this->Controller->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $url = '/auth_test/delete'; <ide> $this->Controller->request->addParams(Router::parse($url)); <ide> public function testLoginRedirect() <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <del> $this->assertInstanceOf('Cake\Network\Response', $response); <add> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login', '?' => ['redirect' => '/posts/view/1']], true); <ide> $redirectHeader = $response->header()['Location']; <ide> $this->assertEquals($expected, $redirectHeader); <ide> public function testLoginRedirectPost() <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <del> $this->assertInstanceOf('Cake\Network\Response', $response); <add> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login', '?' => ['redirect' => '/foo/bar']], true); <ide> $redirectHeader = $response->header()['Location']; <ide> $this->assertEquals($expected, $redirectHeader); <ide> public function testLoginRedirectPostNoReferer() <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <del> $this->assertInstanceOf('Cake\Network\Response', $response); <add> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login'], true); <ide> $redirectHeader = $response->header()['Location']; <ide> $this->assertEquals($expected, $redirectHeader); <ide> public function testStatelessAuthNoRedirect() <ide> */ <ide> public function testStatelessAuthRedirectToLogin() <ide> { <del> $this->Auth->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Auth->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['stop', 'statusCode', 'send']) <ide> ->getMock(); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testStatelessAuthRedirectToLogin() <ide> $this->Auth->response->expects($this->never())->method('statusCode'); <ide> $this->Auth->response->expects($this->never())->method('send'); <ide> <del> $this->assertInstanceOf('Cake\Network\Response', $this->Auth->startup($event)); <add> $this->assertInstanceOf('Cake\Http\Response', $this->Auth->startup($event)); <ide> <ide> $this->assertEquals('/users/login?redirect=%2Fauth_test', $this->Controller->testUrl); <ide> } <ide><path>tests/TestCase/Controller/Component/CookieComponentTest.php <ide> <ide> use Cake\Controller\ComponentRegistry; <ide> use Cake\Controller\Component\CookieComponent; <add>use Cake\Http\Response; <ide> use Cake\I18n\Time; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Utility\Security; <ide> <ide><path>tests/TestCase/Controller/Component/CsrfComponentTest.php <ide> use Cake\Controller\ComponentRegistry; <ide> use Cake\Controller\Component\CsrfComponent; <ide> use Cake\Event\Event; <add>use Cake\Http\Response; <ide> use Cake\I18n\Time; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Controller/Component/RequestHandlerComponentTest.php <ide> public function setUp() <ide> protected function _init() <ide> { <ide> $request = new Request('controller_posts/index'); <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'stop']) <ide> ->getMock(); <ide> $this->Controller = new RequestHandlerTestController($request, $response); <ide> public function testAjaxRedirectWithNoUrl() <ide> { <ide> $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; <ide> $event = new Event('Controller.startup', $this->Controller); <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $this->Controller->response->expects($this->never()) <ide> ->method('body'); <ide> public function testRenderAsWithAttachment() <ide> ->method('parseAccept') <ide> ->will($this->returnValue(['1.0' => ['application/xml']])); <ide> <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['type', 'download', 'charset']) <ide> ->getMock(); <ide> $this->Controller->response->expects($this->at(0)) <ide> public function testRenderAsWithAttachment() <ide> */ <ide> public function testRespondAs() <ide> { <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['type']) <ide> ->getMock(); <ide> $this->Controller->response->expects($this->at(0))->method('type') <ide> public function testRespondAsWithAttachment() <ide> ->setMethods(['_header']) <ide> ->setConstructorArgs([$this->Controller->components()]) <ide> ->getMock(); <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['type', 'download']) <ide> ->getMock(); <ide> $this->Controller->request = $this->getMockBuilder('Cake\Network\Request') <ide> public function testAjaxRedirectAsRequestAction() <ide> $this->Controller->request = $this->getMockBuilder('Cake\Network\Request') <ide> ->setMethods(['is']) <ide> ->getMock(); <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'stop']) <ide> ->getMock(); <ide> $this->Controller->request->expects($this->any()) <ide> public function testAjaxRedirectAsRequestActionWithQueryString() <ide> $this->Controller->request = $this->getMockBuilder('Cake\Network\Request') <ide> ->setMethods(['is']) <ide> ->getMock(); <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'stop']) <ide> ->getMock(); <ide> $this->Controller->request->expects($this->any()) <ide> public function testAjaxRedirectAsRequestActionWithCookieData() <ide> $this->Controller->request = $this->getMockBuilder('Cake\Network\Request') <ide> ->setMethods(['is']) <ide> ->getMock(); <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'stop']) <ide> ->getMock(); <ide> $this->Controller->request->expects($this->any())->method('is')->will($this->returnValue(true)); <ide> public function testAjaxRedirectAsRequestActionStatusCode() <ide> $this->Controller->request = $this->getMockBuilder('Cake\Network\Request') <ide> ->setMethods(['is']) <ide> ->getMock(); <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'stop']) <ide> ->getMock(); <ide> $this->Controller->response->statusCode(302); <ide> public function testAjaxRedirectAsRequestActionStillRenderingLayout() <ide> $this->Controller->request = $this->getMockBuilder('Cake\Network\Request') <ide> ->setMethods(['is']) <ide> ->getMock(); <del> $this->Controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $this->Controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'stop']) <ide> ->getMock(); <ide> $this->Controller->request->expects($this->any())->method('is')->will($this->returnValue(true)); <ide> public function testAddInputTypeException() <ide> public function testCheckNotModifiedByEtagStar() <ide> { <ide> $_SERVER['HTTP_IF_NONE_MATCH'] = '*'; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['notModified', 'stop']) <ide> ->getMock(); <ide> $response->etag('something'); <ide> public function testCheckNotModifiedByEtagStar() <ide> public function testCheckNotModifiedByEtagExact() <ide> { <ide> $_SERVER['HTTP_IF_NONE_MATCH'] = 'W/"something", "other"'; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['notModified', 'stop']) <ide> ->getMock(); <ide> $response->etag('something', true); <ide> public function testCheckNotModifiedByEtagAndTime() <ide> { <ide> $_SERVER['HTTP_IF_NONE_MATCH'] = 'W/"something", "other"'; <ide> $_SERVER['HTTP_IF_MODIFIED_SINCE'] = '2012-01-01 00:00:00'; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['notModified', 'stop']) <ide> ->getMock(); <ide> $response->etag('something', true); <ide> public function testCheckNotModifiedByEtagAndTime() <ide> */ <ide> public function testCheckNotModifiedNoInfo() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['notModified', 'stop']) <ide> ->getMock(); <ide> $response->expects($this->never())->method('notModified'); <ide><path>tests/TestCase/Controller/ComponentRegistryTest.php <ide> use Cake\Controller\Component\CookieComponent; <ide> use Cake\Controller\Controller; <ide> use Cake\Core\Plugin; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Controller/ControllerTest.php <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Event\Event; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\TestCase; <ide> public function tearDown() <ide> public function testTableAutoload() <ide> { <ide> $request = new Request('controller_posts/index'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $Controller = new Controller($request, $response); <ide> $Controller->modelClass = 'SiteArticles'; <ide> <ide> public function testTableAutoload() <ide> public function testLoadModel() <ide> { <ide> $request = new Request('controller_posts/index'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $Controller = new Controller($request, $response); <ide> <ide> $this->assertFalse(isset($Controller->Articles)); <ide> public function testBeforeRenderEventCancelsRender() <ide> }); <ide> <ide> $result = $Controller->render('index'); <del> $this->assertInstanceOf('Cake\Network\Response', $result); <add> $this->assertInstanceOf('Cake\Http\Response', $result); <ide> } <ide> <ide> /** <ide> public function testRedirectBeforeRedirectModifyingUrl() <ide> */ <ide> public function testRedirectBeforeRedirectModifyingStatusCode() <ide> { <del> $Response = $this->getMockBuilder('Cake\Network\Response') <add> $Response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['stop']) <ide> ->getMock(); <ide> $Controller = new Controller(null, $Response); <ide> public function testRedirectBeforeRedirectModifyingStatusCode() <ide> <ide> public function testRedirectBeforeRedirectListenerReturnResponse() <ide> { <del> $Response = $this->getMockBuilder('Cake\Network\Response') <add> $Response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['stop', 'header', 'statusCode']) <ide> ->getMock(); <ide> $Controller = new Controller(null, $Response); <ide> public function testPaginate() <ide> { <ide> $request = new Request('controller_posts/index'); <ide> $request->params['pass'] = []; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['httpCodes']) <ide> ->getMock(); <ide> <ide> public function testPaginateUsesModelClass() <ide> { <ide> $request = new Request('controller_posts/index'); <ide> $request->params['pass'] = []; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['httpCodes']) <ide> ->getMock(); <ide> <ide> public function testInvokeActionMissingAction() <ide> { <ide> $url = new Request('test/missing'); <ide> $url->addParams(['controller' => 'Test', 'action' => 'missing']); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $Controller = new TestController($url, $response); <ide> $Controller->invokeAction(); <ide> public function testInvokeActionPrivate() <ide> { <ide> $url = new Request('test/private_m/'); <ide> $url->addParams(['controller' => 'Test', 'action' => 'private_m']); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $Controller = new TestController($url, $response); <ide> $Controller->invokeAction(); <ide> public function testInvokeActionProtected() <ide> { <ide> $url = new Request('test/protected_m/'); <ide> $url->addParams(['controller' => 'Test', 'action' => 'protected_m']); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $Controller = new TestController($url, $response); <ide> $Controller->invokeAction(); <ide> public function testInvokeActionBaseMethods() <ide> { <ide> $url = new Request('test/redirect/'); <ide> $url->addParams(['controller' => 'Test', 'action' => 'redirect']); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $Controller = new TestController($url, $response); <ide> $Controller->invokeAction(); <ide> public function testInvokeActionReturnValue() <ide> 'action' => 'returner', <ide> 'pass' => [] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $Controller = new TestController($url, $response); <ide> $result = $Controller->invokeAction(); <ide> public function testInvokeActionWithPassedParams() <ide> 'action' => 'index', <ide> 'pass' => ['param1' => '1', 'param2' => '2'] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $Controller = new TestController($url, $response); <ide> $result = $Controller->invokeAction(); <ide> public function testViewPathConventions() <ide> $request->addParams([ <ide> 'prefix' => 'admin' <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $Controller = new \TestApp\Controller\Admin\PostsController($request, $response); <ide> $Controller->eventManager()->on('Controller.beforeRender', function (Event $e) { <ide> return $e->subject()->response; <ide> public function testViewPathConventions() <ide> $request->addParams([ <ide> 'prefix' => 'admin/super' <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $Controller = new \TestApp\Controller\Admin\PostsController($request, $response); <ide> $Controller->eventManager()->on('Controller.beforeRender', function (Event $e) { <ide> return $e->subject()->response; <ide> public function testViewPathConventions() <ide> public function testComponents() <ide> { <ide> $request = new Request('/'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $controller = new TestController($request, $response); <ide> $this->assertInstanceOf('Cake\Controller\ComponentRegistry', $controller->components()); <ide> public function testComponents() <ide> public function testComponentsWithCustomRegistry() <ide> { <ide> $request = new Request('/'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $componentRegistry = $this->getMockBuilder('Cake\Controller\ComponentRegistry') <ide> ->setMethods(['offsetGet']) <ide> ->getMock(); <ide> public function testComponentsWithCustomRegistry() <ide> public function testLoadComponent() <ide> { <ide> $request = new Request('/'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $controller = new TestController($request, $response); <ide> $result = $controller->loadComponent('Paginator'); <ide> public function testLoadComponent() <ide> public function testLoadComponentDuplicate() <ide> { <ide> $request = new Request('/'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $controller = new TestController($request, $response); <ide> $this->assertNotEmpty($controller->loadComponent('Paginator')); <ide> public function testLoadComponentDuplicate() <ide> public function testIsAction() <ide> { <ide> $request = new Request('/'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $controller = new TestController($request, $response); <ide> <ide> $this->assertFalse($controller->isAction('redirect')); <ide><path>tests/TestCase/Error/ExceptionRendererTest.php <ide> public function tearDown() <ide> */ <ide> protected function _mockResponse($error) <ide> { <del> $error->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $error->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader']) <ide> ->getMock(); <ide> <ide> public function testUnknownExceptionTypeWithExceptionThatHasA400Code() <ide> { <ide> $exception = new MissingWidgetThingException('coding fail.'); <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once())->method('statusCode')->with(404); <ide> public function testUnknownExceptionTypeWithNoCodeIsA500() <ide> { <ide> $exception = new \OutOfBoundsException('foul ball.'); <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once()) <ide> public function testUnknownExceptionInProduction() <ide> <ide> $exception = new \OutOfBoundsException('foul ball.'); <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once()) <ide> public function testUnknownExceptionTypeWithCodeHigherThan500() <ide> { <ide> $exception = new \OutOfBoundsException('foul ball.', 501); <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once())->method('statusCode')->with(501); <ide> public function testError400() <ide> <ide> $exception = new NotFoundException('Custom message'); <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once())->method('statusCode')->with(404); <ide> public function testError500Message() <ide> { <ide> $exception = new InternalErrorException('An Internal Error Has Occurred.'); <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once())->method('statusCode')->with(500); <ide> public static function exceptionProvider() <ide> public function testCakeExceptionHandling($exception, $patterns, $code) <ide> { <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once()) <ide> public function testMissingRenderSafe() <ide> ->with('missingHelper') <ide> ->will($this->throwException($exception)); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $response->expects($this->once()) <ide> ->method('body') <ide> ->with($this->stringContains('Helper class Fail')); <ide> public function testRenderExceptionInBeforeRender() <ide> ->method('beforeRender') <ide> ->will($this->throwException($exception)); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $response->expects($this->once()) <ide> ->method('body') <ide> ->with($this->stringContains('Not there, sorry')); <ide> function (Event $event) { <ide> ); <ide> $ExceptionRenderer->controller->request = new Request; <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $response->expects($this->once()) <ide> ->method('body') <ide> ->with($this->stringContains('Not Found')); <ide> public function testMissingPluginRenderSafe() <ide> ->with('error400') <ide> ->will($this->throwException($exception)); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $response->expects($this->once()) <ide> ->method('body') <ide> ->with($this->logicalAnd( <ide> public function testMissingPluginRenderSafeWithPlugin() <ide> ->with('error400') <ide> ->will($this->throwException($exception)); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $response->expects($this->once()) <ide> ->method('body') <ide> ->with($this->logicalAnd( <ide> public function testPDOException() <ide> $exception->queryString = 'SELECT * from poo_query < 5 and :seven'; <ide> $exception->params = ['seven' => 7]; <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <del> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Network\Response') <add> $ExceptionRenderer->controller->response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['statusCode', '_sendHeader']) <ide> ->getMock(); <ide> $ExceptionRenderer->controller->response->expects($this->once())->method('statusCode')->with(500); <ide><path>tests/TestCase/Error/Middleware/ErrorHandlerMiddlewareTest.php <ide> <ide> use Cake\Core\Configure; <ide> use Cake\Error\Middleware\ErrorHandlerMiddleware; <add>use Cake\Http\Response; <ide> use Cake\Http\ServerRequestFactory; <ide> use Cake\Log\Log; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> use LogicException; <ide> use Psr\Log\LoggerInterface; <ide> public function testHandleException() <ide> }; <ide> $result = $middleware($request, $response, $next); <ide> $this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $result); <del> $this->assertInstanceOf('Cake\Network\Response', $result); <add> $this->assertInstanceOf('Cake\Http\Response', $result); <ide> $this->assertNotSame($result, $response); <ide> $this->assertEquals(404, $result->getStatusCode()); <ide> $this->assertContains("was not found", '' . $result->getBody()); <ide><path>tests/TestCase/Http/ActionDispatcherTest.php <ide> use Cake\Core\Configure; <ide> use Cake\Event\Event; <ide> use Cake\Http\ActionDispatcher; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Network\Session; <ide> use Cake\Routing\DispatcherFactory; <ide> use Cake\Routing\Filter\ControllerFactoryFilter; <ide> public function testDispatchAutoRender() <ide> ]); <ide> $response = new Response(); <ide> $result = $this->dispatcher->dispatch($request, $response); <del> $this->assertInstanceOf('Cake\Network\Response', $result); <add> $this->assertInstanceOf('Cake\Http\Response', $result); <ide> $this->assertContains('posts index', $result->body()); <ide> } <ide> <ide> public function testDispatchAutoRenderFalse() <ide> ]); <ide> $response = new Response(); <ide> $result = $this->dispatcher->dispatch($request, $response); <del> $this->assertInstanceOf('Cake\Network\Response', $result); <add> $this->assertInstanceOf('Cake\Http\Response', $result); <ide> $this->assertContains('autoRender false body', $result->body()); <ide> } <ide> <ide> public function testMissingController() <ide> 'action' => 'home', <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response); <ide> } <ide> <ide> public function testMissingControllerInterface() <ide> 'action' => 'index', <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response); <ide> } <ide> <ide> public function testMissingControllerAbstract() <ide> 'action' => 'index', <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response); <ide> } <ide> <ide> public function testMissingControllerLowercase() <ide> 'pass' => ['home'], <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response); <ide> } <ide> <ide><path>tests/TestCase/Http/BaseApplicationTest.php <ide> <ide> use Cake\Core\Configure; <ide> use Cake\Http\BaseApplication; <add>use Cake\Http\Response; <ide> use Cake\Http\ServerRequestFactory; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Http/ControllerFactoryTest.php <ide> <ide> use Cake\Core\Configure; <ide> use Cake\Http\ControllerFactory; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide> public function setUp() <ide> parent::setUp(); <ide> Configure::write('App.namespace', 'TestApp'); <ide> $this->factory = new ControllerFactory(); <del> $this->response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $this->response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> } <ide> <ide> /** <ide><path>tests/TestCase/Http/ResponseTest.php <ide> * @since 2.0.0 <ide> * @license http://www.opensource.org/licenses/mit-license.php MIT License <ide> */ <del>namespace Cake\Test\TestCase\Network; <add>namespace Cake\Test\TestCase\Http; <ide> <ide> include_once CORE_TEST_CASES . DS . 'Http' . DS . 'server_mocks.php'; <ide> <add>use Cake\Http\Response; <ide> use Cake\Network\Exception\NotFoundException; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> use Zend\Diactoros\Stream; <ide> <ide> public function testWithFileInvalidPath($path, $expectedMessage) <ide> */ <ide> public function testFile() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testWithFileDownloadAndName() <ide> */ <ide> public function testFileWithDownloadAndName() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testFileWithUnknownFileTypeGeneric() <ide> $currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null; <ide> $_SERVER['HTTP_USER_AGENT'] = 'Some generic browser'; <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testFileWithUnknownFileTypeOpera() <ide> $currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null; <ide> $_SERVER['HTTP_USER_AGENT'] = 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10'; <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testFileWithUnknownFileTypeIE() <ide> $currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null; <ide> $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)'; <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testFileWithUnknownFileNoDownload() <ide> $currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null; <ide> $_SERVER['HTTP_USER_AGENT'] = 'Some generic browser'; <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testGetFile() <ide> */ <ide> public function testConnectionAbortedOnBuffering() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testConnectionAbortedOnBuffering() <ide> */ <ide> public function testFileUpperExtension() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testWithFileUpperExtension() <ide> */ <ide> public function testFileExtensionNotSet() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public static function rangeProvider() <ide> public function testFileRangeOffsets($range, $length, $offsetResponse) <ide> { <ide> $_SERVER['HTTP_RANGE'] = $range; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testWithFileRangeOffsets($range, $length, $offsetResponse) <ide> public function testFileRange() <ide> { <ide> $_SERVER['HTTP_RANGE'] = 'bytes=8-25'; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function invalidFileRangeProvider() <ide> public function testFileRangeInvalid($range) <ide> { <ide> $_SERVER['HTTP_RANGE'] = $range; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> '_sendHeader', <ide> '_isActive', <ide> public function testWithFileInvalidRange($range) <ide> public function testFileRangeReversed() <ide> { <ide> $_SERVER['HTTP_RANGE'] = 'bytes=30-2'; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testWithFileReversedRange() <ide> public function testFileRangeOffsetsNoDownload($range, $length, $offsetResponse) <ide> { <ide> $_SERVER['HTTP_RANGE'] = $range; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testFileRangeOffsetsNoDownload($range, $length, $offsetResponse) <ide> public function testFileRangeNoDownload() <ide> { <ide> $_SERVER['HTTP_RANGE'] = 'bytes=8-25'; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide> public function testFileRangeNoDownload() <ide> public function testFileRangeInvalidNoDownload() <ide> { <ide> $_SERVER['HTTP_RANGE'] = 'bytes=30-2'; <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods([ <ide> 'header', <ide> 'type', <ide><path>tests/TestCase/Http/ResponseTransformerTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Http; <ide> <add>use Cake\Http\Response as CakeResponse; <ide> use Cake\Http\ResponseTransformer; <del>use Cake\Network\Response as CakeResponse; <ide> use Cake\Network\Session; <ide> use Cake\TestSuite\TestCase; <ide> use Zend\Diactoros\Response as PsrResponse; <ide> public function testToCakeCorrectType() <ide> { <ide> $psr = new PsrResponse('php://memory', 401, []); <ide> $result = ResponseTransformer::toCake($psr); <del> $this->assertInstanceOf('Cake\Network\Response', $result); <add> $this->assertInstanceOf('Cake\Http\Response', $result); <ide> } <ide> <ide> /** <ide> public function testToPsrBodyCallable() <ide> */ <ide> public function testToPsrBodyFileResponse() <ide> { <del> $cake = $this->getMockBuilder('Cake\Network\Response') <add> $cake = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_clearBuffer']) <ide> ->getMock(); <ide> $cake->file(__FILE__, ['name' => 'some-file.php', 'download' => true]); <ide> public function testToPsrBodyFileResponse() <ide> public function testToPsrBodyFileResponseFileRange() <ide> { <ide> $_SERVER['HTTP_RANGE'] = 'bytes=10-20'; <del> $cake = $this->getMockBuilder('Cake\Network\Response') <add> $cake = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_clearBuffer']) <ide> ->getMock(); <ide> $path = TEST_APP . 'webroot/css/cake.generic.css'; <ide><path>tests/TestCase/Network/CorsBuilderTest.php <ide> <?php <ide> namespace Cake\Test\TestCase\Network; <ide> <add>use Cake\Http\Response; <ide> use Cake\Network\CorsBuilder; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> class CorsBuilderTest extends TestCase <ide><path>tests/TestCase/Routing/DispatcherFactoryTest.php <ide> public function testCreateDispatchWithFilters() <ide> 'bare' => true, <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['send']) <ide> ->getMock(); <ide> DispatcherFactory::add('ControllerFactory'); <ide><path>tests/TestCase/Routing/DispatcherFilterTest.php <ide> namespace Cake\Test\TestCase\Routing; <ide> <ide> use Cake\Event\Event; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Routing\DispatcherFilter; <ide> use Cake\TestSuite\TestCase; <ide> <ide> public function testMatchesWithWhen() <ide> { <ide> $matcher = function ($request, $response) { <ide> $this->assertInstanceOf('Cake\Network\Request', $request); <del> $this->assertInstanceOf('Cake\Network\Response', $response); <add> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> <ide> return true; <ide> }; <ide><path>tests/TestCase/Routing/DispatcherTest.php <ide> use Cake\Controller\Controller; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Network\Session; <ide> use Cake\Routing\Dispatcher; <ide> use Cake\Routing\Filter\ControllerFactoryFilter; <ide> public function testMissingController() <ide> 'action' => 'home', <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response, ['return' => 1]); <ide> } <ide> <ide> public function testMissingControllerInterface() <ide> ] <ide> ]); <ide> $url = new Request('dispatcher_test_interface/index'); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response, ['return' => 1]); <ide> } <ide> <ide> public function testMissingControllerAbstract() <ide> 'action' => 'index', <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response, ['return' => 1]); <ide> } <ide> <ide> public function testMissingControllerLowercase() <ide> 'pass' => ['home'], <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response, ['return' => 1]); <ide> } <ide> <ide> public function testDispatchBasic() <ide> 'pass' => ['extract'], <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $response->expects($this->once()) <ide> ->method('send'); <ide> <ide> public function testDispatchActionReturnsResponse() <ide> 'pass' => [] <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader']) <ide> ->getMock(); <ide> <ide> public function testDispatchBadPluginName() <ide> 'return' => 1 <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response); <ide> } <ide> <ide> public function testDispatchBadName() <ide> 'return' => 1 <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->dispatcher->dispatch($request, $response); <ide> } <ide> <ide> public function testDispatcherFilter() <ide> 'pass' => [] <ide> ] <ide> ]); <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['send']) <ide> ->getMock(); <ide> $this->dispatcher->dispatch($request, $response); <ide> public function testDispatcherFilter() <ide> */ <ide> public function testBeforeDispatchAbortDispatch() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['send']) <ide> ->getMock(); <ide> $response->expects($this->once()) <ide> public function testBeforeDispatchAbortDispatch() <ide> */ <ide> public function testAfterDispatchReplaceResponse() <ide> { <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'send']) <ide> ->getMock(); <ide> $response->expects($this->once()) <ide><path>tests/TestCase/Routing/Filter/AssetFilterTest.php <ide> public function testNotModified() <ide> $time = filemtime(Plugin::path('TestTheme') . 'webroot/img/cake.power.gif'); <ide> $time = new \DateTime('@' . $time); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['send', 'checkNotModified']) <ide> ->getMock(); <ide> $request = new Request('test_theme/img/cake.power.gif'); <ide> public function testNotModified() <ide> $this->assertEquals(200, $response->statusCode()); <ide> $this->assertEquals($time->format('D, j M Y H:i:s') . ' GMT', $response->modified()); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader', 'checkNotModified', 'send']) <ide> ->getMock(); <ide> $request = new Request('test_theme/img/cake.power.gif'); <ide> public function test404OnDoubleSlash() <ide> { <ide> $filter = new AssetFilter(); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader']) <ide> ->getMock(); <ide> $request = new Request('//index.php'); <ide> public function test404OnDoubleDot() <ide> { <ide> $filter = new AssetFilter(); <ide> <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader']) <ide> ->getMock(); <ide> $request = new Request('test_theme/../webroot/css/test_asset.css'); <ide> public function testAsset($url, $file) <ide> Plugin::load(['Company/TestPluginThree', 'TestPlugin', 'PluginJs']); <ide> <ide> $filter = new AssetFilter(); <del> $response = $this->getMockBuilder('Cake\Network\Response') <add> $response = $this->getMockBuilder('Cake\Http\Response') <ide> ->setMethods(['_sendHeader']) <ide> ->getMock(); <ide> $request = new Request($url); <ide><path>tests/TestCase/Routing/Filter/ControllerFactoryFilterTest.php <ide> <ide> use Cake\Core\Configure; <ide> use Cake\Event\Event; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Routing\Filter\ControllerFactoryFilter; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Routing/Filter/RoutingFilterTest.php <ide> namespace Cake\Test\TestCase\Routing\Filter; <ide> <ide> use Cake\Event\Event; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Routing\Filter\RoutingFilter; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\TestCase; <ide> public function testBeforeDispatchRedirectRoute() <ide> $response = new Response(); <ide> $event = new Event(__CLASS__, $this, compact('request', 'response')); <ide> $response = $filter->beforeDispatch($event); <del> $this->assertInstanceOf('Cake\Network\Response', $response); <add> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> $this->assertSame('http://localhost/articles', $response->header()['Location']); <ide> $this->assertSame(301, $response->statusCode()); <ide> $this->assertTrue($event->isStopped()); <ide><path>tests/TestCase/TestSuite/IntegrationTestCaseTest.php <ide> <ide> use Cake\Core\Configure; <ide> use Cake\Event\EventManager; <del>use Cake\Network\Response; <add>use Cake\Http\Response; <ide> use Cake\Routing\DispatcherFactory; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\IntegrationTestCase; <ide> public function testGet() <ide> <ide> $this->get('/request_action/test_request_action'); <ide> $this->assertNotEmpty($this->_response); <del> $this->assertInstanceOf('Cake\Network\Response', $this->_response); <add> $this->assertInstanceOf('Cake\Http\Response', $this->_response); <ide> $this->assertEquals('This is a test', $this->_response->body()); <ide> <ide> $this->_response = null; <ide> public function testGetHttpServer() <ide> <ide> $this->get('/request_action/test_request_action'); <ide> $this->assertNotEmpty($this->_response); <del> $this->assertInstanceOf('Cake\Network\Response', $this->_response); <add> $this->assertInstanceOf('Cake\Http\Response', $this->_response); <ide> $this->assertEquals('This is a test', $this->_response->body()); <ide> $this->assertHeader('X-Middleware', 'true'); <ide> } <ide><path>tests/TestCase/View/CellTest.php <ide> public function setUp() <ide> Configure::write('App.namespace', 'TestApp'); <ide> Plugin::load(['TestPlugin', 'TestTheme']); <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $this->View = new View($request, $response); <ide> } <ide> <ide> public function testCellInheritsHelperConfig() <ide> public function testCellInheritsCustomViewClass() <ide> { <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $view = new CustomJsonView($request, $response); <ide> $view->theme = 'Pretty'; <ide> $cell = $view->cell('Articles'); <ide> public function testCellInheritsCustomViewClass() <ide> public function testCellInheritsController() <ide> { <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $controller = new CellTraitTestController($request, $response); <ide> $controller->viewBuilder()->setTheme('Pretty'); <ide> $controller->viewClass = 'Json'; <ide><path>tests/TestCase/View/JsonViewTest.php <ide> <ide> use Cake\Controller\Controller; <ide> use Cake\Core\Configure; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/View/ViewBuilderTest.php <ide> public function testArrayPropertyMerge($property, $value) <ide> public function testBuildComplete() <ide> { <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> $events = $this->getMockBuilder('Cake\Event\EventManager')->getMock(); <ide> <ide> $builder = new ViewBuilder(); <ide><path>tests/TestCase/View/ViewTest.php <ide> public function tearDown() <ide> public function testGetTemplate() <ide> { <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $viewOptions = [ <ide> 'plugin' => null, <ide> public function testPluginGetTemplate() <ide> public function testPluginGetTemplateAbsoluteFail() <ide> { <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $viewOptions = [ <ide> 'plugin' => null, <ide> public function testGetViewFileNames() <ide> 'viewPath' => 'Pages' <ide> ]; <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $View = new TestView(null, null, null, $viewOptions); <ide> <ide> public function testGetViewFileNameDirectoryTraversal() <ide> 'viewPath' => 'Pages', <ide> ]; <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $view = new TestView(null, null, null, $viewOptions); <ide> $view->ext('.php'); <ide> public function testGetLayoutFileNameDirectoryTraversal() <ide> 'viewPath' => 'Pages', <ide> ]; <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $view = new TestView(null, null, null, $viewOptions); <ide> $view->ext('.php'); <ide> public function testMissingTemplate() <ide> 'viewPath' => 'Pages' <ide> ]; <ide> $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); <del> $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); <add> $response = $this->getMockBuilder('Cake\Http\Response')->getMock(); <ide> <ide> $View = new TestView($request, $response, null, $viewOptions); <ide> $View->getViewFileName('does_not_exist'); <ide><path>tests/TestCase/View/XmlViewTest.php <ide> <ide> use Cake\Controller\Controller; <ide> use Cake\Core\Configure; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Utility\Xml; <ide> <ide><path>tests/test_app/TestApp/Auth/TestAuthenticate.php <ide> <ide> use Cake\Auth\BaseAuthenticate; <ide> use Cake\Event\Event; <add>use Cake\Http\Response; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> <ide> /** <ide> * TestAuthenticate class <ide><path>tests/test_app/TestApp/Controller/SomePagesController.php <ide> namespace TestApp\Controller; <ide> <ide> use Cake\Controller\Controller; <del>use Cake\Network\Response; <add>use Cake\Http\Response; <ide> <ide> /** <ide> * SomePagesController class <ide><path>tests/test_app/TestApp/Error/TestAppsExceptionRenderer.php <ide> use Cake\Core\Configure; <ide> use Cake\Error\ExceptionRenderer; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <add>use Cake\Http\Response; <ide> use Cake\Routing\Router; <ide> use TestApp\Controller\TestAppsErrorController; <ide>
35
Ruby
Ruby
add tests for macos version consts usage
efabd4b5c2beadecf3282dbe730b1b6f779571e0
<ide><path>Library/Homebrew/rubocops/extend/formula_cop.rb <ide> def depends_on_name_type?(node, name = nil, type = :required) <ide> # if block given, yield matching nodes <ide> def find_const(node, const_name) <ide> return if node.nil? <del> node.each_child_node(:const) do |const_node| <del> next if const_node.const_name != const_name <add> node.each_descendant(:const) do |const_node| <add> next unless const_node.const_name == const_name <ide> @offensive_node = const_node <ide> @offense_source_range = const_node.source_range <ide> yield const_node if block_given? <ide><path>Library/Homebrew/rubocops/lines_cop.rb <ide> def audit_formula(_node, _class_node, _parent_class_node, body_node) <ide> problem "Use \"if build.#{match[1].downcase}?\" instead" <ide> end <ide> <del> # find_const(body_node, :MACOS_VERSION) do <del> # problem "Use MacOS.version instead of MACOS_VERSION" <del> # end <del> # <del> # find_const(body_node, :MACOS_FULL_VERSION) do <del> # problem "Use MacOS.full_version instead of MACOS_FULL_VERSION" <del> # end <del> # <add> find_const(body_node, "MACOS_VERSION") do <add> problem "Use MacOS.version instead of MACOS_VERSION" <add> end <add> <add> find_const(body_node, "MACOS_FULL_VERSION") do <add> problem "Use MacOS.full_version instead of MACOS_FULL_VERSION" <add> end <add> <ide> # dependency(body_node) do |m| <ide> # # handle symbols and shit: WIP <ide> # next unless modifier?(m.parent) <ide><path>Library/Homebrew/test/rubocops/lines_cop_spec.rb <ide> class Foo < Formula <ide> end <ide> end <ide> <add> it "with MACOS_VERSION const" do <add> source = <<-EOS.undent <add> class Foo < Formula <add> desc "foo" <add> url 'http://example.com/foo-1.0.tgz' <add> test do <add> version = MACOS_VERSION <add> end <add> end <add> EOS <add> <add> expected_offenses = [{ message: "Use MacOS.version instead of MACOS_VERSION", <add> severity: :convention, <add> line: 5, <add> column: 14, <add> source: source }] <add> <add> inspect_source(cop, source) <add> <add> expected_offenses.zip(cop.offenses).each do |expected, actual| <add> expect_offense(expected, actual) <add> end <add> end <add> <ide> end <ide> def expect_offense(expected, actual) <ide> expect(actual.message).to eq(expected[:message])
3
Python
Python
add test -- dimensions for rot90
8ba0325c21e5c9ef4a3b70722cf77bc64abfbade
<ide><path>numpy/lib/tests/test_twodim_base.py <ide> def check_basic(self): <ide> for k in range(0,13,4): <ide> assert_equal(rot90(a,k=k),b4) <ide> <add> def check_axes(self): <add> a = ones((50,40,3)) <add> assert_equal(rot90(a).shape,(40,50,3)) <ide> <ide> class test_histogram2d(NumpyTestCase): <ide> def check_simple(self):
1
Go
Go
fix missing hostname and links in exec env
e98145960988a2259074ae911b6478b7a940748b
<ide><path>container/container_solaris.go <ide> type ExitStatus struct { <ide> } <ide> <ide> // CreateDaemonEnvironment creates a new environment variable slice for this container. <del>func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string { <add>func (container *Container) CreateDaemonEnvironment(_ bool, linkedEnv []string) []string { <ide> return nil <ide> } <ide> <ide><path>container/container_unix.go <ide> type ExitStatus struct { <ide> // environment variables related to links. <ide> // Sets PATH, HOSTNAME and if container.Config.Tty is set: TERM. <ide> // The defaults set here do not override the values in container.Config.Env <del>func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string { <add>func (container *Container) CreateDaemonEnvironment(tty bool, linkedEnv []string) []string { <ide> // Setup environment <ide> env := []string{ <ide> "PATH=" + system.DefaultPathEnv, <ide> "HOSTNAME=" + container.Config.Hostname, <ide> } <del> if container.Config.Tty { <add> if tty { <ide> env = append(env, "TERM=xterm") <ide> } <ide> env = append(env, linkedEnv...) <ide><path>container/container_windows.go <ide> type ExitStatus struct { <ide> } <ide> <ide> // CreateDaemonEnvironment creates a new environment variable slice for this container. <del>func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string { <add>func (container *Container) CreateDaemonEnvironment(_ bool, linkedEnv []string) []string { <ide> // because the env on the container can override certain default values <ide> // we need to replace the 'env' keys where they match and append anything <ide> // else. <ide><path>daemon/exec.go <ide> package daemon <ide> import ( <ide> "fmt" <ide> "io" <del> "runtime" <ide> "strings" <ide> "time" <ide> <ide> import ( <ide> "github.com/docker/docker/libcontainerd" <ide> "github.com/docker/docker/pkg/pools" <ide> "github.com/docker/docker/pkg/signal" <del> "github.com/docker/docker/pkg/system" <ide> "github.com/docker/docker/pkg/term" <ide> "github.com/docker/docker/utils" <ide> ) <ide> func (d *Daemon) ContainerExecCreate(name string, config *types.ExecConfig) (str <ide> execConfig.Privileged = config.Privileged <ide> execConfig.User = config.User <ide> <del> // On Windows, don't default the path, let the platform do it. Also TERM isn't meaningful <del> if runtime.GOOS != "windows" { <del> execConfig.Env = []string{ <del> "PATH=" + system.DefaultPathEnv, <del> } <del> if config.Tty { <del> execConfig.Env = append(execConfig.Env, "TERM=xterm") <del> } <add> linkedEnv, err := d.setupLinkedContainers(container) <add> if err != nil { <add> return "", err <ide> } <del> execConfig.Env = utils.ReplaceOrAppendEnvValues(execConfig.Env, container.Config.Env) <add> execConfig.Env = utils.ReplaceOrAppendEnvValues(container.CreateDaemonEnvironment(config.Tty, linkedEnv), execConfig.Env) <ide> if len(execConfig.User) == 0 { <ide> execConfig.User = container.Config.User <ide> } <ide><path>daemon/oci_linux.go <ide> func (daemon *Daemon) populateCommonSpec(s *specs.Spec, c *container.Container) <ide> } <ide> } <ide> s.Process.Cwd = cwd <del> s.Process.Env = c.CreateDaemonEnvironment(linkedEnv) <add> s.Process.Env = c.CreateDaemonEnvironment(c.Config.Tty, linkedEnv) <ide> s.Process.Terminal = c.Config.Tty <ide> s.Hostname = c.FullHostname() <ide> <ide><path>daemon/oci_windows.go <ide> func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e <ide> // as c:\. Hence, setting it to default of c:\ makes for consistency. <ide> s.Process.Cwd = `C:\` <ide> } <del> s.Process.Env = c.CreateDaemonEnvironment(linkedEnv) <add> s.Process.Env = c.CreateDaemonEnvironment(c.Config.Tty, linkedEnv) <ide> s.Process.ConsoleSize.Height = c.HostConfig.ConsoleSize[0] <ide> s.Process.ConsoleSize.Width = c.HostConfig.ConsoleSize[1] <ide> s.Process.Terminal = c.Config.Tty <ide><path>integration-cli/docker_cli_exec_test.go <ide> func (s *DockerSuite) TestExecWindowsPathNotWiped(c *check.C) { <ide> out = strings.ToLower(strings.Trim(out, "\r\n")) <ide> c.Assert(out, checker.Contains, `windowspowershell\v1.0`) <ide> } <add> <add>func (s *DockerSuite) TestExecEnvLinksHost(c *check.C) { <add> testRequires(c, DaemonIsLinux) <add> runSleepingContainer(c, "-d", "--name", "foo") <add> runSleepingContainer(c, "-d", "--link", "foo:db", "--hostname", "myhost", "--name", "bar") <add> out, _ := dockerCmd(c, "exec", "bar", "env") <add> c.Assert(out, checker.Contains, "HOSTNAME=myhost") <add> c.Assert(out, checker.Contains, "DB_NAME=/bar/db") <add>}
7
PHP
PHP
use a supported plugin component in example
344de871d96a98fe0123eaa2e4dfb3a09eda7c7f
<ide><path>src/Controller/Controller.php <ide> public function components(?ComponentRegistry $components = null): ComponentRegi <ide> * For example: <ide> * <ide> * ``` <del> * $this->loadComponent('Acl.Acl'); <add> * $this->loadComponent('Authentication.Authentication'); <ide> * ``` <ide> * <ide> * Will result in a `Toolbar` property being set.
1
Python
Python
fix typo in gogrid driver
a4469f3e7488ef9510db239a9e0fc8eeb4dc9978
<ide><path>libcloud/drivers/gogrid.py <ide> def list_locations(self): <ide> <ide> def create_node(self, **kwargs): <ide> name = kwargs['name'] <del> image = kwargs['iamge'] <add> image = kwargs['image'] <ide> size = kwargs['size'] <ide> first_ip = self.get_first_ip() <ide> params = {'name': name,
1
PHP
PHP
adjust the params
a13d06c45dd9b03bacd564129d3a433cfc24555b
<ide><path>src/Shell/I18nShell.php <ide> public function init($language = null) { <ide> } <ide> <ide> $this->_paths = [APP]; <del> if (!empty($this->params['plugin'])) { <del> $plugin = Inflector::camelize($this->params['plugin']); <add> if ($this->param('plugin')) { <add> $plugin = Inflector::camelize($this->param('plugin')); <ide> $this->_paths = [Plugin::classPath($plugin)]; <del> $this->params['plugin'] = $plugin; <ide> } <ide> <ide> $response = $this->in('What folder?', null, rtrim($this->_paths[0], DS) . DS . 'Locale'); <ide> public function init($language = null) { <ide> $filename = $fileinfo->getFilename(); <ide> $newFilename = $fileinfo->getBasename('.pot'); <ide> $newFilename = $newFilename . '.po'; <del> if (empty($this->params['force']) && is_file($targetFolder . $newFilename)) { <add> if (!$this->param('force') && is_file($targetFolder . $newFilename)) { <ide> $this->err('File ' . $newFilename . ' exists, skipping. Use --force or -f to force overwriting'); <ide> continue; <ide> }
1
PHP
PHP
fix return type of docblock comment for bindif
5b0593b168d8d0422fd72320407f2e94fb71d525
<ide><path>src/Illuminate/Container/Container.php <ide> protected function getClosure($abstract, $concrete) <ide> * @param string $abstract <ide> * @param Closure|string|null $concrete <ide> * @param bool $shared <del> * @return bool <add> * @return void <ide> */ <ide> public function bindIf($abstract, $concrete = null, $shared = false) <ide> {
1
Javascript
Javascript
remove unnecessary require
e3c612b261d658f492d7456dc9c18ccb48f23aa6
<ide><path>spec/workspace-element-spec.js <ide> const {ipcRenderer} = require('electron') <ide> const path = require('path') <ide> const temp = require('temp').track() <del>const PaneContainer = require('../src/pane-container') <ide> const {Disposable} = require('event-kit') <ide> const {it, fit, ffit, fffit, beforeEach, afterEach} = require('./async-spec-helpers') <ide>
1
PHP
PHP
use new validator methods
f59aae3b42ee66e1435c1e8dfe748c85dec9e0ba
<ide><path>src/ORM/Marshaller.php <ide> protected function _validate($data, $options, $isNew) <ide> return []; <ide> } <ide> if ($options['validate'] === true) { <del> $options['validate'] = $this->_table->validator('default'); <add> $options['validate'] = $this->_table->getValidator(); <ide> } <ide> if (is_string($options['validate'])) { <del> $options['validate'] = $this->_table->validator($options['validate']); <add> $options['validate'] = $this->_table->getValidator($options['validate']); <ide> } <ide> if (!is_object($options['validate'])) { <ide> throw new RuntimeException( <ide><path>src/ORM/SaveOptionsBuilder.php <ide> public function guard($guard) <ide> */ <ide> public function validate($validate) <ide> { <del> $this->_table->validator($validate); <add> $this->_table->getValidator($validate); <ide> $this->_options['validate'] = $validate; <ide> <ide> return $this; <ide><path>src/ORM/Table.php <ide> public function __construct(array $config = []) <ide> } <ide> if (!empty($config['validator'])) { <ide> if (!is_array($config['validator'])) { <del> $this->validator(static::DEFAULT_VALIDATOR, $config['validator']); <add> $this->setValidator(static::DEFAULT_VALIDATOR, $config['validator']); <ide> } else { <ide> foreach ($config['validator'] as $name => $validator) { <del> $this->validator($name, $validator); <add> $this->setValidator($name, $validator); <ide> } <ide> } <ide> } <ide><path>src/View/Form/EntityContext.php <ide> protected function _getValidator($parts) <ide> $method = $this->_context['validator'][$alias]; <ide> } <ide> <del> $validator = $table->validator($method); <add> $validator = $table->getValidator($method); <ide> $validator->setProvider('entity', $entity); <ide> <ide> return $this->_validator[$key] = $validator; <ide><path>tests/TestCase/ORM/TableTest.php <ide> public function testHasField() <ide> public function testValidatorDefault() <ide> { <ide> $table = new Table(); <del> $validator = $table->validator(); <add> $validator = $table->getValidator(); <ide> $this->assertSame($table, $validator->provider('table')); <ide> $this->assertInstanceOf('Cake\Validation\Validator', $validator); <del> $default = $table->validator('default'); <add> $default = $table->getValidator('default'); <ide> $this->assertSame($validator, $default); <ide> } <ide> <ide> public function testValidationWithDefiner() <ide> ->getMock(); <ide> $table->expects($this->once())->method('validationForOtherStuff') <ide> ->will($this->returnArgument(0)); <del> $other = $table->validator('forOtherStuff'); <add> $other = $table->getValidator('forOtherStuff'); <ide> $this->assertInstanceOf('Cake\Validation\Validator', $other); <del> $this->assertNotSame($other, $table->validator()); <add> $this->assertNotSame($other, $table->getValidator()); <ide> $this->assertSame($table, $other->provider('table')); <ide> } <ide> <ide> public function testValidationWithBadDefiner() <ide> ->getMock(); <ide> $table->expects($this->once()) <ide> ->method('validationBad'); <del> $table->validator('bad'); <add> $table->getValidator('bad'); <ide> } <ide> <ide> /** <ide> public function testValidatorSetter() <ide> { <ide> $table = new Table; <ide> $validator = new \Cake\Validation\Validator; <del> $table->validator('other', $validator); <del> $this->assertSame($validator, $table->validator('other')); <add> $table->setValidator('other', $validator); <add> $this->assertSame($validator, $table->getValidator('other')); <ide> $this->assertSame($table, $validator->provider('table')); <ide> } <ide> <ide> public function testEntitySourceExistingAndNew() <ide> public function testNewEntityAndValidation() <ide> { <ide> $table = TableRegistry::get('Articles'); <del> $validator = $table->validator()->requirePresence('title'); <add> $validator = $table->getValidator()->requirePresence('title'); <ide> $entity = $table->newEntity([]); <ide> $errors = $entity->errors(); <ide> $this->assertNotEmpty($errors['title']); <ide> public function testBuildValidatorEvent() <ide> }; <ide> EventManager::instance()->on('Model.buildValidator', $cb); <ide> $articles = TableRegistry::get('Articles'); <del> $articles->validator(); <add> $articles->getValidator(); <ide> $this->assertEquals(1, $count, 'Callback should be called'); <ide> <del> $articles->validator(); <add> $articles->getValidator(); <ide> $this->assertEquals(1, $count, 'Callback should be called only once'); <ide> } <ide> <ide> function (Event $event, Query $query, ArrayObject $options, $primary) use (&$bef <ide> $buildValidatorCount ++; <ide> } <ide> ); <del> $table->validator(); <add> $table->getValidator(); <ide> $this->assertEquals(1, $buildValidatorCount); <ide> <ide> $buildRulesCount = <ide> public function testSaveCorrectPrimaryKeyType() <ide> public function testEntityClean() <ide> { <ide> $table = TableRegistry::get('Articles'); <del> $validator = $table->validator()->requirePresence('body'); <add> $validator = $table->getValidator()->requirePresence('body'); <ide> $entity = $table->newEntity(['title' => 'mark']); <ide> <ide> $entity->dirty('title', true);
5
Javascript
Javascript
fix windows issue
897e997a2d6938f30214c2f610a68edc853b4137
<ide><path>test/cases/entry-exports-field/loader/node_modules/toml-parser/loader.js <del>module.exports = c => `module.exports = ${JSON.stringify(c + "toml")}`; <add>module.exports = c => `module.exports = ${JSON.stringify(c.trim() + "\ntoml")}`;
1
Java
Java
increase timeout on parallel & completable tests
21a7a0567a51193734e21b234fa3ed925e65d0ec
<ide><path>src/test/java/io/reactivex/completable/CompletableTest.java <ide> public void assertSubscriptions(int n) { <ide> /** An error Completable object. */ <ide> final ErrorCompletable error = new ErrorCompletable(); <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void complete() { <ide> Completable c = Completable.complete(); <ide> <ide> public void concatNull() { <ide> Completable.concatArray((Completable[])null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatEmpty() { <ide> Completable c = Completable.concatArray(); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatSingleSource() { <ide> Completable c = Completable.concatArray(normal.completable); <ide> <ide> public void concatSingleSource() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatSingleSourceThrows() { <ide> Completable c = Completable.concatArray(error.completable); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatMultipleSources() { <ide> Completable c = Completable.concatArray(normal.completable, normal.completable, normal.completable); <ide> <ide> public void concatMultipleSources() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatMultipleOneThrows() { <ide> Completable c = Completable.concatArray(normal.completable, error.completable, normal.completable); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void concatMultipleOneIsNull() { <ide> Completable c = Completable.concatArray(normal.completable, null); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatIterableEmpty() { <ide> Completable c = Completable.concat(Collections.<Completable>emptyList()); <ide> <ide> public void concatIterableNull() { <ide> Completable.concat((Iterable<Completable>)null); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void concatIterableIteratorNull() { <ide> Completable c = Completable.concat(new Iterable<Completable>() { <ide> @Override <ide> public Iterator<Completable> iterator() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void concatIterableWithNull() { <ide> Completable c = Completable.concat(Arrays.asList(normal.completable, (Completable)null)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatIterableSingle() { <ide> Completable c = Completable.concat(Collections.singleton(normal.completable)); <ide> <ide> public void concatIterableSingle() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatIterableMany() { <ide> Completable c = Completable.concat(Arrays.asList(normal.completable, normal.completable, normal.completable)); <ide> <ide> public void concatIterableMany() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatIterableOneThrows() { <ide> Completable c = Completable.concat(Collections.singleton(error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatIterableManyOneThrows() { <ide> Completable c = Completable.concat(Arrays.asList(normal.completable, error.completable)); <ide> <ide> public void concatIterableIteratorNextThrows() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatObservableEmpty() { <ide> Completable c = Completable.concat(Flowable.<Completable>empty()); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatObservableError() { <ide> Completable c = Completable.concat(Flowable.<Completable>error(new Callable<Throwable>() { <ide> @Override <ide> public Throwable call() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatObservableSingle() { <ide> Completable c = Completable.concat(Flowable.just(normal.completable)); <ide> <ide> public void concatObservableSingle() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatObservableSingleThrows() { <ide> Completable c = Completable.concat(Flowable.just(error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatObservableMany() { <ide> Completable c = Completable.concat(Flowable.just(normal.completable).repeat(3)); <ide> <ide> public void concatObservableMany() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatObservableManyOneThrows() { <ide> Completable c = Completable.concat(Flowable.just(normal.completable, error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatObservablePrefetch() { <ide> final List<Long> requested = new ArrayList<Long>(); <ide> Flowable<Completable> cs = Flowable <ide> public void createNull() { <ide> Completable.unsafeCreate(null); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void createOnSubscribeThrowsNPE() { <ide> Completable c = Completable.unsafeCreate(new CompletableSource() { <ide> @Override <ide> public void createOnSubscribeThrowsNPE() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void createOnSubscribeThrowsRuntimeException() { <ide> try { <ide> Completable c = Completable.unsafeCreate(new CompletableSource() { <ide> public void subscribe(CompletableObserver s) { <ide> } <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void defer() { <ide> Completable c = Completable.defer(new Callable<Completable>() { <ide> @Override <ide> public void deferNull() { <ide> Completable.defer(null); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void deferReturnsNull() { <ide> Completable c = Completable.defer(new Callable<Completable>() { <ide> @Override <ide> public Completable call() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void deferFunctionThrows() { <ide> Completable c = Completable.defer(new Callable<Completable>() { <ide> @Override <ide> public void deferFunctionThrows() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void deferErrorSource() { <ide> Completable c = Completable.defer(new Callable<Completable>() { <ide> @Override <ide> public void errorSupplierNull() { <ide> Completable.error((Callable<Throwable>)null); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void errorSupplierNormal() { <ide> Completable c = Completable.error(new Callable<Throwable>() { <ide> @Override <ide> public Throwable call() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void errorSupplierReturnsNull() { <ide> Completable c = Completable.error(new Callable<Throwable>() { <ide> @Override <ide> public Throwable call() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void errorSupplierThrows() { <ide> Completable c = Completable.error(new Callable<Throwable>() { <ide> @Override <ide> public void errorNull() { <ide> Completable.error((Throwable)null); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void errorNormal() { <ide> Completable c = Completable.error(new TestException()); <ide> <ide> public void fromCallableNull() { <ide> Completable.fromCallable(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void fromCallableNormal() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public Object call() throws Exception { <ide> Assert.assertEquals(1, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void fromCallableThrows() { <ide> Completable c = Completable.fromCallable(new Callable<Object>() { <ide> @Override <ide> public void fromFlowableNull() { <ide> Completable.fromPublisher(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void fromFlowableEmpty() { <ide> Completable c = Completable.fromPublisher(Flowable.empty()); <ide> <ide> public void fromFlowableSome() { <ide> } <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void fromFlowableError() { <ide> Completable c = Completable.fromPublisher(Flowable.error(new Callable<Throwable>() { <ide> @Override <ide> public void fromObservableNull() { <ide> Completable.fromObservable(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void fromObservableEmpty() { <ide> Completable c = Completable.fromObservable(Observable.empty()); <ide> <ide> public void fromObservableSome() { <ide> } <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void fromObservableError() { <ide> Completable c = Completable.fromObservable(Observable.error(new Callable<Throwable>() { <ide> @Override <ide> public void fromActionNull() { <ide> Completable.fromAction(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void fromActionNormal() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void run() { <ide> Assert.assertEquals(1, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void fromActionThrows() { <ide> Completable c = Completable.fromAction(new Action() { <ide> @Override <ide> public void fromSingleNull() { <ide> Completable.fromSingle(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void fromSingleNormal() { <ide> Completable c = Completable.fromSingle(Single.just(1)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void fromSingleThrows() { <ide> Completable c = Completable.fromSingle(Single.error(new Callable<Throwable>() { <ide> @Override <ide> public void mergeNull() { <ide> Completable.mergeArray((Completable[])null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeEmpty() { <ide> Completable c = Completable.mergeArray(); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeSingleSource() { <ide> Completable c = Completable.mergeArray(normal.completable); <ide> <ide> public void mergeSingleSource() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeSingleSourceThrows() { <ide> Completable c = Completable.mergeArray(error.completable); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeMultipleSources() { <ide> Completable c = Completable.mergeArray(normal.completable, normal.completable, normal.completable); <ide> <ide> public void mergeMultipleSources() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeMultipleOneThrows() { <ide> Completable c = Completable.mergeArray(normal.completable, error.completable, normal.completable); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void mergeMultipleOneIsNull() { <ide> Completable c = Completable.mergeArray(normal.completable, null); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeIterableEmpty() { <ide> Completable c = Completable.merge(Collections.<Completable>emptyList()); <ide> <ide> public void mergeIterableNull() { <ide> Completable.merge((Iterable<Completable>)null); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void mergeIterableIteratorNull() { <ide> Completable c = Completable.merge(new Iterable<Completable>() { <ide> @Override <ide> public Iterator<Completable> iterator() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void mergeIterableWithNull() { <ide> Completable c = Completable.merge(Arrays.asList(normal.completable, (Completable)null)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeIterableSingle() { <ide> Completable c = Completable.merge(Collections.singleton(normal.completable)); <ide> <ide> public void mergeIterableSingle() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeIterableMany() { <ide> Completable c = Completable.merge(Arrays.asList(normal.completable, normal.completable, normal.completable)); <ide> <ide> public void mergeIterableMany() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeIterableOneThrows() { <ide> Completable c = Completable.merge(Collections.singleton(error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeIterableManyOneThrows() { <ide> Completable c = Completable.merge(Arrays.asList(normal.completable, error.completable)); <ide> <ide> public void mergeIterableIteratorNextThrows() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeObservableEmpty() { <ide> Completable c = Completable.merge(Flowable.<Completable>empty()); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeObservableError() { <ide> Completable c = Completable.merge(Flowable.<Completable>error(new Callable<Throwable>() { <ide> @Override <ide> public Throwable call() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeObservableSingle() { <ide> Completable c = Completable.merge(Flowable.just(normal.completable)); <ide> <ide> public void mergeObservableSingle() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeObservableSingleThrows() { <ide> Completable c = Completable.merge(Flowable.just(error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeObservableMany() { <ide> Completable c = Completable.merge(Flowable.just(normal.completable).repeat(3)); <ide> <ide> public void mergeObservableMany() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeObservableManyOneThrows() { <ide> Completable c = Completable.merge(Flowable.just(normal.completable, error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeObservableMaxConcurrent() { <ide> final List<Long> requested = new ArrayList<Long>(); <ide> Flowable<Completable> cs = Flowable <ide> public void mergeDelayErrorNull() { <ide> Completable.mergeArrayDelayError((Completable[])null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorEmpty() { <ide> Completable c = Completable.mergeArrayDelayError(); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorSingleSource() { <ide> Completable c = Completable.mergeArrayDelayError(normal.completable); <ide> <ide> public void mergeDelayErrorSingleSource() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeDelayErrorSingleSourceThrows() { <ide> Completable c = Completable.mergeArrayDelayError(error.completable); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorMultipleSources() { <ide> Completable c = Completable.mergeArrayDelayError(normal.completable, normal.completable, normal.completable); <ide> <ide> public void mergeDelayErrorMultipleSources() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorMultipleOneThrows() { <ide> Completable c = Completable.mergeArrayDelayError(normal.completable, error.completable, normal.completable); <ide> <ide> public void mergeDelayErrorMultipleOneThrows() { <ide> } <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void mergeDelayErrorMultipleOneIsNull() { <ide> Completable c = Completable.mergeArrayDelayError(normal.completable, null); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorIterableEmpty() { <ide> Completable c = Completable.mergeDelayError(Collections.<Completable>emptyList()); <ide> <ide> public void mergeDelayErrorIterableNull() { <ide> Completable.mergeDelayError((Iterable<Completable>)null); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void mergeDelayErrorIterableIteratorNull() { <ide> Completable c = Completable.mergeDelayError(new Iterable<Completable>() { <ide> @Override <ide> public Iterator<Completable> iterator() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void mergeDelayErrorIterableWithNull() { <ide> Completable c = Completable.mergeDelayError(Arrays.asList(normal.completable, (Completable)null)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorIterableSingle() { <ide> Completable c = Completable.mergeDelayError(Collections.singleton(normal.completable)); <ide> <ide> public void mergeDelayErrorIterableSingle() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorIterableMany() { <ide> Completable c = Completable.mergeDelayError(Arrays.asList(normal.completable, normal.completable, normal.completable)); <ide> <ide> public void mergeDelayErrorIterableMany() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeDelayErrorIterableOneThrows() { <ide> Completable c = Completable.mergeDelayError(Collections.singleton(error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorIterableManyOneThrows() { <ide> Completable c = Completable.mergeDelayError(Arrays.asList(normal.completable, error.completable, normal.completable)); <ide> <ide> public void mergeDelayErrorIterableIteratorNextThrows() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorObservableEmpty() { <ide> Completable c = Completable.mergeDelayError(Flowable.<Completable>empty()); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeDelayErrorObservableError() { <ide> Completable c = Completable.mergeDelayError(Flowable.<Completable>error(new Callable<Throwable>() { <ide> @Override <ide> public Throwable call() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorObservableSingle() { <ide> Completable c = Completable.mergeDelayError(Flowable.just(normal.completable)); <ide> <ide> public void mergeDelayErrorObservableSingle() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeDelayErrorObservableSingleThrows() { <ide> Completable c = Completable.mergeDelayError(Flowable.just(error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorObservableMany() { <ide> Completable c = Completable.mergeDelayError(Flowable.just(normal.completable).repeat(3)); <ide> <ide> public void mergeDelayErrorObservableMany() { <ide> normal.assertSubscriptions(3); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void mergeDelayErrorObservableManyOneThrows() { <ide> Completable c = Completable.mergeDelayError(Flowable.just(normal.completable, error.completable)); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeDelayErrorObservableMaxConcurrent() { <ide> final List<Long> requested = new ArrayList<Long>(); <ide> Flowable<Completable> cs = Flowable <ide> public void accept(long v) { <ide> Assert.assertEquals(Arrays.asList(5L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), requested); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void never() { <ide> final AtomicBoolean onSubscribeCalled = new AtomicBoolean(); <ide> final AtomicInteger calls = new AtomicInteger(); <ide> public void timerNewThread() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void timerTestScheduler() { <ide> TestScheduler scheduler = new TestScheduler(); <ide> <ide> public void timerSchedulerNull() { <ide> Completable.timer(1, TimeUnit.SECONDS, null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void usingNormalEager() { <ide> final AtomicInteger dispose = new AtomicInteger(); <ide> <ide> public void onComplete() { <ide> Assert.assertNull(error.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void usingNormalLazy() { <ide> final AtomicInteger dispose = new AtomicInteger(); <ide> <ide> public void onComplete() { <ide> Assert.assertNull(error.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void usingErrorEager() { <ide> final AtomicInteger dispose = new AtomicInteger(); <ide> <ide> public void onComplete() { <ide> Assert.assertFalse(complete.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void usingErrorLazy() { <ide> final AtomicInteger dispose = new AtomicInteger(); <ide> <ide> public Completable apply(Object v) { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void composeNormal() { <ide> Completable c = error.completable.compose(new CompletableTransformer() { <ide> @Override <ide> public void composeNull() { <ide> error.completable.compose(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void concatWithNormal() { <ide> Completable c = normal.completable.concatWith(normal.completable); <ide> <ide> public void concatWithNormal() { <ide> normal.assertSubscriptions(2); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void concatWithError() { <ide> Completable c = normal.completable.concatWith(error.completable); <ide> <ide> public void delaySchedulerNull() { <ide> normal.completable.delay(1, TimeUnit.SECONDS, null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void delayNormal() throws InterruptedException { <ide> Completable c = normal.completable.delay(250, TimeUnit.MILLISECONDS); <ide> <ide> public void onComplete() { <ide> Assert.assertNull(error.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void delayErrorImmediately() throws InterruptedException { <ide> final TestScheduler scheduler = new TestScheduler(); <ide> final Completable c = error.completable.delay(250, TimeUnit.MILLISECONDS, scheduler); <ide> public void onComplete() { <ide> Assert.assertFalse("Already done", done.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void delayErrorToo() throws InterruptedException { <ide> Completable c = error.completable.delay(250, TimeUnit.MILLISECONDS, Schedulers.computation(), true); <ide> <ide> public void onComplete() { <ide> Assert.assertTrue(error.get() instanceof TestException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnCompleteNormal() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void run() { <ide> Assert.assertEquals(1, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnCompleteError() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void doOnCompleteNull() { <ide> normal.completable.doOnComplete(null); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void doOnCompleteThrows() { <ide> Completable c = normal.completable.doOnComplete(new Action() { <ide> @Override <ide> public void doOnCompleteThrows() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnDisposeNormalDoesntCall() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void run() { <ide> Assert.assertEquals(0, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnDisposeErrorDoesntCall() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void run() { <ide> Assert.assertEquals(0, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnDisposeChildCancels() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void doOnDisposeNull() { <ide> normal.completable.doOnDispose(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnDisposeThrows() { <ide> Completable c = normal.completable.doOnDispose(new Action() { <ide> @Override <ide> public void onComplete() { <ide> }); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnErrorNoError() { <ide> final AtomicReference<Throwable> error = new AtomicReference<Throwable>(); <ide> <ide> public void accept(Throwable e) { <ide> Assert.assertNull(error.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnErrorHasError() { <ide> final AtomicReference<Throwable> err = new AtomicReference<Throwable>(); <ide> <ide> public void doOnErrorNull() { <ide> normal.completable.doOnError(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnErrorThrows() { <ide> Completable c = error.completable.doOnError(new Consumer<Throwable>() { <ide> @Override <ide> public void doOnErrorThrows() { <ide> } <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnSubscribeNormal() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void doOnSubscribeThrows() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnTerminateNormal() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void run() { <ide> Assert.assertEquals(1, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void doOnTerminateError() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void run() { <ide> Assert.assertEquals(1, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void getNormal() { <ide> Assert.assertNull(normal.completable.blockingGet()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void getError() { <ide> Assert.assertTrue(error.completable.blockingGet() instanceof TestException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void getTimeout() { <ide> try { <ide> Completable.never().blockingGet(100, TimeUnit.MILLISECONDS); <ide> public void liftNull() { <ide> normal.completable.lift(null); <ide> } <ide> <del> @Test(timeout = 1000, expected = NullPointerException.class) <add> @Test(timeout = 5000, expected = NullPointerException.class) <ide> public void liftReturnsNull() { <ide> Completable c = normal.completable.lift(new CompletableOperator() { <ide> @Override <ide> public void onSubscribe(Disposable d) { <ide> }; <ide> } <ide> } <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void liftOnCompleteError() { <ide> Completable c = normal.completable.lift(new CompletableOperatorSwap()); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void liftOnErrorComplete() { <ide> Completable c = error.completable.lift(new CompletableOperatorSwap()); <ide> <ide> public void mergeWithNull() { <ide> normal.completable.mergeWith(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void mergeWithNormal() { <ide> Completable c = normal.completable.mergeWith(normal.completable); <ide> <ide> public void observeOnNull() { <ide> normal.completable.observeOn(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void observeOnNormal() throws InterruptedException { <ide> final AtomicReference<String> name = new AtomicReference<String>(); <ide> final AtomicReference<Throwable> err = new AtomicReference<Throwable>(); <ide> public void onError(Throwable e) { <ide> Assert.assertTrue(name.get().startsWith("RxComputation")); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void observeOnError() throws InterruptedException { <ide> final AtomicReference<String> name = new AtomicReference<String>(); <ide> final AtomicReference<Throwable> err = new AtomicReference<Throwable>(); <ide> public void onError(Throwable e) { <ide> Assert.assertTrue(name.get().startsWith("RxComputation")); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void onErrorComplete() { <ide> Completable c = error.completable.onErrorComplete(); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void onErrorCompleteFalse() { <ide> Completable c = error.completable.onErrorComplete(new Predicate<Throwable>() { <ide> @Override <ide> public void onErrorResumeNextNull() { <ide> error.completable.onErrorResumeNext(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void onErrorResumeNextFunctionReturnsNull() { <ide> Completable c = error.completable.onErrorResumeNext(new Function<Throwable, Completable>() { <ide> @Override <ide> public Completable apply(Throwable e) { <ide> } <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void onErrorResumeNextFunctionThrows() { <ide> Completable c = error.completable.onErrorResumeNext(new Function<Throwable, Completable>() { <ide> @Override <ide> public void onErrorResumeNextFunctionThrows() { <ide> } <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void onErrorResumeNextNormal() { <ide> Completable c = error.completable.onErrorResumeNext(new Function<Throwable, Completable>() { <ide> @Override <ide> public Completable apply(Throwable v) { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void onErrorResumeNextError() { <ide> Completable c = error.completable.onErrorResumeNext(new Function<Throwable, Completable>() { <ide> @Override <ide> public void onComplete() { <ide> Assert.assertNull(err.get()); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void repeatError() { <ide> Completable c = error.completable.repeat(); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void repeat5Times() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public Object call() throws Exception { <ide> Assert.assertEquals(5, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void repeat1Time() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public Object call() throws Exception { <ide> Assert.assertEquals(1, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void repeat0Time() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public Object call() throws Exception { <ide> Assert.assertEquals(0, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void repeatUntilNormal() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> final AtomicInteger times = new AtomicInteger(5); <ide> public void repeatWhenNull() { <ide> normal.completable.repeatWhen(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void retryNormal() { <ide> Completable c = normal.completable.retry(); <ide> <ide> public void retryNormal() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void retry5Times() { <ide> final AtomicInteger calls = new AtomicInteger(5); <ide> Completable c = Completable.fromAction(new Action() { <ide> public void run() { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void retryBiPredicate5Times() { <ide> Completable c = error.completable.retry(new BiPredicate<Integer, Throwable>() { <ide> @Override <ide> public boolean test(Integer n, Throwable e) { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void retryTimes5Error() { <ide> Completable c = error.completable.retry(5); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void retryTimes5Normal() { <ide> final AtomicInteger calls = new AtomicInteger(5); <ide> <ide> public void retryNegativeTimes() { <ide> normal.completable.retry(-1); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void retryPredicateError() { <ide> Completable c = error.completable.retry(new Predicate<Throwable>() { <ide> @Override <ide> public void retryPredicateNull() { <ide> error.completable.retry((Predicate<Throwable>)null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void retryPredicate5Times() { <ide> final AtomicInteger calls = new AtomicInteger(5); <ide> <ide> public boolean test(Throwable e) { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void retryWhen5Times() { <ide> final AtomicInteger calls = new AtomicInteger(5); <ide> <ide> public Publisher<Object> apply(Flowable<? extends Throwable> o) { <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribe() throws InterruptedException { <ide> final AtomicBoolean complete = new AtomicBoolean(); <ide> <ide> public void run() { <ide> assertTrue(d.isDisposed()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeDispose() throws InterruptedException { <ide> final AtomicBoolean complete = new AtomicBoolean(); <ide> <ide> public void run() { <ide> Assert.assertFalse("Completed", complete.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeTwoCallbacksNormal() { <ide> final AtomicReference<Throwable> err = new AtomicReference<Throwable>(); <ide> final AtomicBoolean complete = new AtomicBoolean(); <ide> public void accept(Throwable e) { <ide> Assert.assertTrue("Not completed", complete.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeTwoCallbacksError() { <ide> final AtomicReference<Throwable> err = new AtomicReference<Throwable>(); <ide> final AtomicBoolean complete = new AtomicBoolean(); <ide> public void run() { } <ide> }, null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeTwoCallbacksCompleteThrows() { <ide> final AtomicReference<Throwable> err = new AtomicReference<Throwable>(); <ide> normal.completable.subscribe(new Action() { <ide> public void accept(Throwable e) { <ide> Assert.assertTrue(String.valueOf(err.get()), err.get() instanceof TestException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeTwoCallbacksOnErrorThrows() { <ide> error.completable.subscribe(new Action() { <ide> @Override <ide> public void run() { } <ide> }); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeObserverNormal() { <ide> TestObserver<Object> ts = new TestObserver<Object>(); <ide> <ide> public void subscribeObserverNormal() { <ide> ts.assertNoErrors(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeObserverError() { <ide> TestObserver<Object> ts = new TestObserver<Object>(); <ide> <ide> public void subscribeObserverError() { <ide> ts.assertError(TestException.class); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeActionNormal() { <ide> final AtomicBoolean run = new AtomicBoolean(); <ide> <ide> public void run() { <ide> Assert.assertTrue("Not completed", run.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeActionError() { <ide> final AtomicBoolean run = new AtomicBoolean(); <ide> <ide> public void subscribeCompletableSubscriberNull() { <ide> normal.completable.subscribe((CompletableObserver)null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeSubscriberNormal() { <ide> TestSubscriber<Object> ts = new TestSubscriber<Object>(); <ide> <ide> public void subscribeSubscriberNormal() { <ide> ts.assertNoErrors(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeSubscriberError() { <ide> TestSubscriber<Object> ts = new TestSubscriber<Object>(); <ide> <ide> public void subscribeOnNull() { <ide> normal.completable.subscribeOn(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeOnNormal() { <ide> final AtomicReference<String> name = new AtomicReference<String>(); <ide> <ide> public void subscribe(CompletableObserver s) { <ide> Assert.assertTrue(name.get().startsWith("RxComputation")); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeOnError() { <ide> final AtomicReference<String> name = new AtomicReference<String>(); <ide> <ide> public void subscribe(CompletableObserver s) { <ide> Assert.assertTrue(name.get().startsWith("RxComputation")); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void timeoutEmitError() { <ide> Throwable e = Completable.never().timeout(100, TimeUnit.MILLISECONDS).blockingGet(); <ide> <ide> Assert.assertTrue(e instanceof TimeoutException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void timeoutSwitchNormal() { <ide> Completable c = Completable.never().timeout(100, TimeUnit.MILLISECONDS, normal.completable); <ide> <ide> public void timeoutSwitchNormal() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void timeoutTimerCancelled() throws InterruptedException { <ide> Completable c = Completable.fromCallable(new Callable<Object>() { <ide> @Override <ide> public void timeoutOtherNull() { <ide> normal.completable.timeout(1, TimeUnit.SECONDS, (Completable)null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void toNormal() { <ide> Flowable<Object> flow = normal.completable.to(new Function<Completable, Flowable<Object>>() { <ide> @Override <ide> public void toNull() { <ide> normal.completable.to(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void toFlowableNormal() { <ide> normal.completable.toFlowable().blockingForEach(Functions.emptyConsumer()); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void toFlowableError() { <ide> error.completable.toFlowable().blockingForEach(Functions.emptyConsumer()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void toObservableNormal() { <ide> normal.completable.toObservable().blockingForEach(Functions.emptyConsumer()); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void toObservableError() { <ide> error.completable.toObservable().blockingForEach(Functions.emptyConsumer()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void toSingleSupplierNormal() { <ide> Assert.assertEquals(1, normal.completable.toSingle(new Callable<Object>() { <ide> @Override <ide> public Object call() { <ide> }).blockingGet()); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void toSingleSupplierError() { <ide> error.completable.toSingle(new Callable<Object>() { <ide> @Override <ide> public void toSingleSupplierThrows() { <ide> }).blockingGet(); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void toSingleDefaultError() { <ide> error.completable.toSingleDefault(1).blockingGet(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void toSingleDefaultNormal() { <ide> Assert.assertEquals((Integer)1, normal.completable.toSingleDefault(1).blockingGet()); <ide> } <ide> public void toSingleDefaultNull() { <ide> normal.completable.toSingleDefault(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void unsubscribeOnNormal() throws InterruptedException { <ide> final AtomicReference<String> name = new AtomicReference<String>(); <ide> final CountDownLatch cdl = new CountDownLatch(1); <ide> public void ambArrayNull() { <ide> Completable.ambArray((Completable[])null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambArrayEmpty() { <ide> Completable c = Completable.ambArray(); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambArraySingleNormal() { <ide> Completable c = Completable.ambArray(normal.completable); <ide> <ide> c.blockingAwait(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambArraySingleError() { <ide> Completable.ambArray(error.completable) <ide> .test() <ide> .assertError(TestException.class); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambArrayOneFires() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void run() { <ide> Assert.assertTrue("Not completed", complete.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambArrayOneFiresError() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void accept(Throwable v) { <ide> Assert.assertTrue("Not completed", complete.get() instanceof TestException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambArraySecondFires() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void run() { <ide> Assert.assertTrue("Not completed", complete.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambArraySecondFiresError() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void accept(Throwable v) { <ide> Assert.assertTrue("Not completed", complete.get() instanceof TestException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambMultipleOneIsNull() { <ide> Completable.ambArray(null, normal.completable) <ide> .test() <ide> .assertError(NullPointerException.class); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambIterableEmpty() { <ide> Completable c = Completable.amb(Collections.<Completable>emptyList()); <ide> <ide> public void ambIterableNull() { <ide> Completable.amb((Iterable<Completable>)null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambIterableIteratorNull() { <ide> Completable.amb(new Iterable<Completable>() { <ide> @Override <ide> public Iterator<Completable> iterator() { <ide> }).test().assertError(NullPointerException.class); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambIterableWithNull() { <ide> Completable.amb(Arrays.asList(null, normal.completable)) <ide> .test() <ide> .assertError(NullPointerException.class); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambIterableSingle() { <ide> Completable c = Completable.amb(Collections.singleton(normal.completable)); <ide> <ide> public void ambIterableSingle() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambIterableMany() { <ide> Completable c = Completable.amb(Arrays.asList(normal.completable, normal.completable, normal.completable)); <ide> <ide> public void ambIterableMany() { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambIterableOneThrows() { <ide> Completable.amb(Collections.singleton(error.completable)) <ide> .test() <ide> .assertError(TestException.class); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambIterableManyOneThrows() { <ide> Completable.amb(Arrays.asList(error.completable, normal.completable)) <ide> .test() <ide> public void ambWithNull() { <ide> normal.completable.ambWith(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambWithArrayOneFires() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void run() { <ide> Assert.assertTrue("Not completed", complete.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambWithArrayOneFiresError() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void accept(Throwable v) { <ide> Assert.assertTrue("Not completed", complete.get() instanceof TestException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambWithArraySecondFires() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void run() { <ide> Assert.assertTrue("Not completed", complete.get()); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void ambWithArraySecondFiresError() { <ide> PublishProcessor<Object> ps1 = PublishProcessor.create(); <ide> PublishProcessor<Object> ps2 = PublishProcessor.create(); <ide> public void accept(Throwable v) { <ide> Assert.assertTrue("Not completed", complete.get() instanceof TestException); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void startWithCompletableNormal() { <ide> final AtomicBoolean run = new AtomicBoolean(); <ide> Completable c = normal.completable <ide> public Object call() throws Exception { <ide> normal.assertSubscriptions(1); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void startWithCompletableError() { <ide> Completable c = normal.completable.startWith(error.completable); <ide> <ide> public void startWithCompletableError() { <ide> } <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void startWithFlowableNormal() { <ide> final AtomicBoolean run = new AtomicBoolean(); <ide> Flowable<Object> c = normal.completable <ide> public Object call() throws Exception { <ide> ts.assertNoErrors(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void startWithFlowableError() { <ide> Flowable<Object> c = normal.completable <ide> .startWith(Flowable.error(new TestException())); <ide> public void startWithFlowableError() { <ide> ts.assertNotComplete(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void startWithObservableNormal() { <ide> final AtomicBoolean run = new AtomicBoolean(); <ide> Observable<Object> c = normal.completable <ide> public Object call() throws Exception { <ide> ts.assertNoErrors(); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void startWithObservableError() { <ide> Observable<Object> c = normal.completable <ide> .startWith(Observable.error(new TestException())); <ide> public void fromRunnableNull() { <ide> Completable.fromRunnable(null); <ide> } <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void fromRunnableNormal() { <ide> final AtomicInteger calls = new AtomicInteger(); <ide> <ide> public void run() { <ide> Assert.assertEquals(1, calls.get()); <ide> } <ide> <del> @Test(timeout = 1000, expected = TestException.class) <add> @Test(timeout = 5000, expected = TestException.class) <ide> public void fromRunnableThrows() { <ide> Completable c = Completable.fromRunnable(new Runnable() { <ide> @Override <ide> public void accept(final Throwable throwable) throws Exception { <ide> } <ide> <ide> <del> @Test(timeout = 1000) <add> @Test(timeout = 5000) <ide> public void subscribeTwoCallbacksDispose() { <ide> PublishProcessor<Integer> pp = PublishProcessor.create(); <ide> Disposable d = pp.ignoreElements().subscribe(Functions.EMPTY_ACTION, Functions.emptyConsumer()); <ide><path>src/test/java/io/reactivex/parallel/ParallelFlowableTest.java <ide> public void parallelismAndPrefetchAsync() { <ide> .map(Functions.<Integer>identity()) <ide> .sequential(prefetch) <ide> .test() <del> .awaitDone(10, TimeUnit.SECONDS) <add> .withTag("parallelism = " + parallelism + ", prefetch = " + prefetch) <add> .awaitDone(30, TimeUnit.SECONDS) <ide> .assertSubscribed() <ide> .assertValueCount(1024 * 1024) <ide> .assertNoErrors()
2
Python
Python
fix flakey test test_disable_logging
ee4f39c67e3393c863c814b7e1ca3b1dc40625f0
<ide><path>tests/providers/google/cloud/utils/test_credentials_provider.py <ide> from __future__ import annotations <ide> <ide> import json <add>import logging <ide> import os <ide> import re <ide> import unittest <ide> def test_get_credentials_and_project_id_with_mutually_exclusive_configuration( <ide> ) <ide> def test_disable_logging(self, mock_default, mock_info, mock_file): <ide> # assert not logs <del> with pytest.raises(AssertionError), self.assertLogs(level="DEBUG"): <add> with self.assertLogs(level="DEBUG") as logs: <add> logging.debug('nothing') <ide> get_credentials_and_project_id(disable_logging=True) <add> assert logs.output == ['DEBUG:root:nothing'] <ide> <del> # assert not logs <del> with pytest.raises(AssertionError), self.assertLogs(level="DEBUG"): <add> # assert no debug logs emitted from get_credentials_and_project_id <add> with self.assertLogs(level="DEBUG") as logs: <add> logging.debug('nothing') <ide> get_credentials_and_project_id( <ide> keyfile_dict={'private_key': 'PRIVATE_KEY'}, <ide> disable_logging=True, <ide> ) <add> assert logs.output == ['DEBUG:root:nothing'] <ide> <del> # assert not logs <del> with pytest.raises(AssertionError), self.assertLogs(level="DEBUG"): <add> # assert no debug logs emitted from get_credentials_and_project_id <add> with self.assertLogs(level="DEBUG") as logs: <add> logging.debug('nothing') <ide> get_credentials_and_project_id( <ide> key_path='KEY.json', <ide> disable_logging=True, <ide> ) <add> assert logs.output == ['DEBUG:root:nothing'] <ide> <ide> <ide> class TestGetScopes(unittest.TestCase):
1
Javascript
Javascript
add product pains to support
11458d67d53157b655ee6640149259ad951fe9aa
<ide><path>website/src/react-native/support.js <ide> var support = React.createClass({ <ide> <ul> <ide> <li><a href="http://reactnative.cn">Chinese</a> (<a href="https://github.com/reactnativecn/react-native-docs-cn">source</a>)</li> <ide> </ul> <del> <add> <ide> <H2>Stack Overflow</H2> <ide> <p>Many members of the community use Stack Overflow to ask questions. Read through the <a href="http://stackoverflow.com/questions/tagged/react-native">existing questions</a> tagged with <strong>react-native</strong> or <a href="http://stackoverflow.com/questions/ask">ask your own</a>!</p> <ide> <ide> <H2>Chat</H2> <del> <p>Join us in <strong><a href="irc://chat.freenode.net/reactnative">#reactnative on Reactiflux</a></strong>.</p> <add> <p>Join us in <strong><a href="https://discord.gg/0ZcbPKXt5bZjGY5n">#react-native on Reactiflux</a></strong>.</p> <add> <add> <H2>Product Pains</H2> <add> <p>React Native uses <a href="https://productpains.com/product/react-native/">Product Pains</a> for feature requests. It has a voting system to surface which issues are most important to the community. GitHub issues should only be used for bugs.</p> <add> <add> <iframe <add> width="100%" <add> height="600px" <add> scrolling="yes" <add> src="https://productpains.com/widget.html?token=3b929306-e0f7-5c94-7d7c-ecc05d059748" <add> /> <ide> <ide> <H2>Twitter</H2> <ide> <p><a href="https://twitter.com/search?q=%23reactnative"><strong>#reactnative</strong> hash tag on Twitter</a> is used to keep up with the latest React Native news.</p>
1
PHP
PHP
allow json_encode options in jsontype
6c17ca54a1be287ed2c6484247eab47f4fed9d33
<ide><path>src/Database/Type/JsonType.php <ide> */ <ide> class JsonType extends BaseType implements BatchCastingInterface <ide> { <add> /** <add> * @var int <add> */ <add> protected $_jsonOptions = 0; <add> <ide> /** <ide> * Convert a value data into a JSON string <ide> * <ide> public function toDatabase($value, DriverInterface $driver): ?string <ide> return null; <ide> } <ide> <del> return json_encode($value); <add> return json_encode($value, $this->_jsonOptions); <ide> } <ide> <ide> /** <ide> public function marshal($value) <ide> { <ide> return $value; <ide> } <add> <add> /** <add> * Set json_encode options. <add> * <add> * @param int|null $jsonOptions Options. Use JSON_* flags <add> * @return self <add> * @see https://www.php.net/manual/en/function.json-encode.php <add> */ <add> public function setJsonOptions(int $jsonOptions): self <add> { <add> $this->_jsonOptions = $jsonOptions; <add> <add> return $this; <add> } <ide> } <ide><path>tests/TestCase/Database/Type/JsonTypeTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Database\Type; <ide> <add>use Cake\Database\Type\JsonType; <ide> use Cake\Database\TypeFactory; <ide> use Cake\TestSuite\TestCase; <ide> use PDO; <ide> public function testToStatement() <ide> { <ide> $this->assertSame(PDO::PARAM_STR, $this->type->toStatement('', $this->driver)); <ide> } <add> <add> /** <add> * Test instance options <add> * <add> * @return void <add> */ <add> public function testInstanceOptions() <add> { <add> // New instance to prevent others tests breaking <add> $instance = new JsonType(); <add> $instance->setJsonOptions(JSON_UNESCAPED_UNICODE + JSON_UNESCAPED_SLASHES); <add> <add> $result = $instance->toDatabase(['é', 'https://cakephp.org/'], $this->driver); <add> $this->assertSame('["é","https://cakephp.org/"]', $result); <add> } <ide> }
2
Python
Python
add test for recent fix
562be02b6f5c3715ddb37b0ee9d4d7a6559bcef4
<ide><path>numpy/core/tests/test_regression.py <ide> def check_multiple_assign(self, level=rlevel): <ide> <ide> def check_empty_array_type(self, level=rlevel): <ide> assert_equal(N.array([]).dtype, N.zeros(0).dtype) <add> <add> def check_void_coercion(self, level=rlevel): <add> dt = N.dtype([('a','f4'),('b','i4')]) <add> x = N.zeros((1,),dt) <add> assert(N.r_[x,x].dtype == dt) <ide> <ide> if __name__ == "__main__": <ide> NumpyTest().run()
1
Python
Python
use flask_dont_load_env flag to disable load .env
bac5d6b9f458c7876163add793bdc53c2f8f413e
<ide><path>flask/cli.py <ide> def main(self, *args, **kwargs): <ide> # script that is loaded here also attempts to start a server. <ide> os.environ['FLASK_RUN_FROM_CLI'] = 'true' <ide> <del> if self.load_dotenv: <add> val = os.environ.get('FLASK_DONT_LOAD_ENV') <add> load_dotenv = not val or val in ('0', 'false', 'no') <add> <add> if self.load_dotenv and load_dotenv: <ide> load_dotenv() <ide> <ide> obj = kwargs.get('obj')
1
Text
Text
update readme to add py 3.8 in supported versions
468e9507adb9b31d858f7f3c78ece1ad62b1a789
<ide><path>README.md <ide> Apache Airflow is tested with: <ide> <ide> ### Stable version (1.10.11) <ide> <del>* Python versions: 2.7, 3.5, 3.6, 3.7 <add>* Python versions: 2.7, 3.5, 3.6, 3.7, 3.8 <ide> * Postgres DB: 9.6, 10 <ide> * MySQL DB: 5.6, 5.7 <ide> * Sqlite - latest stable (it is used mainly for development purpose) <ide> Apache Airflow is tested with: <ide> ### Additional notes on Python version requirements <ide> <ide> * Stable version [requires](https://github.com/apache/airflow/issues/8162) at least Python 3.5.3 when using Python 3 <del>* Stable version is currently incompatible with Python 3.8 due to [a known compatibility issue](https://github.com/Tinche/cattrs/issues/77) with a dependent library <ide> <ide> ## Getting started <ide> <ide> in the URL. <ide> 1. Installing just airflow: <ide> <ide> ```bash <del>pip install apache-airflow==1.10.10 \ <del> --constraint https://raw.githubusercontent.com/apache/airflow/1.10.10/requirements/requirements-python3.7.txt <add>pip install apache-airflow==1.10.11 \ <add> --constraint https://raw.githubusercontent.com/apache/airflow/1.10.11/requirements/requirements-python3.7.txt <ide> ``` <ide> <ide> 2. Installing with extras (for example postgres,gcp) <ide> ```bash <del>pip install apache-airflow[postgres,gcp]==1.10.10 \ <del> --constraint https://raw.githubusercontent.com/apache/airflow/1.10.10/requirements/requirements-python3.7.txt <add>pip install apache-airflow[postgres,gcp]==1.10.11 \ <add> --constraint https://raw.githubusercontent.com/apache/airflow/1.10.11/requirements/requirements-python3.7.txt <ide> ``` <ide> <ide> ## Building customized production images
1
Go
Go
fix volumes-from re-applying on each start
a738df0354cc615c8d0fa3254621b3db811fe0b9
<ide><path>daemon/container.go <ide> type Container struct { <ide> VolumesRW map[string]bool <ide> hostConfig *runconfig.HostConfig <ide> <del> activeLinks map[string]*links.Link <del> monitor *containerMonitor <del> execCommands *execStore <add> activeLinks map[string]*links.Link <add> monitor *containerMonitor <add> execCommands *execStore <add> AppliedVolumesFrom map[string]struct{} <ide> } <ide> <ide> func (container *Container) FromDisk() error { <ide><path>daemon/volumes.go <ide> func parseBindMountSpec(spec string) (string, string, bool, error) { <ide> return path, mountToPath, writable, nil <ide> } <ide> <add>func parseVolumesFromSpec(spec string) (string, string, error) { <add> specParts := strings.SplitN(spec, ":", 2) <add> if len(specParts) == 0 { <add> return "", "", fmt.Errorf("malformed volumes-from specification: %s", spec) <add> } <add> <add> var ( <add> id = specParts[0] <add> mode = "rw" <add> ) <add> if len(specParts) == 2 { <add> mode = specParts[1] <add> if !validMountMode(mode) { <add> return "", "", fmt.Errorf("invalid mode for volumes-from: %s", mode) <add> } <add> } <add> return id, mode, nil <add>} <add> <ide> func (container *Container) applyVolumesFrom() error { <ide> volumesFrom := container.hostConfig.VolumesFrom <add> if len(volumesFrom) > 0 && container.AppliedVolumesFrom == nil { <add> container.AppliedVolumesFrom = make(map[string]struct{}) <add> } <ide> <del> mountGroups := make([]map[string]*Mount, 0, len(volumesFrom)) <add> mountGroups := make(map[string][]*Mount) <ide> <ide> for _, spec := range volumesFrom { <del> mountGroup, err := parseVolumesFromSpec(container.daemon, spec) <add> id, mode, err := parseVolumesFromSpec(spec) <ide> if err != nil { <ide> return err <ide> } <del> mountGroups = append(mountGroups, mountGroup) <add> if _, exists := container.AppliedVolumesFrom[id]; exists { <add> // Don't try to apply these since they've already been applied <add> continue <add> } <add> <add> c := container.daemon.Get(id) <add> if c == nil { <add> return fmt.Errorf("container %s not found, impossible to mount its volumes", id) <add> } <add> <add> var ( <add> fromMounts = c.VolumeMounts() <add> mounts []*Mount <add> ) <add> <add> for _, mnt := range fromMounts { <add> mnt.Writable = mnt.Writable && (mode == "rw") <add> mounts = append(mounts, mnt) <add> } <add> mountGroups[id] = mounts <ide> } <ide> <del> for _, mounts := range mountGroups { <add> for id, mounts := range mountGroups { <ide> for _, mnt := range mounts { <ide> mnt.from = mnt.container <ide> mnt.container = container <ide> if err := mnt.initialize(); err != nil { <ide> return err <ide> } <ide> } <add> container.AppliedVolumesFrom[id] = struct{}{} <ide> } <ide> return nil <ide> } <ide> func (container *Container) setupMounts() error { <ide> return nil <ide> } <ide> <del>func parseVolumesFromSpec(daemon *Daemon, spec string) (map[string]*Mount, error) { <del> specParts := strings.SplitN(spec, ":", 2) <del> if len(specParts) == 0 { <del> return nil, fmt.Errorf("Malformed volumes-from specification: %s", spec) <del> } <del> <del> c := daemon.Get(specParts[0]) <del> if c == nil { <del> return nil, fmt.Errorf("Container %s not found. Impossible to mount its volumes", specParts[0]) <del> } <del> <del> mounts := c.VolumeMounts() <del> <del> if len(specParts) == 2 { <del> mode := specParts[1] <del> if !validMountMode(mode) { <del> return nil, fmt.Errorf("Invalid mode for volumes-from: %s", mode) <del> } <del> <del> // Set the mode for the inheritted volume <del> for _, mnt := range mounts { <del> // Ensure that if the inherited volume is not writable, that we don't make <del> // it writable here <del> mnt.Writable = mnt.Writable && (mode == "rw") <del> } <del> } <del> <del> return mounts, nil <del>} <del> <ide> func (container *Container) VolumeMounts() map[string]*Mount { <ide> mounts := make(map[string]*Mount) <ide> <ide><path>integration-cli/docker_cli_run_test.go <ide> func TestRunVolumesMountedAsReadonly(t *testing.T) { <ide> } <ide> <ide> func TestRunVolumesFromInReadonlyMode(t *testing.T) { <add> defer deleteAllContainers() <ide> cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test", "busybox", "true") <ide> if _, err := runCommand(cmd); err != nil { <ide> t.Fatal(err) <ide> func TestRunVolumesFromInReadonlyMode(t *testing.T) { <ide> t.Fatalf("run should fail because volume is ro: exit code %d", code) <ide> } <ide> <del> deleteAllContainers() <del> <ide> logDone("run - volumes from as readonly mount") <ide> } <ide> <ide> // Regression test for #1201 <ide> func TestRunVolumesFromInReadWriteMode(t *testing.T) { <add> defer deleteAllContainers() <ide> cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test", "busybox", "true") <ide> if _, err := runCommand(cmd); err != nil { <ide> t.Fatal(err) <ide> func TestRunVolumesFromInReadWriteMode(t *testing.T) { <ide> } <ide> <ide> cmd = exec.Command(dockerBinary, "run", "--volumes-from", "parent:bar", "busybox", "touch", "/test/file") <del> if out, _, err := runCommandWithOutput(cmd); err == nil || !strings.Contains(out, "Invalid mode for volumes-from: bar") { <add> if out, _, err := runCommandWithOutput(cmd); err == nil || !strings.Contains(out, "invalid mode for volumes-from: bar") { <ide> t.Fatalf("running --volumes-from foo:bar should have failed with invalid mount mode: %q", out) <ide> } <ide> <ide> func TestRunVolumesFromInReadWriteMode(t *testing.T) { <ide> t.Fatalf("running --volumes-from parent failed with output: %q\nerror: %v", out, err) <ide> } <ide> <del> deleteAllContainers() <del> <ide> logDone("run - volumes from as read write mount") <ide> } <ide> <ide> func TestVolumesFromGetsProperMode(t *testing.T) { <add> defer deleteAllContainers() <ide> cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test:/test:ro", "busybox", "true") <ide> if _, err := runCommand(cmd); err != nil { <ide> t.Fatal(err) <ide> func TestVolumesFromGetsProperMode(t *testing.T) { <ide> t.Fatal("Expected volumes-from to inherit read-only volume even when passing in `ro`") <ide> } <ide> <del> deleteAllContainers() <del> <ide> logDone("run - volumes from ignores `rw` if inherrited volume is `ro`") <ide> } <ide> <ide> func TestRunContainerWithReadonlyRootfs(t *testing.T) { <ide> } <ide> logDone("run - read only rootfs") <ide> } <add> <add>func TestRunVolumesFromRestartAfterRemoved(t *testing.T) { <add> defer deleteAllContainers() <add> <add> out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "--name", "voltest", "-v", "/foo", "busybox")) <add> if err != nil { <add> t.Fatal(out, err) <add> } <add> <add> out, _, err = runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "--name", "restarter", "--volumes-from", "voltest", "busybox", "top")) <add> if err != nil { <add> t.Fatal(out, err) <add> } <add> <add> // Remove the main volume container and restart the consuming container <add> out, _, err = runCommandWithOutput(exec.Command(dockerBinary, "rm", "-f", "voltest")) <add> if err != nil { <add> t.Fatal(out, err) <add> } <add> <add> // This should not fail since the volumes-from were already applied <add> out, _, err = runCommandWithOutput(exec.Command(dockerBinary, "restart", "restarter")) <add> if err != nil { <add> t.Fatalf("expected container to restart successfully: %v\n%s", err, out) <add> } <add> <add> logDone("run - can restart a volumes-from container after producer is removed") <add>}
3
Ruby
Ruby
remove dead code
8559871cd3c3e156aafdc3799dc6234c39ba3d62
<ide><path>activesupport/lib/active_support/callbacks.rb <ide> def filter; @key; end <ide> def raw_filter; @filter; end <ide> <ide> def merge(chain, new_options) <del> _options = { <add> options = { <ide> :if => @if.dup, <ide> :unless => @unless.dup <ide> } <ide> <del> _options[:if].concat Array(new_options.fetch(:unless, [])) <del> _options[:unless].concat Array(new_options.fetch(:if, [])) <add> options[:if].concat Array(new_options.fetch(:unless, [])) <add> options[:unless].concat Array(new_options.fetch(:if, [])) <ide> <del> self.class.build chain, @filter, @kind, _options <add> self.class.build chain, @filter, @kind, options <ide> end <ide> <ide> def matches?(_kind, _filter) <ide> def conditions_lambdas <ide> @if.map { |c| make_lambda c } + <ide> @unless.map { |c| invert_lambda make_lambda c } <ide> end <del> <del> def _normalize_legacy_filter(kind, filter) <del> if !filter.respond_to?(kind) && filter.respond_to?(:filter) <del> message = "Filter object with #filter method is deprecated. Define method corresponding " \ <del> "to filter type (#before, #after or #around)." <del> ActiveSupport::Deprecation.warn message <del> filter.singleton_class.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 <del> def #{kind}(context, &block) filter(context, &block) end <del> RUBY_EVAL <del> elsif filter.respond_to?(:before) && filter.respond_to?(:after) && kind == :around && !filter.respond_to?(:around) <del> message = "Filter object with #before and #after methods is deprecated. Define #around method instead." <del> ActiveSupport::Deprecation.warn message <del> def filter.around(context) <del> should_continue = before(context) <del> yield if should_continue <del> after(context) <del> end <del> end <del> end <ide> end <ide> <ide> # An Array with a compile method.
1
Go
Go
remove unused function from vfs storage driver
c1e04fbb150d71c243d505b79136108cb2f31f5c
<ide><path>daemon/graphdriver/vfs/driver.go <ide> package vfs <ide> <ide> import ( <del> "bytes" <ide> "fmt" <ide> "os" <del> "os/exec" <ide> "path" <ide> <ide> "github.com/docker/docker/daemon/graphdriver" <ide> func (d *Driver) Cleanup() error { <ide> return nil <ide> } <ide> <del>func isGNUcoreutils() bool { <del> if stdout, err := exec.Command("cp", "--version").Output(); err == nil { <del> return bytes.Contains(stdout, []byte("GNU coreutils")) <del> } <del> <del> return false <del>} <del> <ide> func (d *Driver) Create(id, parent string) error { <ide> dir := d.dir(id) <ide> if err := os.MkdirAll(path.Dir(dir), 0700); err != nil {
1
Javascript
Javascript
fix onload and onerror on images
3e34739cb9148c76f0a338ab694f8963d84b1c56
<ide><path>src/browser/ui/dom/components/ReactDOMImg.js <ide> var ReactDOMImg = ReactCompositeComponent.createClass({ <ide> }, <ide> <ide> componentDidMount: function() { <del> this.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'load'); <del> this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'error'); <add> this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load'); <add> this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error'); <ide> } <ide> }); <ide>
1
Javascript
Javascript
run some tests in node environment
0deea326674077598e351803d7a204a1c744a578
<ide><path>packages/react-cs-renderer/src/__tests__/ReactNativeCS-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-dom/src/__tests__/ReactServerRendering-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide> <ide> let React; <ide> let ReactCallReturn; <del>let ReactDOM; <ide> let ReactDOMServer; <del>let ReactTestUtils; <ide> let PropTypes; <ide> <ide> function normalizeCodeLocInfo(str) { <ide> describe('ReactDOMServer', () => { <ide> jest.resetModules(); <ide> React = require('react'); <ide> ReactCallReturn = require('react-call-return'); <del> ReactDOM = require('react-dom'); <del> ReactTestUtils = require('react-dom/test-utils'); <ide> PropTypes = require('prop-types'); <ide> ReactDOMServer = require('react-dom/server'); <ide> }); <ide> describe('ReactDOMServer', () => { <ide> runTest(); <ide> }); <ide> <del> it('should have the correct mounting behavior (old hydrate API)', () => { <del> spyOnDev(console, 'warn'); <del> spyOnDev(console, 'error'); <del> <del> let mountCount = 0; <del> let numClicks = 0; <del> <del> class TestComponent extends React.Component { <del> componentDidMount() { <del> mountCount++; <del> } <del> <del> click = () => { <del> numClicks++; <del> }; <del> <del> render() { <del> return ( <del> <span ref="span" onClick={this.click}> <del> Name: {this.props.name} <del> </span> <del> ); <del> } <del> } <del> <del> const element = document.createElement('div'); <del> ReactDOM.render(<TestComponent />, element); <del> <del> let lastMarkup = element.innerHTML; <del> <del> // Exercise the update path. Markup should not change, <del> // but some lifecycle methods should be run again. <del> ReactDOM.render(<TestComponent name="x" />, element); <del> expect(mountCount).toEqual(1); <del> <del> // Unmount and remount. We should get another mount event and <del> // we should get different markup, as the IDs are unique each time. <del> ReactDOM.unmountComponentAtNode(element); <del> expect(element.innerHTML).toEqual(''); <del> ReactDOM.render(<TestComponent name="x" />, element); <del> expect(mountCount).toEqual(2); <del> expect(element.innerHTML).not.toEqual(lastMarkup); <del> <del> // Now kill the node and render it on top of server-rendered markup, as if <del> // we used server rendering. We should mount again, but the markup should <del> // be unchanged. We will append a sentinel at the end of innerHTML to be <del> // sure that innerHTML was not changed. <del> ReactDOM.unmountComponentAtNode(element); <del> expect(element.innerHTML).toEqual(''); <del> <del> lastMarkup = ReactDOMServer.renderToString(<TestComponent name="x" />); <del> element.innerHTML = lastMarkup; <del> <del> let instance = ReactDOM.render(<TestComponent name="x" />, element); <del> expect(mountCount).toEqual(3); <del> if (__DEV__) { <del> expect(console.warn.calls.count()).toBe(1); <del> expect(console.warn.calls.argsFor(0)[0]).toContain( <del> 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + <del> 'will stop working in React v17. Replace the ReactDOM.render() call ' + <del> 'with ReactDOM.hydrate() if you want React to attach to the server HTML.', <del> ); <del> console.warn.calls.reset(); <del> } <del> expect(element.innerHTML).toBe(lastMarkup); <del> <del> // Ensure the events system works after mount into server markup <del> expect(numClicks).toEqual(0); <del> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <del> expect(numClicks).toEqual(1); <del> <del> ReactDOM.unmountComponentAtNode(element); <del> expect(element.innerHTML).toEqual(''); <del> <del> // Now simulate a situation where the app is not idempotent. React should <del> // warn but do the right thing. <del> element.innerHTML = lastMarkup; <del> instance = ReactDOM.render(<TestComponent name="y" />, element); <del> expect(mountCount).toEqual(4); <del> if (__DEV__) { <del> expect(console.error.calls.count()).toBe(1); <del> expect(console.error.calls.argsFor(0)[0]).toContain( <del> 'Text content did not match. Server: "x" Client: "y"', <del> ); <del> console.error.calls.reset(); <del> } <del> expect(element.innerHTML.length > 0).toBe(true); <del> expect(element.innerHTML).not.toEqual(lastMarkup); <del> <del> // Ensure the events system works after markup mismatch. <del> expect(numClicks).toEqual(1); <del> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <del> expect(numClicks).toEqual(2); <del> if (__DEV__) { <del> expect(console.warn.calls.count()).toBe(0); <del> expect(console.error.calls.count()).toBe(0); <del> } <del> }); <del> <del> it('should have the correct mounting behavior (new hydrate API)', () => { <del> spyOnDev(console, 'error'); <del> <del> let mountCount = 0; <del> let numClicks = 0; <del> <del> class TestComponent extends React.Component { <del> componentDidMount() { <del> mountCount++; <del> } <del> <del> click = () => { <del> numClicks++; <del> }; <del> <del> render() { <del> return ( <del> <span ref="span" onClick={this.click}> <del> Name: {this.props.name} <del> </span> <del> ); <del> } <del> } <del> <del> const element = document.createElement('div'); <del> ReactDOM.render(<TestComponent />, element); <del> <del> let lastMarkup = element.innerHTML; <del> <del> // Exercise the update path. Markup should not change, <del> // but some lifecycle methods should be run again. <del> ReactDOM.render(<TestComponent name="x" />, element); <del> expect(mountCount).toEqual(1); <del> <del> // Unmount and remount. We should get another mount event and <del> // we should get different markup, as the IDs are unique each time. <del> ReactDOM.unmountComponentAtNode(element); <del> expect(element.innerHTML).toEqual(''); <del> ReactDOM.render(<TestComponent name="x" />, element); <del> expect(mountCount).toEqual(2); <del> expect(element.innerHTML).not.toEqual(lastMarkup); <del> <del> // Now kill the node and render it on top of server-rendered markup, as if <del> // we used server rendering. We should mount again, but the markup should <del> // be unchanged. We will append a sentinel at the end of innerHTML to be <del> // sure that innerHTML was not changed. <del> ReactDOM.unmountComponentAtNode(element); <del> expect(element.innerHTML).toEqual(''); <del> <del> lastMarkup = ReactDOMServer.renderToString(<TestComponent name="x" />); <del> element.innerHTML = lastMarkup; <del> <del> let instance = ReactDOM.hydrate(<TestComponent name="x" />, element); <del> expect(mountCount).toEqual(3); <del> expect(element.innerHTML).toBe(lastMarkup); <del> <del> // Ensure the events system works after mount into server markup <del> expect(numClicks).toEqual(0); <del> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <del> expect(numClicks).toEqual(1); <del> <del> ReactDOM.unmountComponentAtNode(element); <del> expect(element.innerHTML).toEqual(''); <del> <del> // Now simulate a situation where the app is not idempotent. React should <del> // warn but do the right thing. <del> element.innerHTML = lastMarkup; <del> instance = ReactDOM.hydrate(<TestComponent name="y" />, element); <del> expect(mountCount).toEqual(4); <del> if (__DEV__) { <del> expect(console.error.calls.count()).toBe(1); <del> } <del> expect(element.innerHTML.length > 0).toBe(true); <del> expect(element.innerHTML).not.toEqual(lastMarkup); <del> <del> // Ensure the events system works after markup mismatch. <del> expect(numClicks).toEqual(1); <del> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <del> expect(numClicks).toEqual(2); <del> }); <del> <del> // We have a polyfill for autoFocus on the client, but we intentionally don't <del> // want it to call focus() when hydrating because this can mess up existing <del> // focus before the JS has loaded. <del> it('should emit autofocus on the server but not focus() when hydrating', () => { <del> const element = document.createElement('div'); <del> element.innerHTML = ReactDOMServer.renderToString( <del> <input autoFocus={true} />, <del> ); <del> expect(element.firstChild.autofocus).toBe(true); <del> <del> // It should not be called on mount. <del> element.firstChild.focus = jest.fn(); <del> ReactDOM.hydrate(<input autoFocus={true} />, element); <del> expect(element.firstChild.focus).not.toHaveBeenCalled(); <del> <del> // Or during an update. <del> ReactDOM.render(<input autoFocus={true} />, element); <del> expect(element.firstChild.focus).not.toHaveBeenCalled(); <del> }); <del> <del> it('should not focus on either server or client with autofocus={false}', () => { <del> const element = document.createElement('div'); <del> element.innerHTML = ReactDOMServer.renderToString( <del> <input autoFocus={false} />, <del> ); <del> expect(element.firstChild.autofocus).toBe(false); <del> <del> element.firstChild.focus = jest.fn(); <del> ReactDOM.hydrate(<input autoFocus={false} />, element); <del> expect(element.firstChild.focus).not.toHaveBeenCalled(); <del> <del> ReactDOM.render(<input autoFocus={false} />, element); <del> expect(element.firstChild.focus).not.toHaveBeenCalled(); <del> }); <del> <del> // Regression test for https://github.com/facebook/react/issues/11726 <del> it('should not focus on either server or client with autofocus={false} even if there is a markup mismatch', () => { <del> spyOnDev(console, 'error'); <del> <del> const element = document.createElement('div'); <del> element.innerHTML = ReactDOMServer.renderToString( <del> <button autoFocus={false}>server</button>, <del> ); <del> expect(element.firstChild.autofocus).toBe(false); <del> <del> element.firstChild.focus = jest.fn(); <del> ReactDOM.hydrate(<button autoFocus={false}>client</button>, element); <del> <del> expect(element.firstChild.focus).not.toHaveBeenCalled(); <del> if (__DEV__) { <del> expect(console.error.calls.count()).toBe(1); <del> expect(console.error.calls.argsFor(0)[0]).toBe( <del> 'Warning: Text content did not match. Server: "server" Client: "client"', <del> ); <del> } <del> }); <del> <ide> it('should throw with silly args', () => { <ide> expect( <ide> ReactDOMServer.renderToString.bind(ReactDOMServer, {x: 123}), <ide> describe('ReactDOMServer', () => { <ide> } <ide> }); <ide> <del> it('should throw rendering portals on the server', () => { <del> const div = document.createElement('div'); <del> expect(() => { <del> ReactDOMServer.renderToString( <del> <div>{ReactDOM.createPortal(<div />, div)}</div>, <del> ); <del> }).toThrow( <del> 'Portals are not currently supported by the server renderer. ' + <del> 'Render them conditionally so that they only appear on the client render.', <del> ); <del> }); <del> <ide> it('should throw rendering call/return on the server', () => { <del> const div = document.createElement('div'); <ide> expect(() => { <ide> ReactDOMServer.renderToString( <ide> <div>{ReactCallReturn.unstable_createReturn(42)}</div>, <ide><path>packages/react-dom/src/__tests__/ReactServerRenderingBrowser-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-dom/src/__tests__/ReactServerRenderingHydration.js <add>/** <add> * Copyright (c) 2013-present, Facebook, Inc. <add> * <add> * This source code is licensed under the MIT license found in the <add> * LICENSE file in the root directory of this source tree. <add> * <add> * @emails react-core <add> */ <add> <add>'use strict'; <add> <add>let React; <add>let ReactDOM; <add>let ReactDOMServer; <add>let ReactTestUtils; <add> <add>// These tests rely both on ReactDOMServer and ReactDOM. <add>// If a test only needs ReactDOMServer, put it in ReactServerRendering-test instead. <add>describe('ReactDOMServerHydration', () => { <add> beforeEach(() => { <add> jest.resetModules(); <add> React = require('react'); <add> ReactDOM = require('react-dom'); <add> ReactTestUtils = require('react-dom/test-utils'); <add> ReactDOMServer = require('react-dom/server'); <add> }); <add> <add> it('should have the correct mounting behavior (old hydrate API)', () => { <add> spyOnDev(console, 'warn'); <add> spyOnDev(console, 'error'); <add> <add> let mountCount = 0; <add> let numClicks = 0; <add> <add> class TestComponent extends React.Component { <add> componentDidMount() { <add> mountCount++; <add> } <add> <add> click = () => { <add> numClicks++; <add> }; <add> <add> render() { <add> return ( <add> <span ref="span" onClick={this.click}> <add> Name: {this.props.name} <add> </span> <add> ); <add> } <add> } <add> <add> const element = document.createElement('div'); <add> ReactDOM.render(<TestComponent />, element); <add> <add> let lastMarkup = element.innerHTML; <add> <add> // Exercise the update path. Markup should not change, <add> // but some lifecycle methods should be run again. <add> ReactDOM.render(<TestComponent name="x" />, element); <add> expect(mountCount).toEqual(1); <add> <add> // Unmount and remount. We should get another mount event and <add> // we should get different markup, as the IDs are unique each time. <add> ReactDOM.unmountComponentAtNode(element); <add> expect(element.innerHTML).toEqual(''); <add> ReactDOM.render(<TestComponent name="x" />, element); <add> expect(mountCount).toEqual(2); <add> expect(element.innerHTML).not.toEqual(lastMarkup); <add> <add> // Now kill the node and render it on top of server-rendered markup, as if <add> // we used server rendering. We should mount again, but the markup should <add> // be unchanged. We will append a sentinel at the end of innerHTML to be <add> // sure that innerHTML was not changed. <add> ReactDOM.unmountComponentAtNode(element); <add> expect(element.innerHTML).toEqual(''); <add> <add> lastMarkup = ReactDOMServer.renderToString(<TestComponent name="x" />); <add> element.innerHTML = lastMarkup; <add> <add> let instance = ReactDOM.render(<TestComponent name="x" />, element); <add> expect(mountCount).toEqual(3); <add> if (__DEV__) { <add> expect(console.warn.calls.count()).toBe(1); <add> expect(console.warn.calls.argsFor(0)[0]).toContain( <add> 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + <add> 'will stop working in React v17. Replace the ReactDOM.render() call ' + <add> 'with ReactDOM.hydrate() if you want React to attach to the server HTML.', <add> ); <add> console.warn.calls.reset(); <add> } <add> expect(element.innerHTML).toBe(lastMarkup); <add> <add> // Ensure the events system works after mount into server markup <add> expect(numClicks).toEqual(0); <add> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <add> expect(numClicks).toEqual(1); <add> <add> ReactDOM.unmountComponentAtNode(element); <add> expect(element.innerHTML).toEqual(''); <add> <add> // Now simulate a situation where the app is not idempotent. React should <add> // warn but do the right thing. <add> element.innerHTML = lastMarkup; <add> instance = ReactDOM.render(<TestComponent name="y" />, element); <add> expect(mountCount).toEqual(4); <add> if (__DEV__) { <add> expect(console.error.calls.count()).toBe(1); <add> expect(console.error.calls.argsFor(0)[0]).toContain( <add> 'Text content did not match. Server: "x" Client: "y"', <add> ); <add> console.error.calls.reset(); <add> } <add> expect(element.innerHTML.length > 0).toBe(true); <add> expect(element.innerHTML).not.toEqual(lastMarkup); <add> <add> // Ensure the events system works after markup mismatch. <add> expect(numClicks).toEqual(1); <add> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <add> expect(numClicks).toEqual(2); <add> if (__DEV__) { <add> expect(console.warn.calls.count()).toBe(0); <add> expect(console.error.calls.count()).toBe(0); <add> } <add> }); <add> <add> it('should have the correct mounting behavior (new hydrate API)', () => { <add> spyOnDev(console, 'error'); <add> <add> let mountCount = 0; <add> let numClicks = 0; <add> <add> class TestComponent extends React.Component { <add> componentDidMount() { <add> mountCount++; <add> } <add> <add> click = () => { <add> numClicks++; <add> }; <add> <add> render() { <add> return ( <add> <span ref="span" onClick={this.click}> <add> Name: {this.props.name} <add> </span> <add> ); <add> } <add> } <add> <add> const element = document.createElement('div'); <add> ReactDOM.render(<TestComponent />, element); <add> <add> let lastMarkup = element.innerHTML; <add> <add> // Exercise the update path. Markup should not change, <add> // but some lifecycle methods should be run again. <add> ReactDOM.render(<TestComponent name="x" />, element); <add> expect(mountCount).toEqual(1); <add> <add> // Unmount and remount. We should get another mount event and <add> // we should get different markup, as the IDs are unique each time. <add> ReactDOM.unmountComponentAtNode(element); <add> expect(element.innerHTML).toEqual(''); <add> ReactDOM.render(<TestComponent name="x" />, element); <add> expect(mountCount).toEqual(2); <add> expect(element.innerHTML).not.toEqual(lastMarkup); <add> <add> // Now kill the node and render it on top of server-rendered markup, as if <add> // we used server rendering. We should mount again, but the markup should <add> // be unchanged. We will append a sentinel at the end of innerHTML to be <add> // sure that innerHTML was not changed. <add> ReactDOM.unmountComponentAtNode(element); <add> expect(element.innerHTML).toEqual(''); <add> <add> lastMarkup = ReactDOMServer.renderToString(<TestComponent name="x" />); <add> element.innerHTML = lastMarkup; <add> <add> let instance = ReactDOM.hydrate(<TestComponent name="x" />, element); <add> expect(mountCount).toEqual(3); <add> expect(element.innerHTML).toBe(lastMarkup); <add> <add> // Ensure the events system works after mount into server markup <add> expect(numClicks).toEqual(0); <add> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <add> expect(numClicks).toEqual(1); <add> <add> ReactDOM.unmountComponentAtNode(element); <add> expect(element.innerHTML).toEqual(''); <add> <add> // Now simulate a situation where the app is not idempotent. React should <add> // warn but do the right thing. <add> element.innerHTML = lastMarkup; <add> instance = ReactDOM.hydrate(<TestComponent name="y" />, element); <add> expect(mountCount).toEqual(4); <add> if (__DEV__) { <add> expect(console.error.calls.count()).toBe(1); <add> } <add> expect(element.innerHTML.length > 0).toBe(true); <add> expect(element.innerHTML).not.toEqual(lastMarkup); <add> <add> // Ensure the events system works after markup mismatch. <add> expect(numClicks).toEqual(1); <add> ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(instance.refs.span)); <add> expect(numClicks).toEqual(2); <add> }); <add> <add> // We have a polyfill for autoFocus on the client, but we intentionally don't <add> // want it to call focus() when hydrating because this can mess up existing <add> // focus before the JS has loaded. <add> it('should emit autofocus on the server but not focus() when hydrating', () => { <add> const element = document.createElement('div'); <add> element.innerHTML = ReactDOMServer.renderToString( <add> <input autoFocus={true} />, <add> ); <add> expect(element.firstChild.autofocus).toBe(true); <add> <add> // It should not be called on mount. <add> element.firstChild.focus = jest.fn(); <add> ReactDOM.hydrate(<input autoFocus={true} />, element); <add> expect(element.firstChild.focus).not.toHaveBeenCalled(); <add> <add> // Or during an update. <add> ReactDOM.render(<input autoFocus={true} />, element); <add> expect(element.firstChild.focus).not.toHaveBeenCalled(); <add> }); <add> <add> it('should not focus on either server or client with autofocus={false}', () => { <add> const element = document.createElement('div'); <add> element.innerHTML = ReactDOMServer.renderToString( <add> <input autoFocus={false} />, <add> ); <add> expect(element.firstChild.autofocus).toBe(false); <add> <add> element.firstChild.focus = jest.fn(); <add> ReactDOM.hydrate(<input autoFocus={false} />, element); <add> expect(element.firstChild.focus).not.toHaveBeenCalled(); <add> <add> ReactDOM.render(<input autoFocus={false} />, element); <add> expect(element.firstChild.focus).not.toHaveBeenCalled(); <add> }); <add> <add> // Regression test for https://github.com/facebook/react/issues/11726 <add> it('should not focus on either server or client with autofocus={false} even if there is a markup mismatch', () => { <add> spyOnDev(console, 'error'); <add> <add> const element = document.createElement('div'); <add> element.innerHTML = ReactDOMServer.renderToString( <add> <button autoFocus={false}>server</button>, <add> ); <add> expect(element.firstChild.autofocus).toBe(false); <add> <add> element.firstChild.focus = jest.fn(); <add> ReactDOM.hydrate(<button autoFocus={false}>client</button>, element); <add> <add> expect(element.firstChild.focus).not.toHaveBeenCalled(); <add> if (__DEV__) { <add> expect(console.error.calls.count()).toBe(1); <add> expect(console.error.calls.argsFor(0)[0]).toBe( <add> 'Warning: Text content did not match. Server: "server" Client: "client"', <add> ); <add> } <add> }); <add> <add> it('should throw rendering portals on the server', () => { <add> const div = document.createElement('div'); <add> expect(() => { <add> ReactDOMServer.renderToString( <add> <div>{ReactDOM.createPortal(<div />, div)}</div>, <add> ); <add> }).toThrow( <add> 'Portals are not currently supported by the server renderer. ' + <add> 'Render them conditionally so that they only appear on the client render.', <add> ); <add> }); <add>}); <ide><path>packages/react-native-renderer/src/__tests__/ReactNativeAttributePayload-test.js <ide> * This source code is licensed under the MIT license found in the <ide> * LICENSE file in the root directory of this source tree. <ide> * <add> * @jest-environment node <ide> */ <ide> 'use strict'; <ide> <ide><path>packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-native-renderer/src/__tests__/createReactNativeComponentClass-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactExpiration-test.js <ide> * <ide> * This source code is licensed under the MIT license found in the <ide> * LICENSE file in the root directory of this source tree. <add> * <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactFiberHostContext-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactFragment-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> 'use strict'; <ide> <ide><path>packages/react-reconciler/src/__tests__/ReactIncremental-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalErrorLogging-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalReflection-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalScheduling-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalTriangle-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactPersistent-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactTopLevelFragment-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-reconciler/src/__tests__/ReactTopLevelText-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-rt-renderer/src/__tests__/ReactNativeRT-test.internal.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>packages/react-test-renderer/src/__tests__/ReactTestRendererTraversal-test.js <ide> * LICENSE file in the root directory of this source tree. <ide> * <ide> * @emails react-core <add> * @jest-environment node <ide> */ <ide> <ide> 'use strict'; <ide><path>scripts/jest/setupEnvironment.js <ide> global.cancelIdleCallback = function(callbackID) { <ide> // for the few that specifically test the logging by shadowing this <ide> // property. In real apps, it would usually not be defined at all. <ide> Error.prototype.suppressReactErrorLogging = true; <del>DOMException.prototype.suppressReactErrorLogging = true; <add>if (typeof DOMException === 'function') { <add> DOMException.prototype.suppressReactErrorLogging = true; <add>}
28
Ruby
Ruby
fix etag expectation to work with the sha256
809236bc4c608e50262de4f82df79b45da1df2d4
<ide><path>railties/test/application/middleware_test.rb <ide> def index <ide> end <ide> end <ide> <del> etag = "W/" + "5af83e3196bf99f440f31f2e1a6c9afe".inspect <add> etag = "W/" + "c00862d1c6c1cf7c1b49388306e7b3c1".inspect <ide> <ide> get "/" <ide> assert_equal 200, last_response.status
1
Ruby
Ruby
add xcode 9.0 beta recognition
a0ae0346547266a6c55bc470fb51840da9008fbc
<ide><path>Library/Homebrew/os/mac.rb <ide> def preferred_arch <ide> "8.3.1" => { clang: "8.1", clang_build: 802 }, <ide> "8.3.2" => { clang: "8.1", clang_build: 802 }, <ide> "8.3.3" => { clang: "8.1", clang_build: 802 }, <add> "9.0" => { clang: "9.0", clang_build: 900 }, <ide> }.freeze <ide> <ide> def compilers_standard?
1
Mixed
Ruby
fix typos in actioncable channel [ci skip]
2ef18c1ebc33585432f46c1b2497268858f4532d
<ide><path>actioncable/README.md <ide> App.cable.subscriptions.create "AppearanceChannel", <ide> ``` <ide> <ide> Simply calling `App.cable.subscriptions.create` will setup the subscription, which will call `AppearanceChannel#subscribed`, <del>which in turn is linked to original `App.cable` -> `ApplicationCable::Connection` instances. <add>which in turn is linked to the original `App.cable` -> `ApplicationCable::Connection` instances. <ide> <ide> Next, we link the client-side `appear` method to `AppearanceChannel#appear(data)`. This is possible because the server-side <ide> channel instance will automatically expose the public methods declared on the class (minus the callbacks), so that these <ide><path>actioncable/lib/action_cable/channel/periodic_timers.rb <ide> module PeriodicTimers <ide> end <ide> <ide> module ClassMethods <del> # Allows you to call a private method <tt>every</tt> so often seconds. This periodic timer can be useful <del> # for sending a steady flow of updates to a client based off an object that was configured on subscription. <add> # Allows you to call a private method periodically. Specify the period, in seconds, using the <tt>every</tt> keyword argument. <add> # This periodic timer can be useful for sending a steady flow of updates to a client based off an object that was configured on subscription. <ide> # It's an alternative to using streams if the channel is able to do the work internally. <ide> def periodically(callback, every:) <ide> self.periodic_timers += [ [ callback, every: every ] ] <ide><path>actioncable/lib/action_cable/channel/streams.rb <ide> module ActionCable <ide> module Channel <ide> # Streams allow channels to route broadcastings to the subscriber. A broadcasting is, as discussed elsewhere, a pubsub queue where any data <ide> # placed into it is automatically sent to the clients that are connected at that time. It's purely an online queue, though. If you're not <del> # streaming a broadcasting at the very moment it sends out an update, you will not get that update, if you connect after it has been sent. <add> # streaming a broadcasting at the very moment it sends out an update, you will not get that update, even if you connect after it has been sent. <ide> # <ide> # Most commonly, the streamed broadcast is sent straight to the subscriber on the client-side. The channel just acts as a connector between <ide> # the two parties (the broadcaster and the channel subscriber). Here's an example of a channel that allows subscribers to get all new <ide><path>actioncable/lib/action_cable/connection/base.rb <ide> module Connection <ide> # Second, we rely on the fact that the WebSocket connection is established with the cookies from the domain being sent along. This makes <ide> # it easy to use signed cookies that were set when logging in via a web interface to authorize the WebSocket connection. <ide> # <del> # Finally, we add a tag to the connection-specific logger with name of the current user to easily distinguish their messages in the log. <add> # Finally, we add a tag to the connection-specific logger with the name of the current user to easily distinguish their messages in the log. <ide> # <ide> # Pretty simple, eh? <ide> class Base
4
PHP
PHP
escape function call
f4dc2615ec22ab6cfdea14a73f0f047886db3393
<ide><path>src/Illuminate/Encryption/Encrypter.php <ide> public function encrypt($value) <ide> { <ide> $iv = Str::randomBytes($this->getIvSize()); <ide> <del> $value = openssl_encrypt(serialize($value), $this->cipher, $this->key, 0, $iv); <add> $value = \openssl_encrypt(serialize($value), $this->cipher, $this->key, 0, $iv); <ide> <ide> if ($value === false) { <ide> throw new EncryptException('Could not encrypt the data.'); <ide> public function decrypt($payload) <ide> <ide> $iv = base64_decode($payload['iv']); <ide> <del> $decrypted = openssl_decrypt($payload['value'], $this->cipher, $this->key, 0, $iv); <add> $decrypted = \openssl_decrypt($payload['value'], $this->cipher, $this->key, 0, $iv); <ide> <ide> if ($decrypted === false) { <ide> throw new DecryptException('Could not decrypt the data.');
1
Python
Python
fix ticket 48
1bca125a3f0c1e86b7777adebcdde5671b713f92
<ide><path>numpy/distutils/command/config_compiler.py <ide> #XXX: Implement confic_cc for enhancing C/C++ compiler options. <ide> #XXX: Linker flags <ide> <add>def show_fortran_compilers(_cache=[]): <add> # Using cache to prevent infinite recursion <add> if _cache: return <add> _cache.append(1) <add> <add> from numpy.distutils.fcompiler import show_fcompilers <add> import distutils.core <add> dist = distutils.core._setup_distribution <add> show_fcompilers(dist) <add> return <add> <ide> class config_fc(Command): <ide> """ Distutils command to hold user specified options <ide> to Fortran compilers. <ide> class config_fc(Command): <ide> ('debug','g',"compile with debugging information"), <ide> ('noopt',None,"compile without optimization"), <ide> ('noarch',None,"compile without arch-dependent optimization"), <del> ('help-fcompiler',None,"list available Fortran compilers"), <ide> ] <ide> <del> boolean_options = ['debug','noopt','noarch','help-fcompiler'] <add> help_options = [ <add> ('help-fcompiler',None, "list available Fortran compilers", <add> show_fortran_compilers), <add> ] <add> <add> boolean_options = ['debug','noopt','noarch'] <ide> <ide> def initialize_options(self): <ide> self.fcompiler = None <ide> def initialize_options(self): <ide> self.debug = None <ide> self.noopt = None <ide> self.noarch = None <del> self.help_fcompiler = None <ide> return <ide> <ide> def finalize_options(self): <del> if self.help_fcompiler: <del> from numpy.distutils.fcompiler import show_fcompilers <del> show_fcompilers(self.distribution) <del> sys.exit() <add> # Do nothing. <ide> return <ide> <ide> def run(self):
1
Python
Python
fix bugs from task refactor + add eta, countdown
121c33dbcfce3c94680e40eb4f03202ace6a0153
<ide><path>celery/execute.py <add>from carrot.connection import DjangoAMQPConnection <add>from celery.conf import AMQP_CONNECTION_TIMEOUT <add>from celery.result import AsyncResult <add>from celery.messaging import TaskPublisher <add>from functools import partial as curry <add> <add> <add>def apply_async(task, args=None, kwargs=None, routing_key=None, <add> immediate=None, mandatory=None, connection=None, <add> connect_timeout=AMQP_CONNECTION_TIMEOUT, priority=None, <add> eta=None, countdown=None, **opts): <add> """Run a task asynchronously by the celery daemon(s). <add> <add> :param task: The task to run (a callable object, or a :class:`Task` <add> instance <add> <add> :param args: The positional arguments to pass on to the task (a ``list``). <add> <add> :param kwargs: The keyword arguments to pass on to the task (a ``dict``) <add> <add> :keyword countdown: Number of seconds in the future that the task <add> should execute. <add> <add> :keyword eta: The task won't be run before this date <add> (a :class:`datetime.datetime` object). <add> <add> :keyword routing_key: The routing key used to route the task to a worker <add> server. <add> <add> :keyword immediate: Request immediate delivery. Will raise an exception <add> if the task cannot be routed to a worker immediately. <add> <add> :keyword mandatory: Mandatory routing. Raises an exception if there's <add> no running workers able to take on this task. <add> <add> :keyword connection: Re-use existing AMQP connection. <add> The ``connect_timeout`` argument is not respected if this is set. <add> <add> :keyword connect_timeout: The timeout in seconds, before we give up <add> on establishing a connection to the AMQP server. <add> <add> :keyword priority: The task priority, a number between ``0`` and ``9``. <add> <add> """ <add> args = args or [] <add> kwargs = kwargs or {} <add> routing_key = routing_key or getattr(task, "routing_key", None) <add> immediate = immediate or getattr(task, "immediate", None) <add> mandatory = mandatory or getattr(task, "mandatory", None) <add> priority = priority or getattr(task, "priority", None) <add> taskset_id = opts.get("taskset_id") <add> publisher = opts.get("publisher") <add> <add> need_to_close_connection = False <add> if not publisher: <add> if not connection: <add> connection = DjangoAMQPConnection(connect_timeout=connect_timeout) <add> need_to_close_connection = True <add> publisher = TaskPublisher(connection=connection) <add> <add> delay_task = publisher.delay_task <add> if taskset_id: <add> delay_task = curry(publisher.delay_task_in_set, taskset_id) <add> <add> task_id = delay_task(task.name, args, kwargs, <add> routing_key=routing_key, mandatory=mandatory, <add> immediate=immediate, priority=priority, <add> countdown=countdown, eta=eta) <add> <add> if need_to_close_connection: <add> publisher.close() <add> connection.close() <add> <add> return AsyncResult(task_id) <add> <add> <add>def delay_task(task_name, *args, **kwargs): <add> """Delay a task for execution by the ``celery`` daemon. <add> <add> :param task_name: the name of a task registered in the task registry. <add> <add> :param \*args: positional arguments to pass on to the task. <add> <add> :param \*\*kwargs: keyword arguments to pass on to the task. <add> <add> :raises celery.registry.NotRegistered: exception if no such task <add> has been registered in the task registry. <add> <add> :rtype: :class:`celery.result.AsyncResult`. <add> <add> Example <add> <add> >>> r = delay_task("update_record", name="George Constanza", age=32) <add> >>> r.ready() <add> True <add> >>> r.result <add> "Record was updated" <add> <add> """ <add> if task_name not in tasks: <add> raise tasks.NotRegistered( <add> "Task with name %s not registered in the task registry." % ( <add> task_name)) <add> task = tasks[task_name] <add> return apply_async(task, args, kwargs) <ide><path>celery/messaging.py <ide> def requeue_task(self, task_name, task_id, task_args, task_kwargs, <ide> def _delay_task(self, task_name, task_id=None, part_of_set=None, <ide> task_args=None, task_kwargs=None, **kwargs): <ide> """INTERNAL""" <add> eta = kwargs.get("eta") <add> countdown = kwargs.get("countdown") <ide> priority = kwargs.get("priority") <ide> immediate = kwargs.get("immediate") <ide> mandatory = kwargs.get("mandatory") <ide> def _delay_task(self, task_name, task_id=None, part_of_set=None, <ide> "task": task_name, <ide> "args": task_args, <ide> "kwargs": task_kwargs, <add> "countdown": countdown, <add> "eta": eta, <ide> } <ide> if part_of_set: <ide> message_data["taskset"] = part_of_set <ide><path>celery/task/__init__.py <ide> """ <ide> from carrot.connection import DjangoAMQPConnection <ide> from celery.conf import AMQP_CONNECTION_TIMEOUT <del>from celery.messaging import TaskPublisher <ide> from celery.registry import tasks <ide> from celery.backends import default_backend <del>from celery.result import AsyncResult <ide> from celery.task.base import Task, TaskSet, PeriodicTask <ide> from celery.task.builtins import AsynchronousMapTask, ExecuteRemoteTask <ide> from celery.task.builtins import DeleteExpiredTaskMetaTask, PingTask <del>from functools import partial as curry <add>from celery.execute import apply_async, delay_task <ide> try: <ide> import cPickle as pickle <ide> except ImportError: <ide> import pickle <ide> <ide> <del>def apply_async(task, args=None, kwargs=None, routing_key=None, <del> immediate=None, mandatory=None, connection=None, <del> connect_timeout=AMQP_CONNECTION_TIMEOUT, priority=None, **opts): <del> """Run a task asynchronously by the celery daemon(s). <del> <del> :param task: The task to run (a callable object, or a :class:`Task` <del> instance <del> <del> :param args: The positional arguments to pass on to the task (a ``list``). <del> <del> :param kwargs: The keyword arguments to pass on to the task (a ``dict``) <del> <del> <del> :keyword routing_key: The routing key used to route the task to a worker <del> server. <del> <del> :keyword immediate: Request immediate delivery. Will raise an exception <del> if the task cannot be routed to a worker immediately. <del> <del> :keyword mandatory: Mandatory routing. Raises an exception if there's <del> no running workers able to take on this task. <del> <del> :keyword connection: Re-use existing AMQP connection. <del> The ``connect_timeout`` argument is not respected if this is set. <del> <del> :keyword connect_timeout: The timeout in seconds, before we give up <del> on establishing a connection to the AMQP server. <del> <del> :keyword priority: The task priority, a number between ``0`` and ``9``. <del> <del> """ <del> args = args or [] <del> kwargs = kwargs or {} <del> routing_key = routing_key or getattr(task, "routing_key", None) <del> immediate = immediate or getattr(task, "immediate", None) <del> mandatory = mandatory or getattr(task, "mandatory", None) <del> priority = priority or getattr(task, "priority", None) <del> taskset_id = opts.get("taskset_id") <del> publisher = opts.get("publisher") <del> <del> need_to_close_connection = False <del> if not publisher: <del> if not connection: <del> connection = DjangoAMQPConnection(connect_timeout=connect_timeout) <del> need_to_close_connection = True <del> publisher = TaskPublisher(connection=connection) <del> <del> delay_task = publisher.delay_task <del> if taskset_id: <del> delay_task = curry(publisher.delay_task_in_set, taskset_id) <del> <del> task_id = delay_task(task.name, args, kwargs, <del> routing_key=routing_key, mandatory=mandatory, <del> immediate=immediate, priority=priority) <del> <del> if need_to_close_connection: <del> publisher.close() <del> connection.close() <del> <del> return AsyncResult(task_id) <del> <del> <del>def delay_task(task_name, *args, **kwargs): <del> """Delay a task for execution by the ``celery`` daemon. <del> <del> :param task_name: the name of a task registered in the task registry. <del> <del> :param \*args: positional arguments to pass on to the task. <del> <del> :param \*\*kwargs: keyword arguments to pass on to the task. <del> <del> :raises celery.registry.NotRegistered: exception if no such task <del> has been registered in the task registry. <del> <del> :rtype: :class:`celery.result.AsyncResult`. <del> <del> Example <del> <del> >>> r = delay_task("update_record", name="George Constanza", age=32) <del> >>> r.ready() <del> True <del> >>> r.result <del> "Record was updated" <del> <del> """ <del> if task_name not in tasks: <del> raise tasks.NotRegistered( <del> "Task with name %s not registered in the task registry." % ( <del> task_name)) <del> task = tasks[task_name] <del> return apply_async(task, args, kwargs) <del> <del> <ide> def discard_all(connect_timeout=AMQP_CONNECTION_TIMEOUT): <ide> """Discard all waiting tasks. <ide> <ide><path>celery/task/base.py <ide> from celery.messaging import TaskPublisher, TaskConsumer <ide> from celery.log import setup_logger <ide> from celery.result import TaskSetResult <add>from celery.execute import apply_async, delay_task <ide> from datetime import timedelta <ide> import uuid <ide> try: <ide><path>celery/worker.py <ide> from celery.timer import EventTimer <ide> from django.core.mail import mail_admins <ide> from celery.monitoring import TaskTimerStats <add>from datetime import datetime, timedelta <add>from Queue import Queue <add>from Queue import Empty as QueueEmpty <add>from multiprocessing import TimeoutError <ide> import multiprocessing <ide> import traceback <ide> import threading <ide> def __init__(self, concurrency=None, logfile=None, loglevel=None, <ide> self.is_detached = is_detached <ide> self.amqp_connection = None <ide> self.task_consumer = None <add> self.bucket_queue = Queue() <ide> <ide> def close_connection(self): <ide> """Close the AMQP connection.""" <ide> def _message_callback(self, message_data, message): <ide> <ide> def process_task(self, message_data, message): <ide> """Process task message by passing it to the pool of workers.""" <add> <add> countdown = message_data.get("countdown") <add> eta = message_data.get("eta") <add> if countdown: <add> eta = datetime.now() + timedelta(seconds=int(countdown)) <add> if eta: <add> self.bucket_queue.put((message, message_data, eta)) <add> return <add> <ide> task = TaskWrapper.from_message(message, message_data, <ide> logger=self.logger) <ide> self.logger.info("Got task from broker: %s[%s]" % ( <ide> def process_task(self, message_data, message): <ide> <ide> self.logger.debug("Task %s has been executed asynchronously." % task) <ide> <del> return result <add> return <ide> <ide> def shutdown(self): <ide> """Make sure ``celeryd`` exits cleanly.""" <ide> def run(self): <ide> <ide> try: <ide> while True: <del> it.next() <add> try: <add> self.process_bucket() <add> self.process_next(it, timeout=1) <add> except TimeoutError: <add> pass <ide> except (SystemExit, KeyboardInterrupt): <ide> self.shutdown() <add> <add> def process_next(self, it, timeout=1): <add> def on_timeout(): <add> raise TimeoutError() <add> timer = threading.Timer(timeout, on_timeout) <add> timer.start() <add> try: <add> it.next() <add> finally: <add> timer.cancel() <add> <add> def process_bucket(self): <add> try: <add> message, msg_data, eta = self.bucket_queue.get_nowait() <add> except QueueEmpty: <add> pass <add> else: <add> if datetime.now() >= eta: <add> self.process_task(message, msg_data) <add> else: <add> self.bucket_queue.put((message, msg_data, eta))
5
Javascript
Javascript
clarify itemcontroller out of range case
32c1d6b1d0f0b83511691435a48a7b7282737ab7
<ide><path>packages/ember-runtime/lib/controllers/array_controller.js <ide> Ember.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin, <ide> if (controllerClass && idx < length) { <ide> return this.controllerAt(idx, object, controllerClass); <ide> } else { <add> // When controllerClass is falsy we have not opted in to using item <add> // controllers, so return the object directly. However, when <add> // controllerClass is defined but the index is out of range, we want to <add> // return the "out of range" value, whatever that might be. Rather than <add> // make assumptions (e.g. guessing `null` or `undefined`) we defer this to <add> // `arrangedContent`. <ide> return object; <ide> } <ide> },
1
Java
Java
add remoteaddress() to serverrequest
7e2726f40018ad83be9ae1d9d5b59f59e981d66a
<ide><path>spring-test/src/main/java/org/springframework/mock/web/reactive/function/server/MockServerRequest.java <ide> public class MockServerRequest implements ServerRequest { <ide> @Nullable <ide> private Principal principal; <ide> <add> @Nullable <add> private final InetSocketAddress remoteAddress; <add> <ide> <ide> private MockServerRequest(HttpMethod method, URI uri, String contextPath, MockHeaders headers, <ide> MultiValueMap<String, HttpCookie> cookies, @Nullable Object body, <ide> Map<String, Object> attributes, MultiValueMap<String, String> queryParams, <del> Map<String, String> pathVariables, @Nullable WebSession session, @Nullable Principal principal) { <add> Map<String, String> pathVariables, @Nullable WebSession session, @Nullable Principal principal, <add> @Nullable InetSocketAddress remoteAddress) { <ide> <ide> this.method = method; <ide> this.uri = uri; <ide> private MockServerRequest(HttpMethod method, URI uri, String contextPath, MockHe <ide> this.pathVariables = pathVariables; <ide> this.session = session; <ide> this.principal = principal; <add> this.remoteAddress = remoteAddress; <ide> } <ide> <ide> <ide> public MultiValueMap<String, HttpCookie> cookies() { <ide> return this.cookies; <ide> } <ide> <add> @Override <add> public Optional<InetSocketAddress> remoteAddress() { <add> return Optional.ofNullable(this.remoteAddress); <add> } <add> <ide> @Override <ide> @SuppressWarnings("unchecked") <ide> public <S> S body(BodyExtractor<S, ? super ServerHttpRequest> extractor) { <ide> public interface Builder { <ide> <ide> Builder session(WebSession session); <ide> <add> /** <add> * @deprecated in favor of {@link #principal(Principal)} <add> */ <add> @Deprecated <ide> Builder session(Principal principal); <ide> <add> Builder principal(Principal principal); <add> <add> Builder remoteAddress(InetSocketAddress remoteAddress); <add> <ide> MockServerRequest body(Object body); <ide> <ide> MockServerRequest build(); <ide> private static class BuilderImpl implements Builder { <ide> @Nullable <ide> private Principal principal; <ide> <add> @Nullable <add> private InetSocketAddress remoteAddress; <add> <ide> @Override <ide> public Builder method(HttpMethod method) { <ide> Assert.notNull(method, "'method' must not be null"); <ide> public Builder session(WebSession session) { <ide> <ide> @Override <ide> public Builder session(Principal principal) { <add> return principal(principal); <add> } <add> <add> @Override <add> public Builder principal(Principal principal) { <ide> Assert.notNull(principal, "'principal' must not be null"); <ide> this.principal = principal; <ide> return this; <ide> } <ide> <add> @Override <add> public Builder remoteAddress(InetSocketAddress remoteAddress) { <add> Assert.notNull(remoteAddress, "'remoteAddress' must not be null"); <add> this.remoteAddress = remoteAddress; <add> return this; <add> } <add> <ide> @Override <ide> public MockServerRequest body(Object body) { <ide> this.body = body; <ide> return new MockServerRequest(this.method, this.uri, this.contextPath, this.headers, <ide> this.cookies, this.body, this.attributes, this.queryParams, this.pathVariables, <del> this.session, this.principal); <add> this.session, this.principal, this.remoteAddress); <ide> } <ide> <ide> @Override <ide> public MockServerRequest build() { <ide> return new MockServerRequest(this.method, this.uri, this.contextPath, this.headers, <ide> this.cookies, null, this.attributes, this.queryParams, this.pathVariables, <del> this.session, this.principal); <add> this.session, this.principal, this.remoteAddress); <ide> } <ide> } <ide> <ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/function/server/DefaultServerRequest.java <ide> public MultiValueMap<String, HttpCookie> cookies() { <ide> return request().getCookies(); <ide> } <ide> <add> @Override <add> public Optional<InetSocketAddress> remoteAddress() { <add> return Optional.ofNullable(request().getRemoteAddress()); <add> } <add> <ide> @Override <ide> public <T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor) { <ide> return body(extractor, Collections.emptyMap()); <ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java <ide> <ide> package org.springframework.web.reactive.function.server; <ide> <add>import java.net.InetSocketAddress; <ide> import java.net.URI; <ide> import java.security.Principal; <ide> import java.util.ArrayList; <ide> public MultiValueMap<String, HttpCookie> cookies() { <ide> return this.request.cookies(); <ide> } <ide> <add> @Override <add> public Optional<InetSocketAddress> remoteAddress() { <add> return this.request.remoteAddress(); <add> } <add> <ide> @Override <ide> public <T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor) { <ide> return this.request.body(extractor); <ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java <ide> default PathContainer pathContainer() { <ide> */ <ide> MultiValueMap<String, HttpCookie> cookies(); <ide> <add> /** <add> * Return the remote address where this request is connected to, if available. <add> * @since 5.1 <add> */ <add> Optional<InetSocketAddress> remoteAddress(); <add> <ide> /** <ide> * Extract the body with the given {@code BodyExtractor}. <ide> * @param extractor the {@code BodyExtractor} that reads from the request <ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapper.java <ide> public MultiValueMap<String, HttpCookie> cookies() { <ide> return this.delegate.cookies(); <ide> } <ide> <add> @Override <add> public Optional<InetSocketAddress> remoteAddress() { <add> return this.delegate.remoteAddress(); <add> } <add> <ide> @Override <ide> public <T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor) { <ide> return this.delegate.body(extractor); <ide><path>spring-webflux/src/test/java/org/springframework/web/reactive/function/server/MockServerRequest.java <ide> public class MockServerRequest implements ServerRequest { <ide> @Nullable <ide> private Principal principal; <ide> <add> @Nullable <add> private final InetSocketAddress remoteAddress; <add> <ide> <ide> private MockServerRequest(HttpMethod method, URI uri, String contextPath, MockHeaders headers, <ide> MultiValueMap<String, HttpCookie> cookies, @Nullable Object body, <ide> Map<String, Object> attributes, MultiValueMap<String, String> queryParams, <del> Map<String, String> pathVariables, @Nullable WebSession session, @Nullable Principal principal) { <add> Map<String, String> pathVariables, @Nullable WebSession session, @Nullable Principal principal, <add> @Nullable InetSocketAddress remoteAddress) { <ide> <ide> this.method = method; <ide> this.uri = uri; <ide> private MockServerRequest(HttpMethod method, URI uri, String contextPath, MockHe <ide> this.pathVariables = pathVariables; <ide> this.session = session; <ide> this.principal = principal; <add> this.remoteAddress = remoteAddress; <ide> } <ide> <ide> <ide> public MultiValueMap<String, HttpCookie> cookies() { <ide> return this.cookies; <ide> } <ide> <add> @Override <add> public Optional<InetSocketAddress> remoteAddress() { <add> return Optional.ofNullable(this.remoteAddress); <add> } <add> <ide> @Override <ide> @SuppressWarnings("unchecked") <ide> public <S> S body(BodyExtractor<S, ? super ServerHttpRequest> extractor) { <ide> public interface Builder { <ide> <ide> Builder session(WebSession session); <ide> <add> /** <add> * @deprecated in favor of {@link #principal(Principal)} <add> */ <add> @Deprecated <ide> Builder session(Principal principal); <ide> <add> Builder principal(Principal principal); <add> <add> Builder remoteAddress(InetSocketAddress remoteAddress); <add> <ide> MockServerRequest body(Object body); <ide> <ide> MockServerRequest build(); <ide> private static class BuilderImpl implements Builder { <ide> @Nullable <ide> private Principal principal; <ide> <add> @Nullable <add> private InetSocketAddress remoteAddress; <add> <ide> @Override <ide> public Builder method(HttpMethod method) { <ide> Assert.notNull(method, "'method' must not be null"); <ide> public Builder session(WebSession session) { <ide> <ide> @Override <ide> public Builder session(Principal principal) { <add> return principal(principal); <add> } <add> <add> @Override <add> public Builder principal(Principal principal) { <ide> Assert.notNull(principal, "'principal' must not be null"); <ide> this.principal = principal; <ide> return this; <ide> } <ide> <add> @Override <add> public Builder remoteAddress(InetSocketAddress remoteAddress) { <add> Assert.notNull(remoteAddress, "'remoteAddress' must not be null"); <add> this.remoteAddress = remoteAddress; <add> return this; <add> } <add> <ide> @Override <ide> public MockServerRequest body(Object body) { <ide> this.body = body; <ide> return new MockServerRequest(this.method, this.uri, this.contextPath, this.headers, <ide> this.cookies, this.body, this.attributes, this.queryParams, this.pathVariables, <del> this.session, this.principal); <add> this.session, this.principal, this.remoteAddress); <ide> } <ide> <ide> @Override <ide> public MockServerRequest build() { <ide> return new MockServerRequest(this.method, this.uri, this.contextPath, this.headers, <ide> this.cookies, null, this.attributes, this.queryParams, this.pathVariables, <del> this.session, this.principal); <add> this.session, this.principal, this.remoteAddress); <ide> } <ide> } <ide>
6
Mixed
Text
add config to halt callback chain on return false
9c65c539e2caa4590aded1975aead008f8135da4
<ide><path>activemodel/CHANGELOG.md <del>* Deprecate returning `false` as a way to halt callback chains. <del> <del> Returning `false` in a `before_` callback will display a <del> deprecation warning explaining that the preferred method to halt a callback <del> chain is to explicitly `throw(:abort)`. <del> <del> *claudiob* <add>* Change the way in which callback chains can be halted. <add> <add> The preferred method to halt a callback chain from now on is to explicitly <add> `throw(:abort)`. <add> In the past, returning `false` in an ActiveModel or ActiveModel::Validations <add> `before_` callback had the side effect of halting the callback chain. <add> This is not recommended anymore and, depending on the value of the <add> `config.active_support.halt_callback_chains_on_return_false` option, will <add> either not work at all or display a deprecation warning. <ide> <ide> <ide> Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md) for previous changes. <ide><path>activerecord/CHANGELOG.md <del>* Deprecate returning `false` as a way to halt callback chains. <del> <del> Returning `false` in a `before_` callback will display a <del> deprecation warning explaining that the preferred method to halt a callback <del> chain is to explicitly `throw(:abort)`. <add>* Change the way in which callback chains can be halted. <add> <add> The preferred method to halt a callback chain from now on is to explicitly <add> `throw(:abort)`. <add> In the past, returning `false` in an ActiveRecord `before_` callback had the <add> side effect of halting the callback chain. <add> This is not recommended anymore and, depending on the value of the <add> `config.active_support.halt_callback_chains_on_return_false` option, will <add> either not work at all or display a deprecation warning. <ide> <ide> *claudiob* <ide> <ide><path>activesupport/CHANGELOG.md <del>* Deprecate returning `false` as a way to halt callback chains. <add>* Change the way in which callback chains can be halted. <ide> <del> Returning `false` in a callback will display a deprecation warning <del> explaining that the preferred method to halt a callback chain is to <del> explicitly `throw(:abort)`. <add> The preferred method to halt a callback chain from now on is to explicitly <add> `throw(:abort)`. <add> In the past, returning `false` in an ActiveSupport callback had the side <add> effect of halting the callback chain. This is not recommended anymore and, <add> depending on the value of <add> `Callbacks::CallbackChain.halt_and_display_warning_on_return_false`, will <add> either not work at all or display a deprecation warning. <add> <add> <add>* Add Callbacks::CallbackChain.halt_and_display_warning_on_return_false <add> <add> Setting `Callbacks::CallbackChain.halt_and_display_warning_on_return_false` <add> to true will let an app support the deprecated way of halting callback <add> chains by returning `false`. <add> <add> Setting the value to false will tell the app to ignore any `false` value <add> returned by callbacks, and only halt the chain upon `throw(:abort)`. <add> <add> The value can also be set with the Rails configuration option <add> `config.active_support.halt_callback_chains_on_return_false`. <add> <add> When the configuration option is missing, its value is `true`, so older apps <add> ported to Rails 5.0 will not break (but display a deprecation warning). <add> For new Rails 5.0 apps, its value is set to `false` in an initializer, so <add> these apps will support the new behavior by default. <ide> <ide> *claudiob* <ide> <ide> <ide> Chains of callbacks defined with a `:terminator` option will maintain their <ide> existing behavior of halting as soon as a `before_` callback matches the <del> terminator's expectation. For instance, ActiveModel's callbacks will still <del> halt the chain when a `before_` callback returns `false`. <add> terminator's expectation. <ide> <ide> *claudiob* <ide> <ide><path>activesupport/lib/active_support/callbacks.rb <ide> class CallbackChain #:nodoc:# <ide> <ide> attr_reader :name, :config <ide> <add> # If true, any callback returning +false+ will halt the entire callback <add> # chain and display a deprecation message. If false, callback chains will <add> # only be halted by calling +throw :abort+. Defaults to +true+. <add> class_attribute :halt_and_display_warning_on_return_false <add> self.halt_and_display_warning_on_return_false = true <add> <ide> def initialize(name, config) <ide> @name = name <ide> @config = { <ide> def default_terminator <ide> terminate = true <ide> catch(:abort) do <ide> result = result_lambda.call if result_lambda.is_a?(Proc) <del> if result == false <add> if halt_and_display_warning_on_return_false && result == false <ide> display_deprecation_warning_for_false_terminator <ide> else <ide> terminate = false <ide><path>activesupport/lib/active_support/railtie.rb <ide> class Railtie < Rails::Railtie # :nodoc: <ide> end <ide> end <ide> <add> initializer "active_support.halt_callback_chains_on_return_false", after: :load_config_initializers do |app| <add> if app.config.active_support.key? :halt_callback_chains_on_return_false <add> ActiveSupport::Callbacks::CallbackChain.halt_and_display_warning_on_return_false = \ <add> app.config.active_support.halt_callback_chains_on_return_false <add> end <add> end <add> <ide> # Sets the default value for Time.zone <ide> # If assigned value cannot be matched to a TimeZone, an exception will be raised. <ide> initializer "active_support.initialize_time_zone" do |app| <ide><path>activesupport/test/callbacks_test.rb <ide> def second <ide> set_save_callbacks <ide> end <ide> <add> class CallbackFalseTerminator < AbstractCallbackTerminator <add> define_callbacks :save <add> <add> def second <add> @history << "second" <add> false <add> end <add> <add> set_save_callbacks <add> end <add> <ide> class CallbackObject <ide> def before(caller) <ide> caller.record << "before" <ide> def test_block_never_called_if_abort_is_thrown <ide> end <ide> end <ide> <add> class CallbackFalseTerminatorWithoutConfigTest < ActiveSupport::TestCase <add> def test_returning_false_halts_callback_if_config_variable_is_not_set <add> obj = CallbackFalseTerminator.new <add> assert_deprecated do <add> obj.save <add> assert_equal :second, obj.halted <add> assert !obj.saved <add> end <add> end <add> end <add> <add> class CallbackFalseTerminatorWithConfigTrueTest < ActiveSupport::TestCase <add> def setup <add> ActiveSupport::Callbacks::CallbackChain.halt_and_display_warning_on_return_false = true <add> end <add> <add> def test_returning_false_halts_callback_if_config_variable_is_true <add> obj = CallbackFalseTerminator.new <add> assert_deprecated do <add> obj.save <add> assert_equal :second, obj.halted <add> assert !obj.saved <add> end <add> end <add> end <add> <add> class CallbackFalseTerminatorWithConfigFalseTest < ActiveSupport::TestCase <add> def setup <add> ActiveSupport::Callbacks::CallbackChain.halt_and_display_warning_on_return_false = false <add> end <add> <add> def test_returning_false_does_not_halt_callback_if_config_variable_is_false <add> obj = CallbackFalseTerminator.new <add> obj.save <add> assert_equal nil, obj.halted <add> assert obj.saved <add> end <add> end <add> <ide> class HyphenatedKeyTest < ActiveSupport::TestCase <ide> def test_save <ide> obj = HyphenatedCallbacks.new <ide><path>guides/source/configuring.md <ide> There are a few configuration options available in Active Support: <ide> <ide> * `config.active_support.time_precision` sets the precision of JSON encoded time values. Defaults to `3`. <ide> <add>* `config.active_support.halt_callback_chains_on_return_false` specifies whether ActiveRecord, ActiveModel and ActiveModel::Validations callback chains can be halted by returning `false` in a 'before' callback. Defaults to `true`. <add> <ide> * `ActiveSupport::Logger.silencer` is set to `false` to disable the ability to silence logging in a block. The default is `true`. <ide> <ide> * `ActiveSupport::Cache::Store.logger` specifies the logger to use within cache store operations. <ide><path>guides/source/upgrading_ruby_on_rails.md <ide> Don't forget to review the difference, to see if there were any unexpected chang <ide> Upgrading from Rails 4.2 to Rails 5.0 <ide> ------------------------------------- <ide> <add>### Halting callback chains by returning `false` <add> <add>In Rails 4.2, when a 'before' callback returns `false` in ActiveRecord, <add>ActiveModel and ActiveModel::Validations, then the entire callback chain <add>is halted. In other words, successive 'before' callbacks are not executed, <add>and neither is the action wrapped in callbacks. <add> <add>In Rails 5.0, returning `false` in a callback will not have this side effect <add>of halting the callback chain. Instead, callback chains must be explicitly <add>halted by calling `throw(:abort)`. <add> <add>When you upgrade from Rails 4.2 to Rails 5.0, returning `false` in a callback <add>will still halt the callback chain, but you will receive a deprecation warning <add>about this upcoming change. <add> <add>When you are ready, you can opt into the new behavior and remove the deprecation <add>warning by adding the following configuration to your `config/application.rb`: <add> <add> config.active_support.halt_callback_chains_on_return_false = false <add> <add>See [#17227](https://github.com/rails/rails/pull/17227) for more details. <add> <ide> Upgrading from Rails 4.1 to Rails 4.2 <ide> ------------------------------------- <ide> <ide><path>railties/CHANGELOG.md <add>* Add `config/initializers/callback_terminator.rb` <add> <add> Newly generated Rails apps have a new initializer called <add> `callback_terminator.rb` which sets the value of the configuration option <add> `config.active_support.halt_callback_chains_on_return_false` to `false`. <add> <add> As a result, new Rails apps do not halt callback chains when a callback <add> returns `false`; only when they are explicitly halted with `throw(:abort)`. <add> <add> The terminator is *not* added when running `rake rails:update`, so returning <add> `false` will still work on old apps ported to Rails 5, displaying a <add> deprecation warning to prompt users to update their code to the new syntax. <add> <add> *claudiob* <add> <ide> * Add `--skip-action-mailer` option to the app generator. <ide> <ide> *claudiob* <ide><path>railties/lib/rails/generators/rails/app/app_generator.rb <ide> def config <ide> <ide> def config_when_updating <ide> cookie_serializer_config_exist = File.exist?('config/initializers/cookies_serializer.rb') <add> callback_terminator_config_exist = File.exist?('config/initializers/callback_terminator.rb') <ide> <ide> config <ide> <add> unless callback_terminator_config_exist <add> remove_file 'config/initializers/callback_terminator.rb' <add> end <add> <ide> unless cookie_serializer_config_exist <ide> gsub_file 'config/initializers/cookies_serializer.rb', /json/, 'marshal' <ide> end <add> <add> <ide> end <ide> <ide> def database_yml <ide><path>railties/lib/rails/generators/rails/app/templates/config/initializers/callback_terminator.rb <add># Be sure to restart your server when you modify this file. <add> <add># Do not halt callback chains when a callback returns false. <add>Rails.application.config.active_support.halt_callback_chains_on_return_false = false <ide><path>railties/test/generators/app_generator_test.rb <ide> def test_rails_update_keep_the_cookie_serializer_if_it_is_already_configured <ide> assert_file("#{app_root}/config/initializers/cookies_serializer.rb", /Rails\.application\.config\.action_dispatch\.cookies_serializer = :json/) <ide> end <ide> <add> def test_rails_update_does_not_create_callback_terminator_initializer <add> app_root = File.join(destination_root, 'myapp') <add> run_generator [app_root] <add> <add> FileUtils.rm("#{app_root}/config/initializers/callback_terminator.rb") <add> <add> Rails.application.config.root = app_root <add> Rails.application.class.stubs(:name).returns("Myapp") <add> Rails.application.stubs(:is_a?).returns(Rails::Application) <add> <add> generator = Rails::Generators::AppGenerator.new ["rails"], { with_dispatchers: true }, destination_root: app_root, shell: @shell <add> generator.send(:app_const) <add> quietly { generator.send(:update_config_files) } <add> assert_no_file "#{app_root}/config/initializers/callback_terminator.rb" <add> end <add> <add> def test_rails_update_does_not_remove_callback_terminator_initializer_if_already_present <add> app_root = File.join(destination_root, 'myapp') <add> run_generator [app_root] <add> <add> FileUtils.touch("#{app_root}/config/initializers/callback_terminator.rb") <add> <add> Rails.application.config.root = app_root <add> Rails.application.class.stubs(:name).returns("Myapp") <add> Rails.application.stubs(:is_a?).returns(Rails::Application) <add> <add> generator = Rails::Generators::AppGenerator.new ["rails"], { with_dispatchers: true }, destination_root: app_root, shell: @shell <add> generator.send(:app_const) <add> quietly { generator.send(:update_config_files) } <add> assert_file "#{app_root}/config/initializers/callback_terminator.rb" <add> end <add> <ide> def test_rails_update_set_the_cookie_serializer_to_marchal_if_it_is_not_already_configured <ide> app_root = File.join(destination_root, 'myapp') <ide> run_generator [app_root]
12
PHP
PHP
add ttr to beanstalkd..
2038e4e625de390991d2ba5a027d7ca4ed1330b3
<ide><path>src/Illuminate/Queue/BeanstalkdQueue.php <ide> class BeanstalkdQueue extends Queue implements QueueInterface { <ide> */ <ide> protected $default; <ide> <add> /** <add> * The timeout for workers <add> * <add> * @var int <add> */ <add> protected $ttr; <add> <ide> /** <ide> * Create a new Beanstalkd queue instance. <ide> * <ide> * @param Pheanstalk $pheanstalk <ide> * @param string $default <ide> * @return void <ide> */ <del> public function __construct(Pheanstalk $pheanstalk, $default) <add> public function __construct(Pheanstalk $pheanstalk, $default, $ttr) <ide> { <del> $this->default = $default; <add> $this->default = $default; <ide> $this->pheanstalk = $pheanstalk; <add> $this->ttr = $ttr; <ide> } <ide> <ide> /** <ide> public function push($job, $data = '', $queue = null) <ide> */ <ide> public function pushRaw($payload, $queue = null, array $options = array()) <ide> { <del> return $this->pheanstalk->useTube($this->getQueue($queue))->put($payload); <add> return $this->pheanstalk->useTube($this->getQueue($queue))->put($payload, Pheanstalk::DEFAULT_PRIORITY, PheanstalkInterface::DEFAULT_DELAY, $this->ttr); <ide> } <ide> <ide> /** <ide><path>src/Illuminate/Queue/Connectors/BeanstalkdConnector.php <ide> public function connect(array $config) <ide> { <ide> $pheanstalk = new Pheanstalk($config['host']); <ide> <del> return new BeanstalkdQueue($pheanstalk, $config['queue']); <add> $config['ttr'] = isset($config['ttr']) ? $config['ttr'] : Pheanstalk::DEFAULT_TTR; <add> <add> return new BeanstalkdQueue($pheanstalk, $config['queue'], $config['ttr']); <ide> } <ide> <ide> } <ide>\ No newline at end of file
2
Javascript
Javascript
remove literal error messages
ba6049f7f9e42995b165865546d455926cd2f428
<ide><path>test/parallel/test-zlib-flush-drain.js <ide> deflater.on('drain', function() { <ide> <ide> process.once('exit', function() { <ide> assert.strictEqual( <del> beforeFlush, true, <del> 'before calling flush, writable stream should need to drain'); <add> beforeFlush, true); <ide> assert.strictEqual( <del> afterFlush, false, <del> 'after calling flush, writable stream should not need to drain'); <add> afterFlush, false); <ide> assert.strictEqual( <del> drainCount, 1, 'the deflater should have emitted a single drain event'); <add> drainCount, 1); <ide> assert.strictEqual( <del> flushCount, 2, 'flush should be called twice'); <add> flushCount, 2); <ide> });
1
Ruby
Ruby
remove incorrect 7.0 framework default
9bca2b7907fec3451211c635f246bd13e416f825
<ide><path>railties/lib/rails/application/configuration.rb <ide> def load_defaults(target_version) <ide> end <ide> <ide> if respond_to?(:action_controller) <del> action_controller.raise_on_missing_callback_actions = false <ide> action_controller.raise_on_open_redirects = true <ide> action_controller.wrap_parameters_by_default = true <ide> end
1
Text
Text
create list of ctc emeriti
0c260f164b7ad014e287801f43047c0c1cc9b6fc
<ide><path>README.md <ide> more information about the governance of the Node.js project, see <ide> * [Trott](https://github.com/Trott) - <ide> **Rich Trott** &lt;rtrott@gmail.com&gt; (he/him) <ide> <add>### CTC Emeriti <add> <add>* [chrisdickinson](https://github.com/chrisdickinson) - <add>**Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt; <add>* [isaacs](https://github.com/isaacs) - <add>**Isaac Z. Schlueter** &lt;i@izs.me&gt; <add>* [orangemocha](https://github.com/orangemocha) - <add>**Alexis Campailla** &lt;orangemocha@nodejs.org&gt; <add>* [piscisaureus](https://github.com/piscisaureus) - <add>**Bert Belder** &lt;bertbelder@gmail.com&gt; <add> <ide> ### Collaborators <ide> <ide> * [abouthiroppy](https://github.com/abouthiroppy) - <ide> more information about the governance of the Node.js project, see <ide> **Bartosz Sosnowski** &lt;bartosz@janeasystems.com&gt; <ide> * [calvinmetcalf](https://github.com/calvinmetcalf) - <ide> **Calvin Metcalf** &lt;calvin.metcalf@gmail.com&gt; <del>* [chrisdickinson](https://github.com/chrisdickinson) - <del>**Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt; <ide> * [claudiorodriguez](https://github.com/claudiorodriguez) - <ide> **Claudio Rodriguez** &lt;cjrodr@yahoo.com&gt; <ide> * [danbev](https://github.com/danbev) - <ide> more information about the governance of the Node.js project, see <ide> **Imran Iqbal** &lt;imran@imraniqbal.org&gt; <ide> * [imyller](https://github.com/imyller) - <ide> **Ilkka Myller** &lt;ilkka.myller@nodefield.com&gt; <del>* [isaacs](https://github.com/isaacs) - <del>**Isaac Z. Schlueter** &lt;i@izs.me&gt; <ide> * [italoacasas](https://github.com/italoacasas) - <ide> **Italo A. Casas** &lt;me@italoacasas.com&gt; (he/him) <ide> * [JacksonTian](https://github.com/JacksonTian) - <ide> more information about the governance of the Node.js project, see <ide> **Teddy Katz** &lt;teddy.katz@gmail.com&gt; <ide> * [Olegas](https://github.com/Olegas) - <ide> **Oleg Elifantiev** &lt;oleg@elifantiev.ru&gt; <del>* [orangemocha](https://github.com/orangemocha) - <del>**Alexis Campailla** &lt;orangemocha@nodejs.org&gt; <ide> * [othiym23](https://github.com/othiym23) - <ide> **Forrest L Norvell** &lt;ogd@aoaioxxysz.net&gt; (he/him) <ide> * [petkaantonov](https://github.com/petkaantonov) - <ide> **Petka Antonov** &lt;petka_antonov@hotmail.com&gt; <ide> * [phillipj](https://github.com/phillipj) - <ide> **Phillip Johnsen** &lt;johphi@gmail.com&gt; <del>* [piscisaureus](https://github.com/piscisaureus) - <del>**Bert Belder** &lt;bertbelder@gmail.com&gt; <ide> * [pmq20](https://github.com/pmq20) - <ide> **Minqi Pan** &lt;pmq2001@gmail.com&gt; <ide> * [princejwesley](https://github.com/princejwesley) -
1
Text
Text
remove 5.7 changelog from master
38278b29e05680ba5d2f992235c29d317e1c8309
<ide><path>CHANGELOG-5.7.md <del># Release Notes for 5.7.x <del> <del>## [Unreleased](https://github.com/laravel/framework/compare/v5.7.28...5.7) <del> <del> <del>## [v5.7.28 (2019-02-26)](https://github.com/laravel/framework/compare/v5.7.27...v5.7.28) <del> <del>### Added <del>- Add support for `Pheanstalk 4.x` ([#27622](https://github.com/laravel/framework/pull/27622)) <del>- Allow configuration of token guard keys ([#27585](https://github.com/laravel/framework/pull/27585)) <del> <del>### Changed <del>- Update vue preset to exclude `@babel/preset-react` ([#27645](https://github.com/laravel/framework/pull/27645)) <del>- Reflash the session for the broadcasting auth call ([#27647](https://github.com/laravel/framework/pull/27647)) <del>- Improving readability in `AuthenticateWithBasicAuth` Middleware ([#27661](https://github.com/laravel/framework/pull/27661)) <del>- Use safe container getter on `Pipeline` ([#27648](https://github.com/laravel/framework/pull/27648)) <del> <del>### Fixed <del>- Fixed Postgres grammar when using union queries ([#27589](https://github.com/laravel/framework/pull/27589)) <del>- Fixed an issue when using Mail::queue to queue Mailables ([#27618](https://github.com/laravel/framework/pull/27618)) <del>- Fixed error in `Foundation\Exceptions\Handler` ([#27632](https://github.com/laravel/framework/pull/27632)) <del> <del> <del>## [v5.7.26 (2019-02-12)](https://github.com/laravel/framework/compare/v5.7.25...v5.7.26) <del> <del>### Added <del>- Added `Illuminate\Pipeline\Pipeline::thenReturn()` ([#27429](https://github.com/laravel/framework/pull/27429)) <del>- Added `Illuminate\Cache\TaggedCache::getTags()` ([#27445](https://github.com/laravel/framework/pull/27445)) <del>- Added `Illuminate\Http\ResponseTrait::getCallback()` ([#27464](https://github.com/laravel/framework/pull/27464)) <del>- Added license file to each component ([9e57e8b](https://github.com/laravel/framework/commit/9e57e8bea04638d5bafec62db1051fbc2ce39e3a)) <del>- Added `Model::withoutEvents()` method ([#27419](https://github.com/laravel/framework/pull/27419), [5c5d6b2](https://github.com/laravel/framework/commit/5c5d6b24f6156768575ae49aa84d7b1d004f23fe)) <del> <del>### Reverted <del>- Revert of "Fixed wrong class being used when eager loading nullable `MorphTo` with `withDefault()` ([#27411](https://github.com/laravel/framework/pull/27411))"([9bbf644](https://github.com/laravel/framework/commit/9bbf6443e2709d846367f04ebed9a41823ebcc34)) <del> <del>### Changed <del>- Improved error message in `Illuminate\Foundation\Testing\TestResponse::assertJsonValidationErrors()` ([#27495](https://github.com/laravel/framework/pull/27495), [98010da](https://github.com/laravel/framework/commit/98010da996de264c1487bbd1c145741169691b95)) <del>- `Illuminate\Support\Testing\Fakes\EventFake::dispatch()` will return response ([#27430](https://github.com/laravel/framework/pull/27430)) <del> <del> <del>## [v5.7.25 (2019-02-05)](https://github.com/laravel/framework/compare/v5.7.24...v5.7.25) <del> <del>### Added <del>- Allowed specifying custom translation for date relative messages ([#27341](https://github.com/laravel/framework/pull/27341)) <del>- Add computed support to SQL Server schema grammar ([#27346](https://github.com/laravel/framework/pull/27346), [1c74d7f](https://github.com/laravel/framework/commit/1c74d7fe595df223279de55dffc7ae6fc8ac9ca6)) <del>- Allowed `ENV` to control paths of `cache files` for `services`, `packages` and `routes` ([#27389](https://github.com/laravel/framework/pull/27389)) <del> <del>### Fixed <del>- Fixed `BelongsToMany` pivot relationship child with loaded relations wakeup ([#27358](https://github.com/laravel/framework/pull/27358)) <del>- Fixed wrong class being used when eager loading nullable `MorphTo` with `withDefault()` ([#27411](https://github.com/laravel/framework/pull/27411)) <del> <del>### Changed <del>- Removed `php_network_getaddresses: getaddrinfo failed: Name or service not known` in `DetectsLostConnections` trait ([#27418](https://github.com/laravel/framework/pull/27418)) <del> <del> <del>## [v5.7.24 (2019-01-30)](https://github.com/laravel/framework/compare/v5.7.23...v5.7.24) <del> <del>### Fixed <del>- Fixed `ResetPassword` notification ([#27351](https://github.com/laravel/framework/pull/27351), [b130771](https://github.com/laravel/framework/commit/b13077164bc6b4cb032b9eec7f5209402b5260eb)) <del> <del> <del>## [v5.7.23 (2019-01-29)](https://github.com/laravel/framework/compare/v5.7.22...v5.7.23) <del> <del>### Added <del>- Added `AbstractPaginator::getOptions()` method ([#27273](https://github.com/laravel/framework/pull/27273)) <del>- Added `Communication link failure` to `DetectsLostConnections` trait ([#27307](https://github.com/laravel/framework/pull/27307)) <del>- Added `orWhere()` `proxy` for `scopes` to `EloquentBuilder` ([#27281](https://github.com/laravel/framework/pull/27281), [2e6fe85](https://github.com/laravel/framework/commit/2e6fe855c7d7d9d3cbf34e1fbea17c8059640c5c)) <del>- Allow the `app path` to be configured ([#27332](https://github.com/laravel/framework/pull/27332), [d73e672](https://github.com/laravel/framework/commit/d73e6729cefb26c2fbcb16e47daefc2ba86b9697)) <del>- Added config for using `WhatFailureGroupHandler` when `StackDriver` created for Logger ([#27308](https://github.com/laravel/framework/pull/27308) ,[6a92651](https://github.com/laravel/framework/commit/6a926519e8e3905013569e7b3fcdd598ec7cece3)) <del> <del>### Fixed <del>- Fixed `QueueableCollection` serialization of Eloquent Models when using `Binary IDs` ([#27271](https://github.com/laravel/framework/pull/27271)) <del>- Replaced `newModelQuery()` with `newQueryWithoutRelationships()` for `UPDATE`/`DELETE` queries ([#27277](https://github.com/laravel/framework/pull/27277)) <del> <del>### Changed <del>- Apply parameters to entire localization array ([#27254](https://github.com/laravel/framework/pull/27254)) <del>- Added line about expiring password reset in notification email ([#27324](https://github.com/laravel/framework/pull/27324), [80c5aec](https://github.com/laravel/framework/commit/80c5aecb443e7a55e868b66b9e0a93b7dfec08e8)) <del>- "Go Home" link will redirect to the `home` route on exception page ([#27343](https://github.com/laravel/framework/pull/27343)) <del> <del> <del>## [v5.7.22 (2019-01-22)](https://github.com/laravel/framework/compare/v5.7.21...v5.7.22) <del> <del>### Fixed <del>- Fixed `TestResponse::assertJsonValidationErrors()` when there are no errors ([#27190](https://github.com/laravel/framework/pull/27190)) <del> <del>### Changed <del>- Allowed `TestResponse::assertJsonMissingValidationErrors()` to be called without an argument ([#27176](https://github.com/laravel/framework/pull/27176)) <del>- Updated vue preset's vue-stubs for laravel-mix 4 compatibility ([#27229](https://github.com/laravel/framework/pull/27229)) <del>- Updated preset to use `@babel/preset-react` ([#27235](https://github.com/laravel/framework/pull/27235)) <del>- Used `config` to resolve the database value during tests. ([#27240](https://github.com/laravel/framework/pull/27240)) <del> <del> <del>## [v5.7.21 (2019-01-15)](https://github.com/laravel/framework/compare/v5.7.20...v5.7.21) <del> <del>### Fixed <del>- Fixed `Blueprint::removeColumn()` ([#27115](https://github.com/laravel/framework/pull/27115), [#27122](https://github.com/laravel/framework/pull/27122)) <del>- Fixed allowing of null broadcast connection driver ([#27135](https://github.com/laravel/framework/pull/27135)) <del>- Fixed `ModelMakeCommand::handle()` should always return `bool` value ([#27156](https://github.com/laravel/framework/pull/27156)) <del>- Fixed `TestResponse::assertSessionDoesntHaveErrors()` when there are no errors ([#27145](https://github.com/laravel/framework/pull/27145)) <del>- Fixed default message is localization twice in `403.blade.php` error page ([4a08120](https://github.com/laravel/framework/commit/4a081204d65a6e01959d795e71770079588bad21)) <del> <del>### Changed <del>- Replaced `get_called_class()` to `static::class` ([#27146](https://github.com/laravel/framework/pull/27146)) <del>- Re-throw `NoMatchingExpectationException` from `PendingCommand` ([#27158](https://github.com/laravel/framework/pull/27158)) <del> <del> <del>## [v5.7.20 (2019-01-08)](https://github.com/laravel/framework/compare/v5.7.19...v5.7.20) <del> <del>### Added <del>- Added `chunkById` support in relations ([#26919](https://github.com/laravel/framework/pull/26919)) <del>- Added `Collection::whereNotBetween` method ([#27028](https://github.com/laravel/framework/pull/27028)) <del>- Allowed predefined log channels to change formatter from config ([#26895](https://github.com/laravel/framework/pull/26895)) <del>- Allowed storage assertions (`FilesystemAdapter::assertExists` / `FilesystemAdapter::assertMissing`) to handle multiple files at once ([#26975](https://github.com/laravel/framework/pull/26975)) <del>- Added `Adaptive Server connection failed` to `DetectsLostConnections` trait ([#27055](https://github.com/laravel/framework/pull/27055)) <del>- Added `Route::originalParameters()` ([#27056](https://github.com/laravel/framework/pull/27056)) <del>- Added `QueueFake::pushedJobs()` ([#27089](https://github.com/laravel/framework/pull/27089), [695ffa1](https://github.com/laravel/framework/commit/695ffa1247a7a44a79ba85442ad9ea311413feae)) <del> <del>### Fixed <del>- Prevents unnecessary queries when lazy loading empty relationships ([#26992](https://github.com/laravel/framework/pull/26992)) <del>- Fixed broken `Command::setHidden` method ([#27005](https://github.com/laravel/framework/pull/27005)) <del>- Fixed `Str::slug` method ([#27002](https://github.com/laravel/framework/pull/27002)) <del>- Ignore `--seed` option for `artisan migrate --pretend` ([#27015](https://github.com/laravel/framework/pull/27015)) <del>- Fixed `previousUrl` in the session if the call is `prefetch` ([#27017](https://github.com/laravel/framework/pull/27017)) <del>- Fixed nullable `MorphTo` touching ([#27031](https://github.com/laravel/framework/pull/27031)) <del>- Fixed `Collection::loadMissing()` with duplicate relation names ([#27040](https://github.com/laravel/framework/pull/27040)) <del>- Fixed some commands ([#27020](https://github.com/laravel/framework/pull/27020)) <del>- Ensured the command `context` is forwarded to calls ([#27012](https://github.com/laravel/framework/pull/27012), [#27065](https://github.com/laravel/framework/pull/27065)) <del>- Fixed `Collection::loadMorph()` issue relations loading issue ([#27081](https://github.com/laravel/framework/pull/27081)) <del> <del>### Changed <del>- Removed `HasOneOrMany::update()` since `Builder::update()` already adds the `UPDATED_AT` timestamp. ([#27026](https://github.com/laravel/framework/pull/27026)) <del>- Changed `Name or service not known` to `php_network_getaddresses: getaddrinfo failed: Name or service not known` in `DetectsLostConnections` trait ([#27054](https://github.com/laravel/framework/pull/27054), [5459ac1](https://github.com/laravel/framework/commit/5459ac15b56cdee8e176827ddbb30357119ceabb)) <del>- Changed Eloquent `ApiResource merge()` methods to accept `JsonResource` object ([#27068](https://github.com/laravel/framework/pull/27068)) <del>- Stop email re-verification with same link ([#27070](https://github.com/laravel/framework/pull/27070)) <del> <del> <del>## [v5.7.19 (2018-12-18)](https://github.com/laravel/framework/compare/v5.7.18...v5.7.19) <del> <del>### Added <del>- Added `Illuminate\Support\Collection::whereBetween` method ([#26888](https://github.com/laravel/framework/pull/26888)) <del> <del>### Fixed <del>- <strong> Reverted changes related to [`app()->call()`](https://github.com/laravel/framework/pull/26852) </strong> ([fefaf46](https://github.com/laravel/framework/commit/fefaf46dd147a4caf1dea1712f9797f3db49fea4)) <del>- Reset doctrineConnection property on Database/Connection when reconnecting ([#26890](https://github.com/laravel/framework/pull/26890)) <del> <del> <del>## [v5.7.18 (2018-12-17)](https://github.com/laravel/framework/compare/v5.7.17...v5.7.18) <del> <del>### Added <del>- Added missing `starts_with` validation message ([#26822](https://github.com/laravel/framework/pull/26822)) <del>- Added `Facade::resolved()` method to register pending callback until the service is available. ([#26824](https://github.com/laravel/framework/pull/26824)) <del>- Added env var `APP_CONFIG_CACHE` to control cache config path ([578bc83](https://github.com/laravel/framework/commit/578bc83f0247b97ec87fefe39a8da7e9bbfd4a66)) <del> <del>### Changed <del>- Changed `TransportManager::createMailDriver` ([#26846](https://github.com/laravel/framework/pull/26846)) <del> <del>### Fixed <del>- Fixed of using `illuminate/mail` outside of Laravel with driver log ([#26842](https://github.com/laravel/framework/pull/26842)) <del>- Fixed some bugs for `app()->call()` ([#26852](https://github.com/laravel/framework/pull/26852)) <del>- Added workaround for PHP-bug related to [incorrect variable values when Opcache enabled in PHP v 7.3.0](https://github.com/laravel/framework/issues/26819) ([36d3436](https://github.com/laravel/framework/commit/36d343682d25570946ff22397a720727e0c1dcd7)) <del> <del> <del>## [v5.7.17 (2018-12-12)](https://github.com/laravel/framework/compare/v5.7.16...v5.7.17) <del> <del>### Added <del>- Added `Database\Query\Builder::insertUsing` method ([#26732](https://github.com/laravel/framework/pull/26732), [8216b46](https://github.com/laravel/framework/commit/8216b4607152f9b01f26efba6b045add5382c625)) <del>- Added `Database\Query\Builder::havingBetween` method ([#26758](https://github.com/laravel/framework/pull/26758)) <del>- Added `Packets out of order. Expected` string to `DetectsLostConnections` trait ([#26760](https://github.com/laravel/framework/pull/26760)) <del>- Added `NOT VALID` option for skipping validation when adding postgres foreign keys ([#26775](https://github.com/laravel/framework/pull/26775)) <del> <del>### Fixed <del>- Fixed: Using `store` on an uploaded file when you push an empty file ([#26809](https://github.com/laravel/framework/pull/26809)) <del>- Fixed hiding for hidden commands ([#26781](https://github.com/laravel/framework/pull/26781)) <del> <del> <del>## [v5.7.16 (2018-12-05)](https://github.com/laravel/framework/compare/v5.7.15...v5.7.16) <del> <del>### Added <del>- Added localization for `403.blade.php` and `503.blade.php` ([#26751](https://github.com/laravel/framework/pull/26751)) <del>- Changing the Migrator to accept not only migration directory paths, but migration file paths too ([#26642](https://github.com/laravel/framework/pull/26642), [c4b13bf](https://github.com/laravel/framework/commit/c4b13bfd115bcfd54588ad2a5809fea2222d1cdb)) <del> <del>### Fixed <del>- Fixed self-referencing HasManyThrough existence queries ([#26662](https://github.com/laravel/framework/pull/26662)) <del>- Fixed HasManyThrough existence queries with same parent and through parent table ([#26676](https://github.com/laravel/framework/pull/26676)) <del>- Fixed breaking eager loading with "incrementing" string keys ([#26688](https://github.com/laravel/framework/pull/26688)) <del>- Remove the Register `<li>` when the route doesn't exist in `app.stub` ([#26708](https://github.com/laravel/framework/pull/26708)) <del>- Fixed `Collection::some` method ([#26696](https://github.com/laravel/framework/pull/26696)) <del>- <strong> Revert breaking change in `TestResponse::decodeResponseJson` method </strong> ([#26713](https://github.com/laravel/framework/pull/26713)) <del>- Fixed `PhpRedisConnection::mget` ([#26716](https://github.com/laravel/framework/pull/26716)) <del>- Fixed `Eloquent\Collection::loadCount` attribute syncing ([#26714](https://github.com/laravel/framework/pull/26714)) <del>- Fixed `Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase::seed` for array accepting ([#26734](https://github.com/laravel/framework/pull/26734)) <del>- Fixed `FormRequest` validation triggering twice ([#26731](https://github.com/laravel/framework/pull/26731)) <del> <del>### Changed <del>- Changed markdown on auth stub view (`Auth/Console/stubs/make/views/auth/login.stub`) ([#26648](https://github.com/laravel/framework/pull/26648)) <del>- Moved Slack and Nexmo notification channels to the own packages `laravel/nexmo-notification-channel`, `laravel/slack-notification-channel` ([#26689](https://github.com/laravel/framework/pull/26689), [#26727](https://github.com/laravel/framework/pull/26727)) <del> <del>### Deprecated <del>- `$cachedSchema` property in `UrlGenerator` is deprecated. Will be renamed to the `$cachedScheme` in 5.8 ([#26640](https://github.com/laravel/framework/pull/26640)) <del> <del> <del>## [v5.7.15 (2018-11-26)](https://github.com/laravel/framework/compare/v5.7.14...v5.7.15) <del> <del>### Added <del>- Added `date_equals` validation message ([#26584](https://github.com/laravel/framework/pull/26584)) <del>- Added `starts_with` validation rule ([#26612](https://github.com/laravel/framework/pull/26612)) <del>- Added relationship getters `BelongsToMany::getParentKeyName`, `BelongsToMany::getRelatedKeyName`, `HasManyThrough::getFirstKeyName`, `HasManyThrough::getForeignKeyName`, `HasManyThrough::getSecondLocalKeyName`, `HasOneOrMany::getLocalKeyName`, `MorphToMany::getInverse` ([#26607](https://github.com/laravel/framework/pull/26607)) <del>- Make `ResourceCollection` countable ([#26595](https://github.com/laravel/framework/pull/26595)) <del> <del>### Fixed <del>- Fixed duplicate validation issue in `FormRequest::validated` method ([#26604](https://github.com/laravel/framework/pull/26604)) <del>- <strong> Prevent breaking eager loading with string keys </strong> ([#26622](https://github.com/laravel/framework/pull/26622)) <del> <del> <del>## [v5.7.14 (2018-11-21)](https://github.com/laravel/framework/compare/v5.7.13...v5.7.14) <del> <del>### Added <del>- Added `Macroable` trait to `Illuminate\Cookie\CookieJar` ([#26445](https://github.com/laravel/framework/pull/26445)) <del>- Added ability to disable password reset route ([#26459](https://github.com/laravel/framework/pull/26459)) <del>- Added ability to publish error views ([#26460](https://github.com/laravel/framework/pull/26460)) <del>- Added ability to set notifcation tries and timeout ([#26493](https://github.com/laravel/framework/pull/26493)) <del>- Added `mail.log_channel` config for make `log` for mail driver configurable ([#26510](https://github.com/laravel/framework/pull/26510)) <del>- Allowed `asset` root urls to be configurable via `app.asset_url` ([9172a67](https://github.com/laravel/framework/commit/9172a67b783952c1d3e15452d9c8646dc0b3eb6d)) <del>- Added `Error while sending QUERY packet` string to `DetectsLostConnections` trait ([#26233](https://github.com/laravel/framework/pull/26560)) <del>- Added env override for running in console ([a36906a](https://github.com/laravel/framework/commit/a36906ab8a141f1f497a0667196935e41970ae51), [19f2245](https://github.com/laravel/framework/commit/19f2245c6d7c87daf784f94b169f0dd4d98f0ca4)) <del> <del>### Fixed <del>- Fixed `UNION` aggregate queries with columns ([#26466](https://github.com/laravel/framework/pull/26466)) <del>- Allowed migration table name to be guessed without `_table` suffix ([#26429](https://github.com/laravel/framework/pull/26429)) <del>- Fixed `TestResponse::assertExactJson` for empty JSON objects ([#26353](https://github.com/laravel/framework/pull/26353), [e6ebc8d](https://github.com/laravel/framework/commit/e6ebc8d239e53e6daf16c869de3897ffbce6c751), [621d91d](https://github.com/laravel/framework/commit/621d91d802016ab4a64acc5c65f81cb9f5e5f779), [#26508](https://github.com/laravel/framework/pull/26508)) <del>- Fixed cache repository for PHP from 7.2.12v ([#26495]( https://github.com/laravel/framework/pull/26495)) <del>- Fixed user authorization check for Email Verification ([#26528](https://github.com/laravel/framework/pull/26528)) <del>- Fixed nested JOINs on SQLite ([#26567](https://github.com/laravel/framework/pull/26567)) <del> <del>### Changed <del>- Improved eager loading performance ([#26434](https://github.com/laravel/framework/pull/26434), [#26453](https://github.com/laravel/framework/pull/26453), [3992140](https://github.com/laravel/framework/commit/3992140064307ef82d23328995e7c59045c231f2), [#26471](https://github.com/laravel/framework/pull/26471), [a3738cf](https://github.com/laravel/framework/commit/a3738cf4e133a4475c56b51f521a12db78e2ecbb), [#26531](https://github.com/laravel/framework/pull/26531)) <del>- Adjusted `mix` missing asset exceptions ([#26431](https://github.com/laravel/framework/pull/26431)) <del>- Used `asset` helper to generate full path urls in exception views ([#26411](https://github.com/laravel/framework/pull/26411)) <del>- Changed `Illuminate\Foundation\Testing\Concerns\MocksApplicationServices::withoutJobs` method ([#26437](https://github.com/laravel/framework/pull/26437)) <del>- Cached `distinct` validation rule data ([#26509](https://github.com/laravel/framework/pull/26509)) <del>- Improved DNS Prefetching in view files ([#26552](https://github.com/laravel/framework/pull/26552)) <del> <del> <del>## [v5.7.13 (2018-11-07)](https://github.com/laravel/framework/compare/v5.7.12...v5.7.13) <del> <del>### Added <del>- Added ability to return an array of messages in a custom validation rule ([#26327](https://github.com/laravel/framework/pull/26327)) <del>- Added `whenEmpty`/ `whenNotEmpty` / `unlessEmpty` / `unlessNotEmpty` methods to `Collection` ([#26345](https://github.com/laravel/framework/pull/26345)) <del>- Added `Illuminate\Support\Collection::some` method ([#26376](https://github.com/laravel/framework/pull/26376), [8f7e647](https://github.com/laravel/framework/commit/8f7e647dcee5fe13d7fc33a1e0e1ce531ea9f49e)) <del>- Added `Illuminate\Cache\Repository::missing` method ([#26351](https://github.com/laravel/framework/pull/26351)) <del>- Added `Macroable` trait to `Illuminate\View\Factory` ([#26361](https://github.com/laravel/framework/pull/26361)) <del>- Added support for UNION aggregate queries ([#26365](https://github.com/laravel/framework/pull/26365)) <del> <del>### Changed <del>- Updated `AbstractPaginator::appends` to handle null ([#26326](https://github.com/laravel/framework/pull/26326)) <del>- Added "guzzlehttp/guzzle": "^6.3", to `composer.json` ([#26328](https://github.com/laravel/framework/pull/26328)) <del>- Showed exception message on 403 error page when message is available ([#26356](https://github.com/laravel/framework/pull/26356)) <del>- Don't run TransformsRequest twice on ?query= parameters ([#26366](https://github.com/laravel/framework/pull/26366)) <del>- Added missing logging options to slack log driver ([#26360](https://github.com/laravel/framework/pull/26360)) <del>- Use cascade when truncating table in PostgreSQL ([#26389](https://github.com/laravel/framework/pull/26389)) <del>- Allowed pass absolute parameter in has valid signature request macro ([#26397](https://github.com/laravel/framework/pull/26397)) <del> <del>### Changed realization <del>- Used `Request::validate` macro in Auth traits ([#26314](https://github.com/laravel/framework/pull/26314)) <del> <del> <del>## [v5.7.12 (2018-10-30)](https://github.com/laravel/framework/compare/v5.7.11...v5.7.12) <del> <del>### Added <del>- Added `CacheManager::forgetDriver` method ([#26264](https://github.com/laravel/framework/pull/26264), [fd9ef49](https://github.com/laravel/framework/commit/fd9ef492faefff96deab5285e30bc1b675211bcb)) <del>- Added `Illuminate\Foundation\Http\Kernel::getMiddlewareGroups` method ([#26268](https://github.com/laravel/framework/pull/26268)) <del>- Added an sqlite config option (`foreign_key_constraints`) to enable / disable foreign key constraints ([#26298](https://github.com/laravel/framework/pull/26298), [674f8be](https://github.com/laravel/framework/commit/674f8befc57f1e9fe8d064b475903431de39f41c), [#26306](https://github.com/laravel/framework/pull/26306)) <del> <del>### Fixed <del>- Checked `$absolute` parameter in `UrlGenerator::signedRoute` ([#26265](https://github.com/laravel/framework/pull/26265)) <del>- Fixed error in resource building after running `php artisan preset none` command ([41becda](https://github.com/laravel/framework/pull/26244/commits/41becda26a6bfcfaf9754beb9106b6ca0f328a61), [#26244](https://github.com/laravel/framework/pull/26244)) <del>- Fixed `whereDoesntHave()` and `doesntHave()` with nested relationships ([#26228](https://github.com/laravel/framework/pull/26228)) <del>- Fixed filesystem locking hangs in `PackageManifest::build()` ([#26254](https://github.com/laravel/framework/pull/26254)) <del> <del>### Changed <del>- Made expectation closure optional for `InteractsWithContainer::mock` and `InteractsWithContainer::spy` ([#26242](https://github.com/laravel/framework/pull/26242)) <del>- Allowed multiple `createPayloadCallback` on queues ([#26250](https://github.com/laravel/framework/pull/26250), [6e3d568](https://github.com/laravel/framework/commit/6e3d568757a8e4124b49bf9ac94f1db7a66437a1)) <del>- Changed wording on default 403 view ([#26258](https://github.com/laravel/framework/pull/26258)) <del>- Bump `vue.js` to `^2.5.17` in `artisan preset vue` command ([89f56bf](https://github.com/laravel/framework/pull/26244/commits/89f56bf8f9abb310bf985045c13103cb73a40351), [#26244](https://github.com/laravel/framework/pull/26244)) <del>- Allowed adding additional `$manyMethods` when extending the model class ([#26307](https://github.com/laravel/framework/pull/26307)) <del> <del> <del>## [v5.7.11 (2018-10-24)](https://github.com/laravel/framework/compare/v5.7.10...v5.7.11) <del> <del>### Added <del>- Added `decimal:<num>` cast to Model ([#26173](https://github.com/laravel/framework/pull/26173)) <del>- Allowed updateExistingPivot to receive an arrayable item ([#26167](https://github.com/laravel/framework/pull/26167)) <del>- Added `setIntendedUrl` method to `Routing/Redirector.php` ([#26227](https://github.com/laravel/framework/pull/26227)) <del>- Added `ORA-03114` string to `DetectsLostConnections` trait ([#26233](https://github.com/laravel/framework/pull/26233)) <del> <del>### Fixed <del>- Fixed an issue where the worker process would not be killed by the listener when the timeout is exceeded ([#25981](https://github.com/laravel/framework/pull/25981)) <del> <del>### Changed <del>- Reverted filesystem changes which were done in [#26010](https://github.com/laravel/framework/pull/26010) ([#26231](https://github.com/laravel/framework/pull/26231)) <del> <del> <del>## [v5.7.10 (2018-10-23)](https://github.com/laravel/framework/compare/v5.7.9...v5.7.10) <del> <del>### Added <del>- Added loadCount method to eloquent collections ([#25997](https://github.com/laravel/framework/pull/25997)) <del>- Added support for identity columns in PostgreSQL 10+ ([#26096](https://github.com/laravel/framework/pull/26096)) <del>- Allowed passing a model instance directly to `assertSoftDeleted` method in `Foundation/Testing/Concerns/InteractsWithDatabase.php` ([#26133](https://github.com/laravel/framework/pull/26133) , [#26148](https://github.com/laravel/framework/pull/26148)) <del>- Added possibility to define exclude methods on registered `apiResource` ([#26149](https://github.com/laravel/framework/pull/26149)) <del>- Added `filp/whoops` to `suggest` in `composer.json` ([#26180](https://github.com/laravel/framework/pull/26180)) <del>- Added `mock` and `spy` methods to `Foundation/Testing/Concerns/InteractsWithContainer.php` ([#26171](https://github.com/laravel/framework/pull/26171), [b50f9f3](https://github.com/laravel/framework/commit/b50f9f3bc8c1ee03c22ee8cc0ac37179fb28a1c9)) <del>- Added `uuid` validation rule to validator ([#26135](https://github.com/laravel/framework/pull/26135)) <del>- NotificationFake can assert preferred locale ([#26205](https://github.com/laravel/framework/pull/26205)) <del> <del>### Fixed <del>- Fixed `whereHas` and `$withCount` bindings from `polymorphic relationships` ([#26145](https://github.com/laravel/framework/pull/26145)) <del>- Fixed `getTable` method in Model ([#26085](https://github.com/laravel/framework/pull/26085)) <del>- Fixed filesystem locking hangs in `PackageManifest::build()` ([#26010](https://github.com/laravel/framework/pull/26010), [98b8256](https://github.com/laravel/framework/commit/98b8256f350d468cfc6b9fe2c2b0efb4103810a4)) <del>- Fixed `Illuminate/Http/Testing/File.php` for Symfony 4.1 components ([#26080](https://github.com/laravel/framework/pull/26080)) <del>- Fixed URL in `Notifications/resources/views/email.blade.php` ([22ca105](https://github.com/laravel/framework/commit/22ca105c0b1759c95f79e553c1977ffd2a013d05)) <del>- Fixed `hasValidSignature` method when someone send a `null` signature in `UrlGenerator.php` ([#26132](https://github.com/laravel/framework/pull/26132)) <del>- Fixed autocomplete for container in ServiceProvider for cases when someone developed packages ([#26063](https://github.com/laravel/framework/pull/26063)) <del>- Fixed `ColumnDefinition::default` typehint ([#26041](https://github.com/laravel/framework/pull/26041)) <del> <del>### Changed <del>- Define mix as const in `react-stubs/webpack.mix.js` and `vue-stubs/webpack.mix.js` presets ([#26119](https://github.com/laravel/framework/pull/26119)) <del>- Make `assertSessionHasNoErrors` in `TestResponse.php` print the unexpected errors ([#26039](https://github.com/laravel/framework/pull/26039), [e6bdf8a](https://github.com/laravel/framework/commit/e6bdf8af7790db485856ecde0448b353d0cb15ca)) <del>- Replaced the remaining occurrences of `newQuery()` to `newModelQuery()` in UPDATE/DELETE queries. ([#26158](https://github.com/laravel/framework/pull/26158)) <del>- Improved `findOrFail()` exceptions in `BelongsToMany.php` and `HasManyThrough.php` relations ([#26182](https://github.com/laravel/framework/pull/26182)) <del> <del>### Changed realization <del>- Reversed ternary condition in `Arr::wrap` to make it clearer ([#26150](https://github.com/laravel/framework/pull/26150)) <del>- Simplified `formatAction` in `UrlGenerator.php` ([#26121](https://github.com/laravel/framework/pull/26121)) <del>- Simplified `isChainOfObjects` method in `Support/Testing/Fakes/QueueFake.php` ([#26151](https://github.com/laravel/framework/pull/26151)) <del>- Deleted unneeded code ([#26053](https://github.com/laravel/framework/pull/26053), [#26162](https://github.com/laravel/framework/pull/26162), [#26160](https://github.com/laravel/framework/pull/26160), [#26159](https://github.com/laravel/framework/pull/26159), [#26152](https://github.com/laravel/framework/pull/26152)) <del>- Prefer stricter comparison ([#26139](https://github.com/laravel/framework/pull/26139), [#26157](https://github.com/laravel/framework/pull/26157)) <del>- Removed duplicated code from `Router::updateGroupStack` method ([#26206](https://github.com/laravel/framework/pull/26206), [6debff6](https://github.com/laravel/framework/commit/6debff6affba9224c778e32cc3c00e00a66cb9dd)) <del> <del> <del>## [v5.7.9 (2018-10-09)](https://github.com/laravel/framework/compare/v5.7.8...v5.7.9) <del> <del>### Added <del>- Support custom user provider names in generator commands ([#25681](https://github.com/laravel/framework/pull/25681)) <del>- Added 401 Exception view ([#26002](https://github.com/laravel/framework/pull/26002)) <del>- Added `Categorical imperative` quote to `Inspiring.php` ([#25968](https://github.com/laravel/framework/pull/25968)) <del>- Mailable `render` method respects `Mailable@locale` property ([#25990](https://github.com/laravel/framework/pull/25990)) <del>- Added some meta data to the notification mails ([477273c](https://github.com/laravel/framework/commit/477273c72be8b253b6421c69f3e37b5bf4c3a185)) <del>- Added `Macroable` trait to `PendingResourceRegistration` ([#25947](https://github.com/laravel/framework/pull/25947)) <del>- Added `assertSessionDoesntHaveErrors` method to `TestResponse.php` ([#25949](https://github.com/laravel/framework/pull/25949), [3005706](https://github.com/laravel/framework/commit/3005706abb411d1468adbff6627ff26351afe446)) <del>- Enable passing options to custom presets ([#25930](https://github.com/laravel/framework/pull/25930)) <del> <del>### Fixed <del>- Fix missing `illuminate/support` dependency in `illuminate/container` ([#25955](https://github.com/laravel/framework/pull/25955)) <del>- Extend grammar ([#25944](https://github.com/laravel/framework/pull/25944)) <del> <del>### Changed <del>- Improved PSR-11 implementation ([#25870](https://github.com/laravel/framework/pull/25870)) <del>- Changed the sentence of error 403 view from unauthorised to forbidden ([#26002](https://github.com/laravel/framework/pull/26002)) <del>- Revert email lang template changes ([#25963](https://github.com/laravel/framework/pull/25963)) <del>- Added model checking in `assertViewHas` ([#26012](https://github.com/laravel/framework/pull/26012)) <del> <del>### Changed realization <del>- Inline `Arr::pluck()` in `data_get()` ([#25938](https://github.com/laravel/framework/pull/25938)) <del> <del>## [v5.7.8 (2018-10-04)](https://github.com/laravel/framework/compare/v5.7.7...v5.7.8) <del> <del>### Added <del>- Add `--step` to `migrate:fresh` command ([#25897](https://github.com/laravel/framework/pull/25897)) <del>- Allow `destroy` method in `Model` to accept a collection of ids ([#25878](https://github.com/laravel/framework/pull/25878)) <del>- Add AsPivot trait ([#25851](https://github.com/laravel/framework/pull/25851)) <del> <del>### Fixed <del>- Fixed wrap table for sql server ([#25896](https://github.com/laravel/framework/pull/25896)) <del> <del>### Changed <del>- Use "optimize:clear" in "app:name" command ([#25922](https://github.com/laravel/framework/pull/25922)) <del>- Revert of "html string support in translator" ([e626ab3](https://github.com/laravel/framework/commit/e626ab32a4afec90f80641fbcd00e6b79d15cd3a)) <del> <del>### Changed (only realization) <del>- Simplify code for contextual binding ([e2476c1](https://github.com/laravel/framework/commit/e2476c1cdfeffd1c4432ec8dc1f733815f70c000)) <del> <del> <del>## [v5.7.7 (2018-10-02)](https://github.com/laravel/framework/compare/v5.7.6...v5.7.7) <del> <del>### Added <del>- Allow array callables to be passed to Gate::before() ([#25817](https://github.com/laravel/framework/pull/25817)) <del>- Mail recipient and notifiable can set preferred locale ([#25752](https://github.com/laravel/framework/pull/25752)) <del>- Always show seeder info ([#25872](https://github.com/laravel/framework/pull/25872)) <del>- Support JSON UPDATE queries on PostgreSQL ([#25797](https://github.com/laravel/framework/pull/25797)) <del>- Makes sure changing a database field to JSON does not include a collation ([#25741](https://github.com/laravel/framework/pull/25741)) <del>- Added Queued Closures ([#25777](https://github.com/laravel/framework/pull/25777)) <del>- Add the ability to skip algorithm checking ([#25468](https://github.com/laravel/framework/pull/25468), [5fd4b89](https://github.com/laravel/framework/commit/5fd4b899cc42d266fab34ee2d5f92fb47ca34fd0)) <del>- Add queue create payload hook ([3f68cbe](https://github.com/laravel/framework/commit/3f68cbe3df82990c69e34309901fcefefdb65c95)) <del>- Authorize Middleware Accept String Parameters ([#25763](https://github.com/laravel/framework/pull/25763)) <del> <del>### Fixed <del>- Fix `each` method on BelongsToMany relationships ([#25832](https://github.com/laravel/framework/pull/25832)) <del>- Fix prefixed table indexes ([#25867](https://github.com/laravel/framework/pull/25867)) <del>- Fix `be` method in `InteractsWithAuthentication` trait ([#25873](https://github.com/laravel/framework/pull/25873)) <del>- Fixes the error when $resource is null ([#25838](https://github.com/laravel/framework/pull/25838)) <del>- Attach all disk attachments and not only first one in the `Mail/Mailable.php` ([#25793](https://github.com/laravel/framework/pull/25793)) <del>- Fixed: in case if one job throw exception, than we will proceed to next one ([#25820](https://github.com/laravel/framework/pull/25820)) <del> <del>### Changed <del>- Trim model class name when passing in `Authorize.php` middleware ([#25849](https://github.com/laravel/framework/pull/25849)) <del>- Improve JSON UPDATE queries on MySQL ([#25794](https://github.com/laravel/framework/pull/25794)) <del>- Don't print the generated application key ([#25802](https://github.com/laravel/framework/pull/25802)) <del>- Improve "exists" validation with array values ([#25819](https://github.com/laravel/framework/pull/25819)) <del>- Only escape trans parameters ([98046cb](https://github.com/laravel/framework/commit/98046cb0c81b418fb4046ade034f3d33a4172239)) <del>- Added type check for assertExitCode(0) ([#25847](https://github.com/laravel/framework/pull/25847)) <del> <del>### Changed (only realization) <del>- Simplify `save` method `MorphOneOrMany` relation ([#25864](https://github.com/laravel/framework/pull/25864)) <del> <del> <del>## [v5.7.6 (2018-09-25)](https://github.com/laravel/framework/compare/v5.7.5...v5.7.6) <del> <del>### Added <del>- Support MorphTo eager loading with selected columns ([#25662](https://github.com/laravel/framework/pull/25662)) <del>- Added possibility to define a complex condition (overwrite `shouldAddXsrfTokenCookie` method) for add cookie to response in `Middleware/VerifyCsrfToken.php` <del> <del>### Fixed <del>- Fixed tag cache clearing when using Redis ([#25744](https://github.com/laravel/framework/pull/25744)) <del>- Fixed broken email subcopy template escaping ([#25723](https://github.com/laravel/framework/pull/25723)) <del>- Fixed MethodNotAllowedHTTPException on Intended Redirect ([#25739](https://github.com/laravel/framework/pull/25739)) <del> <del>### Changed <del>- Use url() function instead of plain url in `views/illustrated-layout.blade.php` ([25725](https://github.com/laravel/framework/pull/25725)) <del> <del> <del>## [v5.7.5 (2018-09-20)](https://github.com/laravel/framework/compare/v5.7.4...v5.7.5) <del> <del>### Added <del>- Add callback hook for building mailable data in `\Illuminate\Mail\Mailable` ([7dc3d8d](https://github.com/laravel/framework/commit/7dc3d8d35ad8bcd3b18334a44320e3162b9f6dc1)) <del> <del>### Fixed <del>- Make any column searchable with `like` in PostgreSQL ([#25698](https://github.com/laravel/framework/pull/25698)) <del>- Remove trailing newline from hot url in `mix` helper ([#25699](https://github.com/laravel/framework/pull/25699)) <del> <del>### Changed <del>- Revert of "Remove `Hash::check()` for password verification" ([2e78bf4](https://github.com/laravel/framework/commit/2e78bf472832cd68ef7d80c73dbb722a62ee1429)) <del> <del> <del>## [v5.7.4 (2018-09-18)](https://github.com/laravel/framework/compare/v5.7.3...v5.7.4) <del> <del>### Added <del>- Add 'verified' session boolean in `VerifiesEmails::verify` action ([#25638](https://github.com/laravel/framework/pull/25638)) <del>- Add Nelson Mandela to Inspirational Quotes ([#25599](https://github.com/laravel/framework/pull/25599)) <del>- Add `streamedContent` to `TestResponse` class ([#25469](https://github.com/laravel/framework/pull/25469), [b3f583c](https://github.com/laravel/framework/commit/b3f583cd5efbc9e1b9482b00a7c22b00324e936e)) <del> <del>### Fixed <del>- Fix app stub when register route option is set to false ([#25582](https://github.com/laravel/framework/pull/25582)) <del>- Fix artisan PendingCommand run method return value ([#25577](https://github.com/laravel/framework/pull/25577)) <del>- Support custom accessor on `whenPivotLoaded()` ([#25661](https://github.com/laravel/framework/pull/25661)) <del> <del>### Changed <del>- Remove `Hash::check()` for password verification ([#25677](https://github.com/laravel/framework/pull/25677)) <del> <del> <del>## [v5.7.3 (2018-09-11)](https://github.com/laravel/framework/compare/v5.7.2...v5.7.3) <del> <del>### Changed <del>- `__toString` method in `Illuminate/Auth/Access/Response.php` ([#25539](https://github.com/laravel/framework/pull/25539)) <del>- Do not pass the guard instance to the authentication events ([#25568](https://github.com/laravel/framework/pull/25568)) <del>- Call Pending artisan command immediately ([#25574](https://github.com/laravel/framework/pull/25574), [d54ffa5](https://github.com/laravel/framework/commit/d54ffa594b968b6c9a7cf716f5c73758a7d36824)) <del>- Use `request()` method when we called Guzzle ClientInterface ([#25490](https://github.com/laravel/framework/pull/25490)) <del>- Replace all placeholders for comparison rules (`gt`/`gte`/`lt`/`lte`) properly ([#25513](https://github.com/laravel/framework/pull/25513)) <del> <del>### Added <del>- Add `storeOutput` method to `Illuminate/Console/Scheduling/Event.php` ([70a72fc](https://github.com/laravel/framework/commit/70a72fcac9d8852fc1a4ce11eb47842774c11876)) <del>- Add `ensureOutputIsBeingCaptured` method to `Illuminate/Console/Scheduling/Event.php` <del>- Add options for SES Mailer ([#25536](https://github.com/laravel/framework/pull/25536)) <del>- Add Ability to disable register route ([#25556](https://github.com/laravel/framework/pull/25556)) <del> <del>### Fixed <del>- Fix database cache on PostgreSQL ([#25530](https://github.com/laravel/framework/pull/25530)) <del>- Fix bug with invokables in `Illuminate/Console/Scheduling/CallbackEvent.php` ([eaac77b](https://github.com/laravel/framework/commit/eaac77bfb878b49f2ceff4fb09198e437d38683d)) <del>- Stop sending email verification if user already verified ([#25540](https://github.com/laravel/framework/pull/25540)) <del>- Fix `withoutMockingConsoleOutput` in `Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php` ([#25499](https://github.com/laravel/framework/pull/25499)) <del>- Fix DurationLimiter not using Redis connection proxy to call eval command ([#25505](https://github.com/laravel/framework/pull/25505)) <del> <del>### Deprecated <del>- Make `ensureOutputIsBeingCapturedForEmail` method deprecated in `Illuminate/Console/Scheduling/Event.php` <del> <del> <del>## [v5.7.2 (2018-09-06)](https://github.com/laravel/framework/compare/v5.7.1...v5.7.2) <del> <del>### Added <del>- Added `moontoast/math` suggestion to `Support` module ([79edf5c](https://github.com/laravel/framework/commit/79edf5c70c9a54c75e17da62ba3649f24b874e09)) <del>- Send an event when the user's email is verified ([045cbfd](https://github.com/laravel/framework/commit/045cbfd95c611928aef1b877d1a3dc60d5f19580)) <del>- Allow email verification middleware to work with API routes ([0e23b6a](https://github.com/laravel/framework/commit/0e23b6afa4d1d8b440ce7696a23fa770b4f7e5e3)) <del>- Add Builder::whereJsonLength() ([5e33a96](https://github.com/laravel/framework/commit/5e33a96cd5fe9f5bea953a3e07ec827d5f19a9a3), [f149fbd](https://github.com/laravel/framework/commit/f149fbd0fede21fc3a8c0347d1ab9ee858727bb4)) <del>- Pass configuration key parameter to updatePackageArray in Preset ([#25457](https://github.com/laravel/framework/pull/25457)) <del>- Let the WorkCommand specify whether to stop when queue is empty ([2524c5e](https://github.com/laravel/framework/commit/2524c5ee89a0c5e6e4e65c13d5f9945075bb299c)) <del> <del>### Changed <del>- Make email verification scaffolding translatable ([#25473](https://github.com/laravel/framework/pull/25473)) <del>- Do not mock console output by default ([b433970](https://github.com/laravel/framework/commit/b4339702dbdc5f1f55f30f1e6576450f6277e3ae)) <del>- Allow daemon to stop when there is no more jobs in the queue ([157a150](https://github.com/laravel/framework/commit/157a15080b95b26b2ccb0677dceab4964e25f18d)) <del> <del>### Fixed <del>- Do not send email verification if user is already verified ([#25450](https://github.com/laravel/framework/pull/25450)) <del>- Fixed required carbon version ([394f79f](https://github.com/laravel/framework/commit/394f79f9a6651b103f6e065cb4470b4b347239ea)) <del> <del> <del>## [v5.7.1 (2018-09-04)](https://github.com/laravel/framework/compare/v5.7.0...v5.7.1) <del> <del>### Fixed <del>- Fixed an issue with basic auth when no field is defined <del> <del>### Changed <del>- Remove X-UA-Compatible meta tag ([#25442](https://github.com/laravel/framework/pull/25442)) <del>- Added default array value for redis config ([#25443](https://github.com/laravel/framework/pull/25443)) <del> <del>## [v5.7.0 (2018-09-04)](https://github.com/laravel/framework/compare/5.6...v5.7.0) <del> <del>Check the upgrade guide in the [Official Laravel Documentation](https://laravel.com/docs/5.7/upgrade).
1
Javascript
Javascript
fix bug when comparing name lengths
5161d96650b462922354bc1cef0f1d0c248e1533
<ide><path>lib/Chunk.js <ide> class Chunk { <ide> otherChunk._groups.clear(); <ide> <ide> if(this.name && otherChunk.name) { <del> if(this.name.length !== otherChunk.name) <add> if(this.name.length !== otherChunk.name.length) <ide> this.name = this.name.length < otherChunk.name.length ? this.name : otherChunk.name; <ide> else <ide> this.name = this.name < otherChunk.name ? this.name : otherChunk.name;
1
Go
Go
add regression tests
bb241c10e2f124406f00c8e40e00fca67934638a
<ide><path>server_test.go <ide> func TestContainerTagImageDelete(t *testing.T) { <ide> if err := srv.runtime.repositories.Set("utest", "tag1", unitTestImageName, false); err != nil { <ide> t.Fatal(err) <ide> } <del> if err := srv.runtime.repositories.Set("utest/docker", "tag2", unitTestImageName, false); err != nil { <add> if err := srv.runtime.repositories.Set("utest:5000/docker", "tag2", unitTestImageName, false); err != nil { <ide> t.Fatal(err) <ide> } <ide> <ide> func TestContainerTagImageDelete(t *testing.T) { <ide> t.Errorf("Expected %d images, %d found", len(initialImages)+2, len(images)) <ide> } <ide> <del> if _, err := srv.ImageDelete("utest/docker:tag2", true); err != nil { <add> if _, err := srv.ImageDelete("utest:5000/docker:tag2", true); err != nil { <ide> t.Fatal(err) <ide> } <ide>
1
Text
Text
add two tips for speeding the dev builds
36581f1d4e8f2f9d29709daaa25e0236021f0b16
<ide><path>BUILDING.md <ide> file a new issue. <ide> * [Building the documentation](#building-the-documentation) <ide> * [Building a debug build](#building-a-debug-build) <ide> * [Building an ASAN build](#building-an-asan-build) <add> * [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) <ide> * [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) <ide> * [Windows](#windows) <ide> * [Prerequisites](#prerequisites) <ide> $ ./configure --debug --enable-asan && make -j4 <ide> $ make test-only <ide> ``` <ide> <add>#### Speeding up frequent rebuilds when developing <add> <add>If you plan to frequently rebuild Node.js, especially if using several branches, <add>installing `ccache` can help to greatly reduce build times. Set up with: <add>```console <add>$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros <add>$ ccache -o cache_dir=<tmp_dir> <add>$ ccache -o max_size=5.0G <add>$ export CC="ccache gcc" # add to your .profile <add>$ export CXX="ccache g++" # add to your .profile <add>``` <add>This will allow for near-instantaneous rebuilds even when switching branches. <add> <add>When modifying only the JS layer in `lib`, it is possible to externally load it <add>without modifying the executable: <add>```console <add>$ ./configure --node-builtin-modules-path $(pwd) <add>``` <add>The resulting binary won't include any JS files and will try to load them from <add>the specified directory. The JS debugger of Visual Studio Code supports this <add>configuration since the November 2020 version and allows for setting <add>breakpoints. <add> <ide> #### Troubleshooting Unix and macOS builds <ide> <ide> Stale builds can sometimes result in `file not found` errors while building.
1
Ruby
Ruby
reduce method calls
b3ae67dbb91a79f0f58528ba0ba4ffe592db1924
<ide><path>activerecord/lib/active_record/reflection.rb <ide> def source_reflection <ide> end <ide> <ide> def has_inverse? <del> !@options[:inverse_of].nil? <add> @options[:inverse_of] <ide> end <ide> <ide> def inverse_of
1