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
PHP
PHP
use useascallable instead of is_callable
b7c4b1c1acf973b2cc50f1a7c2a7190d91623a06
<ide><path>src/Illuminate/Support/Collection.php <ide> public function contains($key, $value = null) <ide> }); <ide> } <ide> <del> if (is_callable($key)) <add> if ($this->useAsCallable($key)) <ide> { <ide> return ! is_null($this->first($key)); <ide> }
1
PHP
PHP
remove unused variable
8a3810c6b6f4549105341b91485eed748d760768
<ide><path>tests/Auth/AuthEloquentUserProviderTest.php <ide> public function testRetrieveTokenWithBadIdentifierReturnsNull() <ide> public function testRetrievingWithOnlyPasswordCredentialReturnsNull() <ide> { <ide> $provider = $this->getProviderMock(); <del> $mock = m::mock(stdClass::class); <ide> $user = $provider->retrieveByCredentials(['api_password' => 'foo']); <ide> <ide> $this->assertNull($user); <ide><path>tests/Foundation/FoundationApplicationTest.php <ide> public function testEnvPathsAreUsedForCachePathsWhenSpecified() <ide> $_SERVER['APP_ROUTES_CACHE'] = '/absolute/path/routes.php'; <ide> $_SERVER['APP_EVENTS_CACHE'] = '/absolute/path/events.php'; <ide> <del> $ds = DIRECTORY_SEPARATOR; <ide> $this->assertSame('/absolute/path/services.php', $app->getCachedServicesPath()); <ide> $this->assertSame('/absolute/path/packages.php', $app->getCachedPackagesPath()); <ide> $this->assertSame('/absolute/path/config.php', $app->getCachedConfigPath()); <ide><path>tests/Queue/DynamoDbFailedJobProviderTest.php <ide> public function testNullIsReturnedIfJobNotFound() <ide> { <ide> $dynamoDbClient = m::mock(DynamoDbClient::class); <ide> <del> $time = time(); <del> <ide> $dynamoDbClient->shouldReceive('getItem')->once()->with([ <ide> 'TableName' => 'table', <ide> 'Key' => [ <ide> public function testJobsCanBeDeleted() <ide> { <ide> $dynamoDbClient = m::mock(DynamoDbClient::class); <ide> <del> $time = time(); <del> <ide> $dynamoDbClient->shouldReceive('deleteItem')->once()->with([ <ide> 'TableName' => 'table', <ide> 'Key' => [
3
Text
Text
add missing link to missing podspec
f134de532aa3b61c1ff8703a9225480fe6c9f37f
<ide><path>docs/IntegrationWithExistingApps.md <ide> target 'NumberTileGame' do <ide> ] <ide> # Explicitly include Yoga if you are using RN >= 0.42.0 <ide> pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' <add> <add> # Third party deps podspec link <add> pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' <add> pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec' <add> pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' <ide> <ide> end <ide> ``` <ide> target 'swift-2048' do <ide> ] <ide> # Explicitly include Yoga if you are using RN >= 0.42.0 <ide> pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga" <add> <add> # Third party deps podspec link <add> pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' <add> pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec' <add> pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' <ide> <ide> end <ide> ```
1
Javascript
Javascript
keep bound view classes in separate modules
00258675329766e7be1712fc49dd976ed5028e6e
<ide><path>packages/ember-htmlbars/lib/helpers/if_unless.js <ide> import shouldDisplay from "ember-views/streams/should_display"; <ide> import { read } from "ember-metal/streams/utils"; <ide> import { get } from "ember-metal/property_get"; <ide> import { isStream } from "ember-metal/streams/utils"; <del>import { BoundIfView } from "ember-views/views/bound_view"; <add>import BoundIfView from "ember-views/views/bound_if_view"; <ide> import emptyTemplate from "ember-htmlbars/templates/empty"; <ide> <ide> <ide><path>packages/ember-htmlbars/lib/helpers/partial.js <ide> import { get } from "ember-metal/property_get"; <ide> import { isStream } from "ember-metal/streams/utils"; <del>import { BoundPartialView } from "ember-views/views/bound_view"; <add>import BoundPartialView from "ember-views/views/bound_partial_view"; <ide> import lookupPartial from "ember-views/system/lookup_partial"; <ide> import emptyTemplate from "ember-htmlbars/templates/empty"; <ide> <ide><path>packages/ember-views/lib/mixins/normalized_rerender_if_needed.js <add>/** <add>@module ember <add>@submodule ember-views <add>*/ <add> <add>import { get } from "ember-metal/property_get"; <add>import { Mixin } from 'ember-metal/mixin'; <add>import merge from "ember-metal/merge"; <add>import { <add> cloneStates, <add> states as viewStates <add>} from "ember-views/views/states"; <add> <add>var states = cloneStates(viewStates); <add> <add>merge(states._default, { <add> rerenderIfNeeded: function() { return this; } <add>}); <add> <add>merge(states.inDOM, { <add> rerenderIfNeeded: function(view) { <add> if (view.normalizedValue() !== view._lastNormalizedValue) { <add> view.rerender(); <add> } <add> } <add>}); <add> <add>export default Mixin.create({ <add> _states: states, <add> <add> normalizedValue: function() { <add> var value = this.lazyValue.value(); <add> var valueNormalizer = get(this, 'valueNormalizerFunc'); <add> return valueNormalizer ? valueNormalizer(value) : value; <add> }, <add> <add> rerenderIfNeeded: function() { <add> this.currentState.rerenderIfNeeded(this); <add> }, <add>}); <ide><path>packages/ember-views/lib/views/bound_if_view.js <add>import { set } from "ember-metal/property_set"; <add>import run from 'ember-metal/run_loop'; <add>import _MetamorphView from "ember-views/views/metamorph_view"; <add>import NormalizedRerenderIfNeededSupport from "ember-views/mixins/normalized_rerender_if_needed"; <add> <add>export default _MetamorphView.extend(NormalizedRerenderIfNeededSupport, { <add> init: function() { <add> this._super(); <add> <add> var self = this; <add> <add> this.conditionStream.subscribe(this._wrapAsScheduled(function() { <add> run.scheduleOnce('render', self, 'rerenderIfNeeded'); <add> })); <add> }, <add> <add> normalizedValue: function() { <add> return this.conditionStream.value(); <add> }, <add> <add> render: function(buffer) { <add> var result = this.conditionStream.value(); <add> this._lastNormalizedValue = result; <add> <add> if (result) { <add> set(this, 'template', this.truthyTemplate); <add> } else { <add> set(this, 'template', this.falsyTemplate); <add> } <add> <add> return this._super(buffer); <add> } <add>}); <ide><path>packages/ember-views/lib/views/bound_partial_view.js <add>/** <add>@module ember <add>@submodule ember-views <add>*/ <add> <add>import { set } from "ember-metal/property_set"; <add>import run from 'ember-metal/run_loop'; <add>import _MetamorphView from "ember-views/views/metamorph_view"; <add>import NormalizedRerenderIfNeededSupport from "ember-views/mixins/normalized_rerender_if_needed"; <add>import lookupPartial from "ember-views/system/lookup_partial"; <add>import run from 'ember-metal/run_loop'; <add> <add>export default _MetamorphView.extend(NormalizedRerenderIfNeededSupport, { <add> init: function() { <add> this._super(); <add> <add> var self = this; <add> <add> this.templateNameStream.subscribe(this._wrapAsScheduled(function() { <add> run.scheduleOnce('render', self, 'rerenderIfNeeded'); <add> })); <add> }, <add> <add> normalizedValue: function() { <add> return this.templateNameStream.value(); <add> }, <add> <add> render: function(buffer) { <add> var templateName = this.normalizedValue(); <add> this._lastNormalizedValue = templateName; <add> <add> if (templateName) { <add> set(this, 'template', lookupPartial(this, templateName)); <add> } else { <add> set(this, 'template', this.emptyTemplate); <add> } <add> <add> return this._super(buffer); <add> } <add>}); <ide><path>packages/ember-views/lib/views/bound_view.js <ide> <ide> import { get } from "ember-metal/property_get"; <ide> import { set } from "ember-metal/property_set"; <del>import merge from "ember-metal/merge"; <del>import { <del> cloneStates, <del> states as viewStates <del>} from "ember-views/views/states"; <ide> import _MetamorphView from "ember-views/views/metamorph_view"; <del>import lookupPartial from "ember-views/system/lookup_partial"; <del>import { Mixin } from 'ember-metal/mixin'; <del>import run from 'ember-metal/run_loop'; <del> <del>function K() { return this; } <del> <del>var states = cloneStates(viewStates); <del> <del>merge(states._default, { <del> rerenderIfNeeded: K <del>}); <del> <del>merge(states.inDOM, { <del> rerenderIfNeeded: function(view) { <del> if (view.normalizedValue() !== view._lastNormalizedValue) { <del> view.rerender(); <del> } <del> } <del>}); <del> <del>var NormalizedRerenderIfNeededSupport = Mixin.create({ <del> _states: states, <del> <del> normalizedValue: function() { <del> var value = this.lazyValue.value(); <del> var valueNormalizer = get(this, 'valueNormalizerFunc'); <del> return valueNormalizer ? valueNormalizer(value) : value; <del> }, <del> <del> rerenderIfNeeded: function() { <del> this.currentState.rerenderIfNeeded(this); <del> }, <del>}); <add>import NormalizedRerenderIfNeededSupport from "ember-views/mixins/normalized_rerender_if_needed"; <ide> <ide> /** <ide> `Ember._BoundView` is a private view created by the Handlebars <ide> var NormalizedRerenderIfNeededSupport = Mixin.create({ <ide> @extends Ember._MetamorphView <ide> @private <ide> */ <del>var BoundView = _MetamorphView.extend(NormalizedRerenderIfNeededSupport, { <add>export default _MetamorphView.extend(NormalizedRerenderIfNeededSupport, { <ide> instrumentName: 'bound', <ide> <ide> /** <ide> var BoundView = _MetamorphView.extend(NormalizedRerenderIfNeededSupport, { <ide> return this._super(buffer); <ide> } <ide> }); <del> <del>var BoundIfView = _MetamorphView.extend(NormalizedRerenderIfNeededSupport, { <del> init: function() { <del> this._super(); <del> <del> var self = this; <del> <del> this.conditionStream.subscribe(this._wrapAsScheduled(function() { <del> run.scheduleOnce('render', self, 'rerenderIfNeeded'); <del> })); <del> }, <del> <del> normalizedValue: function() { <del> return this.conditionStream.value(); <del> }, <del> <del> render: function(buffer) { <del> var result = this.conditionStream.value(); <del> this._lastNormalizedValue = result; <del> <del> if (result) { <del> set(this, 'template', this.truthyTemplate); <del> } else { <del> set(this, 'template', this.falsyTemplate); <del> } <del> <del> return this._super(buffer); <del> } <del>}); <del> <del>var BoundPartialView = _MetamorphView.extend(NormalizedRerenderIfNeededSupport, { <del> init: function() { <del> this._super(); <del> <del> var self = this; <del> <del> this.templateNameStream.subscribe(this._wrapAsScheduled(function() { <del> run.scheduleOnce('render', self, 'rerenderIfNeeded'); <del> })); <del> }, <del> <del> normalizedValue: function() { <del> return this.templateNameStream.value(); <del> }, <del> <del> render: function(buffer) { <del> var templateName = this.normalizedValue(); <del> this._lastNormalizedValue = templateName; <del> <del> if (templateName) { <del> set(this, 'template', lookupPartial(this, templateName)); <del> } else { <del> set(this, 'template', this.emptyTemplate); <del> } <del> <del> return this._super(buffer); <del> } <del>}); <del> <del>export default BoundView; <del>export { <del> BoundIfView, <del> BoundPartialView <del>};
6
Go
Go
add simple tool to test the deviceset commands
2b1dc8a8a3b99e6edbdf2cc71bf5461d81b9c354
<ide><path>devmapper/docker-device-tool/device_tool.go <add>package main <add> <add>import ( <add> "fmt" <add> "github.com/dotcloud/docker/devmapper" <add> "os" <add>) <add> <add>func usage() { <add> fmt.Printf("Usage: %s [snap new-id base-id] | [remove id] | [mount id mountpoint]\n", os.Args[0]) <add> os.Exit(1) <add>} <add> <add>func main() { <add> devices := devmapper.NewDeviceSetDM("/var/lib/docker") <add> <add> if len(os.Args) < 2 { <add> usage() <add> } <add> <add> cmd := os.Args[1] <add> if cmd == "snap" { <add> if len(os.Args) < 4 { <add> usage() <add> } <add> <add> err := devices.AddDevice(os.Args[2], os.Args[3]) <add> if err != nil { <add> fmt.Println("Can't create snap device: ", err) <add> os.Exit(1) <add> } <add> } else if cmd == "remove" { <add> if len(os.Args) < 3 { <add> usage() <add> } <add> <add> err := devices.RemoveDevice(os.Args[2]) <add> if err != nil { <add> fmt.Println("Can't remove device: ", err) <add> os.Exit(1) <add> } <add> } else if cmd == "mount" { <add> if len(os.Args) < 4 { <add> usage() <add> } <add> <add> err := devices.MountDevice(os.Args[2], os.Args[3]) <add> if err != nil { <add> fmt.Println("Can't create snap device: ", err) <add> os.Exit(1) <add> } <add> } else { <add> fmt.Printf("Unknown command %s\n", cmd) <add> if len(os.Args) < 4 { <add> usage() <add> } <add> <add> os.Exit(1) <add> } <add> <add> return <add>}
1
Java
Java
avoid warnings in tests
dedbbf0a7908c33a27e717ff3ffbc46848ff9b02
<ide><path>spring-context/src/test/java/org/springframework/context/annotation/Gh29105Tests.java <ide> * <ide> * @author Stephane Nicoll <ide> */ <del>public class Gh29105Tests { <add>class Gh29105Tests { <ide> <ide> @Test <ide> void beanProviderWithParentContextReuseOrder() { <ide> void beanProviderWithParentContextReuseOrder() { <ide> List<Class<?>> orderedTypes = child.getBeanProvider(MyService.class) <ide> .orderedStream().map(Object::getClass).collect(Collectors.toList()); <ide> assertThat(orderedTypes).containsExactly(CustomService.class, DefaultService.class); <add> child.close(); <ide> } <ide> <ide> <ide> DefaultService defaultService() { <ide> } <ide> <ide> } <add> <ide> }
1
Java
Java
delete unused imports in spring-test
1d57a15e40d0e9aef3b5421dceb3209f1710b754
<ide><path>spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/AsyncTests.java <ide> <ide> import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.asyncDispatch; <ide> import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; <del>import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; <ide> import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; <ide> import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.request; <ide> import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; <ide> import java.util.concurrent.CopyOnWriteArrayList; <ide> <ide> import org.junit.Before; <del>import org.junit.Ignore; <ide> import org.junit.Test; <ide> import org.springframework.http.MediaType; <ide> import org.springframework.stereotype.Controller;
1
Javascript
Javascript
rewrite mergekeysets to be o(n) instead of o(n^3)
1efb14bcf6a5702febefdce5bcd34c70a44d5fce
<ide><path>src/addons/transitions/ReactTransitionKeySet.js <ide> <ide> var ReactChildren = require('ReactChildren'); <ide> <del>var MERGE_KEY_SETS_TAIL_SENTINEL = {}; <del> <ide> var ReactTransitionKeySet = { <ide> /** <ide> * Given `this.props.children`, return an object mapping key to child. Just <ide> var ReactTransitionKeySet = { <ide> prev = prev || {}; <ide> next = next || {}; <ide> <del> var keySet = {}; <del> var prevKeys = Object.keys(prev).concat([MERGE_KEY_SETS_TAIL_SENTINEL]); <del> var nextKeys = Object.keys(next).concat([MERGE_KEY_SETS_TAIL_SENTINEL]); <del> var i; <del> for (i = 0; i < prevKeys.length - 1; i++) { <del> var prevKey = prevKeys[i]; <add> // For each key of `next`, the list of keys to insert before that key in <add> // the combined list <add> var nextKeysPending = {}; <add> <add> var pendingKeys = []; <add> for (var prevKey in prev) { <ide> if (next[prevKey]) { <del> continue; <add> if (pendingKeys.length) { <add> nextKeysPending[prevKey] = pendingKeys; <add> pendingKeys = []; <add> } <add> } else { <add> pendingKeys.push(prevKey); <ide> } <add> } <ide> <del> // This key is not in the new set. Place it in our <del> // best guess where it should go. We do this by searching <del> // for a key after the current one in prevKeys that is <del> // still in nextKeys, and inserting right before it. <del> // I know this is O(n^2), but this is not a particularly <del> // hot code path. <del> var insertPos = -1; <del> <del> for (var j = i + 1; j < prevKeys.length; j++) { <del> insertPos = nextKeys.indexOf(prevKeys[j]); <del> if (insertPos >= 0) { <del> break; <add> var i; <add> var keySet = {}; <add> for (var nextKey in next) { <add> if (nextKeysPending[nextKey]) { <add> for (i = 0; i < nextKeysPending[nextKey].length; i++) { <add> keySet[nextKeysPending[nextKey][i]] = true; <ide> } <ide> } <del> <del> // Insert before insertPos <del> nextKeys.splice(insertPos, 0, prevKey); <add> keySet[nextKey] = true; <ide> } <ide> <del> for (i = 0; i < nextKeys.length - 1; i++) { <del> keySet[nextKeys[i]] = true; <add> // Finally, add the keys which didn't appear before any key in `next` <add> for (i = 0; i < pendingKeys.length; i++) { <add> keySet[pendingKeys[i]] = true; <ide> } <ide> <ide> return keySet;
1
Ruby
Ruby
remove explicit self
ac687d3b5f3654d8eaea8d4b8fc86905ef0a9f36
<ide><path>Library/Homebrew/tab.rb <ide> def self.for_keg keg <ide> path = keg.join(FILENAME) <ide> <ide> if path.exist? <del> self.from_file(path) <add> from_file(path) <ide> else <del> self.dummy_tab <add> dummy_tab <ide> end <ide> end <ide>
1
Text
Text
add gibson fahnestock to tsc
049f7d8af7212afee936363ed9cb900292da80a4
<ide><path>README.md <ide> For more information about the governance of the Node.js project, see <ide> **Franziska Hinkelmann** &lt;franziska.hinkelmann@gmail.com&gt; (she/her) <ide> * [Fishrock123](https://github.com/Fishrock123) - <ide> **Jeremiah Senkpiel** &lt;fishrock123@rocketmail.com&gt; <add>* [gibfahn](https://github.com/gibfahn) - <add>**Gibson Fahnestock** &lt;gibfahn@gmail.com&gt; (he/him) <ide> * [indutny](https://github.com/indutny) - <ide> **Fedor Indutny** &lt;fedor.indutny@gmail.com&gt; <ide> * [jasnell](https://github.com/jasnell) -
1
Python
Python
remember changes from remote control commands
8d76a7b968185de71d85c24e3338b1b0f5d781ab
<ide><path>celery/worker/consumer.py <ide> def __init__(self, c, send_events=None, **kwargs): <ide> c.event_dispatcher = None <ide> <ide> def start(self, c): <del> # Flush events sent while connection was down. <add> # flush events sent while connection was down. <ide> prev = c.event_dispatcher <ide> dis = c.event_dispatcher = c.app.events.Dispatcher( <ide> c.connect(), hostname=c.hostname, <ide> def start(self, c): <ide> <ide> def stop(self, c): <ide> if c.event_dispatcher: <add> # remember changes from remote control commands: <add> self.groups = c.event_dispatcher.groups <add> <add> # close custom connection <ide> if c.event_dispatcher.connection: <ide> ignore_errors(c, c.event_dispatcher.connection.close) <ide> ignore_errors(c, c.event_dispatcher.close)
1
Text
Text
remove end of line whitespace from bb87c16
a5034444299412c96cc286cf84a15077c8be425e
<ide><path>guides/source/getting_started.md <ide> styling for it afterwards. <ide> <ide> ### Laying down the ground work <ide> <del>Firstly, you need a place within the application to create a new article. A <del>great place for that would be at `/articles/new`. With the route already <del>defined, requests can now be made to `/articles/new` in the application. <del>Navigate to <http://localhost:3000/articles/new> and you'll see a routing <add>Firstly, you need a place within the application to create a new article. A <add>great place for that would be at `/articles/new`. With the route already <add>defined, requests can now be made to `/articles/new` in the application. <add>Navigate to <http://localhost:3000/articles/new> and you'll see a routing <ide> error: <ide> <ide> ![Another routing error, uninitialized constant ArticlesController](images/getting_started/routing_error_no_controller.png)
1
Javascript
Javascript
fix optimization bailout for hmr dependencies
b58393fce05c39329428bb5547451edfbd10cded
<ide><path>lib/HotModuleReplacementPlugin.js <ide> const ModuleHotDeclineDependency = require("./dependencies/ModuleHotDeclineDepen <ide> const HotModuleReplacementRuntimeModule = require("./hmr/HotModuleReplacementRuntimeModule"); <ide> const JavascriptParser = require("./javascript/JavascriptParser"); <ide> const { <del> evaluateToIdentifier, <del> evaluateToString, <del> toConstantDependency <add> evaluateToIdentifier <ide> } = require("./javascript/JavascriptParserHelpers"); <ide> const { find } = require("./util/SetHelpers"); <ide> const TupleSet = require("./util/TupleSet"); <ide> class HotModuleReplacementPlugin { <ide> ); <ide> dep.loc = expr.loc; <ide> module.addPresentationalDependency(dep); <add> module.buildInfo.moduleConcatenationBailout = "Hot Module Replacement"; <ide> if (expr.arguments.length >= 1) { <ide> const arg = parser.evaluateExpression(expr.arguments[0]); <ide> let params = []; <ide> class HotModuleReplacementPlugin { <ide> ); <ide> dep.loc = expr.loc; <ide> module.addPresentationalDependency(dep); <add> module.buildInfo.moduleConcatenationBailout = "Hot Module Replacement"; <ide> if (expr.arguments.length === 1) { <ide> const arg = parser.evaluateExpression(expr.arguments[0]); <ide> let params = []; <ide> class HotModuleReplacementPlugin { <ide> ); <ide> dep.loc = expr.loc; <ide> module.addPresentationalDependency(dep); <add> module.buildInfo.moduleConcatenationBailout = "Hot Module Replacement"; <ide> return true; <ide> }; <ide> <ide> class HotModuleReplacementPlugin { <ide> .tap("HotModuleReplacementPlugin", createHMRExpressionHandler(parser)); <ide> }; <ide> <del> const applyWebpackHash = parser => { <del> parser.hooks.expression <del> .for("__webpack_hash__") <del> .tap( <del> "HotModuleReplacementPlugin", <del> toConstantDependency(parser, `${RuntimeGlobals.getFullHash}()`, [ <del> RuntimeGlobals.getFullHash <del> ]) <del> ); <del> parser.hooks.evaluateTypeof <del> .for("__webpack_hash__") <del> .tap("HotModuleReplacementPlugin", evaluateToString("string")); <del> }; <del> <ide> compiler.hooks.compilation.tap( <ide> "HotModuleReplacementPlugin", <ide> (compilation, { normalModuleFactory }) => { <ide> class HotModuleReplacementPlugin { <ide> normalModuleFactory.hooks.parser <ide> .for("javascript/auto") <ide> .tap("HotModuleReplacementPlugin", parser => { <del> applyWebpackHash(parser); <ide> applyModuleHot(parser); <ide> applyImportMetaHot(parser); <ide> }); <ide> normalModuleFactory.hooks.parser <ide> .for("javascript/dynamic") <ide> .tap("HotModuleReplacementPlugin", parser => { <del> applyWebpackHash(parser); <ide> applyModuleHot(parser); <ide> }); <ide> normalModuleFactory.hooks.parser <ide> .for("javascript/esm") <ide> .tap("HotModuleReplacementPlugin", parser => { <del> applyWebpackHash(parser); <ide> applyImportMetaHot(parser); <ide> }); <ide> <ide><path>lib/optimize/ModuleConcatenationPlugin.js <ide> const NormalModule = require("../NormalModule"); <ide> const { STAGE_DEFAULT } = require("../OptimizationStages"); <ide> const HarmonyCompatibilityDependency = require("../dependencies/HarmonyCompatibilityDependency"); <ide> const HarmonyImportDependency = require("../dependencies/HarmonyImportDependency"); <del>const ModuleHotAcceptDependency = require("../dependencies/ModuleHotAcceptDependency"); <del>const ModuleHotDeclineDependency = require("../dependencies/ModuleHotDeclineDependency"); <ide> const StackedMap = require("../util/StackedMap"); <ide> const { compareModulesByIdentifier } = require("../util/comparators"); <ide> const { intersectRuntime, mergeRuntimeOwned } = require("../util/runtime"); <ide> class ModuleConcatenationPlugin { <ide> continue; <ide> } <ide> <del> // Hot Module Replacement need it's own module to work correctly <del> if ( <del> module.dependencies.some( <del> dep => <del> dep instanceof ModuleHotAcceptDependency || <del> dep instanceof ModuleHotDeclineDependency <del> ) <del> ) { <del> setBailoutReason(module, "Module uses Hot Module Replacement"); <del> continue; <del> } <del> <ide> // Module must be in any chunk (we don't want to do useless work) <ide> if (chunkGraph.getNumberOfModuleChunks(module) === 0) { <ide> setBailoutReason(module, "Module is not in any chunk");
2
Javascript
Javascript
use plain ascii for license
94f4c176ee76b6615a1efd1df4d9ecb308eac142
<ide><path>generators/license.js <ide> // ========================================================================== <ide> // Project: Ember - JavaScript Application Framework <del>// Copyright: ©2011-2013 Tilde Inc. and contributors <del>// Portions ©2006-2011 Strobe Inc. <del>// Portions ©2008-2011 Apple Inc. All rights reserved. <add>// Copyright: Copyright 2011-2013 Tilde Inc. and contributors <add>// Portions Copyright 2006-2011 Strobe Inc. <add>// Portions Copyright 2008-2011 Apple Inc. All rights reserved. <ide> // License: Licensed under MIT license <ide> // See https://raw.github.com/emberjs/ember.js/master/LICENSE <ide> // ==========================================================================
1
Ruby
Ruby
rearrange npm release process again
71df60e921a784fb01729e98fa9636a4b6862d72
<ide><path>tasks/release.rb <ide> <ide> directory "pkg" <ide> <add># This "npm-ifies" the current version number <add># With npm, versions such as "5.0.0.rc1" or "5.0.0.beta1.1" are not compliant with its <add># versioning system, so they must be transformed to "5.0.0-rc1" and "5.0.0-beta1-1" respectively. <add> <add># "5.0.1" --> "5.0.1" <add># "5.0.1.1" --> "5.0.1-1" * <add># "5.0.0.rc1" --> "5.0.0-rc1" <add># <add># * This makes it a prerelease. That's bad, but we haven't come up with <add># a better solution at the moment. <add>npm_version = version.gsub(/\./).with_index { |s, i| i >= 2 ? "-" : s } <add> <ide> (FRAMEWORKS + ["rails"]).each do |framework| <ide> namespace framework do <ide> gem = "pkg/#{framework}-#{version}.gem" <ide> raise "Could not insert PRE in #{file}" unless $1 <ide> <ide> File.open(file, "w") { |f| f.write ruby } <add> <add> require "json" <add> if File.exist?("#{framework}/package.json") && JSON.parse(File.read("#{framework}/package.json"))["version"] != npm_version <add> Dir.chdir("#{framework}") do <add> if sh "which npm" <add> sh "npm version #{npm_version} --no-git-tag-version" <add> else <add> raise "You must have npm installed to release Rails." <add> end <add> end <add> end <ide> end <ide> <ide> task gem => %w(update_versions pkg) do <ide> task push: :build do <ide> sh "gem push #{gem}" <ide> <del> # When running the release task we usually run build first to check that the gem works properly. <del> # NPM will refuse to publish or rebuild the gem if the version is changed when the Rails gem <del> # versions are changed. This then causes the gem push to fail. Because of this we need to update <del> # the version and publish at the same time. <ide> if File.exist?("#{framework}/package.json") <ide> Dir.chdir("#{framework}") do <del> # This "npm-ifies" the current version <del> # With npm, versions such as "5.0.0.rc1" or "5.0.0.beta1.1" are not compliant with its <del> # versioning system, so they must be transformed to "5.0.0-rc1" and "5.0.0-beta1-1" respectively. <del> <del> # In essence, the code below runs through all "."s that appear in the version, <del> # and checks to see if their index in the version string is greater than or equal to 2, <del> # and if so, it will change the "." to a "-". <del> <del> # Sample version transformations: <del> # irb(main):001:0> version = "5.0.1.1" <del> # => "5.0.1.1" <del> # irb(main):002:0> version.gsub(/\./).with_index { |s, i| i >= 2 ? '-' : s } <del> # => "5.0.1-1" <del> # irb(main):003:0> version = "5.0.0.rc1" <del> # => "5.0.0.rc1" <del> # irb(main):004:0> version.gsub(/\./).with_index { |s, i| i >= 2 ? '-' : s } <del> # => "5.0.0-rc1" <del> npm_version = version.gsub(/\./).with_index { |s, i| i >= 2 ? "-" : s } <del> <del> # Check if npm is installed, and raise an error if not <del> if sh "which npm" <del> sh "npm version #{npm_version} --no-git-tag-version" <del> sh "npm publish" <del> else <del> raise "You must have npm installed to release Rails." <del> end <add> npm_tag = version =~ /[a-z]/ ? "pre" : "latest" <add> sh "npm publish --tag #{npm_tag}" <ide> end <ide> end <ide> end <ide> (FRAMEWORKS + ["guides"]).each do |fw| <ide> require "date" <ide> fname = File.join fw, "CHANGELOG.md" <add> current_contents = File.read(fname) <ide> <del> header = "## Rails #{version} (#{Date.today.strftime('%B %d, %Y')}) ##\n\n* No changes.\n\n\n" <del> contents = header + File.read(fname) <add> header = "## Rails #{version} (#{Date.today.strftime('%B %d, %Y')}) ##\n\n" <add> header << "* No changes.\n\n\n" if current_contents =~ /\A##/ <add> contents = header + current_contents <ide> File.open(fname, "wb") { |f| f.write contents } <ide> end <ide> end <ide> task push: FRAMEWORKS.map { |f| "#{f}:push" } + ["rails:push"] <ide> <ide> task :ensure_clean_state do <del> unless `git status -s | grep -v 'RAILS_VERSION\\|CHANGELOG\\|Gemfile.lock'`.strip.empty? <add> unless `git status -s | grep -v 'RAILS_VERSION\\|CHANGELOG\\|Gemfile.lock\\|package.json\\|version.rb'`.strip.empty? <ide> abort "[ABORTING] `git status` reports a dirty tree. Make sure all changes are committed" <ide> end <ide> <ide> end <ide> <ide> task :commit do <del> File.open("pkg/commit_message.txt", "w") do |f| <del> f.puts "# Preparing for #{version} release\n" <del> f.puts <del> f.puts "# UNCOMMENT THE LINE ABOVE TO APPROVE THIS COMMIT" <del> end <add> unless `git status -s`.strip.empty? <add> File.open("pkg/commit_message.txt", "w") do |f| <add> f.puts "# Preparing for #{version} release\n" <add> f.puts <add> f.puts "# UNCOMMENT THE LINE ABOVE TO APPROVE THIS COMMIT" <add> end <ide> <del> sh "git add . && git commit --verbose --template=pkg/commit_message.txt" <del> rm_f "pkg/commit_message.txt" <add> sh "git add . && git commit --verbose --template=pkg/commit_message.txt" <add> rm_f "pkg/commit_message.txt" <add> end <ide> end <ide> <ide> task :tag do <ide> sh "git tag -s -m '#{tag} release' #{tag}" <ide> sh "git push --tags" <ide> end <ide> <del> task prep_release: %w(ensure_clean_state build) <add> task prep_release: %w(ensure_clean_state build bundle commit) <ide> <del> task release: %w(ensure_clean_state build bundle commit tag push) <add> task release: %w(prep_release tag push) <ide> end <ide> <ide> task :announce do
1
PHP
PHP
update debugger to reflect correct file name
9a4efafcd7bafc89ac2f4997c4e0113f9e578bd3
<ide><path>src/Error/Debugger.php <ide> public static function checkSecurityKeys(): void <ide> $salt = Security::getSalt(); <ide> if ($salt === '__SALT__' || strlen($salt) < 32) { <ide> trigger_error( <del> 'Please change the value of `Security.salt` in `ROOT/config/app.php` ' . <add> 'Please change the value of `Security.salt` in `ROOT/config/app_local.php` ' . <ide> 'to a random value of at least 32 characters.', <ide> E_USER_NOTICE <ide> );
1
Python
Python
fix mypy issues in ``airflow/jobs``
2d092021d7749e985062fb94f90c5a6415022d62
<ide><path>airflow/jobs/base_job.py <ide> from airflow.configuration import conf <ide> from airflow.exceptions import AirflowException <ide> from airflow.executors.executor_loader import ExecutorLoader <del>from airflow.models import DagRun <ide> from airflow.models.base import ID_LEN, Base <add>from airflow.models.dagrun import DagRun <ide> from airflow.models.taskinstance import TaskInstance <ide> from airflow.stats import Stats <ide> from airflow.utils import timezone
1
Go
Go
fix typo in api/types/time/timestamp.go
2859ce6a577a9eac2c1610b76c156a5eb06cee83
<ide><path>api/types/time/timestamp.go <ide> func ParseTimestamps(value string, def int64) (int64, int64, error) { <ide> if err != nil { <ide> return s, n, err <ide> } <del> // should already be in nanoseconds but just in case convert n to nanoseonds <add> // should already be in nanoseconds but just in case convert n to nanoseconds <ide> n = int64(float64(n) * math.Pow(float64(10), float64(9-len(sa[1])))) <ide> return s, n, nil <ide> }
1
Java
Java
add html rendering integration test
971ca6beb8be8a12cc3e9197f5b46d78ad89f3c6
<ide><path>spring-web-reactive/src/test/java/org/springframework/web/reactive/method/annotation/RequestMappingIntegrationTests.java <ide> import java.nio.ByteBuffer; <ide> import java.util.ArrayList; <ide> import java.util.Arrays; <add>import java.util.Collections; <ide> import java.util.List; <ide> import java.util.concurrent.CompletableFuture; <ide> <ide> import org.springframework.context.annotation.Configuration; <ide> import org.springframework.core.ParameterizedTypeReference; <ide> import org.springframework.core.ResolvableType; <add>import org.springframework.core.codec.Encoder; <ide> import org.springframework.core.codec.support.ByteBufferEncoder; <ide> import org.springframework.core.codec.support.JacksonJsonEncoder; <ide> import org.springframework.core.codec.support.JsonObjectEncoder; <ide> import org.springframework.http.ResponseEntity; <ide> import org.springframework.http.server.reactive.AbstractHttpHandlerIntegrationTests; <ide> import org.springframework.http.server.reactive.HttpHandler; <add>import org.springframework.stereotype.Controller; <add>import org.springframework.ui.Model; <ide> import org.springframework.web.bind.annotation.ExceptionHandler; <ide> import org.springframework.web.bind.annotation.RequestBody; <ide> import org.springframework.web.bind.annotation.RequestMapping; <ide> import org.springframework.web.bind.annotation.RequestParam; <ide> import org.springframework.web.bind.annotation.RestController; <ide> import org.springframework.web.client.RestTemplate; <ide> import org.springframework.web.reactive.DispatcherHandler; <add>import org.springframework.web.reactive.ViewResolver; <ide> import org.springframework.web.reactive.handler.SimpleHandlerResultHandler; <add>import org.springframework.web.reactive.view.ViewResolverResultHandler; <add>import org.springframework.web.reactive.view.freemarker.FreeMarkerConfigurer; <add>import org.springframework.web.reactive.view.freemarker.FreeMarkerViewResolver; <ide> import org.springframework.web.server.adapter.WebHttpHandlerBuilder; <ide> <ide> import static org.junit.Assert.assertArrayEquals; <ide> public void observableCreate() throws Exception { <ide> create("http://localhost:" + this.port + "/observable-create"); <ide> } <ide> <add> @Test <add> public void html() throws Exception { <add> <add> RestTemplate restTemplate = new RestTemplate(); <add> <add> URI url = new URI("http://localhost:" + port + "/html?name=Jason"); <add> RequestEntity<Void> request = RequestEntity.get(url).accept(MediaType.TEXT_HTML).build(); <add> ResponseEntity<String> response = restTemplate.exchange(request, String.class); <add> <add> assertEquals("<html><body>Hello: Jason!</body></html>", response.getBody()); <add> } <add> <ide> <ide> private void serializeAsPojo(String requestUrl) throws Exception { <ide> RestTemplate restTemplate = new RestTemplate(); <ide> private void create(String requestUrl) throws Exception { <ide> ResponseEntity<Void> response = restTemplate.exchange(request, Void.class); <ide> <ide> assertEquals(HttpStatus.OK, response.getStatusCode()); <del> assertEquals(2, this.wac.getBean(TestController.class).persons.size()); <add> assertEquals(2, this.wac.getBean(TestRestController.class).persons.size()); <ide> } <ide> <ide> <ide> @Configuration <ide> @SuppressWarnings("unused") <ide> static class FrameworkConfig { <ide> <add> private DataBufferAllocator allocator = new DefaultDataBufferAllocator(); <add> <add> <ide> @Bean <ide> public RequestMappingHandlerMapping handlerMapping() { <ide> return new RequestMappingHandlerMapping(); <ide> public ConversionService conversionService() { <ide> <ide> @Bean <ide> public ResponseBodyResultHandler responseBodyResultHandler() { <del> DataBufferAllocator allocator = new DefaultDataBufferAllocator(); <del> return new ResponseBodyResultHandler(Arrays.asList( <del> new ByteBufferEncoder(allocator), new StringEncoder(allocator), <del> new JacksonJsonEncoder(allocator, new JsonObjectEncoder(allocator))), <del> conversionService()); <add> List<Encoder<?>> encoders = Arrays.asList( <add> new ByteBufferEncoder(this.allocator), new StringEncoder(this.allocator), <add> new JacksonJsonEncoder(this.allocator, new JsonObjectEncoder(this.allocator))); <add> ResponseBodyResultHandler resultHandler = new ResponseBodyResultHandler(encoders, conversionService()); <add> resultHandler.setOrder(1); <add> return resultHandler; <ide> } <ide> <ide> @Bean <ide> public SimpleHandlerResultHandler simpleHandlerResultHandler() { <del> return new SimpleHandlerResultHandler(conversionService()); <add> SimpleHandlerResultHandler resultHandler = new SimpleHandlerResultHandler(conversionService()); <add> resultHandler.setOrder(2); <add> return resultHandler; <add> } <add> <add> @Bean <add> public ViewResolverResultHandler viewResolverResultHandler() { <add> List<ViewResolver> resolvers = Collections.singletonList(freeMarkerViewResolver()); <add> ViewResolverResultHandler resultHandler = new ViewResolverResultHandler(resolvers, conversionService()); <add> resultHandler.setOrder(3); <add> return resultHandler; <add> } <add> <add> @Bean <add> public ViewResolver freeMarkerViewResolver() { <add> FreeMarkerViewResolver viewResolver = new FreeMarkerViewResolver("", ".ftl"); <add> viewResolver.setBufferAllocator(this.allocator); <add> return viewResolver; <add> } <add> <add> @Bean <add> public FreeMarkerConfigurer freeMarkerConfig() { <add> FreeMarkerConfigurer configurer = new FreeMarkerConfigurer(); <add> configurer.setPreferFileSystemAccess(false); <add> configurer.setTemplateLoaderPath("classpath*:org/springframework/web/reactive/view/freemarker/"); <add> return configurer; <ide> } <ide> <ide> } <ide> public SimpleHandlerResultHandler simpleHandlerResultHandler() { <ide> @SuppressWarnings("unused") <ide> static class ApplicationConfig { <ide> <add> @Bean <add> public TestRestController testRestController() { <add> return new TestRestController(); <add> } <add> <ide> @Bean <ide> public TestController testController() { <ide> return new TestController(); <ide> public TestController testController() { <ide> <ide> @RestController <ide> @SuppressWarnings("unused") <del> private static class TestController { <add> private static class TestRestController { <ide> <ide> final List<Person> persons = new ArrayList<>(); <ide> <ide> public Publisher<String> handleException(IllegalStateException ex) { <ide> <ide> } <ide> <add> @Controller <add> @SuppressWarnings("unused") <add> private static class TestController { <add> <add> @RequestMapping("/html") <add> public String getHtmlPage(@RequestParam String name, Model model) { <add> model.addAttribute("hello", "Hello: " + name + "!"); <add> return "test"; <add> } <add> <add> } <add> <ide> private static class Person { <ide> <ide> private String name;
1
Text
Text
add missing comma
2555f5974a19f6ce3af14df2e7fa6cb2f275a7d3
<ide><path>src/Database/README.md <ide> directly in the options array: <ide> use Cake\Database\Connection; <ide> <ide> $connection = new Connection([ <del> 'driver' => 'Cake\Database\Driver\Sqlite' <add> 'driver' => 'Cake\Database\Driver\Sqlite', <ide> 'database' => '/path/to/file.db' <ide> ]); <ide> ```
1
Python
Python
fix matcher tests
f6e587b1c76fe141dcce72d8cdf7a88a766f8def
<ide><path>spacy/tests/matcher/test_matcher_bugfixes.py <ide> def test_overlap_issue118(EN): <ide> ) <ide> <ide> assert len(list(doc.ents)) == 0 <del> matches = matcher(doc) <add> matches = [(ent_type, start, end) for ent_id, ent_type, start, end in matcher(doc)] <ide> assert matches == [(ORG, 9, 11), (ORG, 10, 11)] <ide> ents = list(doc.ents) <ide> assert len(ents) == 1 <ide> def test_overlap_issue242(): <ide> nlp.matcher.add('FOOD', 'FOOD', {}, patterns) <ide> <ide> doc = nlp.tokenizer(u'There are different food safety standards in different countries.') <del> food_safety, safety_standards = nlp.matcher(doc) <add> <add> matches = [(ent_type, start, end) for ent_id, ent_type, start, end in nlp.matcher(doc)] <add> food_safety, safety_standards = matches <ide> assert food_safety[1] == 3 <ide> assert food_safety[2] == 5 <ide> assert safety_standards[1] == 4 <ide> def test_overlap_reorder(EN): <ide> ) <ide> <ide> assert len(list(doc.ents)) == 0 <del> matches = matcher(doc) <add> matches = [(ent_type, start, end) for ent_id, ent_type, start, end in matcher(doc)] <ide> assert matches == [(ORG, 9, 11), (ORG, 10, 11)] <ide> ents = list(doc.ents) <ide> assert len(ents) == 1 <ide> def test_overlap_prefix(EN): <ide> ) <ide> <ide> assert len(list(doc.ents)) == 0 <del> matches = matcher(doc) <add> matches = [(ent_type, start, end) for ent_id, ent_type, start, end in matcher(doc)] <ide> assert matches == [(ORG, 9, 10), (ORG, 9, 11)] <ide> ents = list(doc.ents) <ide> assert len(ents) == 1 <ide> def test_overlap_prefix_reorder(EN): <ide> ) <ide> <ide> assert len(list(doc.ents)) == 0 <del> matches = matcher(doc) <add> matches = [(ent_type, start, end) for ent_id, ent_type, start, end in matcher(doc)] <ide> assert matches == [(ORG, 9, 10), (ORG, 9, 11)] <ide> ents = list(doc.ents) <ide> assert len(ents) == 1
1
Text
Text
add resource type
487bf5dd4cbeb2ad03c11ade8a03525eb2e7ed91
<ide><path>guide/english/php/php-data-types/index.md <ide> $herbie = new Car(); <ide> echo $herbie->model; <ide> ?> <ide> ``` <add> <add>### PHP Resource <add> <add>A resource is a special variable, holding a reference to an external resource. Resources are created and used by special functions. See the [official PHP documentation](http://php.net/manual/en/resource.php) for a listing of all these functions and the corresponding resource types. You can use [get_resource_type()](http://php.net/manual/en/function.get-resource-type.php) function to see resource type. <add> <add>**Example:** <add>```php <add><?php <add>// prints: mysql link <add>$c = mysql_connect(); <add>echo get_resource_type($c) . "\n"; <add> <add>// prints: stream <add>$fp = fopen("foo", "w"); <add>echo get_resource_type($fp) . "\n"; <add> <add>// prints: domxml document <add>$doc = new_xmldoc("1.0"); <add>echo get_resource_type($doc->doc) . "\n"; <add>```
1
Python
Python
update resnet to run with tf r0.12 api. (#833)
22036b6f44efeb648fe2b2b4551f2b982edf0f5f
<ide><path>resnet/cifar_input.py <ide> def build_input(dataset, data_path, batch_size, mode): <ide> else: <ide> image = tf.image.resize_image_with_crop_or_pad( <ide> image, image_size, image_size) <del> image = tf.image.per_image_whitening(image) <add> image = tf.image.per_image_standardization(image) <ide> <ide> example_queue = tf.FIFOQueue( <ide> 3 * batch_size, <ide> def build_input(dataset, data_path, batch_size, mode): <ide> assert labels.get_shape()[1] == num_classes <ide> <ide> # Display the training images in the visualizer. <del> tf.image_summary('images', images) <add> tf.summary.image('images', images) <ide> return images, labels <ide><path>resnet/resnet_main.py <ide> def train(hps): <ide> summary_hook = tf.train.SummarySaverHook( <ide> save_steps=100, <ide> output_dir=FLAGS.train_dir, <del> summary_op=[model.summaries, <del> tf.summary.scalar('Precision', precision)]) <add> summary_op=tf.summary.merge([model.summaries, <add> tf.summary.scalar('Precision', precision)])) <ide> <ide> logging_hook = tf.train.LoggingTensorHook( <ide> tensors={'step': model.global_step, <ide><path>resnet/resnet_model.py <ide> def build_graph(self): <ide> self._build_model() <ide> if self.mode == 'train': <ide> self._build_train_op() <del> self.summaries = tf.merge_all_summaries() <add> self.summaries = tf.summary.merge_all() <ide> <ide> def _stride_arr(self, stride): <ide> """Map a stride scalar to the stride array for tf.nn.conv2d.""" <ide> def _build_model(self): <ide> self.cost = tf.reduce_mean(xent, name='xent') <ide> self.cost += self._decay() <ide> <del> tf.scalar_summary('cost', self.cost) <add> tf.summary.scalar('cost', self.cost) <ide> <ide> def _build_train_op(self): <ide> """Build training specific ops for the graph.""" <ide> self.lrn_rate = tf.constant(self.hps.lrn_rate, tf.float32) <del> tf.scalar_summary('learning rate', self.lrn_rate) <add> tf.summary.scalar('learning rate', self.lrn_rate) <ide> <ide> trainable_variables = tf.trainable_variables() <ide> grads = tf.gradients(self.cost, trainable_variables)
3
Javascript
Javascript
use spread notation instead of object.assign
4ea2c1c192f21f786e7ceac91a73e78044c6838d
<ide><path>lib/internal/console/constructor.js <ide> Console.prototype.table = function(tabularData, properties) { <ide> const final = (k, v) => this.log(cliTable(k, v)); <ide> <ide> const inspect = (v) => { <del> const opt = { depth: 0, maxArrayLength: 3 }; <del> if (v !== null && typeof v === 'object' && <del> !isArray(v) && ObjectKeys(v).length > 2) <del> opt.depth = -1; <del> Object.assign(opt, this[kGetInspectOptions](this._stdout)); <add> const depth = v !== null && <add> typeof v === 'object' && <add> !isArray(v) && <add> ObjectKeys(v).length > 2 ? -1 : 0; <add> const opt = { <add> depth, <add> maxArrayLength: 3, <add> ...this[kGetInspectOptions](this._stdout) <add> }; <ide> return util.inspect(v, opt); <ide> }; <ide> const getIndexArray = (length) => ArrayFrom({ length }, (_, i) => inspect(i));
1
Text
Text
update my collab entry
b3c6d281d7be393dc09456fbef2f677f696c42d2
<ide><path>README.md <ide> For information about the governance of the Node.js project, see <ide> * [devnexen](https://github.com/devnexen) - <ide> **David Carlier** &lt;devnexen@gmail.com&gt; <ide> * [devsnek](https://github.com/devsnek) - <del>**Gus Caplan** &lt;me@gus.host&gt; (he/him) <add>**Gus Caplan** &lt;me@gus.host&gt; (they/them) <ide> * [edsadr](https://github.com/edsadr) - <ide> **Adrian Estrada** &lt;edsadr@gmail.com&gt; (he/him) <ide> * [eugeneo](https://github.com/eugeneo) -
1
Ruby
Ruby
convert postflight test to spec
e7c943b561cc9c0bfc1d0923783e5dbf729bc076
<add><path>Library/Homebrew/cask/spec/cask/dsl/postflight_spec.rb <del><path>Library/Homebrew/cask/test/cask/dsl/postflight_test.rb <del>require "test_helper" <add>require "spec_helper" <ide> <ide> describe Hbc::DSL::Postflight do <ide> let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/basic-cask.rb") } <add><path>Library/Homebrew/cask/spec/support/shared_examples/staged.rb <del><path>Library/Homebrew/cask/test/support/shared_examples/staged.rb <del>require "test_helper" <add>require "spec_helper" <ide> <del>shared_examples_for Hbc::Staged do <add>require "hbc/staged" <add> <add>shared_examples Hbc::Staged do <ide> let(:fake_pathname_exists) { <del> fake_pathname = Pathname("/path/to/file/that/exists") <del> fake_pathname.stubs(exist?: true, expand_path: fake_pathname) <add> fake_pathname = Pathname.new("/path/to/file/that/exists") <add> allow(fake_pathname).to receive(:exist?).and_return(true) <add> allow(fake_pathname).to receive(:expand_path).and_return(fake_pathname) <ide> fake_pathname <ide> } <ide> <ide> let(:fake_pathname_does_not_exist) { <del> fake_pathname = Pathname("/path/to/file/that/does/not/exist") <del> fake_pathname.stubs(exist?: false, expand_path: fake_pathname) <add> fake_pathname = Pathname.new("/path/to/file/that/does/not/exist") <add> allow(fake_pathname).to receive(:exist?).and_return(false) <add> allow(fake_pathname).to receive(:expand_path).and_return(fake_pathname) <ide> fake_pathname <ide> } <ide> <ide> it "can run system commands with list-form arguments" do <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["echo", "homebrew-cask", "rocks!"] <ide> ) <del> staged.system_command("echo", args: ["homebrew-cask", "rocks!"]) <add> <add> shutup do <add> staged.system_command("echo", args: ["homebrew-cask", "rocks!"]) <add> end <ide> end <ide> <ide> it "can get the Info.plist file for the primary app" do <del> staged.info_plist_file.to_s.must_include Hbc.appdir.join("TestCask.app/Contents/Info.plist") <add> expect(staged.info_plist_file.to_s).to include Hbc.appdir.join("TestCask.app/Contents/Info.plist") <ide> end <ide> <ide> it "can execute commands on the Info.plist file" do <del> staged.stubs(bundle_identifier: "com.example.BasicCask") <add> allow(staged).to receive(:bundle_identifier).and_return("com.example.BasicCask") <ide> <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["/usr/libexec/PlistBuddy", "-c", "Print CFBundleIdentifier", staged.info_plist_file] <ide> ) <del> staged.plist_exec("Print CFBundleIdentifier") <add> <add> shutup do <add> staged.plist_exec("Print CFBundleIdentifier") <add> end <ide> end <ide> <ide> it "can set a key in the Info.plist file" do <del> staged.stubs(bundle_identifier: "com.example.BasicCask") <add> allow(staged).to receive(:bundle_identifier).and_return("com.example.BasicCask") <ide> <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", staged.info_plist_file] <ide> ) <del> staged.plist_set(":JVMOptions:JVMVersion", "1.6+") <add> <add> shutup do <add> staged.plist_set(":JVMOptions:JVMVersion", "1.6+") <add> end <ide> end <ide> <ide> it "can set the permissions of a file" do <ide> fake_pathname = fake_pathname_exists <del> staged.stubs(Pathname: fake_pathname) <add> allow(staged).to receive(:Pathname).and_return(fake_pathname) <ide> <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["/bin/chmod", "-R", "--", "777", fake_pathname] <ide> ) <del> staged.set_permissions(fake_pathname.to_s, "777") <add> <add> shutup do <add> staged.set_permissions(fake_pathname.to_s, "777") <add> end <ide> end <ide> <ide> it "can set the permissions of multiple files" do <ide> fake_pathname = fake_pathname_exists <del> staged.stubs(:Pathname).returns(fake_pathname) <add> allow(staged).to receive(:Pathname).and_return(fake_pathname) <ide> <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["/bin/chmod", "-R", "--", "777", fake_pathname, fake_pathname] <ide> ) <del> staged.set_permissions([fake_pathname.to_s, fake_pathname.to_s], "777") <add> <add> shutup do <add> staged.set_permissions([fake_pathname.to_s, fake_pathname.to_s], "777") <add> end <ide> end <ide> <ide> it "cannot set the permissions of a file that does not exist" do <ide> fake_pathname = fake_pathname_does_not_exist <del> staged.stubs(Pathname: fake_pathname) <add> allow(staged).to receive(:Pathname).and_return(fake_pathname) <ide> staged.set_permissions(fake_pathname.to_s, "777") <ide> end <ide> <ide> it "can set the ownership of a file" do <del> staged.stubs(current_user: "fake_user") <ide> fake_pathname = fake_pathname_exists <del> staged.stubs(Pathname: fake_pathname) <add> <add> allow(staged).to receive(:current_user).and_return("fake_user") <add> allow(staged).to receive(:Pathname).and_return(fake_pathname) <ide> <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "fake_user:staff", fake_pathname] <ide> ) <del> staged.set_ownership(fake_pathname.to_s) <add> <add> shutup do <add> staged.set_ownership(fake_pathname.to_s) <add> end <ide> end <ide> <ide> it "can set the ownership of multiple files" do <del> staged.stubs(current_user: "fake_user") <ide> fake_pathname = fake_pathname_exists <del> staged.stubs(Pathname: fake_pathname) <add> <add> allow(staged).to receive(:current_user).and_return("fake_user") <add> allow(staged).to receive(:Pathname).and_return(fake_pathname) <ide> <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "fake_user:staff", fake_pathname, fake_pathname] <ide> ) <del> staged.set_ownership([fake_pathname.to_s, fake_pathname.to_s]) <add> <add> shutup do <add> staged.set_ownership([fake_pathname.to_s, fake_pathname.to_s]) <add> end <ide> end <ide> <ide> it "can set the ownership of a file with a different user and group" do <ide> fake_pathname = fake_pathname_exists <del> staged.stubs(Pathname: fake_pathname) <add> <add> allow(staged).to receive(:Pathname).and_return(fake_pathname) <ide> <ide> Hbc::FakeSystemCommand.expects_command( <ide> ["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "other_user:other_group", fake_pathname] <ide> ) <del> staged.set_ownership(fake_pathname.to_s, user: "other_user", group: "other_group") <add> <add> shutup do <add> staged.set_ownership(fake_pathname.to_s, user: "other_user", group: "other_group") <add> end <ide> end <ide> <ide> it "cannot set the ownership of a file that does not exist" do <del> staged.stubs(current_user: "fake_user") <add> allow(staged).to receive(:current_user).and_return("fake_user") <ide> fake_pathname = fake_pathname_does_not_exist <del> staged.stubs(Pathname: fake_pathname) <del> staged.set_ownership(fake_pathname.to_s) <add> allow(staged).to receive(:Pathname).and_return(fake_pathname) <add> <add> shutup do <add> staged.set_ownership(fake_pathname.to_s) <add> end <ide> end <ide> end <ide><path>Library/Homebrew/cask/test/test_helper.rb <ide> def self.install_without_artifacts_with_caskfile(cask) <ide> <ide> # Extend MiniTest API with support for RSpec-style shared examples <ide> require "support/shared_examples" <del>require "support/shared_examples/staged.rb" <ide> <ide> require "support/fake_dirs" <ide> require "support/fake_system_command"
3
Text
Text
add v3.24.0-beta.3 to changelog
5364bed35d44777a9c671906619f0cda1d5b75cd
<ide><path>CHANGELOG.md <ide> # Ember Changelog <ide> <add>### v3.24.0-beta.3 (December 21, 2020) <add> <add>- [#19280](https://github.com/emberjs/ember.js/pull/19280) [BUGFIX] Ensure aliases cause recompute of a computed property when used with `@each` in the dependent keys of that property <add> <ide> ### v3.24.0-beta.2 (November 24, 2020) <ide> <ide> - [#19282](https://github.com/emberjs/ember.js/pull/19282) [BUGFIX] Issue deprecations (instead of assertions) for tracked mutation in constructor during rendering
1
Text
Text
fix typo in readme bach examples
fa1aa81f2623cbb3243ba67b0fb5a862851d8eda
<ide><path>README.md <ide> python run_squad.py \ <ide> --init_checkpoint $BERT_PYTORCH_DIR/pytorch_model.bin \ <ide> --do_train \ <ide> --do_predict \ <del> --do_lower_case <add> --do_lower_case \ <ide> --train_file $SQUAD_DIR/train-v1.1.json \ <ide> --predict_file $SQUAD_DIR/dev-v1.1.json \ <ide> --train_batch_size 12 \ <ide> To get these results that we used a combination of: <ide> <ide> Here are the full list of hyper-parameters we used for this run: <ide> ```bash <del>python ./run_squad.py --vocab_file $BERT_LARGE_DIR/vocab.txt --bert_config_file $BERT_LARGE_DIR/bert_config.json --init_checkpoint $BERT_LARGE_DIR/pytorch_model.bin --do_lower_case --do_train --do_predict --train_file $SQUAD_TRAIN --predict_file $SQUAD_EVAL --learning_rate 3e-5 --num_train_epochs 2 --max_seq_length 384 --doc_stride 128 --output_dir $OUTPUT_DIR/bert_large_bsz_24 --train_batch_size 24 --gradient_accumulation_steps 2 --optimize_on_cpu <add>python ./run_squad.py \ <add> --vocab_file $BERT_LARGE_DIR/vocab.txt \ <add> --bert_config_file $BERT_LARGE_DIR/bert_config.json \ <add> --init_checkpoint $BERT_LARGE_DIR/pytorch_model.bin \ <add> --do_lower_case \ <add> --do_train \ <add> --do_predict \ <add> --train_file $SQUAD_TRAIN \ <add> --predict_file $SQUAD_EVAL \ <add> --learning_rate 3e-5 \ <add> --num_train_epochs 2 \ <add> --max_seq_length 384 \ <add> --doc_stride 128 \ <add> --output_dir $OUTPUT_DIR \ <add> --train_batch_size 24 \ <add> --gradient_accumulation_steps 2 \ <add> --optimize_on_cpu <ide> ```
1
Javascript
Javascript
increase enoughtestmem to 1.75 gb
53f4ac2774fa8aa1e964cf5fb660bcc72433e0b9
<ide><path>test/common/index.js <ide> exports.isFreeBSD = process.platform === 'freebsd'; <ide> exports.isLinux = process.platform === 'linux'; <ide> exports.isOSX = process.platform === 'darwin'; <ide> <del>exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */ <add>exports.enoughTestMem = os.totalmem() > 0x70000000; /* 1.75 Gb */ <ide> const cpus = os.cpus(); <ide> exports.enoughTestCpu = Array.isArray(cpus) && <ide> (cpus.length > 1 || cpus[0].speed > 999);
1
Go
Go
add die event
a41384ad7312a21fd8fe429637c8d6b5c883fa2a
<ide><path>container.go <ide> func (container *Container) monitor() { <ide> } <ide> } <ide> utils.Debugf("Process finished") <del> <add> if container.runtime != nil && container.runtime.srv != nil { <add> container.runtime.srv.LogEvent("die", container.ShortID()) <add> } <ide> exitCode := -1 <ide> if container.cmd != nil { <ide> exitCode = container.cmd.ProcessState.Sys().(syscall.WaitStatus).ExitStatus()
1
Go
Go
update manifest format for push
bcc0a343bb9c75443238e614e4c2da5f707aef8d
<ide><path>graph/manifest.go <ide> func (s *TagStore) CmdManifest(job *engine.Job) engine.Status { <ide> if !exists { <ide> return job.Errorf("Tag does not exist for %s: %s", name, tag) <ide> } <del> tarsums := make([]string, 0, 4) <ide> layersSeen := make(map[string]bool) <ide> <ide> layer, err := s.graph.Get(layerId) <ide> func (s *TagStore) CmdManifest(job *engine.Job) engine.Status { <ide> return job.Errorf("Missing layer configuration") <ide> } <ide> manifest.Architecture = layer.Architecture <add> manifest.FSLayers = make([]*registry.FSLayer, 0, 4) <add> manifest.History = make([]*registry.ManifestHistory, 0, 4) <ide> var metadata runconfig.Config <ide> metadata = *layer.Config <del> history := make([]string, 0, cap(tarsums)) <ide> <ide> for ; layer != nil; layer, err = layer.GetParent() { <ide> if err != nil { <ide> func (s *TagStore) CmdManifest(job *engine.Job) engine.Status { <ide> tarId := tarSum.Sum(nil) <ide> // Save tarsum to image json <ide> <del> tarsums = append(tarsums, tarId) <add> manifest.FSLayers = append(manifest.FSLayers, &registry.FSLayer{BlobSum: tarId}) <ide> <ide> layersSeen[layer.ID] = true <ide> jsonData, err := ioutil.ReadFile(path.Join(s.graph.Root, layer.ID, "json")) <ide> if err != nil { <ide> return job.Error(fmt.Errorf("Cannot retrieve the path for {%s}: %s", layer.ID, err)) <ide> } <del> history = append(history, string(jsonData)) <add> manifest.History = append(manifest.History, &registry.ManifestHistory{V1Compatibility: string(jsonData)}) <ide> } <ide> <del> manifest.BlobSums = tarsums <del> manifest.History = history <del> <ide> manifestBytes, err := json.MarshalIndent(manifest, "", " ") <ide> if err != nil { <ide> return job.Error(err)
1
Javascript
Javascript
return error object for compiler dependency errors
ecd02195a29beaceff47eaf639b525a19c89c4de
<ide><path>lib/MultiCompiler.js <ide> module.exports = class MultiCompiler extends Tapable { <ide> errors.unshift("Circular dependency found in compiler dependencies."); <ide> } <ide> if(errors.length > 0) { <del> callback(errors.join("\n")); <add> const message = errors.join("\n"); <add> callback(new Error(message)); <ide> return false; <ide> } <ide> return true; <ide><path>test/MultiCompiler.test.js <ide> describe("MultiCompiler", () => { <ide> env.compiler1WatchCallbacks.length.should.be.exactly(0); <ide> env.compiler2WatchCallbacks.length.should.be.exactly(0); <ide> env.callback.callCount.should.be.exactly(1); <del> env.callback.getCall(0).args[0].should.match(/`compiler2` not found/); <add> env.callback.getCall(0).args[0].should.be.Error(); <add> should(env.callback.getCall(0).args[1]).be.undefined(); <ide> }); <ide> }); <ide> <ide> describe("MultiCompiler", () => { <ide> env.compiler1WatchCallbacks.length.should.be.exactly(0); <ide> env.compiler2WatchCallbacks.length.should.be.exactly(0); <ide> env.callback.callCount.should.be.exactly(1); <del> env.callback.getCall(0).args[0].should.equal("Circular dependency found in compiler dependencies."); <add> env.callback.getCall(0).args[0].should.be.Error(); <add> should(env.callback.getCall(0).args[1]).be.undefined(); <ide> }); <ide> }); <ide> }); <ide> describe("MultiCompiler", () => { <ide> env.compiler1RunCallbacks.length.should.be.exactly(0); <ide> env.compiler2RunCallbacks.length.should.be.exactly(0); <ide> env.callback.callCount.should.be.exactly(1); <del> env.callback.getCall(0).args[0].should.match(/`compiler2` not found/); <add> env.callback.getCall(0).args[0].should.be.Error(); <add> should(env.callback.getCall(0).args[1]).be.undefined(); <ide> }); <ide> }); <ide> <ide> describe("MultiCompiler", () => { <ide> env.compiler1RunCallbacks.length.should.be.exactly(0); <ide> env.compiler2RunCallbacks.length.should.be.exactly(0); <ide> env.callback.callCount.should.be.exactly(1); <del> env.callback.getCall(0).args[0].should.equal("Circular dependency found in compiler dependencies."); <add> env.callback.getCall(0).args[0].should.be.Error(); <add> should(env.callback.getCall(0).args[1]).be.undefined(); <ide> }); <ide> }); <ide> });
2
PHP
PHP
add missing arguments names to params
d69f639488c1a0389fd1999fda564a4591364d15
<ide><path>src/Illuminate/Auth/Guard.php <ide> public function getDispatcher() <ide> /** <ide> * Set the event dispatcher instance. <ide> * <del> * @param \Illuminate\Contracts\Events\Dispatcher <add> * @param \Illuminate\Contracts\Events\Dispatcher $events <ide> * @return void <ide> */ <ide> public function setDispatcher(Dispatcher $events) <ide> public function getRequest() <ide> /** <ide> * Set the current request instance. <ide> * <del> * @param \Symfony\Component\HttpFoundation\Request <add> * @param \Symfony\Component\HttpFoundation\Request $request <ide> * @return $this <ide> */ <ide> public function setRequest(Request $request) <ide><path>src/Illuminate/Cache/Repository.php <ide> public function __construct(Store $store) <ide> /** <ide> * Set the event dispatcher instance. <ide> * <del> * @param \Illuminate\Contracts\Events\Dispatcher <add> * @param \Illuminate\Contracts\Events\Dispatcher $events <ide> * @return void <ide> */ <ide> public function setEventDispatcher(Dispatcher $events) <ide><path>src/Illuminate/Database/Connection.php <ide> public function getQueryGrammar() <ide> /** <ide> * Set the query grammar used by the connection. <ide> * <del> * @param \Illuminate\Database\Query\Grammars\Grammar <add> * @param \Illuminate\Database\Query\Grammars\Grammar $grammar <ide> * @return void <ide> */ <ide> public function setQueryGrammar(Query\Grammars\Grammar $grammar) <ide> public function getSchemaGrammar() <ide> /** <ide> * Set the schema grammar used by the connection. <ide> * <del> * @param \Illuminate\Database\Schema\Grammars\Grammar <add> * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar <ide> * @return void <ide> */ <ide> public function setSchemaGrammar(Schema\Grammars\Grammar $grammar) <ide> public function getPostProcessor() <ide> /** <ide> * Set the query post processor used by the connection. <ide> * <del> * @param \Illuminate\Database\Query\Processors\Processor <add> * @param \Illuminate\Database\Query\Processors\Processor $processor <ide> * @return void <ide> */ <ide> public function setPostProcessor(Processor $processor) <ide> public function getEventDispatcher() <ide> /** <ide> * Set the event dispatcher instance on the connection. <ide> * <del> * @param \Illuminate\Contracts\Events\Dispatcher <add> * @param \Illuminate\Contracts\Events\Dispatcher $events <ide> * @return void <ide> */ <ide> public function setEventDispatcher(Dispatcher $events) <ide><path>src/Illuminate/Database/Eloquent/Model.php <ide> protected function asDateTime($value) <ide> /** <ide> * Prepare a date for array / JSON serialization. <ide> * <del> * @param \DateTime <add> * @param \DateTime $date <ide> * @return string <ide> */ <ide> protected function serializeDate(DateTime $date) <ide><path>src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php <ide> protected function hasPivotColumn($column) <ide> /** <ide> * Set the join clause for the relation query. <ide> * <del> * @param \Illuminate\Database\Eloquent\Builder|null <add> * @param \Illuminate\Database\Eloquent\Builder|null $query <ide> * @return $this <ide> */ <ide> protected function setJoin($query = null) <ide><path>src/Illuminate/Database/Eloquent/Relations/Pivot.php <ide> public function __construct(Model $parent, $attributes, $table, $exists = false) <ide> /** <ide> * Set the keys for a save update query. <ide> * <del> * @param \Illuminate\Database\Eloquent\Builder <add> * @param \Illuminate\Database\Eloquent\Builder $query <ide> * @return \Illuminate\Database\Eloquent\Builder <ide> */ <ide> protected function setKeysForSaveQuery(Builder $query) <ide><path>src/Illuminate/Database/Query/Grammars/Grammar.php <ide> class Grammar extends BaseGrammar { <ide> /** <ide> * Compile a select query into SQL. <ide> * <del> * @param \Illuminate\Database\Query\Builder <add> * @param \Illuminate\Database\Query\Builder $query <ide> * @return string <ide> */ <ide> public function compileSelect(Builder $query) <ide> public function compileSelect(Builder $query) <ide> /** <ide> * Compile the components necessary for a select clause. <ide> * <del> * @param \Illuminate\Database\Query\Builder <add> * @param \Illuminate\Database\Query\Builder $query <ide> * @return array <ide> */ <ide> protected function compileComponents(Builder $query) <ide><path>src/Illuminate/Database/Query/Grammars/MySqlGrammar.php <ide> class MySqlGrammar extends Grammar { <ide> /** <ide> * Compile a select query into SQL. <ide> * <del> * @param \Illuminate\Database\Query\Builder <add> * @param \Illuminate\Database\Query\Builder $query <ide> * @return string <ide> */ <ide> public function compileSelect(Builder $query) <ide><path>src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php <ide> class SqlServerGrammar extends Grammar { <ide> /** <ide> * Compile a select query into SQL. <ide> * <del> * @param \Illuminate\Database\Query\Builder <add> * @param \Illuminate\Database\Query\Builder $query <ide> * @return string <ide> */ <ide> public function compileSelect(Builder $query) <ide><path>src/Illuminate/Database/Schema/Builder.php <ide> public function getConnection() <ide> /** <ide> * Set the database connection instance. <ide> * <del> * @param \Illuminate\Database\Connection <add> * @param \Illuminate\Database\Connection $connection <ide> * @return $this <ide> */ <ide> public function setConnection(Connection $connection) <ide><path>src/Illuminate/Foundation/Application.php <ide> public function resolveProviderClass($provider) <ide> /** <ide> * Mark the given provider as registered. <ide> * <del> * @param \Illuminate\Support\ServiceProvider <add> * @param \Illuminate\Support\ServiceProvider $provider <ide> * @return void <ide> */ <ide> protected function markAsRegistered($provider) <ide><path>src/Illuminate/Foundation/Console/QueuedJob.php <ide> public function __construct(KernelContract $kernel) <ide> /** <ide> * Fire the job. <ide> * <del> * @param \Illuminate\Queue\Jobs\Job <add> * @param \Illuminate\Queue\Jobs\Job $job <ide> * @param array $data <ide> * @return void <ide> */ <ide><path>src/Illuminate/Foundation/Console/VendorPublishCommand.php <ide> class VendorPublishCommand extends Command { <ide> /** <ide> * Create a new command instance. <ide> * <del> * @param \Illuminate\Filesystem\Filesystem <add> * @param \Illuminate\Filesystem\Filesystem $files <ide> * @return void <ide> */ <ide> public function __construct(Filesystem $files) <ide><path>src/Illuminate/Foundation/Testing/CrawlerTrait.php <ide> protected function makeRequest($method, $uri, $parameters = [], $cookies = [], $ <ide> /** <ide> * Make a request to the application using the given form. <ide> * <del> * @param \Symfony\Component\DomCrawler\Form <add> * @param \Symfony\Component\DomCrawler\Form $form <ide> * @return $this <ide> */ <ide> protected function makeRequestUsingForm(Form $form) <ide><path>src/Illuminate/Queue/CallQueuedHandler.php <ide> class CallQueuedHandler { <ide> /** <ide> * Create a new handler instance. <ide> * <del> * @param \Illuminate\Contracts\Bus\Dispatcher <add> * @param \Illuminate\Contracts\Bus\Dispatcher $dispatcher <ide> * @return void <ide> */ <ide> public function __construct(Dispatcher $dispatcher) <ide><path>src/Illuminate/Queue/InteractsWithQueue.php <ide> public function attempts() <ide> /** <ide> * Set the base queue job instance. <ide> * <del> * @param \Illuminate\Contracts\Queue\Job <add> * @param \Illuminate\Contracts\Queue\Job $job <ide> * @return $this <ide> */ <ide> public function setJob(JobContract $job) <ide><path>src/Illuminate/View/Factory.php <ide> public function getDispatcher() <ide> /** <ide> * Set the event dispatcher instance. <ide> * <del> * @param \Illuminate\Contracts\Events\Dispatcher <add> * @param \Illuminate\Contracts\Events\Dispatcher $events <ide> * @return void <ide> */ <ide> public function setDispatcher(Dispatcher $events)
17
Java
Java
remove hard crash when root view is reused
dc74975c5faad1a5f4d3685679394308ca8f6b24
<ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java <ide> protected synchronized final void addRootViewGroup( <ide> ViewGroup view, <ide> ThemedReactContext themedContext) { <ide> if (view.getId() != View.NO_ID) { <del> themedContext.handleException( <del> new IllegalViewOperationException( <del> "Trying to add a root view with an explicit id (" + view.getId() + ") already " + <del> "set. React Native uses the id field to track react tags and will overwrite this field. " + <del> "If that is fine, explicitly overwrite the id field to View.NO_ID before calling " + <del> "addRootView.")); <add> FLog.e( <add> TAG, <add> "Trying to add a root view with an explicit id (" + view.getId() + ") already " + <add> "set. React Native uses the id field to track react tags and will overwrite this field. " + <add> "If that is fine, explicitly overwrite the id field to View.NO_ID before calling " + <add> "addRootView."); <ide> } <ide> <ide> mTagsToViews.put(tag, view);
1
Text
Text
create standard vendor policies
1e021ff5715ade80310a04895da414a897529d7a
<ide><path>VENDORING.md <add># Vendoring policies <add> <add>This document outlines recommended Vendoring policies for Docker repositories. <add>(Example, libnetwork is a Docker repo and logrus is not.) <add> <add>## Vendoring using tags <add> <add>Commit ID based vendoring provides little/no information about the updates <add>vendored. To fix this, vendors will now require that repositories use annotated <add>tags along with commit ids to snapshot commits. Annotated tags by themselves <add>are not sufficient, since the same tag can be force updated to reference <add>different commits. <add> <add>Each tag should: <add>- Follow Semantic Versioning rules (refer to section on "Semantic Versioning") <add>- Have a corresponding entry in the change tracking document. <add> <add>Each repo should: <add>- Have a change tracking document between tags/releases. Ex: CHANGELOG.md, <add>github releases file. <add> <add>The goal here is for consuming repos to be able to use the tag version and <add>changelog updates to determine whether the vendoring will cause any breaking or <add>backward incompatible changes. This also means that repos can specify having <add>dependency on a package of a specific version or greater up to the next major <add>release, without encountering breaking changes. <add> <add>## Semantic Versioning <add>Annotated version tags should follow Schema Versioning policies. <add>According to http://semver.org: <add> <add>"Given a version number MAJOR.MINOR.PATCH, increment the: <add> MAJOR version when you make incompatible API changes, <add> MINOR version when you add functionality in a backwards-compatible manner, and <add> PATCH version when you make backwards-compatible bug fixes. <add>Additional labels for pre-release and build metadata are available as extensions <add>to the MAJOR.MINOR.PATCH format." <add> <add>## Vendoring cadence <add>In order to avoid huge vendoring changes, it is recommended to have a regular <add>cadence for vendoring updates. eg. monthly. <add> <add>## Pre-merge vendoring tests <add>All related repos will be vendored into docker/docker. <add>CI on docker/docker should catch any breaking changes involving multiple repos.
1
Javascript
Javascript
add test for https server close event
210e65a017d05e7382d0be5a6e4d271d1d95bbd1
<ide><path>test/parallel/test-https-close.js <add>'use strict'; <add>const common = require('../common'); <add>const fs = require('fs'); <add> <add>if (!common.hasCrypto) { <add> console.log('1..0 # Skipped: missing crypto'); <add> return; <add>} <add>const https = require('https'); <add> <add>const options = { <add> key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), <add> cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') <add>}; <add> <add>var connections = {}; <add> <add>var server = https.createServer(options, function(req, res) { <add> var interval = setInterval(function() { <add> res.write('data'); <add> }, 1000); <add> interval.unref(); <add>}); <add> <add>server.on('connection', function(connection) { <add> var key = connection.remoteAddress + ':' + connection.remotePort; <add> connection.on('close', function() { <add> delete connections[key]; <add> }); <add> connections[key] = connection; <add>}); <add> <add>function shutdown() { <add> server.close(common.mustCall(function() {})); <add> <add> for (var key in connections) { <add> connections[key].destroy(); <add> delete connections[key]; <add> } <add>} <add> <add>server.listen(common.PORT, function() { <add> var requestOptions = { <add> hostname: '127.0.0.1', <add> port: common.PORT, <add> path: '/', <add> method: 'GET', <add> rejectUnauthorized: false <add> }; <add> <add> var req = https.request(requestOptions, function(res) { <add> res.on('data', function(d) {}); <add> setImmediate(shutdown); <add> }); <add> req.end(); <add>});
1
Python
Python
simplify identity initializer with zero padding
6096ded90df902e1f8a21f666748a03100d140c0
<ide><path>keras/initializers.py <ide> def __call__(self, shape, dtype=None): <ide> raise ValueError( <ide> 'Identity matrix initializer can only be used for 2D matrices.') <ide> <del> if shape[0] == shape[1]: <del> return self.gain * np.identity(shape[0]) <del> elif shape[0] > shape[1]: <del> return self.gain * np.concatenate( <del> [np.identity(shape[1]), <del> np.zeros((shape[0] - shape[1], shape[1]))], <del> axis=0 <del> ) <del> else: <del> return self.gain * np.concatenate( <del> [np.identity(shape[0]), <del> np.zeros((shape[0], shape[1] - shape[0]))], <del> axis=1 <del> ) <add> return self.gain * np.eye(shape[0], shape[1]) <ide> <ide> def get_config(self): <ide> return {
1
Javascript
Javascript
replace magic numbers by constants
c86fe511f4924ebbf7291fd938e5cd952199145b
<ide><path>lib/internal/constants.js <ide> <ide> module.exports = { <ide> // Alphabet chars. <del> CHAR_UPPERCASE_A: 65, /*A*/ <del> CHAR_LOWERCASE_A: 97, /*a*/ <del> CHAR_UPPERCASE_Z: 90, /*Z*/ <del> CHAR_LOWERCASE_Z: 122, /*z*/ <add> CHAR_UPPERCASE_A: 65, /* A */ <add> CHAR_LOWERCASE_A: 97, /* a */ <add> CHAR_UPPERCASE_Z: 90, /* Z */ <add> CHAR_LOWERCASE_Z: 122, /* z */ <ide> <ide> // Non-alphabetic chars. <del> CHAR_DOT: 46, /*.*/ <del> CHAR_FORWARD_SLASH: 47, /*/*/ <del> CHAR_BACKWARD_SLASH: 92, /*\*/ <del> CHAR_COLON: 58, /*:*/ <del> CHAR_QUESTION_MARK: 63, /*?*/ <add> CHAR_DOT: 46, /* . */ <add> CHAR_FORWARD_SLASH: 47, /* / */ <add> CHAR_BACKWARD_SLASH: 92, /* \ */ <add> CHAR_COLON: 58, /* : */ <add> CHAR_QUESTION_MARK: 63, /* ? */ <add> CHAR_UNDERSCORE: 95, /* _ */ <add> <add> // Digits <add> CHAR_0: 48, /* 0 */ <add> CHAR_9: 57, /* 9 */ <ide> }; <ide><path>lib/module.js <ide> module.exports = Module; <ide> const internalESModule = require('internal/process/modules'); <ide> const ModuleJob = require('internal/loader/ModuleJob'); <ide> const createDynamicModule = require('internal/loader/CreateDynamicModule'); <add>const { <add> CHAR_UPPERCASE_A, <add> CHAR_LOWERCASE_A, <add> CHAR_UPPERCASE_Z, <add> CHAR_LOWERCASE_Z, <add> CHAR_FORWARD_SLASH, <add> CHAR_BACKWARD_SLASH, <add> CHAR_COLON, <add> CHAR_DOT, <add> CHAR_UNDERSCORE, <add> CHAR_0, <add> CHAR_9, <add>} = require('internal/constants'); <ide> <ide> function stat(filename) { <ide> filename = path.toNamespacedPath(filename); <ide> Module._findPath = function(request, paths, isMain) { <ide> <ide> var exts; <ide> var trailingSlash = request.length > 0 && <del> request.charCodeAt(request.length - 1) === 47/*/*/; <add> request.charCodeAt(request.length - 1) === CHAR_FORWARD_SLASH; <ide> <ide> // For each path <ide> for (var i = 0; i < paths.length; i++) { <ide> if (process.platform === 'win32') { <ide> <ide> // return root node_modules when path is 'D:\\'. <ide> // path.resolve will make sure from.length >=3 in Windows. <del> if (from.charCodeAt(from.length - 1) === 92/*\*/ && <del> from.charCodeAt(from.length - 2) === 58/*:*/) <add> if (from.charCodeAt(from.length - 1) === CHAR_BACKWARD_SLASH && <add> from.charCodeAt(from.length - 2) === CHAR_COLON) <ide> return [from + 'node_modules']; <ide> <ide> const paths = []; <ide> if (process.platform === 'win32') { <ide> // Use colon as an extra condition since we can get node_modules <ide> // path for drive root like 'C:\node_modules' and don't need to <ide> // parse drive name. <del> if (code === 92/*\*/ || code === 47/*/*/ || code === 58/*:*/) { <add> if (code === CHAR_BACKWARD_SLASH || <add> code === CHAR_FORWARD_SLASH || <add> code === CHAR_COLON) { <ide> if (p !== nmLen) <ide> paths.push(from.slice(0, last) + '\\node_modules'); <ide> last = i; <ide> if (process.platform === 'win32') { <ide> var last = from.length; <ide> for (var i = from.length - 1; i >= 0; --i) { <ide> const code = from.charCodeAt(i); <del> if (code === 47/*/*/) { <add> if (code === CHAR_FORWARD_SLASH) { <ide> if (p !== nmLen) <ide> paths.push(from.slice(0, last) + '/node_modules'); <ide> last = i; <ide> Module._resolveLookupPaths = function(request, parent, newReturn) { <ide> <ide> // Check for relative path <ide> if (request.length < 2 || <del> request.charCodeAt(0) !== 46/*.*/ || <del> (request.charCodeAt(1) !== 46/*.*/ && <del> request.charCodeAt(1) !== 47/*/*/)) { <add> request.charCodeAt(0) !== CHAR_DOT || <add> (request.charCodeAt(1) !== CHAR_DOT && <add> request.charCodeAt(1) !== CHAR_FORWARD_SLASH)) { <ide> var paths = modulePaths; <ide> if (parent) { <ide> if (!parent.paths) <ide> Module._resolveLookupPaths = function(request, parent, newReturn) { <ide> // We matched 'index.', let's validate the rest <ide> for (; i < base.length; ++i) { <ide> const code = base.charCodeAt(i); <del> if (code !== 95/*_*/ && <del> (code < 48/*0*/ || code > 57/*9*/) && <del> (code < 65/*A*/ || code > 90/*Z*/) && <del> (code < 97/*a*/ || code > 122/*z*/)) <add> if (code !== CHAR_UNDERSCORE && <add> (code < CHAR_0 || code > CHAR_9) && <add> (code < CHAR_UPPERCASE_A || code > CHAR_UPPERCASE_Z) && <add> (code < CHAR_LOWERCASE_A || code > CHAR_LOWERCASE_Z)) <ide> break; <ide> } <ide> if (i === base.length) {
2
Javascript
Javascript
add missing files
4a5723f83b80c2625b881a96df75efa4f4062a75
<ide><path>angularFiles.js <ide> var angularFiles = { <ide> 'test/auto/*.js', <ide> 'test/ng/**/*.js', <ide> 'test/ngAnimate/*.js', <add> 'test/ngMessageFormat/*.js', <ide> 'test/ngMessages/*.js', <ide> 'test/ngCookies/*.js', <ide> 'test/ngResource/*.js', <ide> var angularFiles = { <ide> 'test/modules/no_bootstrap.js', <ide> 'src/ngScenario/browserTrigger.js', <ide> 'test/helpers/*.js', <add> 'test/ngAnimate/*.js', <ide> 'test/ngMessageFormat/*.js', <add> 'test/ngMessages/*.js', <ide> 'test/ngMock/*.js', <ide> 'test/ngCookies/*.js', <ide> 'test/ngRoute/**/*.js', <ide><path>test/helpers/matchers.js <ide> beforeEach(function() { <ide> compare: generateCompare(false), <ide> negativeCompare: generateCompare(true) <ide> }; <add> function hasClass(element, selector) { <add> if (!element.getAttribute) return false; <add> return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " "). <add> indexOf(" " + selector + " ") > -1); <add> } <ide> function generateCompare(isNot) { <ide> return function(actual, clazz) { <ide> var message = function() { <ide> return "Expected '" + angular.mock.dump(actual) + "'" + (isNot ? " not " : "") + " to have class '" + clazz + "'."; <ide> }; <ide> var classes = clazz.trim().split(/\s+/); <ide> for (var i = 0; i < classes.length; ++i) { <del> if (!jqLiteHasClass(actual[0], classes[i])) { <add> if (!hasClass(actual[0], classes[i])) { <ide> return { pass: isNot }; <ide> } <ide> } <ide><path>test/ngAnimate/animateCssSpec.js <ide> describe("ngAnimate $animateCss", function() { <ide> inject(function($animateCss, $sniffer, $rootElement, $document) { <ide> <ide> var animator; <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> $sniffer.transitions = $sniffer.animations = false; <ide> animator = $animateCss(element, { <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> $animate.enabled(false); <ide> <del> var animator, element = jqLite('<div></div>'); <add> var animator, element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> animator = $animateCss(element, { <ide> duration: 10, <ide> describe("ngAnimate $animateCss", function() { <ide> it("should silently quit the animation and not throw when an element has no parent during preparation", <ide> inject(function($animateCss, $rootScope, $document, $rootElement) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> expect(function() { <ide> $animateCss(element, { <ide> duration: 1000, <ide> describe("ngAnimate $animateCss", function() { <ide> it("should silently quit the animation and not throw when an element has no parent before starting", <ide> inject(function($animateCss, $$rAF, $rootScope, $document, $rootElement) { <ide> <del> var element = jqLite('<div></div>'); <del> jqLite($document[0].body).append($rootElement); <add> var element = angular.element('<div></div>'); <add> angular.element($document[0].body).append($rootElement); <ide> $rootElement.append(element); <ide> <ide> $animateCss(element, { <ide> describe("ngAnimate $animateCss", function() { <ide> it("should buffer all requests into a single requestAnimationFrame call", <ide> inject(function($animateCss, $$rAF, $rootScope, $document, $rootElement) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var count = 0; <ide> var runners = []; <ide> function makeRequest() { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> var runner = $animateCss(element, { duration: 5, to: fakeStyle }).start(); <ide> runner.then(function() { <ide> describe("ngAnimate $animateCss", function() { <ide> }); <ide> }); <ide> inject(function($animateCss, $$rAF, $document, $rootElement) { <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> function makeRequest() { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> $animateCss(element, { duration: 5, to: fakeStyle }).start(); <ide> } <ide> describe("ngAnimate $animateCss", function() { <ide> var animationDuration = 5; <ide> var element, animator; <ide> beforeEach(inject(function($animateCss, $rootElement, $document) { <del> element = jqLite('<div></div>'); <add> element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> animator = $animateCss(element, { <ide> event: 'enter', <ide> describe("ngAnimate $animateCss", function() { <ide> } <ide> <ide> beforeEach(inject(function($rootElement, $document) { <del> element = jqLite('<div></div>'); <add> element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> options = { event: 'enter', structural: true }; <ide> })); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should apply a stagger based when an active ng-EVENT-stagger class with a transition-delay is detected", <ide> inject(function($animateCss, $document, $rootElement, $timeout) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.ng-enter-stagger', 'transition-delay:0.2s'); <ide> ss.addRule('.ng-enter', 'transition:2s linear all'); <ide> describe("ngAnimate $animateCss", function() { <ide> var elm; <ide> <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> elements.push(elm); <ide> $rootElement.append(elm); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should apply a stagger based when for all provided addClass/removeClass CSS classes", <ide> inject(function($animateCss, $document, $rootElement, $timeout) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.red-add-stagger,' + <ide> '.blue-remove-stagger,' + <ide> describe("ngAnimate $animateCss", function() { <ide> var elm; <ide> <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div class="blue"></div>'); <add> elm = angular.element('<div class="blue"></div>'); <ide> elements.push(elm); <ide> $rootElement.append(elm); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should block the transition animation between start and animate when staggered", <ide> inject(function($animateCss, $document, $rootElement) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.ng-enter-stagger', 'transition-delay:0.2s'); <ide> ss.addRule('.ng-enter', 'transition:2s linear all;'); <ide> describe("ngAnimate $animateCss", function() { <ide> var elms = []; <ide> <ide> for (i = 0; i < 5; i++) { <del> element = jqLite('<div class="transition-animation"></div>'); <add> element = angular.element('<div class="transition-animation"></div>'); <ide> $rootElement.append(element); <ide> <ide> $animateCss(element, { event: 'enter', structural: true }).start(); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should block (pause) the keyframe animation between start and animate when staggered", <ide> inject(function($animateCss, $document, $rootElement) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addPossiblyPrefixedRule('.ng-enter-stagger', 'animation-delay:0.2s'); <ide> ss.addPossiblyPrefixedRule('.ng-enter', 'animation:my_animation 2s;'); <ide> <ide> var i, element, elements = []; <ide> for (i = 0; i < 5; i++) { <del> element = jqLite('<div class="transition-animation"></div>'); <add> element = angular.element('<div class="transition-animation"></div>'); <ide> $rootElement.append(element); <ide> <ide> $animateCss(element, { event: 'enter', structural: true }).start(); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should not apply a stagger if the transition delay value is inherited from a earlier CSS class", <ide> inject(function($animateCss, $document, $rootElement) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.transition-animation', 'transition:2s 5s linear all;'); <ide> <ide> for (var i = 0; i < 5; i++) { <del> var element = jqLite('<div class="transition-animation"></div>'); <add> var element = angular.element('<div class="transition-animation"></div>'); <ide> $rootElement.append(element); <ide> <ide> $animateCss(element, { event: 'enter', structural: true }).start(); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should apply a stagger only if the transition duration value is zero when inherited from a earlier CSS class", <ide> inject(function($animateCss, $document, $rootElement) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.transition-animation', 'transition:2s 5s linear all;'); <ide> ss.addRule('.transition-animation.ng-enter-stagger', <ide> 'transition-duration:0s; transition-delay:0.2s;'); <ide> <ide> var element, i, elms = []; <ide> for (i = 0; i < 5; i++) { <del> element = jqLite('<div class="transition-animation"></div>'); <add> element = angular.element('<div class="transition-animation"></div>'); <ide> $rootElement.append(element); <ide> <ide> elms.push(element); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should ignore animation staggers if only transition animations were detected", <ide> inject(function($animateCss, $document, $rootElement) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.ng-enter-stagger', prefix + 'animation-delay:0.2s'); <ide> ss.addRule('.transition-animation', 'transition:2s 5s linear all;'); <ide> <ide> for (var i = 0; i < 5; i++) { <del> var element = jqLite('<div class="transition-animation"></div>'); <add> var element = angular.element('<div class="transition-animation"></div>'); <ide> $rootElement.append(element); <ide> <ide> $animateCss(element, { event: 'enter', structural: true }).start(); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should ignore transition staggers if only keyframe animations were detected", <ide> inject(function($animateCss, $document, $rootElement) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.ng-enter-stagger', 'transition-delay:0.2s'); <ide> ss.addPossiblyPrefixedRule('.transition-animation', 'animation: 2s 5s my_animation;'); <ide> <ide> for (var i = 0; i < 5; i++) { <del> var elm = jqLite('<div class="transition-animation"></div>'); <add> var elm = angular.element('<div class="transition-animation"></div>'); <ide> $rootElement.append(elm); <ide> <ide> var animator = $animateCss(elm, { event: 'enter', structural: true }).start(); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should start on the highest stagger value if both transition and keyframe staggers are used together", <ide> inject(function($animateCss, $document, $rootElement, $timeout, $browser) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addPossiblyPrefixedRule('.ng-enter-stagger', 'transition-delay: 0.5s; ' + <ide> 'animation-delay: 1s'); <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> var i, elm, elements = []; <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> elements.push(elm); <ide> $rootElement.append(elm); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should apply the closing timeout ontop of the stagger timeout", <ide> inject(function($animateCss, $document, $rootElement, $timeout, $browser) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.ng-enter-stagger', 'transition-delay:1s;'); <ide> ss.addRule('.ng-enter', 'transition:10s linear all;'); <ide> <ide> var elm, i, elms = []; <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> elms.push(elm); <ide> $rootElement.append(elm); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should apply the closing timeout ontop of the stagger timeout with an added delay", <ide> inject(function($animateCss, $document, $rootElement, $timeout, $browser) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.ng-enter-stagger', 'transition-delay:1s;'); <ide> ss.addRule('.ng-enter', 'transition:10s linear all; transition-delay:50s;'); <ide> <ide> var elm, i, elms = []; <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> elms.push(elm); <ide> $rootElement.append(elm); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should issue a stagger if a stagger value is provided in the options", <ide> inject(function($animateCss, $document, $rootElement, $timeout) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> ss.addRule('.ng-enter', 'transition:2s linear all'); <ide> <ide> var elm, i, elements = []; <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> elements.push(elm); <ide> $rootElement.append(elm); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should only add/remove classes once the stagger timeout has passed", <ide> inject(function($animateCss, $document, $rootElement, $timeout) { <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <del> var element = jqLite('<div class="green"></div>'); <add> var element = angular.element('<div class="green"></div>'); <ide> $rootElement.append(element); <ide> <ide> $animateCss(element, { <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> ss.addRule('.ng-enter', 'transition:10s linear all;'); <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var animator = $animateCss(element, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> ss.addRule('.ng-enter', 'transition:10s linear all; transition-delay:30s;'); <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var animator = $animateCss(element, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> ss.addRule('.ng-enter', 'transition:10s linear all;'); <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var animator = $animateCss(element, { event: 'enter', structural: true }); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> ss.addRule('.ng-enter', 'transition:10s linear all;'); <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var animator = $animateCss(element, { event: 'enter', structural: true }); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> ss.addRule('.elm.blue', 'transition:2s linear all; background:blue;'); <ide> ss.addRule('.elm.green', 'background:green;'); <ide> <del> var element = jqLite('<div class="elm"></div>'); <add> var element = angular.element('<div class="elm"></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> // timeout will be at 1500s <ide> animate(element, 'red', doneSpy); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should not throw an error any pending timeout requests resolve after the element has already been removed", <ide> inject(function($animateCss, $document, $rootElement, $timeout, $animate) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.red', 'transition:1s linear all;'); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it("should consider a positive options.delay value for the closing timeout", <ide> inject(function($animateCss, $rootElement, $timeout, $document) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var options = { <ide> delay: 3, <ide> describe("ngAnimate $animateCss", function() { <ide> it("should ignore a boolean options.delay value for the closing timeout", <ide> inject(function($animateCss, $rootElement, $timeout, $document) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var options = { <ide> delay: true, <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> ss.addRule('.ng-enter', 'transition:10s linear all;'); <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var animator = $animateCss(element, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> beforeEach(module(function($provide) { <ide> count = {}; <ide> $provide.value('$window', extend({}, window, { <del> document: jqLite(window.document), <add> document: angular.element(window.document), <ide> getComputedStyle: function(node) { <ide> var key = node.className.indexOf('stagger') >= 0 <ide> ? 'stagger' : 'normal'; <ide> describe("ngAnimate $animateCss", function() { <ide> })); <ide> <ide> return function($document, $rootElement) { <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> }; <ide> })); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> var i, elm, animator; <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> $rootElement.append(elm); <ide> animator = $animateCss(elm, { event: 'enter', structural: true }); <ide> var runner = animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> expect(count.normal).toBe(1); <ide> <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> $rootElement.append(elm); <ide> animator = $animateCss(elm, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> expect(count.normal).toBe(2); <ide> <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> $rootElement.append(elm); <ide> animator = $animateCss(elm, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> it("should cache frequent calls to getComputedStyle for stagger animations before the next animation frame kicks in", <ide> inject(function($animateCss, $document, $rootElement, $$rAF) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> var animator = $animateCss(element, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> var i, elm; <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> $rootElement.append(elm); <ide> animator = $animateCss(elm, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> expect(count.stagger).toBe(1); <ide> <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> $rootElement.append(elm); <ide> animator = $animateCss(elm, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> $$rAF.flush(); <ide> <ide> for (i = 0; i < 5; i++) { <del> elm = jqLite('<div></div>'); <add> elm = angular.element('<div></div>'); <ide> $rootElement.append(elm); <ide> animator = $animateCss(elm, { event: 'enter', structural: true }); <ide> animator.start(); <ide> describe("ngAnimate $animateCss", function() { <ide> } <ide> <ide> beforeEach(inject(function($rootElement, $document) { <del> element = jqLite('<div></div>'); <add> element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> elementOnSpy = spyOn(element, 'on').and.callThrough(); <ide> elementOffSpy = spyOn(element, 'off').and.callThrough(); <ide> describe("ngAnimate $animateCss", function() { <ide> triggerAnimationStartFrame(); <ide> } <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> startAnimation(element, 0.5, 'red'); <ide> expect(element.attr('style')).toContain('transition'); <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> it("should clear cache if no animation so follow-up animation on the same element will not be from cache", <ide> inject(function($animateCss, $rootElement, $document, $$rAF) { <del> var element = jqLite('<div class="rclass"></div>'); <add> var element = angular.element('<div class="rclass"></div>'); <ide> var options = { <ide> event: 'enter', <ide> structural: true <ide> }; <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> var animator = $animateCss(element, options); <ide> expect(animator.$$willAnimate).toBeFalsy(); <ide> <ide> describe("ngAnimate $animateCss", function() { <ide> it('should apply a custom temporary class when a non-structural animation is used', <ide> inject(function($animateCss, $rootElement, $document) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> $animateCss(element, { <ide> event: 'super', <ide> describe("ngAnimate $animateCss", function() { <ide> they('should decorate the element with the ng-$prop CSS class', <ide> ['enter', 'leave', 'move'], function(event) { <ide> inject(function($animateCss, $rootElement, $document) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> $animateCss(element, { <ide> event: event, <ide> describe("ngAnimate $animateCss", function() { <ide> they('should decorate the element with the ng-$prop-active CSS class', <ide> ['enter', 'leave', 'move'], function(event) { <ide> inject(function($animateCss, $rootElement, $document) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var animator = $animateCss(element, { <ide> event: event, <ide> describe("ngAnimate $animateCss", function() { <ide> they('should remove the ng-$prop and ng-$prop-active CSS classes from the element once the animation is done', <ide> ['enter', 'leave', 'move'], function(event) { <ide> inject(function($animateCss, $rootElement, $document) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var animator = $animateCss(element, { <ide> event: event, <ide> describe("ngAnimate $animateCss", function() { <ide> they('should allow additional CSS classes to be added and removed alongside the $prop animation', <ide> ['enter', 'leave', 'move'], function(event) { <ide> inject(function($animateCss, $rootElement) { <del> var element = jqLite('<div class="green"></div>'); <add> var element = angular.element('<div class="green"></div>'); <ide> $rootElement.append(element); <ide> var animator = $animateCss(element, { <ide> event: event, <ide> describe("ngAnimate $animateCss", function() { <ide> ['enter', 'leave', 'move', 'addClass', 'removeClass'], function(event) { <ide> <ide> inject(function($animateCss, $rootElement, $document) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.cool-animation', 'transition:1.5s linear all;'); <ide> element.addClass('cool-animation'); <ide> describe("ngAnimate $animateCss", function() { <ide> ['enter', 'leave', 'move', 'addClass', 'removeClass'], function(event) { <ide> <ide> inject(function($animateCss, $rootElement, $document, $window) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.cool-animation', 'transition:1.5s linear all;'); <ide> element.addClass('cool-animation'); <ide> describe("ngAnimate $animateCss", function() { <ide> ['enter', 'leave', 'move', 'addClass', 'removeClass'], function(event) { <ide> <ide> inject(function($animateCss, $rootElement, $document) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> ss.addRule('.cool-animation', 'transition:1.5s linear all;'); <ide> element.addClass('cool-animation'); <ide> describe("ngAnimate $animateCss", function() { <ide> it('should allow multiple events to be animated at the same time', <ide> inject(function($animateCss, $rootElement, $document) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> $animateCss(element, { <ide> event: ['enter', 'leave', 'move'], <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> it('should not break when running anchored animations without duration', <ide> inject(function($animate, $document, $rootElement) { <del> var element1 = jqLite('<div class="item" ng-animate-ref="test">Item 1</div>'); <del> var element2 = jqLite('<div class="item" ng-animate-ref="test">Item 2</div>'); <add> var element1 = angular.element('<div class="item" ng-animate-ref="test">Item 1</div>'); <add> var element2 = angular.element('<div class="item" ng-animate-ref="test">Item 2</div>'); <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> $rootElement.append(element1); <ide> <ide> expect($rootElement.text()).toBe('Item 1'); <ide> describe("ngAnimate $animateCss", function() { <ide> they('should decorate the element with the class-$prop CSS class', <ide> ['add', 'remove'], function(event) { <ide> inject(function($animateCss, $rootElement) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> <ide> var options = {}; <ide> describe("ngAnimate $animateCss", function() { <ide> they('should decorate the element with the class-$prop-active CSS class', <ide> ['add', 'remove'], function(event) { <ide> inject(function($animateCss, $rootElement) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> <ide> var options = {}; <ide> describe("ngAnimate $animateCss", function() { <ide> they('should remove the class-$prop-add and class-$prop-active CSS classes from the element once the animation is done', <ide> ['enter', 'leave', 'move'], function(event) { <ide> inject(function($animateCss, $rootElement, $document) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var options = {}; <ide> options.event = event; <ide> describe("ngAnimate $animateCss", function() { <ide> ['add', 'remove'], function(event) { <ide> inject(function($animateCss, $rootElement, $document) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> <ide> if (event == 'add') { <ide> ss.addRule('.natural-class', 'transition:1s linear all;'); <ide> describe("ngAnimate $animateCss", function() { <ide> } <ide> <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var options = {}; <ide> options[event + 'Class'] = 'natural-class'; <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> ss.addRule('.blue.ng-' + event, 'transition:2s linear all;'); <ide> <del> var element = jqLite('<div class="red"></div>'); <add> var element = angular.element('<div class="red"></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <ide> var runner = $animateCss(element, { <ide> addClass: 'blue', <ide> describe("ngAnimate $animateCss", function() { <ide> var element; <ide> beforeEach(module(function() { <ide> return function($rootElement, $document) { <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> <del> element = jqLite('<div></div>'); <add> element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> }; <ide> })); <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> describe("[duration]", function() { <ide> it("should be applied for a transition directly", inject(function($animateCss, $rootElement) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> <ide> var options = { <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> describe("[delay]", function() { <ide> it("should be applied for a transition directly", inject(function($animateCss, $rootElement) { <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> <ide> var options = { <ide> describe("ngAnimate $animateCss", function() { <ide> it("should return false for the animator if a delay is provided but not a duration", <ide> inject(function($animateCss, $rootElement) { <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> <ide> var options = { <ide> describe("ngAnimate $animateCss", function() { <ide> '-webkit-transition-delay:10s;' + <ide> 'transition-delay:10s;'); <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> <ide> var options = { <ide> describe("ngAnimate $animateCss", function() { <ide> '-webkit-transition-delay:10s;' + <ide> 'transition-delay:10s;'); <ide> <del> var element = jqLite('<div></div>'); <add> var element = angular.element('<div></div>'); <ide> $rootElement.append(element); <ide> <ide> var options = { <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> var element; <ide> beforeEach(inject(function($document, $rootElement) { <del> element = jqLite('<div></div>'); <add> element = angular.element('<div></div>'); <ide> $rootElement.append(element); <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> })); <ide> <ide> it("should apply easing to a transition animation if it exists", inject(function($animateCss) { <ide> describe("ngAnimate $animateCss", function() { <ide> '<circle cx="15" cy="5" r="100" fill="orange" />' + <ide> '</svg>')($rootScope); <ide> <del> jqLite($document[0].body).append($rootElement); <add> angular.element($document[0].body).append($rootElement); <ide> $rootElement.append(element); <ide> <ide> $animateCss(element, { <ide> describe("ngAnimate $animateCss", function() { <ide> <ide> triggerAnimationStartFrame(); <ide> <del> expect(jqLiteHasClass(element[0], 'ng-enter')).toBe(true); <del> expect(jqLiteHasClass(element[0], 'ng-enter-active')).toBe(true); <add> expect(element).toHaveClass('ng-enter'); <add> expect(element).toHaveClass('ng-enter-active'); <ide> <ide> browserTrigger(element, 'transitionend', { timeStamp: Date.now() + 1000, elapsedTime: 10 }); <ide> <del> expect(jqLiteHasClass(element[0], 'ng-enter')).toBe(false); <del> expect(jqLiteHasClass(element[0], 'ng-enter-active')).toBe(false); <add> expect(element).not.toHaveClass('ng-enter'); <add> expect(element).not.toHaveClass('ng-enter-active'); <ide> })); <ide> <ide> it('should properly remove classes from SVG elements', inject(function($animateCss) { <del> var element = jqLite('<svg width="500" height="500">' + <add> var element = angular.element('<svg width="500" height="500">' + <ide> '<rect class="class-of-doom"></rect>' + <ide> '</svg>'); <ide> var child = element.find('rect'); <ide><path>test/ngMessages/messagesSpec.js <ide> describe('ngMessages', function() { <ide> return str.replace(/\s+/g,''); <ide> } <ide> <add> function trim(value) { <add> return isString(value) ? value.trim() : value; <add> } <add> <ide> var element; <ide> afterEach(function() { <ide> dealoc(element);
4
Python
Python
fix spelling mistake in version module gen
a70c4833629dcacddcdca118f45fc95e3dd4739d
<ide><path>setup.py <ide> def svn_version(): <ide> def write_version_py(filename='numpy/version.py'): <ide> cnt = """ <ide> # THIS FILE IS GENERATED FROM NUMPY SETUP.PY <del>Short_version='%(version)s' <add>short_version='%(version)s' <ide> version='%(version)s' <ide> release=%(isrelease)s <ide>
1
Javascript
Javascript
prevent mousemove spam
b7cc2a8a4c6e329322cc182447b7052850ed48ff
<ide><path>src/js/player.js <ide> vjs.Player.prototype.userActive = function(bool){ <ide> }; <ide> <ide> vjs.Player.prototype.listenForUserActivity = function(){ <del> var onMouseActivity, onMouseDown, mouseInProgress, onMouseUp, <del> activityCheck, inactivityTimeout; <add> var onActivity, onMouseMove, onMouseDown, mouseInProgress, onMouseUp, <add> activityCheck, inactivityTimeout, lastMoveX, lastMoveY; <ide> <del> onMouseActivity = vjs.bind(this, this.reportUserActivity); <add> onActivity = vjs.bind(this, this.reportUserActivity); <add> <add> onMouseMove = function(e) { <add> // Prevent mousemove spamming <add> if(e.screenX != lastMoveX || e.screenY != lastMoveY) { <add> lastMoveX = e.screenX; <add> lastMoveY = e.screenY; <add> onActivity(); <add> } <add> }; <ide> <ide> onMouseDown = function() { <del> onMouseActivity(); <add> onActivity(); <ide> // For as long as the they are touching the device or have their mouse down, <ide> // we consider them active even if they're not moving their finger or mouse. <ide> // So we want to continue to update that they are active <ide> clearInterval(mouseInProgress); <ide> // Setting userActivity=true now and setting the interval to the same time <ide> // as the activityCheck interval (250) should ensure we never miss the <ide> // next activityCheck <del> mouseInProgress = setInterval(onMouseActivity, 250); <add> mouseInProgress = setInterval(onActivity, 250); <ide> }; <ide> <ide> onMouseUp = function(event) { <del> onMouseActivity(); <add> onActivity(); <ide> // Stop the interval that maintains activity if the mouse/touch is down <ide> clearInterval(mouseInProgress); <ide> }; <ide> <ide> // Any mouse movement will be considered user activity <ide> this.on('mousedown', onMouseDown); <del> this.on('mousemove', onMouseActivity); <add> this.on('mousemove', onMouseMove); <ide> this.on('mouseup', onMouseUp); <ide> <ide> // Listen for keyboard navigation <ide> // Shouldn't need to use inProgress interval because of key repeat <del> this.on('keydown', onMouseActivity); <del> this.on('keyup', onMouseActivity); <add> this.on('keydown', onActivity); <add> this.on('keyup', onActivity); <ide> <ide> // Run an interval every 250 milliseconds instead of stuffing everything into <ide> // the mousemove/touchmove function itself, to prevent performance degradation.
1
Go
Go
add some more fields in docker service inspect -p
4c9e21b674046e8a3819cfbbb96f471bd280fba5
<ide><path>api/client/service/inspect.go <ide> import ( <ide> "github.com/docker/docker/pkg/ioutils" <ide> apiclient "github.com/docker/engine-api/client" <ide> "github.com/docker/engine-api/types/swarm" <add> "github.com/docker/go-units" <ide> "github.com/spf13/cobra" <ide> ) <ide> <ide> func printService(out io.Writer, service swarm.Service) { <ide> } <ide> } <ide> fmt.Fprintln(out, "Placement:") <del> fmt.Fprintln(out, " Strategy:\tSPREAD") <add> fmt.Fprintln(out, " Strategy:\tSpread") <add> if service.Spec.TaskTemplate.Placement != nil && len(service.Spec.TaskTemplate.Placement.Constraints) > 0 { <add> ioutils.FprintfIfNotEmpty(out, " Constraints\t: %s\n", strings.Join(service.Spec.TaskTemplate.Placement.Constraints, ", ")) <add> } <ide> fmt.Fprintf(out, "UpdateConfig:\n") <ide> fmt.Fprintf(out, " Parallelism:\t%d\n", service.Spec.UpdateConfig.Parallelism) <ide> if service.Spec.UpdateConfig.Delay.Nanoseconds() > 0 { <ide> fmt.Fprintf(out, " Delay:\t\t%s\n", service.Spec.UpdateConfig.Delay) <ide> } <ide> fmt.Fprintf(out, "ContainerSpec:\n") <ide> printContainerSpec(out, service.Spec.TaskTemplate.ContainerSpec) <add> <add> if service.Spec.TaskTemplate.Resources != nil { <add> fmt.Fprintln(out, "Resources:") <add> printResources := func(out io.Writer, r *swarm.Resources) { <add> if r.NanoCPUs != 0 { <add> fmt.Fprintf(out, " CPU:\t\t%g\n", float64(r.NanoCPUs)/1e9) <add> } <add> if r.MemoryBytes != 0 { <add> fmt.Fprintf(out, " Memory:\t\t%s\n", units.BytesSize(float64(r.MemoryBytes))) <add> } <add> } <add> if service.Spec.TaskTemplate.Resources.Reservations != nil { <add> fmt.Fprintln(out, "Reservations:") <add> printResources(out, service.Spec.TaskTemplate.Resources.Reservations) <add> } <add> if service.Spec.TaskTemplate.Resources.Limits != nil { <add> fmt.Fprintln(out, "Limits:") <add> printResources(out, service.Spec.TaskTemplate.Resources.Limits) <add> } <add> } <add> if len(service.Spec.Networks) > 0 { <add> fmt.Fprintf(out, "Networks:") <add> for _, n := range service.Spec.Networks { <add> fmt.Fprintf(out, " %s", n.Target) <add> } <add> } <add> <add> if len(service.Endpoint.Ports) > 0 { <add> fmt.Fprintln(out, "Ports:") <add> for _, port := range service.Endpoint.Ports { <add> fmt.Fprintf(out, " Name = %s\n", port.Name) <add> fmt.Fprintf(out, " Protocol = %s\n", port.Protocol) <add> fmt.Fprintf(out, " TargetPort = %d\n", port.TargetPort) <add> fmt.Fprintf(out, " PublishedPort = %d\n", port.PublishedPort) <add> } <add> } <ide> } <ide> <ide> func printContainerSpec(out io.Writer, containerSpec swarm.ContainerSpec) { <ide> func printContainerSpec(out io.Writer, containerSpec swarm.ContainerSpec) { <ide> } <ide> ioutils.FprintfIfNotEmpty(out, " Dir\t\t%s\n", containerSpec.Dir) <ide> ioutils.FprintfIfNotEmpty(out, " User\t\t%s\n", containerSpec.User) <add> if len(containerSpec.Mounts) > 0 { <add> fmt.Fprintln(out, " Mounts:") <add> for _, v := range containerSpec.Mounts { <add> fmt.Fprintf(out, " Target = %s\n", v.Target) <add> fmt.Fprintf(out, " Source = %s\n", v.Source) <add> fmt.Fprintf(out, " Writable = %v\n", v.Writable) <add> fmt.Fprintf(out, " Type = %v\n", v.Type) <add> } <add> } <ide> }
1
Go
Go
use local variable err instead of a outer one
a0804e8e118510dc49e7e74273a323e99c097a3d
<ide><path>api/server/server.go <ide> func getContainersTop(eng *engine.Engine, version version.Version, w http.Respon <ide> } <ide> <ide> func getContainersJSON(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error { <del> var err error <del> if err = parseForm(r); err != nil { <add> if err := parseForm(r); err != nil { <ide> return err <ide> } <ide> <ide> func getContainersJSON(eng *engine.Engine, version version.Version, w http.Respo <ide> } <ide> <ide> if tmpLimit := r.Form.Get("limit"); tmpLimit != "" { <del> config.Limit, err = strconv.Atoi(tmpLimit) <add> limit, err := strconv.Atoi(tmpLimit) <ide> if err != nil { <ide> return err <ide> } <add> config.Limit = limit <ide> } <ide> <ide> containers, err := getDaemon(eng).Containers(config)
1
Javascript
Javascript
add transformexample to uiexplorerlist.ios.js
43ca8a0da41bd804329c056d6c5ac7cea931d5e4
<ide><path>Examples/UIExplorer/UIExplorerList.ios.js <ide> var APIS = [ <ide> require('./RCTRootViewIOSExample'), <ide> require('./StatusBarIOSExample'), <ide> require('./TimerExample'), <add> require('./TransformExample'), <ide> require('./VibrationIOSExample'), <ide> require('./XHRExample.ios'), <ide> require('./ImageEditingExample'),
1
Javascript
Javascript
fix dom width retrieval
b5fdfca9dc1304a9844e13ab5955dad5640c489b
<ide><path>examples/js/controls/OrbitControls.js <ide> THREE.OrbitControls = function ( object, domElement ) { <ide> // half of the fov is center to top of screen <ide> targetDistance *= Math.tan( (scope.object.fov/2) * Math.PI / 180.0 ); <ide> // we actually don't use screenWidth, since perspective camera is fixed to screen height <del> scope.panLeft( 2 * delta.x * targetDistance / scope.domElement.height ); <del> scope.panUp( 2 * delta.y * targetDistance / scope.domElement.height ); <add> var height = ( scope.domElement.height !== undefined ) ? <add> scope.domElement.height : scope.domElement.body.clientHeight; <add> scope.panLeft( 2 * delta.x * targetDistance / height ); <add> scope.panUp( 2 * delta.y * targetDistance / height ); <ide> } <ide> else if ( scope.object.top !== undefined ) <ide> { <ide> // orthographic <del> scope.panLeft( delta.x * (scope.object.right - scope.object.left) / scope.domElement.width ); <del> scope.panUp( delta.y * (scope.object.top - scope.object.bottom) / scope.domElement.height ); <add> var width = ( scope.domElement.width !== undefined ) ? <add> scope.domElement.width : scope.domElement.body.clientWidth; <add> var height = ( scope.domElement.height !== undefined ) ? <add> scope.domElement.height : scope.domElement.body.clientHeight; <add> scope.panLeft( delta.x * (scope.object.right - scope.object.left) / width ); <add> scope.panUp( delta.y * (scope.object.top - scope.object.bottom) / height ); <ide> } <ide> else <ide> { <ide> THREE.OrbitControls = function ( object, domElement ) { <ide> rotateEnd.set( event.clientX, event.clientY ); <ide> rotateDelta.subVectors( rotateEnd, rotateStart ); <ide> <add> var width = ( scope.domElement.width !== undefined ) ? <add> scope.domElement.width : scope.domElement.body.clientWidth; <add> var height = ( scope.domElement.height !== undefined ) ? <add> scope.domElement.height : scope.domElement.body.clientHeight; <ide> // rotating across whole screen goes 360 degrees around <del> scope.rotateLeft( 2 * Math.PI * rotateDelta.x / scope.domElement.width * scope.rotateSpeed ); <add> scope.rotateLeft( 2 * Math.PI * rotateDelta.x / width * scope.rotateSpeed ); <ide> // rotating up and down along whole screen attempts to go 360, but limited to 180 <del> scope.rotateUp( 2 * Math.PI * rotateDelta.y / scope.domElement.height * scope.rotateSpeed ); <add> scope.rotateUp( 2 * Math.PI * rotateDelta.y / height * scope.rotateSpeed ); <ide> <ide> rotateStart.copy( rotateEnd ); <ide> <ide> THREE.OrbitControls = function ( object, domElement ) { <ide> rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); <ide> rotateDelta.subVectors( rotateEnd, rotateStart ); <ide> <add> var width = ( scope.domElement.width !== undefined ) ? <add> scope.domElement.width : scope.domElement.body.clientWidth; <add> var height = ( scope.domElement.height !== undefined ) ? <add> scope.domElement.height : scope.domElement.body.clientHeight; <ide> // rotating across whole screen goes 360 degrees around <del> scope.rotateLeft( 2 * Math.PI * rotateDelta.x / scope.domElement.width * scope.rotateSpeed ); <add> scope.rotateLeft( 2 * Math.PI * rotateDelta.x / width * scope.rotateSpeed ); <ide> // rotating up and down along whole screen attempts to go 360, but limited to 180 <del> scope.rotateUp( 2 * Math.PI * rotateDelta.y / scope.domElement.height * scope.rotateSpeed ); <add> scope.rotateUp( 2 * Math.PI * rotateDelta.y / height * scope.rotateSpeed ); <ide> <ide> rotateStart.copy( rotateEnd ); <ide> break;
1
Javascript
Javascript
remove minified tests from grunt test task
44953cf99b4911bfff64e588ce275675e06261be
<ide><path>Gruntfile.js <ide> module.exports = function(grunt) { <ide> // Development watch task. Doing the minimum required. <ide> grunt.registerTask('dev', ['jshint', 'less', 'browserify', 'karma:chrome']); <ide> <add> // Tests. <add> // We want to run things a little differently if it's coming from Travis vs local <add> if (process.env.TRAVIS) { <add> grunt.registerTask('test', ['build', 'test-travis', 'coveralls']); <add> } else { <add> grunt.registerTask('test', ['build', 'test-local']); <add> } <add> <ide> // Load all the tasks in the tasks directory <ide> grunt.loadTasks('build/tasks'); <ide> }; <ide><path>build/tasks/test-local.js <add>module.exports = function(grunt) { <add> // You can specify which browsers to build with by using grunt-style arguments <add> // or separating them with a comma: <add> // grunt test:chrome:firefox # grunt-style <add> // grunt test:chrome,firefox # comma-separated <add> grunt.registerTask('test-local', function() { <add> var tasks = this.args; <add> var tasksMinified; <add> <add> // if we aren't running this in a CI, but running it manually, we can <add> // supply arguments to this task. These arguments are either colon (`:`) <add> // separated which is the default grunt separator for arguments, or they <add> // are comma (`,`) separated to make it easier. <add> // The arguments are the names of which browsers you want. <add> if (tasks.length === 0) { <add> tasks.push('chrome'); <add> } <add> if (tasks.length === 1) { <add> tasks = tasks[0].split(','); <add> } <add> <add> tasks = tasks.map(function(task) { <add> return 'karma:' + task; <add> }); <add> <add> grunt.task.run(tasks); <add> }); <add>}; <ide><path>build/tasks/test-travis.js <add>module.exports = function(grunt) { <add> // The test task will run `karma:saucelabs` when running in travis, <add> // when running via a PR from a fork, it'll run qunit tests in phantom using <add> // karma otherwise, it'll run the tests in chrome via karma <add> // You can specify which browsers to build with by using grunt-style arguments <add> // or separating them with a comma: <add> // grunt test:chrome:firefox # grunt-style <add> // grunt test:chrome,firefox # comma-separated <add> grunt.registerTask('test-travis', function() { <add> var tasks = this.args; <add> var tasksMinified; <add> <add> // I believe this was done originally because of security implications around running <add> // Saucelabs automatically on PRs. <add> if (process.env.TRAVIS_PULL_REQUEST !== 'false') { <add> grunt.task.run(['karma:firefox']); <add> } else { <add> grunt.task.run(['karma:firefox']); <add> //Disabling saucelabs until we figure out how to make it run reliably. <add> //grunt.task.run([ <add> //'karma:chrome_sl', <add> //'karma:firefox_sl', <add> //'karma:safari_sl', <add> //'karma:ipad_sl', <add> //'karma:android_sl', <add> //'karma:ie_sl' <add> //]); <add> } <add> }); <add>}; <ide><path>build/tasks/test.js <del>module.exports = function(grunt) { <del> // The test task will run `karma:saucelabs` when running in travis, <del> // when running via a PR from a fork, it'll run qunit tests in phantom using <del> // karma otherwise, it'll run the tests in chrome via karma <del> // You can specify which browsers to build with by using grunt-style arguments <del> // or separating them with a comma: <del> // grunt test:chrome:firefox # grunt-style <del> // grunt test:chrome,firefox # comma-separated <del> grunt.registerTask('test', function() { <del> var tasks = this.args, <del> tasksMinified, <del> tasksMinifiedApi; <del> <del> // I believe this was done originally because of security implications around running <del> // Saucelabs automatically on PRs. <del> if (process.env.TRAVIS && process.env.TRAVIS_PULL_REQUEST !== 'false') { <del> grunt.task.run(['karma:firefox', 'coveralls']); <del> } else if (process.env.TRAVIS) { <del> grunt.task.run(['karma:firefox', 'coveralls']); <del> //Disabling saucelabs until we figure out how to make it run reliably. <del> //grunt.task.run([ <del> //'karma:chrome_sl', <del> //'karma:firefox_sl', <del> //'karma:safari_sl', <del> //'karma:ipad_sl', <del> //'karma:android_sl', <del> //'karma:ie_sl' <del> //]); <del> } else { <del> // if we aren't running this in a CI, but running it manually, we can <del> // supply arguments to this task. These arguments are either colon (`:`) <del> // separated which is the default grunt separator for arguments, or they <del> // are comma (`,`) separated to make it easier. <del> // The arguments are the names of which browsers you want. It'll then <del> // make sure you have the `minified` and `minified_api` for those browsers <del> // as well. <del> if (tasks.length === 0) { <del> tasks.push('chrome'); <del> } <del> if (tasks.length === 1) { <del> tasks = tasks[0].split(','); <del> } <del> <del> tasksMinified = tasks.slice(); <del> tasksMinifiedApi = tasks.slice(); <del> <del> tasksMinified = tasksMinified.map(function(task) { <del> return 'minified_' + task; <del> }); <del> <del> tasksMinifiedApi = tasksMinifiedApi.map(function(task) { <del> return 'minified_api_' + task; <del> }); <del> <del> tasks = tasks.concat(tasksMinified).concat(tasksMinifiedApi); <del> tasks = tasks.map(function(task) { <del> return 'karma:' + task; <del> }); <del> <del> grunt.task.run(tasks); <del> } <del> }); <del>};
4
PHP
PHP
update typehints for event manager
f5e1257493e46a3b631ce8a383b839673fa7774f
<ide><path>src/Event/Event.php <ide> public function getName(): string <ide> /** <ide> * Returns the subject of this event <ide> * <del> * @return object <add> * @return object|null <ide> */ <ide> public function getSubject() <ide> { <ide><path>src/Event/EventManager.php <ide> */ <ide> namespace Cake\Event; <ide> <add>use Cake\Core\Exception\Exception; <ide> use InvalidArgumentException; <ide> <ide> /** <ide> public static function instance(?EventManagerInterface $manager = null) <ide> /** <ide> * @inheritDoc <ide> */ <del> public function on($eventKey = null, $options = [], $callable = null) <add> public function on($eventKey, $options = [], ?callable $callable = null) <ide> { <ide> if ($eventKey instanceof EventListenerInterface) { <ide> $this->_attachSubscriber($eventKey); <ide> <ide> return $this; <ide> } <add> <ide> $argCount = func_num_args(); <del> if ($eventKey && $argCount === 2) { <add> if ($argCount === 2) { <ide> $this->_listeners[$eventKey][static::$defaultPriority][] = [ <ide> 'callable' => $options, <ide> ]; <ide> <ide> return $this; <ide> } <del> if ($eventKey && $argCount === 3) { <del> $priority = $options['priority'] ?? static::$defaultPriority; <del> $this->_listeners[$eventKey][$priority][] = [ <del> 'callable' => $callable, <del> ]; <ide> <del> return $this; <del> } <del> throw new InvalidArgumentException( <del> 'Invalid arguments for EventManager::on(). ' . <del> "Expected 1, 2 or 3 arguments. Got {$argCount} arguments." <del> ); <add> $priority = $options['priority'] ?? static::$defaultPriority; <add> $this->_listeners[$eventKey][$priority][] = [ <add> 'callable' => $callable, <add> ]; <add> <add> return $this; <ide> } <ide> <ide> /** <ide> public function off($eventKey, $callable = null) <ide> <ide> return $this; <ide> } <del> if ($callable instanceof EventListenerInterface) { <del> $this->_detachSubscriber($callable, $eventKey); <add> <add> if (!is_string($eventKey)) { <add> if (!is_callable($eventKey)) { <add> throw new Exception( <add> 'First argument of EventManager::off() must be ' . <add> ' string or EventListenerInterface instance or callable.' <add> ); <add> } <add> <add> foreach (array_keys($this->_listeners) as $name) { <add> $this->off($name, $eventKey); <add> } <ide> <ide> return $this; <ide> } <del> if ($callable === null && is_string($eventKey)) { <del> unset($this->_listeners[$eventKey]); <add> <add> if ($callable instanceof EventListenerInterface) { <add> $this->_detachSubscriber($callable, $eventKey); <ide> <ide> return $this; <ide> } <add> <ide> if ($callable === null) { <del> foreach (array_keys($this->_listeners) as $name) { <del> $this->off($name, $eventKey); <del> } <add> unset($this->_listeners[$eventKey]); <ide> <ide> return $this; <ide> } <add> <ide> if (empty($this->_listeners[$eventKey])) { <ide> return $this; <ide> } <add> <ide> foreach ($this->_listeners[$eventKey] as $priority => $callables) { <ide> foreach ($callables as $k => $callback) { <ide> if ($callback['callable'] === $callable) { <ide><path>src/Event/EventManagerInterface.php <ide> interface EventManagerInterface <ide> * $eventManager->on('Model.beforeSave', ['priority' => 90], $callable); <ide> * ``` <ide> * <del> * @param string|\Cake\Event\EventListenerInterface|null $eventKey The event unique identifier name <add> * @param string|\Cake\Event\EventListenerInterface $eventKey The event unique identifier name <ide> * with which the callback will be associated. If $eventKey is an instance of <ide> * Cake\Event\EventListenerInterface its events will be bound using the `implementedEvents` methods. <ide> * <ide> interface EventManagerInterface <ide> * @throws \InvalidArgumentException When event key is missing or callable is not an <ide> * instance of Cake\Event\EventListenerInterface. <ide> */ <del> public function on($eventKey = null, $options = [], $callable = null); <add> public function on($eventKey, $options = [], ?callable $callable = null); <ide> <ide> /** <ide> * Remove a listener from the active listeners. <ide> public function on($eventKey = null, $options = [], $callable = null); <ide> * $manager->off($callback); <ide> * ``` <ide> * <del> * @param string|\Cake\Event\EventListenerInterface $eventKey The event unique identifier name <add> * @param string|\Cake\Event\EventListenerInterface|callable $eventKey The event unique identifier name <ide> * with which the callback has been associated, or the $listener you want to remove. <del> * @param callable|null $callable The callback you want to detach. <add> * @param \Cake\Event\EventListenerInterface|callable|null $callable The callback you want to detach. <ide> * @return $this <ide> */ <ide> public function off($eventKey, $callable = null); <ide><path>tests/TestCase/Event/EventManagerTest.php <ide> public function testOn() <ide> { <ide> $count = 1; <ide> $manager = new EventManager(); <del> $manager->on('my.event', 'myfunc'); <add> $manager->on('my.event', 'substr'); <ide> $expected = [ <del> ['callable' => 'myfunc'], <add> ['callable' => 'substr'], <ide> ]; <ide> $this->assertSame($expected, $manager->listeners('my.event')); <ide> <del> $manager->on('my.event', ['priority' => 1], 'func2'); <add> $manager->on('my.event', ['priority' => 1], 'strpos'); <ide> $expected = [ <del> ['callable' => 'func2'], <del> ['callable' => 'myfunc'], <add> ['callable' => 'strpos'], <add> ['callable' => 'substr'], <ide> ]; <ide> $this->assertSame($expected, $manager->listeners('my.event')); <ide> <ide> public function testOn() <ide> $this->assertEquals($expected, $manager->listeners('fake.event')); <ide> } <ide> <del> /** <del> * Test the on() with invalid arguments <del> * <del> * @expectedException InvalidArgumentException <del> * @expectedExceptionMessage Invalid arguments for EventManager::on(). Expected 1, 2 or 3 arguments. <del> * @return void <del> */ <del> public function testOnInvalidArgument() <del> { <del> $manager = new EventManager(); <del> $manager->on(); <del> } <del> <ide> /** <ide> * Tests off'ing an event from a event key queue <ide> * <ide> public function testOff() <ide> $manager = new EventManager(); <ide> $manager->on('fake.event', ['AClass', 'aMethod']); <ide> $manager->on('another.event', ['AClass', 'anotherMethod']); <del> $manager->on('another.event', ['priority' => 1], 'fakeFunction'); <add> $manager->on('another.event', ['priority' => 1], 'substr'); <ide> <ide> $manager->off('fake.event', ['AClass', 'aMethod']); <ide> $this->assertEquals([], $manager->listeners('fake.event')); <ide> <ide> $manager->off('another.event', ['AClass', 'anotherMethod']); <ide> $expected = [ <del> ['callable' => 'fakeFunction'], <add> ['callable' => 'substr'], <ide> ]; <ide> $this->assertEquals($expected, $manager->listeners('another.event')); <ide> <del> $manager->off('another.event', 'fakeFunction'); <add> $manager->off('another.event', 'substr'); <ide> $this->assertEquals([], $manager->listeners('another.event')); <ide> } <ide> <ide> public function testOff() <ide> public function testOffFromAll() <ide> { <ide> $manager = new EventManager(); <del> $manager->on('fake.event', ['AClass', 'aMethod']); <del> $manager->on('another.event', ['AClass', 'aMethod']); <del> $manager->on('another.event', ['priority' => 1], 'fakeFunction'); <add> $callable = function () { <add> }; <add> $manager->on('fake.event', $callable); <add> $manager->on('another.event', $callable); <add> $manager->on('another.event', ['priority' => 1], 'substr'); <ide> <del> $manager->off(['AClass', 'aMethod']); <add> $manager->off($callable); <ide> $expected = [ <del> ['callable' => 'fakeFunction'], <add> ['callable' => 'substr'], <ide> ]; <ide> $this->assertEquals($expected, $manager->listeners('another.event')); <ide> $this->assertEquals([], $manager->listeners('fake.event')); <ide> public function testRemoveAllListeners() <ide> { <ide> $manager = new EventManager(); <ide> $manager->on('fake.event', ['AClass', 'aMethod']); <del> $manager->on('another.event', ['priority' => 1], 'fakeFunction'); <add> <add> $manager->on('another.event', ['priority' => 1], 'substr'); <ide> <ide> $manager->off('fake.event'); <ide> <ide> $expected = [ <del> ['callable' => 'fakeFunction'], <add> ['callable' => 'substr'], <ide> ]; <ide> $this->assertEquals($expected, $manager->listeners('another.event')); <ide> $this->assertEquals([], $manager->listeners('fake.event'));
4
PHP
PHP
add testcase from oauth wiki for hmac-sha1
6323936af95d5ec9aab73a251218f5d80a49ee3b
<ide><path>lib/Cake/Network/Http/Auth/Oauth.php <ide> protected function _plaintext($request, $credentials) { <ide> * @param array $credentials <ide> */ <ide> protected function _hmacSha1($request, $credentials) { <add> $nonce = isset($credentials['nonce']) ? $credentials['nonce'] : uniqid(); <add> $timestamp = isset($credentials['timestamp']) ? $credentials['timestamp'] : time(); <ide> $values = [ <ide> 'oauth_version' => '1.0', <del> 'oauth_nonce' => uniqid(), <del> 'oauth_timestamp' => time(), <add> 'oauth_nonce' => $nonce, <add> 'oauth_timestamp' => $timestamp, <ide> 'oauth_signature_method' => 'HMAC-SHA1', <ide> 'oauth_token' => $credentials['token'], <ide> 'oauth_consumer_key' => $credentials['consumerKey'], <ide> ]; <del> $baseString = $this->_baseString($request, $values); <add> $baseString = $this->baseString($request, $values); <ide> <ide> if (isset($credentials['realm'])) { <ide> $values['oauth_realm'] = $credentials['realm']; <ide> } <del> $key = [$credentials['consumerSecret'], $value['tokenSecret']]; <del> $key = array_map([$this, 'encode'], $key); <add> $key = [$credentials['consumerSecret'], $credentials['tokenSecret']]; <add> $key = array_map([$this, '_encode'], $key); <add> $key = implode('&', $key); <ide> <ide> $values['oauth_signature'] = base64_encode( <ide> hash_hmac('sha1', $baseString, $key, true) <ide> protected function _normalizedParams($request, $oauthValues) { <ide> $query = parse_url($request->url(), PHP_URL_QUERY); <ide> parse_str($query, $queryArgs); <ide> <del> $args = array_merge($queryArgs, $oauthValues); <del> $keys = array_map([$this, '_encode'], array_keys($args)); <del> $values = array_map([$this, '_encode'], array_values($args)); <del> $args = array_combine($keys, $values); <add> $post = []; <add> $body = $request->body(); <add> $contentType = $request->header('content-type'); <add> <add> if (is_array($body)) { <add> $post = $body; <add> } <ide> <add> $args = array_merge($queryArgs, $oauthValues, $post); <ide> uksort($args, 'strcmp'); <ide> <ide> $pairs = []; <ide> foreach ($args as $k => $val) { <del> $pairs[] = "$k=$val"; <add> if (is_array($val)) { <add> } else { <add> $pairs[] = "$k=$val"; <add> } <ide> } <ide> return implode('&', $pairs); <ide> } <ide><path>lib/Cake/Test/TestCase/Network/Http/Auth/OauthTest.php <ide> public function testBaseStringWithQueryString() { <ide> ); <ide> } <ide> <add>/** <add> * Ensure that post data is sorted and encoded. <add> * <add> * @return void <add> */ <ide> public function testBaseStringWithPostData() { <del> $this->markTestIncomplete(); <add> $request = new Request(); <add> $request->url('http://example.com/search?q=pogo') <add> ->method(Request::METHOD_POST) <add> ->body([ <add> 'address' => 'post', <add> 'tags' => ['cake', 'oauth'], <add> 'zed' => 'last' <add> ]); <add> <add> $auth = new Oauth(); <add> $values = [ <add> 'oauth_version' => '1.0', <add> 'oauth_nonce' => uniqid(), <add> 'oauth_timestamp' => time(), <add> 'oauth_signature_method' => 'HMAC-SHA1', <add> 'oauth_token' => 'token', <add> 'oauth_consumer_key' => 'consumer-key', <add> ]; <add> $result = $auth->baseString($request, $values); <add> <add> $this->assertContains('POST&', $result, 'method was missing.'); <add> $this->assertContains( <add> 'http%3A%2F%2Fexample.com%2Fsearch&', <add> $result <add> ); <add> $this->assertContains( <add> '&address%3Dpost' . <add> '%26oauth_consumer_key%3Dconsumer-key' . <add> '%26oauth_nonce%3D' . $values['oauth_nonce'] . <add> '%26oauth_signature_method%3DHMAC-SHA1' . <add> '%26oauth_timestamp%3D' . $values['oauth_timestamp'] . <add> '%26oauth_token%3Dtoken' . <add> '%26oauth_version%3D1.0' . <add> '%26q%3Dpogo' . <add> '%26zed%3Dlast', <add> $result <add> ); <ide> } <ide> <ide> /** <ide> * Test HMAC-SHA1 signing <ide> * <add> * Hash result + parameters taken from <add> * http://wiki.oauth.net/w/page/12238556/TestCases <add> * <ide> * @return void <ide> */ <ide> public function testHmacSigning() { <del> $this->markTestIncomplete(); <add> $request = new Request(); <add> $request->url('http://photos.example.net/photos') <add> ->body([ <add> 'file' => 'vacation.jpg', <add> 'size' => 'original' <add> ]); <add> <add> $options = [ <add> 'consumerKey' => 'dpf43f3p2l4k3l03', <add> 'consumerSecret' => 'kd94hf93k423kf44', <add> 'tokenSecret' => 'pfkkdhi9sl3r4s00', <add> 'token' => 'nnch734d00sl2jdk', <add> 'nonce' => 'kllo9940pd9333jh', <add> 'timestamp' => '1191242096' <add> ]; <add> $auth = new Oauth(); <add> $auth->authentication($request, $options); <add> <add> $result = $request->header('Authorization'); <add> $expected = 'tR3+Ty81lMeYAr/Fid0kMTYa/WM='; <add> $this->assertContains( <add> 'oauth_signature="' . $expected . '"', <add> urldecode($result) <add> ); <ide> } <ide> <ide> }
2
Python
Python
use cached_property from kombu.utils
951bbd9605170933a70489db3cd248a83ec596b7
<ide><path>celery/app/__init__.py <ide> <ide> from inspect import getargspec <ide> <add>from kombu.utils import cached_property <add> <ide> from celery import registry <ide> from celery.app import base <del>from celery.utils import cached_property, instantiate <add>from celery.utils import instantiate <ide> from celery.utils.functional import wraps <ide> <ide> # Apps with the :attr:`~celery.app.base.BaseApp.set_as_current` attribute <ide><path>celery/app/amqp.py <ide> from kombu import BrokerConnection, Exchange <ide> from kombu.connection import Resource <ide> from kombu import compat as messaging <add>from kombu.utils import cached_property <ide> <ide> from celery import routes as _routes <ide> from celery import signals <del>from celery.utils import gen_unique_id, textindent, cached_property <add>from celery.utils import gen_unique_id, textindent <ide> from celery.utils import promise, maybe_promise <ide> from celery.utils.compat import UserDict <ide> <ide><path>celery/app/base.py <ide> <ide> from copy import deepcopy <ide> <add>from kombu.utils import cached_property <add> <ide> from celery.app.defaults import DEFAULTS <ide> from celery.datastructures import ConfigurationView <del>from celery.utils import cached_property, instantiate, lpmerge <add>from celery.utils import instantiate, lpmerge <ide> from celery.utils.functional import wraps <ide> <ide> <ide><path>celery/backends/cache.py <ide> from datetime import timedelta <ide> <del>from kombu.utils import partition <add>from kombu.utils import partition, cached_property <ide> <ide> from celery.backends.base import KeyValueStoreBackend <ide> from celery.exceptions import ImproperlyConfigured <del>from celery.utils import cached_property <ide> from celery.utils import timeutils <ide> from celery.datastructures import LocalCache <ide> <ide><path>celery/backends/pyredis.py <ide> from datetime import timedelta <ide> <add>from kombu.utils import cached_property <add> <ide> from celery.backends.base import KeyValueStoreBackend <ide> from celery.exceptions import ImproperlyConfigured <ide> from celery.utils import timeutils <del>from celery.utils import cached_property <ide> <ide> try: <ide> import redis <ide><path>celery/beat.py <ide> <ide> from datetime import datetime <ide> <add>from kombu.utils import cached_property <add> <ide> from celery import __version__ <ide> from celery import platforms <ide> from celery import registry <ide> from celery import signals <ide> from celery.app import app_or_default <ide> from celery.log import SilenceRepeated <ide> from celery.schedules import maybe_schedule, crontab <del>from celery.utils import cached_property, instantiate, maybe_promise <add>from celery.utils import instantiate, maybe_promise <ide> from celery.utils.timeutils import humanize_seconds <ide> <ide> <ide><path>celery/contrib/batches.py <ide> def count_click(requests): <ide> from itertools import count <ide> from Queue import Queue <ide> <add>from kombu.utils import cached_property <add> <ide> from celery.datastructures import consume_queue <ide> from celery.task import Task <ide> from celery.utils import timer2 <del>from celery.utils import cached_property <ide> from celery.worker import state <ide> <ide> <ide><path>celery/loaders/base.py <ide> import re <ide> import warnings <ide> <del>import anyjson <add>from anyjson import deserialize <add>from kombu.utils import cached_property <ide> <del>from celery.utils import cached_property, import_from_cwd as _import_from_cwd <add>from celery.utils import import_from_cwd as _import_from_cwd <ide> <ide> BUILTIN_MODULES = ["celery.task"] <ide> <ide> def init_worker(self): <ide> <ide> def cmdline_config_parser(self, args, namespace="celery", <ide> re_type=re.compile(r"\((\w+)\)"), <del> extra_types={"json": anyjson.deserialize}, <add> extra_types={"json": deserialize}, <ide> override_types={"tuple": "json", <ide> "list": "json", <ide> "dict": "json"}): <ide><path>celery/task/sets.py <ide> import warnings <ide> <add>from kombu.utils import cached_property <add> <ide> from celery import registry <ide> from celery.app import app_or_default <ide> from celery.datastructures import AttributeDict <del>from celery.utils import cached_property, gen_unique_id <add>from celery.utils import gen_unique_id <ide> from celery.utils.compat import UserList <ide> <ide> TASKSET_DEPRECATION_TEXT = """\ <ide><path>celery/utils/__init__.py <ide> from itertools import islice <ide> from pprint import pprint <ide> <del>from kombu.utils import gen_unique_id, rpartition <add>from kombu.utils import gen_unique_id, rpartition, cached_property <ide> <ide> from celery.utils.compat import StringIO <ide> from celery.utils.functional import partial, wraps <ide> def import_from_cwd(module, imp=None): <ide> pass <ide> <ide> <del>class cached_property(object): <del> """Property descriptor that caches the return value <del> of the get function. <del> <del> *Examples* <del> <del> .. code-block:: python <del> <del> @cached_property <del> def connection(self): <del> return Connection() <del> <del> @connection.setter # Prepares stored value <del> def connection(self, value): <del> if value is None: <del> raise TypeError("Connection must be a connection") <del> return value <del> <del> @connection.deleter <del> def connection(self, value): <del> # Additional action to do at del(self.attr) <del> if value is not None: <del> print("Connection %r deleted" % (value, )) <del> <del> """ <del> <del> def __init__(self, fget=None, fset=None, fdel=None, doc=None): <del> self.__get = fget <del> self.__set = fset <del> self.__del = fdel <del> self.__doc__ = doc or fget.__doc__ <del> self.__name__ = fget.__name__ <del> self.__module__ = fget.__module__ <del> <del> def __get__(self, obj, type=None): <del> if obj is None: <del> return self <del> try: <del> return obj.__dict__[self.__name__] <del> except KeyError: <del> value = obj.__dict__[self.__name__] = self.__get(obj) <del> return value <del> <del> def __set__(self, obj, value): <del> if obj is None: <del> return self <del> if self.__set is not None: <del> value = self.__set(obj, value) <del> obj.__dict__[self.__name__] = value <del> <del> def __delete__(self, obj): <del> if obj is None: <del> return self <del> try: <del> value = obj.__dict__.pop(self.__name__) <del> except KeyError: <del> pass <del> else: <del> if self.__del is not None: <del> self.__del(obj, value) <del> <del> def setter(self, fset): <del> return self.__class__(self.__get, fset, self.__del) <del> <del> def deleter(self, fdel): <del> return self.__class__(self.__get, self.__set, fdel) <del> <del> <ide> def cry(): <ide> """Return stacktrace of all active threads. <ide> <ide><path>celery/worker/state.py <ide> import platform <ide> import shelve <ide> <add>from kombu.utils import cached_property <add> <ide> from celery import __version__ <del>from celery.utils import cached_property <ide> from celery.utils.compat import defaultdict <ide> from celery.datastructures import LimitedSet <ide>
11
Mixed
Ruby
fix error message documentation
80f46653e2353a40a7175cbd6030dcf60916d6cd
<ide><path>activesupport/lib/active_support/ordered_options.rb <ide> module ActiveSupport <ide> # To raise an exception when the value is blank, append a <ide> # bang to the key name, like: <ide> # <del> # h.dog! # => raises KeyError: key not found: :dog <add> # h.dog! # => raises KeyError: :dog is blank <ide> # <ide> class OrderedOptions < Hash <ide> alias_method :_get, :[] # preserve the original #[] method <ide> def method_missing(name, *args) <ide> bangs = name_string.chomp!("!") <ide> <ide> if bangs <del> fetch(name_string.to_sym).presence || raise(KeyError.new("#{name_string} is blank.")) <add> fetch(name_string.to_sym).presence || raise(KeyError.new(":#{name_string} is blank")) <ide> else <ide> self[name_string] <ide> end <ide><path>guides/source/security.md <ide> If you want an exception to be raised when some key is blank, use the bang <ide> version: <ide> <ide> ```ruby <del>Rails.application.credentials.some_api_key! # => raises KeyError: key not found: :some_api_key <add>Rails.application.credentials.some_api_key! # => raises KeyError: :some_api_key is blank <ide> ``` <ide> <ide> Additional Resources
2
Javascript
Javascript
fix proxy inspection
a32cbe159749c645bf2da6b2af46f9b732b416e0
<ide><path>lib/internal/util/inspect.js <ide> function formatValue(ctx, value, recurseTimes, typedArray) { <ide> return ctx.stylize('null', 'null'); <ide> } <ide> <add> // Memorize the context for custom inspection on proxies. <add> const context = value; <add> // Always check for proxies to prevent side effects and to prevent triggering <add> // any proxy handlers. <add> const proxy = getProxyDetails(value); <add> if (proxy !== undefined) { <add> if (ctx.showProxy && ctx.stop === undefined) { <add> return formatProxy(ctx, proxy, recurseTimes); <add> } <add> value = proxy[0]; <add> } <add> <ide> if (ctx.stop !== undefined) { <ide> const name = getConstructorName(value, ctx) || value[Symbol.toStringTag]; <ide> return ctx.stylize(`[${name || 'Object'}]`, 'special'); <ide> } <ide> <del> if (ctx.showProxy) { <del> const proxy = getProxyDetails(value); <del> if (proxy !== undefined) { <del> return formatProxy(ctx, proxy, recurseTimes); <del> } <del> } <del> <ide> // Provide a hook for user-specified inspect functions. <ide> // Check that value is an object with an inspect function on it. <ide> if (ctx.customInspect) { <ide> function formatValue(ctx, value, recurseTimes, typedArray) { <ide> // This makes sure the recurseTimes are reported as before while using <ide> // a counter internally. <ide> const depth = ctx.depth === null ? null : ctx.depth - recurseTimes; <del> const ret = maybeCustom.call(value, depth, plainCtx); <del> <add> const ret = maybeCustom.call(context, depth, plainCtx); <ide> // If the custom inspection method returned `this`, don't go into <ide> // infinite recursion. <del> if (ret !== value) { <add> if (ret !== context) { <ide> if (typeof ret !== 'string') { <ide> return formatValue(ctx, ret, recurseTimes); <ide> } <ide><path>test/parallel/test-util-inspect-proxy.js <ide> const { internalBinding } = require('internal/test/binding'); <ide> const processUtil = internalBinding('util'); <ide> const opts = { showProxy: true }; <ide> <del>const target = {}; <add>let proxyObj; <add>let called = false; <add>const target = { <add> [util.inspect.custom](depth, { showProxy }) { <add> if (showProxy === false) { <add> called = true; <add> if (proxyObj !== this) { <add> throw new Error('Failed'); <add> } <add> } <add> return [1, 2, 3]; <add> } <add>}; <ide> const handler = { <del> get: function() { throw new Error('Getter should not be called'); } <add> getPrototypeOf() { throw new Error('getPrototypeOf'); }, <add> setPrototypeOf() { throw new Error('setPrototypeOf'); }, <add> isExtensible() { throw new Error('isExtensible'); }, <add> preventExtensions() { throw new Error('preventExtensions'); }, <add> getOwnPropertyDescriptor() { throw new Error('getOwnPropertyDescriptor'); }, <add> defineProperty() { throw new Error('defineProperty'); }, <add> has() { throw new Error('has'); }, <add> get() { throw new Error('get'); }, <add> set() { throw new Error('set'); }, <add> deleteProperty() { throw new Error('deleteProperty'); }, <add> ownKeys() { throw new Error('ownKeys'); }, <add> apply() { throw new Error('apply'); }, <add> construct() { throw new Error('construct'); } <ide> }; <del>const proxyObj = new Proxy(target, handler); <add>proxyObj = new Proxy(target, handler); <ide> <ide> // Inspecting the proxy should not actually walk it's properties <ide> util.inspect(proxyObj, opts); <ide> const details = processUtil.getProxyDetails(proxyObj); <ide> assert.strictEqual(target, details[0]); <ide> assert.strictEqual(handler, details[1]); <ide> <del>assert.strictEqual(util.inspect(proxyObj, opts), <del> 'Proxy [ {}, { get: [Function: get] } ]'); <add>assert.strictEqual( <add> util.inspect(proxyObj, opts), <add> 'Proxy [ [ 1, 2, 3 ],\n' + <add> ' { getPrototypeOf: [Function: getPrototypeOf],\n' + <add> ' setPrototypeOf: [Function: setPrototypeOf],\n' + <add> ' isExtensible: [Function: isExtensible],\n' + <add> ' preventExtensions: [Function: preventExtensions],\n' + <add> ' getOwnPropertyDescriptor: [Function: getOwnPropertyDescriptor],\n' + <add> ' defineProperty: [Function: defineProperty],\n' + <add> ' has: [Function: has],\n' + <add> ' get: [Function: get],\n' + <add> ' set: [Function: set],\n' + <add> ' deleteProperty: [Function: deleteProperty],\n' + <add> ' ownKeys: [Function: ownKeys],\n' + <add> ' apply: [Function: apply],\n' + <add> ' construct: [Function: construct] } ]' <add>); <ide> <ide> // Using getProxyDetails with non-proxy returns undefined <ide> assert.strictEqual(processUtil.getProxyDetails({}), undefined); <ide> <del>// This will throw because the showProxy option is not used <del>// and the get function on the handler object defined above <del>// is actually invoked. <del>assert.throws( <del> () => util.inspect(proxyObj), <del> /^Error: Getter should not be called$/ <del>); <add>// Inspecting a proxy without the showProxy option set to true should not <add>// trigger any proxy handlers. <add>assert.strictEqual(util.inspect(proxyObj), '[ 1, 2, 3 ]'); <add>assert(called); <ide> <ide> // Yo dawg, I heard you liked Proxy so I put a Proxy <ide> // inside your Proxy that proxies your Proxy's Proxy.
2
PHP
PHP
fix deprecation warnings in authcomponent tests
52c751cb22cddbf3b614cd824cc1cad0036470ff
<ide><path>src/Controller/Component/AuthComponent.php <ide> public function authorizationProvider() <ide> */ <ide> protected function _getUrlToRedirectBackTo() <ide> { <del> $urlToRedirectBackTo = $this->request->here(false); <add> $urlToRedirectBackTo = $this->request->getRequestTarget(); <ide> if (!$this->request->is('get')) { <ide> $urlToRedirectBackTo = $this->request->referer(true); <ide> } <ide><path>tests/TestCase/Controller/Component/AuthComponentTest.php <ide> public function setUp() <ide> $routes->fallbacks(InflectedRoute::class); <ide> }); <ide> <del> $request = new ServerRequest(); <del> $request->env('REQUEST_METHOD', 'GET'); <del> <del> $response = $this->getMockBuilder('Cake\Http\Response') <del> ->setMethods(['stop']) <del> ->getMock(); <add> $request = new ServerRequest([ <add> 'url' => '/auth_test', <add> 'environment' => [ <add> 'REQUEST_METHOD' => 'GET' <add> ], <add> 'params' => [ <add> 'plugin' => null, <add> 'controller' => 'AuthTest', <add> 'action' => 'index' <add> ], <add> 'webroot' => '/' <add> ]); <ide> <add> $response = new Response(); <ide> $this->Controller = new AuthTestController($request, $response); <ide> $this->Auth = new TestAuthComponent($this->Controller->components()); <ide> <ide> public function testNoAuth() <ide> $this->assertFalse($this->Auth->isAuthorized()); <ide> } <ide> <del> /** <del> * testIsErrorOrTests <del> * <del> * @return void <del> * @triggers Controller.startup $this->Controller <del> */ <del> public function testIsErrorOrTests() <del> { <del> $event = new Event('Controller.startup', $this->Controller); <del> <del> $this->Controller->name = 'Error'; <del> $this->assertNull($this->Controller->Auth->startup($event)); <del> <del> $this->Controller->name = 'Post'; <del> $this->Controller->request['action'] = 'thisdoesnotexist'; <del> $this->assertNull($this->Controller->Auth->startup($event)); <del> } <del> <ide> /** <ide> * testIdentify method <ide> * <ide> public function testAllowDenyAll() <ide> $this->Controller->Auth->allow(); <ide> $this->Controller->Auth->deny(['add', 'camelCase']); <ide> <del> $this->Controller->request['action'] = 'delete'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'delete'); <ide> $this->assertNull($this->Controller->Auth->startup($event)); <ide> <del> $this->Controller->request['action'] = 'add'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'add'); <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <del> $this->Controller->request['action'] = 'camelCase'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'camelCase'); <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->allow(); <ide> $this->Controller->Auth->deny(['add', 'camelCase']); <ide> <del> $this->Controller->request['action'] = 'delete'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'delete'); <ide> $this->assertNull($this->Controller->Auth->startup($event)); <ide> <del> $this->Controller->request['action'] = 'camelCase'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'camelCase'); <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->allow(); <ide> $this->Controller->Auth->deny(); <ide> <del> $this->Controller->request['action'] = 'camelCase'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'camelCase'); <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <del> $this->Controller->request['action'] = 'add'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'add'); <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->allow('camelCase'); <ide> $this->Controller->Auth->deny(); <ide> <del> $this->Controller->request['action'] = 'camelCase'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'camelCase'); <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <del> $this->Controller->request['action'] = 'login'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'login'); <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->deny(); <ide> $this->Controller->Auth->allow(null); <ide> <del> $this->Controller->request['action'] = 'camelCase'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'camelCase'); <ide> $this->assertNull($this->Controller->Auth->startup($event)); <ide> <ide> $this->Controller->Auth->allow(); <ide> $this->Controller->Auth->deny(null); <ide> <del> $this->Controller->request['action'] = 'camelCase'; <ide> $this->assertInstanceOf('Cake\Http\Response', $this->Controller->Auth->startup($event)); <ide> } <ide> <ide> public function testLoginRedirect() <ide> 'AuthUsers' => ['id' => '1', 'username' => 'nate'] <ide> ]); <ide> <del> $this->Auth->request->addParams(['controller' => 'Users', 'action' => 'login']); <del> $this->Auth->request->url = 'users/login'; <del> $this->Auth->request->env('HTTP_REFERER', false); <add> $this->Auth->request = $this->Controller->request = new ServerRequest([ <add> 'params' => ['controller' => 'Users', 'action' => 'login'], <add> 'url' => '/users/login', <add> 'environment' => ['HTTP_REFERER' => false], <add> 'session' => $this->Auth->session <add> ]); <ide> <ide> $this->Auth->setConfig('loginRedirect', [ <ide> 'controller' => 'pages', <ide> public function testLoginRedirect() <ide> <ide> $this->Auth->session->delete('Auth'); <ide> <del> $url = '/posts/view/1'; <del> <ide> $this->Auth->session->write( <ide> 'Auth', <ide> ['AuthUsers' => ['id' => '1', 'username' => 'nate']] <ide> ); <del> $this->Auth->request->addParams(['controller' => 'Posts', 'action' => 'view', 'pass' => [1]]); <del> $this->Auth->request->here = $url; <add> $this->Auth->request = $this->Controller->request = new ServerRequest([ <add> 'params' => ['controller' => 'Posts', 'action' => 'view', 'pass' => [1]], <add> 'url' => '/posts/view/1', <add> 'environment' => ['HTTP_REFERER' => false, 'REQUEST_METHOD' => 'GET'], <add> 'session' => $this->Auth->session <add> ]); <ide> <ide> $this->Auth->setConfig('authorize', 'controller'); <ide> <ide> public function testLoginRedirect() <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> $expected = Router::url([ <del> 'controller' => 'AuthTest', 'action' => 'login', '?' => ['redirect' => $url] <add> 'controller' => 'AuthTest', <add> 'action' => 'login', <add> '?' => ['redirect' => '/posts/view/1'] <ide> ], true); <del> $redirectHeader = $response->header()['Location']; <add> $redirectHeader = $response->getHeaderLine('Location'); <ide> $this->assertEquals($expected, $redirectHeader); <ide> <ide> // Auth.redirect gets set when accessing a protected action without being authenticated <ide> $this->Auth->session->delete('Auth'); <del> $url = '/posts/view/1'; <del> $this->Auth->request->addParams(['controller' => 'Posts', 'action' => 'view', 'pass' => [1]]); <del> $this->Auth->request->url = $this->Auth->request->here = Router::normalize($url); <add> <add> $this->Auth->request = $this->Controller->request = new ServerRequest([ <add> 'params' => ['controller' => 'Posts', 'action' => 'view', 'pass' => [1]], <add> 'url' => '/posts/view/1', <add> 'environment' => ['HTTP_REFERER' => false, 'REQUEST_METHOD' => 'GET'], <add> 'session' => $this->Auth->session <add> ]); <ide> $this->Auth->setConfig('loginAction', ['controller' => 'AuthTest', 'action' => 'login']); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <ide> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login', '?' => ['redirect' => '/posts/view/1']], true); <del> $redirectHeader = $response->header()['Location']; <add> $redirectHeader = $response->getHeaderLine('Location'); <ide> $this->assertEquals($expected, $redirectHeader); <ide> } <ide> <ide> public function testLoginRedirect() <ide> public function testLoginRedirectPost() <ide> { <ide> $this->Auth->session->delete('Auth'); <del> <del> $url = '/posts/view/1'; <del> $this->Auth->request->addParams(['controller' => 'Posts', 'action' => 'view', 'pass' => [1]]); <del> $this->Auth->request->env('HTTP_REFERER', Router::url('/foo/bar', true)); <del> $this->Auth->request->env('REQUEST_METHOD', 'POST'); <del> $this->Auth->request->url = $this->Auth->request->here = Router::normalize($url); <add> $this->Auth->request = new ServerRequest([ <add> 'environment' => [ <add> 'HTTP_REFERER' => Router::url('/foo/bar', true), <add> 'REQUEST_METHOD' => 'POST' <add> ], <add> 'params' => ['controller' => 'Posts', 'action' => 'view', 'pass' => [1]], <add> 'url' => '/posts/view/1?print=true&refer=menu', <add> 'session' => $this->Auth->session <add> ]); <ide> $this->Auth->setConfig('loginAction', ['controller' => 'AuthTest', 'action' => 'login']); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <ide> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login', '?' => ['redirect' => '/foo/bar']], true); <del> $redirectHeader = $response->header()['Location']; <add> $redirectHeader = $response->getHeaderLine('Location'); <ide> $this->assertEquals($expected, $redirectHeader); <ide> } <ide> <ide> public function testLoginRedirectPost() <ide> public function testLoginRedirectPostNoReferer() <ide> { <ide> $this->Auth->session->delete('Auth'); <del> <del> $url = '/posts/view/1'; <del> $this->Auth->request->addParams(['controller' => 'Posts', 'action' => 'view', 'pass' => [1]]); <del> $this->Auth->request->env('REQUEST_METHOD', 'POST'); <del> $this->Auth->request->url = $this->Auth->request->here = Router::normalize($url); <add> $this->Auth->request = new ServerRequest([ <add> 'environment' => ['REQUEST_METHOD' => 'POST'], <add> 'params' => ['controller' => 'Posts', 'action' => 'view', 'pass' => [1]], <add> 'url' => '/posts/view/1?print=true&refer=menu', <add> 'session' => $this->Auth->session <add> ]); <ide> $this->Auth->setConfig('loginAction', ['controller' => 'AuthTest', 'action' => 'login']); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <ide> $this->assertInstanceOf('Cake\Http\Response', $response); <ide> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login'], true); <del> $redirectHeader = $response->header()['Location']; <add> $redirectHeader = $response->getHeaderLine('Location'); <ide> $this->assertEquals($expected, $redirectHeader); <ide> } <ide> <ide> public function testLoginRedirectQueryString() <ide> { <ide> // QueryString parameters are preserved when redirecting with redirect key <ide> $this->Auth->session->delete('Auth'); <del> $url = '/posts/view/29'; <del> $this->Auth->request->addParams(['controller' => 'Posts', 'action' => 'view', 'pass' => [29]]); <del> $this->Auth->request->url = $this->Auth->request->here = Router::normalize($url); <del> $this->Auth->request->query = [ <del> 'print' => 'true', <del> 'refer' => 'menu' <del> ]; <add> $this->Auth->request = new ServerRequest([ <add> 'environment' => ['REQUEST_METHOD' => 'GET'], <add> 'params' => ['controller' => 'Posts', 'action' => 'view', 'pass' => [29]], <add> 'url' => '/posts/view/29?print=true&refer=menu', <add> 'session' => $this->Auth->session <add> ]); <ide> <ide> $this->Auth->setConfig('loginAction', ['controller' => 'AuthTest', 'action' => 'login']); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <del> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login', '?' => ['redirect' => '/posts/view/29?print=true&refer=menu']], true); <del> $redirectHeader = $response->header()['Location']; <add> $expected = Router::url([ <add> 'controller' => 'AuthTest', <add> 'action' => 'login', <add> '?' => ['redirect' => '/posts/view/29?print=true&refer=menu'] <add> ], true); <add> $redirectHeader = $response->getHeaderLine('Location'); <ide> $this->assertEquals($expected, $redirectHeader); <ide> } <ide> <ide> public function testLoginRedirectQueryString() <ide> public function testLoginRedirectQueryStringWithComplexLoginActionUrl() <ide> { <ide> $this->Auth->session->delete('Auth'); <del> $url = '/posts/view/29'; <del> $this->Auth->request->addParams(['controller' => 'Posts', 'action' => 'view', 'pass' => [29]]); <del> $this->Auth->request->url = $this->Auth->request->here = Router::normalize($url); <del> $this->Auth->request->query = [ <del> 'print' => 'true', <del> 'refer' => 'menu' <del> ]; <add> $this->Auth->request = new ServerRequest([ <add> 'environment' => ['REQUEST_METHOD' => 'GET'], <add> 'params' => ['controller' => 'Posts', 'action' => 'view', 'pass' => [29]], <add> 'url' => '/posts/view/29?print=true&refer=menu', <add> 'session' => $this->Auth->session <add> ]); <ide> <ide> $this->Auth->session->delete('Auth'); <ide> $this->Auth->setConfig('loginAction', '/auth_test/login/passed-param?a=b'); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <del> $redirectHeader = $response->header()['Location']; <del> $expected = Router::url(['controller' => 'AuthTest', 'action' => 'login', 'passed-param', '?' => ['a' => 'b', 'redirect' => '/posts/view/29?print=true&refer=menu']], true); <add> $redirectHeader = $response->getHeaderLine('Location'); <add> $expected = Router::url([ <add> 'controller' => 'AuthTest', <add> 'action' => 'login', <add> 'passed-param', <add> '?' => ['a' => 'b', 'redirect' => '/posts/view/29?print=true&refer=menu'] <add> ], true); <ide> $this->assertEquals($expected, $redirectHeader); <ide> } <ide> <ide> public function testLoginRedirectDifferentBaseUrl() <ide> <ide> $this->Auth->session->delete('Auth'); <ide> <del> $url = '/posts/add'; <del> $this->Auth->request = $this->Controller->request = new ServerRequest($url); <del> $this->Auth->request->env('REQUEST_METHOD', 'GET'); <del> $this->Auth->request->addParams(['controller' => 'Posts', 'action' => 'add']); <del> $this->Auth->request->url = Router::normalize($url); <add> $request = new ServerRequest([ <add> 'url' => '/posts/add', <add> 'params' => [ <add> 'plugin' => null, <add> 'controller' => 'Posts', <add> 'action' => 'add' <add> ], <add> 'environment' => [ <add> 'REQUEST_METHOD' => 'GET' <add> ], <add> 'session' => $this->Auth->session, <add> 'base' => '', <add> 'webroot' => '/' <add> ]); <add> $this->Controller->request = $request; <ide> <ide> $this->Auth->setConfig('loginAction', ['controller' => 'Users', 'action' => 'login']); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $response = $this->Auth->startup($event); <ide> <ide> $expected = Router::url(['controller' => 'Users', 'action' => 'login', '?' => ['redirect' => '/posts/add']], true); <del> $redirectHeader = $response->header()['Location']; <add> $redirectHeader = $response->getHeaderLine('Location'); <ide> $this->assertEquals($expected, $redirectHeader); <ide> <ide> $this->Auth->session->delete('Auth'); <ide> public function testLoginRedirectDifferentBaseUrl() <ide> */ <ide> public function testNoLoginRedirectForAuthenticatedUser() <ide> { <del> $this->Controller->request['controller'] = 'auth_test'; <del> $this->Controller->request['action'] = 'login'; <del> $this->Controller->here = '/auth_test/login'; <del> $this->Auth->request->url = 'auth_test/login'; <add> $request = new ServerRequest([ <add> 'params' => [ <add> 'plugin' => null, <add> 'controller' => 'auth_test', <add> 'action' => 'login' <add> ], <add> 'url' => '/auth_test/login', <add> 'session' => $this->Auth->session <add> ]); <add> $this->Controller->request = $request; <ide> <ide> $this->Auth->session->write('Auth.User.id', '1'); <ide> $this->Auth->setConfig('authenticate', ['Form']); <ide> public function testNoLoginRedirectForAuthenticatedUser() <ide> public function testDefaultToLoginRedirect() <ide> { <ide> $url = '/party/on'; <del> $this->Auth->request = $request = new ServerRequest($url); <del> $request->env('HTTP_REFERER', false); <del> $request->addParams(['controller' => 'Part', 'action' => 'on']); <del> $request->addPaths([ <add> $this->Auth->request = $request = new ServerRequest([ <add> 'url' => $url, <add> 'environment' => [ <add> 'HTTP_REFERER' => false, <add> ], <add> 'params' => [ <add> 'plugin' => null, <add> 'controller' => 'Part', <add> 'action' => 'on' <add> ], <ide> 'base' => 'dirname', <del> 'webroot' => '/dirname/', <add> 'webroot' => '/dirname/' <ide> ]); <ide> Router::pushRequest($request); <ide> <ide> public function testAdminRoute() <ide> Router::scope('/', function ($routes) { <ide> $routes->fallbacks(InflectedRoute::class); <ide> }); <del> <del> $url = '/admin/auth_test/add'; <del> $this->Auth->request->addParams(['controller' => 'AuthTest', 'action' => 'add', 'prefix' => 'admin']); <del> $this->Auth->request->base = ''; <del> $this->Auth->request->here = $url; <add> $this->Auth->request = new ServerRequest([ <add> 'environment' => [ <add> 'REQUEST_METHOD' => 'GET', <add> ], <add> 'params' => [ <add> 'controller' => 'AuthTest', <add> 'action' => 'add', <add> 'plugin' => null, <add> 'prefix' => 'admin' <add> ], <add> 'url' => '/admin/auth_test/add', <add> 'session' => $this->Auth->session <add> ]); <ide> <ide> Router::setRequestInfo($this->Auth->request); <ide> <ide> public function testAdminRoute() <ide> ]); <ide> <ide> $response = $this->Auth->startup($event); <del> $redirectHeader = $response->header()['Location']; <add> $redirectHeader = $response->getHeaderLine('Location'); <ide> $expected = Router::url([ <ide> 'prefix' => 'admin', <ide> 'controller' => 'auth_test', <ide> public function testAjaxLogin() <ide> $response = $this->Auth->startup($event); <ide> <ide> $this->assertTrue($event->isStopped()); <del> $this->assertEquals(403, $response->statusCode()); <add> $this->assertEquals(403, $response->getStatusCode()); <ide> $this->assertEquals( <ide> "Ajax!\nthis is the test element", <del> str_replace("\r\n", "\n", $response->body()) <add> str_replace("\r\n", "\n", $response->getBody()) <ide> ); <ide> } <ide> <ide> public function testAjaxUnauthenticated() <ide> $response = $this->Auth->startup($event); <ide> <ide> $this->assertTrue($event->isStopped()); <del> $this->assertEquals(403, $response->statusCode()); <del> $this->assertArrayNotHasKey('Location', $response->header()); <add> $this->assertEquals(403, $response->getStatusCode()); <add> $this->assertFalse($response->hasHeader('Location')); <ide> } <ide> <ide> /** <ide> public function testLoginActionRedirect() <ide> }); <ide> <ide> $url = '/admin/auth_test/login'; <del> $request = $this->Auth->request; <del> $request->addParams([ <del> 'plugin' => null, <del> 'controller' => 'auth_test', <del> 'action' => 'login', <del> 'prefix' => 'admin', <del> 'pass' => [], <del> ])->addPaths([ <del> 'base' => null, <del> 'here' => $url, <add> $request = new ServerRequest([ <add> 'params' => [ <add> 'plugin' => null, <add> 'controller' => 'auth_test', <add> 'action' => 'login', <add> 'prefix' => 'admin', <add> 'pass' => [], <add> ], <ide> 'webroot' => '/', <add> 'url' => $url <ide> ]); <del> $request->url = ltrim($url, '/'); <ide> Router::setRequestInfo($request); <ide> <ide> $this->Auth->setConfig('loginAction', [ <ide> 'prefix' => 'admin', <ide> 'controller' => 'auth_test', <ide> 'action' => 'login' <ide> ]); <del> $this->Auth->startup($event); <add> $result = $this->Auth->startup($event); <ide> <del> $this->assertNull($this->Controller->testUrl); <add> $this->assertNull($result); <ide> } <ide> <ide> /** <ide> public function testLoginActionRedirect() <ide> public function testStatelessAuthWorksWithUser() <ide> { <ide> $event = new Event('Controller.startup', $this->Controller); <del> $url = '/auth_test/add'; <del> $this->Auth->request->addParams(['controller' => 'AuthTest', 'action' => 'add']); <del> $this->Auth->request->env('PHP_AUTH_USER', 'mariano'); <del> $this->Auth->request->env('PHP_AUTH_PW', 'cake'); <add> $this->Auth->request = new ServerRequest([ <add> 'environment' => [ <add> 'REQUEST_METHOD' => 'POST', <add> 'PHP_AUTH_USER' => 'mariano', <add> 'PHP_AUTH_PW' => 'cake', <add> ], <add> 'params' => ['controller' => 'AuthTest', 'action' => 'add'], <add> 'url' => '/auth_test/add', <add> 'session' => $this->Auth->session <add> ]); <ide> <ide> $this->Auth->setConfig('authenticate', [ <ide> 'Basic' => ['userModel' => 'AuthUsers'] <ide> public function testAfterIdentifyForStatelessAuthentication() <ide> { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $url = '/auth_test/add'; <del> $this->Auth->request->addParams(['controller' => 'AuthTest', 'action' => 'add']); <del> $this->Auth->request->env('PHP_AUTH_USER', 'mariano'); <del> $this->Auth->request->env('PHP_AUTH_PW', 'cake'); <add> $this->Auth->request = $this->Auth->request <add> ->withParam('controller', 'AuthTest') <add> ->withParam('action', 'add') <add> ->withEnv('PHP_AUTH_USER', 'mariano') <add> ->withEnv('PHP_AUTH_PW', 'cake'); <ide> <ide> $this->Auth->setConfig('authenticate', [ <ide> 'Basic' => ['userModel' => 'AuthUsers'] <ide> public function testStatelessAuthNoRedirect() <ide> $_SESSION = []; <ide> <ide> $this->Auth->setConfig('authenticate', ['Basic']); <del> $this->Controller->request['action'] = 'add'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'add'); <ide> <ide> $result = $this->Auth->startup($event); <ide> } <ide> public function testStatelessAuthNoRedirect() <ide> */ <ide> public function testStatelessAuthRedirectToLogin() <ide> { <del> $this->Auth->response = $this->getMockBuilder('Cake\Http\Response') <del> ->setMethods(['stop', 'statusCode', 'send']) <del> ->getMock(); <ide> $event = new Event('Controller.startup', $this->Controller); <ide> $this->Auth->authenticate = ['Basic', 'Form']; <del> $this->Controller->request['action'] = 'add'; <add> $this->Controller->request = $this->Controller->request->withParam('action', 'add'); <ide> <del> $this->Auth->response->expects($this->never())->method('statusCode'); <del> $this->Auth->response->expects($this->never())->method('send'); <del> <del> $this->assertInstanceOf('Cake\Http\Response', $this->Auth->startup($event)); <add> $response = $this->Auth->startup($event); <add> $this->assertInstanceOf(Response::class, $response); <ide> <del> $this->assertEquals('/users/login?redirect=%2Fauth_test', $this->Controller->testUrl); <add> $this->assertEquals( <add> 'http://localhost/users/login?redirect=%2Fauth_test', <add> $response->getHeaderLine('Location') <add> ); <ide> } <ide> <ide> /** <ide><path>tests/test_app/TestApp/Controller/AuthTestController.php <ide> class AuthTestController extends Controller <ide> */ <ide> public function __construct($request = null, $response = null) <ide> { <del> $request->addParams(['controller' => 'AuthTest', 'action' => 'index']); <del> $request->here = '/auth_test'; <del> $request->webroot = '/'; <ide> Router::setRequestInfo($request); <ide> parent::__construct($request, $response); <ide> }
3
Ruby
Ruby
update arg names in docs and signature
b2d94dc897f25083cddb994c9b981834d9df6fd0
<ide><path>Library/Homebrew/formula.rb <ide> def extract_macho_slice_from(file, arch = Hardware::CPU.arch) <ide> end <ide> private :extract_macho_slice_from <ide> <del> # Generate shell completions for a formula for bash, zsh, and fish, using the formula's binary. <add> # Generate shell completions for a formula for bash, zsh, and fish, using the formula's executable. <ide> # <ide> # @param base_name [String] the base name of the generated completion script. Defaults to the formula name. <ide> # @param shells [Array<Symbol>] the shells to generate completion scripts for. Defaults to `[:bash, :zsh, :fish]`. <del> # @param binary [Pathname] the binary to use for generating the completion scripts. Defaults to the binary with the <del> # name of the formula. <add> # @param executable [Pathname] the executable to use for generating the completion scripts. Defaults to the <add> # executable with the name of the formula. <ide> # @param cmd [String] the command to pass to the `binary`. Defaults to 'completion'. <del> # @param shell_as_flag [Boolean] specify if `shells` should each be passed as flags to the `binary`. <del> # Defaults to `false`. <add> # @param shell_parameter_format [String]/[Symbol] specify how `shells` should each be passed <add> # to the `executable`. Takes either a String representing a prefix, or one of [:flag, :arg, :none]. <add> # Defaults to plainly passing the shell. <ide> sig { <del> params(base_name: String, shells: T::Array[Symbol], binary: Pathname, cmd: String, <del> shell_prefix: T.nilable(T.any(Symbol, String))).void <add> params(base_name: String, shells: T::Array[Symbol], executable: Pathname, cmd: String, <add> shell_parameter_format: T.nilable(T.any(Symbol, String))).void <ide> } <ide> def generate_completions_from_executable(base_name: name, <ide> shells: [:bash, :zsh, :fish],
1
Javascript
Javascript
fix code style
dc87b9108857ea1a56319cca424bd1580628b6b3
<ide><path>src/core/InstancedBufferGeometry.js <ide> InstancedBufferGeometry.prototype = Object.assign( Object.create( BufferGeometry <ide> <ide> }, <ide> <del> toJSON: function(){ <add> toJSON: function () { <add> <ide> var data = BufferGeometry.prototype.toJSON.call( this ); <ide> <ide> data.maxInstancedCount = this.maxInstancedCount; <ide> <ide> data.isInstancedBufferGeometry = true; <ide> <ide> return data; <add> <ide> } <ide> <ide> } );
1
PHP
PHP
remove unneeded annotation
15da42fdedfefc612b886293a8807acdd9db47c2
<ide><path>src/View/Helper/UrlHelper.php <ide> public function build($url = null, array $options = []): string <ide> ]; <ide> $options += $defaults; <ide> <del> /** @var string $url */ <ide> $url = Router::url($url, $options['fullBase']); <ide> if ($options['escape']) { <ide> /** @var string $url */
1
Javascript
Javascript
add tests for validatenumber/validatestring
6914b3798c6c4cc6b2f64a206674505b4b5adf80
<ide><path>test/parallel/test-validators.js <ide> const { <ide> validateArray, <ide> validateBoolean, <ide> validateInteger, <add> validateNumber, <ide> validateObject, <add> validateString, <ide> } = require('internal/validators'); <ide> const { MAX_SAFE_INTEGER, MIN_SAFE_INTEGER } = Number; <ide> const outOfRangeError = { <ide> const invalidArgValueError = { <ide> <ide> validateObject(null, 'foo', { nullable: true }); <ide> } <add> <add>{ <add> // validateString type validation. <add> [ <add> -1, {}, [], false, true, <add> 1, Infinity, -Infinity, NaN, <add> undefined, null, 1.1 <add> ].forEach((i) => assert.throws(() => validateString(i, 'name'), { <add> code: 'ERR_INVALID_ARG_TYPE' <add> })); <add>} <add>{ <add> // validateNumber type validation. <add> [ <add> 'a', {}, [], false, true, <add> undefined, null, '', ' ', '0x', <add> '-0x1', '-0o1', '-0b1', '0o', '0b' <add> ].forEach((i) => assert.throws(() => validateNumber(i, 'name'), { <add> code: 'ERR_INVALID_ARG_TYPE' <add> })); <add>}
1
Python
Python
fix a typo in a comment
e18e7441700db0ff2fd8f51901aa416c63e35cbc
<ide><path>numpy/core/tests/test_shape_base.py <ide> def test_concatenate_sloppy0(): <ide> assert_array_equal(concatenate((r4, r3), 10), r4 + r3) <ide> finally: <ide> warnings.filters.pop(0) <del> # Confurm DepractionWarning raised <add> # Confirm DepractionWarning raised <ide> warnings.simplefilter('always', DeprecationWarning) <ide> warnings.simplefilter('error', DeprecationWarning) <ide> try:
1
Python
Python
fix non-determanistic default bug. closes
bde725541359de1fef785801fc5dad98e70a8e2f
<ide><path>rest_framework/serializers.py <ide> def get_fields(self): <ide> elif getattr(unique_constraint_field, 'auto_now', None): <ide> default = timezone.now <ide> elif unique_constraint_field.has_default(): <del> default = model_field.default <add> default = unique_constraint_field.default <ide> else: <ide> default = empty <ide>
1
Mixed
Ruby
constrain sequence search classid
0110d7b714a6ecc810a38ef5a27b66ec321995e5
<ide><path>activerecord/CHANGELOG.md <ide> <ide> *Matthew Draper* <ide> <add>* `pk_and_sequence_for` now ensures that only the pg_depend entries <add> pointing to pg_class, and thus only sequence objects, are considered. <add> <add> *Josh Williams* <add> <ide> * `where.not` adds `references` for `includes` like normal `where` calls do. <ide> <ide> Fixes #14406. <ide><path>activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb <ide> def pk_and_sequence_for(table) #:nodoc: <ide> AND attr.attrelid = cons.conrelid <ide> AND attr.attnum = cons.conkey[1] <ide> AND cons.contype = 'p' <add> AND dep.classid = 'pg_class'::regclass <ide> AND dep.refobjid = '#{quote_table_name(table)}'::regclass <ide> end_sql <ide> <ide><path>activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb <ide> def test_pk_and_sequence_for_returns_nil_if_table_not_found <ide> assert_nil @connection.pk_and_sequence_for('unobtainium') <ide> end <ide> <add> def test_pk_and_sequence_for_with_collision_pg_class_oid <add> @connection.exec_query('create table ex(id serial primary key)') <add> @connection.exec_query('create table ex2(id serial primary key)') <add> <add> correct_depend_record = [ <add> "'pg_class'::regclass", <add> "'ex_id_seq'::regclass", <add> '0', <add> "'pg_class'::regclass", <add> "'ex'::regclass", <add> '1', <add> "'a'" <add> ] <add> <add> collision_depend_record = [ <add> "'pg_attrdef'::regclass", <add> "'ex2_id_seq'::regclass", <add> '0', <add> "'pg_class'::regclass", <add> "'ex'::regclass", <add> '1', <add> "'a'" <add> ] <add> <add> @connection.exec_query( <add> "DELETE FROM pg_depend WHERE objid = 'ex_id_seq'::regclass AND refobjid = 'ex'::regclass AND deptype = 'a'" <add> ) <add> @connection.exec_query( <add> "INSERT INTO pg_depend VALUES(#{collision_depend_record.join(',')})" <add> ) <add> @connection.exec_query( <add> "INSERT INTO pg_depend VALUES(#{correct_depend_record.join(',')})" <add> ) <add> <add> seq = @connection.pk_and_sequence_for('ex').last <add> assert_equal 'ex_id_seq', seq <add> <add> @connection.exec_query( <add> "DELETE FROM pg_depend WHERE objid = 'ex2_id_seq'::regclass AND refobjid = 'ex'::regclass AND deptype = 'a'" <add> ) <add> ensure <add> @connection.exec_query('DROP TABLE IF EXISTS ex') <add> @connection.exec_query('DROP TABLE IF EXISTS ex2') <add> end <add> <ide> def test_exec_insert_number <ide> with_example_table do <ide> insert(@connection, 'number' => 10)
3
PHP
PHP
fix testsuite for php5.5
b611b3bc168ec650219418f16c2054125f17ce9d
<ide><path>tests/TestCase/Database/Driver/SqliteTest.php <ide> <ide> use Cake\Database\Driver\Sqlite; <ide> use Cake\TestSuite\TestCase; <del>use \PDO; <add>use PDO; <ide> <ide> /** <ide> * Tests Sqlite driver <ide> public static function schemaValueProvider() <ide> public function testSchemaValue($input, $expected) <ide> { <ide> $driver = new Sqlite(); <del> $mock = $this->getMockBuilder(\PDO::class) <add> $pdo = PDO::class; <add> if (version_compare(PHP_VERSION, '5.6', '<')) { <add> $pdo = 'FakePdo'; <add> } <add> $mock = $this->getMockBuilder($pdo) <ide> ->setMethods(['quote', 'quoteIdentifier']) <ide> ->disableOriginalConstructor() <ide> ->getMock(); <ide><path>tests/TestCase/Database/DriverTest.php <ide> use Cake\Database\QueryCompiler; <ide> use Cake\Database\ValueBinder; <ide> use Cake\TestSuite\TestCase; <del> <ide> use PDO; <ide> <ide> /** <ide><path>tests/TestCase/Database/Schema/MysqlSchemaTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Database\Schema; <ide> <add>use Cake\Database\Driver\Mysql; <ide> use Cake\Database\Schema\Collection as SchemaCollection; <ide> use Cake\Database\Schema\MysqlSchema; <ide> use Cake\Database\Schema\Table; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <add>use PDO; <ide> <ide> /** <ide> * Test case for Mysql Schema Dialect. <ide> public function testDescribeJson() <ide> */ <ide> protected function _getMockedDriver() <ide> { <del> $driver = new \Cake\Database\Driver\Mysql(); <del> $mock = $this->getMockBuilder(\PDO::class) <add> $driver = new Mysql(); <add> $pdo = PDO::class; <add> if (version_compare(PHP_VERSION, '5.6', '<')) { <add> $pdo = 'FakePdo'; <add> } <add> $mock = $this->getMockBuilder($pdo) <ide> ->setMethods(['quote', 'quoteIdentifier', 'getAttribute']) <ide> ->disableOriginalConstructor() <ide> ->getMock(); <ide><path>tests/TestCase/Database/Schema/PostgresSchemaTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Database\Schema; <ide> <add>use Cake\Database\Driver\Postgres; <ide> use Cake\Database\Schema\Collection as SchemaCollection; <ide> use Cake\Database\Schema\PostgresSchema; <ide> use Cake\Database\Schema\Table; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <add>use PDO; <ide> <ide> /** <ide> * Postgres schema test case. <ide> public function testTruncateSql() <ide> */ <ide> protected function _getMockedDriver() <ide> { <del> $driver = new \Cake\Database\Driver\Postgres(); <del> $mock = $this->getMockBuilder(\PDO::class) <add> $driver = new Postgres(); <add> $pdo = PDO::class; <add> if (version_compare(PHP_VERSION, '5.6', '<')) { <add> $pdo = 'FakePdo'; <add> } <add> $mock = $this->getMockBuilder($pdo) <ide> ->setMethods(['quote']) <ide> ->disableOriginalConstructor() <ide> ->getMock(); <ide><path>tests/TestCase/Database/Schema/SqliteSchemaTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Database\Schema; <ide> <add>use Cake\Database\Driver\Sqlite; <ide> use Cake\Database\Schema\Collection as SchemaCollection; <ide> use Cake\Database\Schema\SqliteSchema; <ide> use Cake\Database\Schema\Table; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <add>use PDO; <ide> <ide> /** <ide> * Test case for Sqlite Schema Dialect. <ide> public function testTruncateSqlNoSequences() <ide> */ <ide> protected function _getMockedDriver() <ide> { <del> $driver = new \Cake\Database\Driver\Sqlite(); <del> $mock = $this->getMockBuilder(\PDO::class) <add> $driver = new Sqlite(); <add> $pdo = PDO::class; <add> if (version_compare(PHP_VERSION, '5.6', '<')) { <add> $pdo = 'FakePdo'; <add> } <add> $mock = $this->getMockBuilder($pdo) <ide> ->setMethods(['quote', 'prepare']) <ide> ->disableOriginalConstructor() <ide> ->getMock(); <ide><path>tests/TestCase/Database/Schema/SqlserverSchemaTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Database\Schema; <ide> <add>use Cake\Database\Driver\Sqlserver; <ide> use Cake\Database\Schema\Collection as SchemaCollection; <ide> use Cake\Database\Schema\SqlserverSchema; <ide> use Cake\Database\Schema\Table; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <add>use PDO; <ide> <ide> /** <ide> * SQL Server schema test case. <ide> public function testTruncateSql() <ide> */ <ide> protected function _getMockedDriver() <ide> { <del> $driver = new \Cake\Database\Driver\Sqlserver(); <del> $mock = $this->getMockBuilder(\PDO::class) <add> $driver = new Sqlserver(); <add> $pdo = PDO::class; <add> if (version_compare(PHP_VERSION, '5.6', '<')) { <add> $pdo = 'FakePdo'; <add> } <add> $mock = $this->getMockBuilder($pdo) <ide> ->setMethods(['quote']) <ide> ->disableOriginalConstructor() <ide> ->getMock();
6
Text
Text
add v3.28.8 to changelog
703b9ca2653a6b479a762b30dca1a33eaa13d8ab
<ide><path>CHANGELOG.md <ide> - [#19542](https://github.com/emberjs/ember.js/pull/19542) [BUGFIX] Fix initializer test blueprints <ide> - [#19589](https://github.com/emberjs/ember.js/pull/19589) [BUGFIX] Don’t include type-tests in build output <ide> <add>## v3.28.8 (December 2, 2021) <add> <add>- [#19868](https://github.com/emberjs/ember.js/pull/19868) [BUGFIX] Fix a bug with the implicit injections deprecation that meant injecting a store to avoid the deprecation did not work. <add> <ide> ## v3.28.7 (December 1, 2021) <ide> <ide> - [#19854](https://github.com/emberjs/ember.js/pull/19854) [BUGFIX] Fix implicit injections deprecation for routes to cover previously missed cases
1
Javascript
Javascript
add tests to deferred mixin
7be8024dcd65c3c8a49f06df0a6452c1641a4d14
<ide><path>packages/ember-runtime/tests/mixins/deferred_test.js <ide> test("can resolve deferred", function() { <ide> }); <ide> <ide> Ember.run(function() { <del> deferred.resolve(); <add> deferred.resolve(deferred); <ide> }); <ide> <ide> equal(count, 1, "was fulfilled"); <ide> test("can resolve with then", function() { <ide> }); <ide> <ide> Ember.run(function() { <del> deferred.resolve(); <add> deferred.resolve(deferred); <ide> }); <ide> <ide> equal(count1, 1, "then were resolved"); <ide> test("can call resolve multiple times", function() { <ide> }); <ide> <ide> Ember.run(function() { <del> deferred.resolve(); <del> deferred.resolve(); <del> deferred.resolve(); <add> deferred.resolve(deferred); <add> deferred.resolve(deferred); <add> deferred.resolve(deferred); <ide> }); <ide> <ide> equal(count, 1, "calling resolve multiple times has no effect"); <ide> test("resolve prevent reject", function() { <ide> }); <ide> <ide> Ember.run(function() { <del> deferred.resolve(); <add> deferred.resolve(deferred); <ide> }); <ide> <ide> Ember.run(function() { <ide> test("reject prevent resolve", function() { <ide> deferred.reject(); <ide> }); <ide> Ember.run(function() { <del> deferred.resolve(); <add> deferred.resolve(deferred); <ide> }); <ide> <ide> equal(resolved, false, "is not resolved"); <ide> test("then is chainable", function() { <ide> }); <ide> <ide> Ember.run(function() { <del> deferred.resolve(); <add> deferred.resolve(deferred); <ide> }); <ide> <ide> equal(count, 1, "chained callback was called"); <ide> }); <add> <add> <add>test("can self fulfill", function() { <add> expect(1); <add> var deferred; <add> <add> Ember.run(function() { <add> deferred = Ember.Object.createWithMixins(Ember.DeferredMixin); <add> }); <add> <add> deferred.then(function(value) { <add> equal(value, deferred, "successfully resolved to itself"); <add> }); <add> <add> Ember.run(function() { <add> deferred.resolve(deferred); <add> }); <add>}); <add> <add> <add> <add>test("can fulfill to a custom value", function() { <add> expect(1); <add> var deferred, obj = {}; <add> <add> Ember.run(function() { <add> deferred = Ember.Object.createWithMixins(Ember.DeferredMixin); <add> }); <add> <add> deferred.then(function(value) { <add> equal(value, obj, "successfully resolved to given value"); <add> }); <add> <add> Ember.run(function() { <add> deferred.resolve(obj); <add> }); <add>}); <add> <add> <add>test("can chain self fulfilling objects", function() { <add> expect(2); <add> var firstDeferred, secondDeferred; <add> <add> Ember.run(function() { <add> firstDeferred = Ember.Object.createWithMixins(Ember.DeferredMixin); <add> secondDeferred = Ember.Object.createWithMixins(Ember.DeferredMixin); <add> }); <add> <add> firstDeferred.then(function(value) { <add> equal(value, firstDeferred, "successfully resolved to the first deferred"); <add> return secondDeferred; <add> }) <add> .then(function(value) { <add> equal(value, secondDeferred, "successfully resolved to the second deferred"); <add> }); <add> <add> Ember.run(function() { <add> firstDeferred.resolve(firstDeferred); <add> secondDeferred.resolve(secondDeferred); <add> }); <add>}); <add> <add>test("can do multi level assimilation", function() { <add> expect(1); <add> var firstDeferred, secondDeferred, firstDeferredResolved = false; <add> <add> Ember.run(function() { <add> firstDeferred = Ember.Object.createWithMixins(Ember.DeferredMixin); <add> secondDeferred = Ember.Object.createWithMixins(Ember.DeferredMixin); <add> }); <add> <add> firstDeferred.then(function() { <add> firstDeferredResolved = true; <add> }); <add> <add> secondDeferred.then(function() { <add> ok(firstDeferredResolved, "first deferred already resolved"); <add> }); <add> <add> Ember.run(function() { <add> secondDeferred.resolve(firstDeferred); <add> }); <add> <add> Ember.run(function() { <add> firstDeferred.resolve(firstDeferred); <add> }); <add>}); <add>
1
Go
Go
remove duplicate call to net.parseip
b180de55caa382fd6ced4488d68392edd1d34da0
<ide><path>opts/ip.go <ide> func (o *IpOpt) Set(val string) error { <ide> if ip == nil { <ide> return fmt.Errorf("%s is not an ip address", val) <ide> } <del> (*o.IP) = net.ParseIP(val) <add> *o.IP = ip <ide> return nil <ide> } <ide> <ide> func (o *IpOpt) String() string { <del> return (*o.IP).String() <add> return o.IP.String() <ide> }
1
Text
Text
add missing ipam options to api docs
d69fce79f94b807ccb0f2f64c47881ee8fc31250
<ide><path>docs/reference/api/docker_remote_api_v1.21.md <ide> Content-Type: application/json <ide> <ide> { <ide> "Name":"isolated_nw", <add> "CheckDuplicate":true, <ide> "Driver":"bridge", <ide> "IPAM":{ <add> "Driver": "default", <ide> "Config":[ <ide> { <ide> "Subnet":"172.20.0.0/16", <ide> Content-Type: application/json <ide> **JSON parameters**: <ide> <ide> - **Name** - The new network's name. this is a mandatory field <add>- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false` <ide> - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver <ide> - **IPAM** - Optional custom IP scheme for the network <add> - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver <add> - **Config** - List of IPAM configuration options, specified as a map: <add> `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` <ide> - **Options** - Network specific options to be used by the drivers <del>- **CheckDuplicate** - Requests daemon to check for networks with same name <ide> <ide> ### Connect a container to a network <ide> <ide><path>docs/reference/api/docker_remote_api_v1.22.md <ide> Content-Type: application/json <ide> <ide> { <ide> "Name":"isolated_nw", <add> "CheckDuplicate":true, <ide> "Driver":"bridge", <ide> "IPAM":{ <add> "Driver": "default", <ide> "Config":[ <ide> { <ide> "Subnet":"172.20.0.0/16", <ide> Content-Type: application/json <ide> **JSON parameters**: <ide> <ide> - **Name** - The new network's name. this is a mandatory field <add>- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false` <ide> - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver <ide> - **IPAM** - Optional custom IP scheme for the network <add> - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver <add> - **Config** - List of IPAM configuration options, specified as a map: <add> `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` <add> - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}` <ide> - **Options** - Network specific options to be used by the drivers <del>- **CheckDuplicate** - Requests daemon to check for networks with same name <ide> <ide> ### Connect a container to a network <ide> <ide><path>docs/reference/api/docker_remote_api_v1.23.md <ide> Content-Type: application/json <ide> <ide> { <ide> "Name":"isolated_nw", <del> "CheckDuplicate":false, <add> "CheckDuplicate":true, <ide> "Driver":"bridge", <ide> "EnableIPv6": true, <ide> "IPAM":{ <add> "Driver": "default", <ide> "Config":[ <ide> { <ide> "Subnet":"172.20.0.0/16", <ide> Content-Type: application/json <ide> **JSON parameters**: <ide> <ide> - **Name** - The new network's name. this is a mandatory field <del>- **CheckDuplicate** - Requests daemon to check for networks with same name <add>- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false` <ide> - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver <ide> - **Internal** - Restrict external access to the network <ide> - **IPAM** - Optional custom IP scheme for the network <add> - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver <add> - **Config** - List of IPAM configuration options, specified as a map: <add> `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` <add> - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}` <ide> - **EnableIPv6** - Enable IPv6 on the network <ide> - **Options** - Network specific options to be used by the drivers <ide> - **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}` <ide><path>docs/reference/api/docker_remote_api_v1.24.md <ide> Content-Type: application/json <ide> <ide> { <ide> "Name":"isolated_nw", <del> "CheckDuplicate":false, <add> "CheckDuplicate":true, <ide> "Driver":"bridge", <ide> "EnableIPv6": true, <ide> "IPAM":{ <add> "Driver": "default", <ide> "Config":[ <ide> { <ide> "Subnet":"172.20.0.0/16", <ide> Content-Type: application/json <ide> **JSON parameters**: <ide> <ide> - **Name** - The new network's name. this is a mandatory field <del>- **CheckDuplicate** - Requests daemon to check for networks with same name <add>- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false` <ide> - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver <ide> - **Internal** - Restrict external access to the network <ide> - **IPAM** - Optional custom IP scheme for the network <add> - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver <add> - **Config** - List of IPAM configuration options, specified as a map: <add> `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` <add> - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}` <ide> - **EnableIPv6** - Enable IPv6 on the network <ide> - **Options** - Network specific options to be used by the drivers <ide> - **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}` <ide><path>docs/reference/api/docker_remote_api_v1.25.md <ide> Content-Type: application/json <ide> <ide> { <ide> "Name":"isolated_nw", <del> "CheckDuplicate":false, <add> "CheckDuplicate":true, <ide> "Driver":"bridge", <ide> "EnableIPv6": true, <ide> "IPAM":{ <add> "Driver": "default", <ide> "Config":[ <ide> { <ide> "Subnet":"172.20.0.0/16", <ide> Content-Type: application/json <ide> **JSON parameters**: <ide> <ide> - **Name** - The new network's name. this is a mandatory field <del>- **CheckDuplicate** - Requests daemon to check for networks with same name <add>- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false` <ide> - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver <ide> - **Internal** - Restrict external access to the network <ide> - **IPAM** - Optional custom IP scheme for the network <add> - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver <add> - **Config** - List of IPAM configuration options, specified as a map: <add> `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` <add> - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}` <ide> - **EnableIPv6** - Enable IPv6 on the network <ide> - **Options** - Network specific options to be used by the drivers <ide> - **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
5
Text
Text
improve livecheck docs
fb29dec0de185c8154c602612e4638d3b878a33f
<ide><path>docs/Brew-Livecheck.md <ide> When livecheck isn't given instructions for how to check for upstream versions, <ide> 1. If a strategy can be applied, use it to check for new versions. <ide> 1. Return the newest version (or an error if versions could not be found at any available URLs). <ide> <del>It's sometimes necessary to override this default behavior to create a working check for a formula/cask. If a source doesn't provide the newest version, we need to check a different one. If livecheck doesn't correctly match version text, we need to provide an appropriate regex. <add>It's sometimes necessary to override this default behavior to create a working check. If a source doesn't provide the newest version, we need to check a different one. If livecheck doesn't correctly match version text, we need to provide an appropriate regex or `strategy` block. <ide> <ide> This can be accomplished by adding a `livecheck` block to the formula/cask. For more information on the available methods, please refer to the [`Livecheck` class documentation](https://rubydoc.brew.sh/Livecheck.html). <ide> <ide> This can be accomplished by adding a `livecheck` block to the formula/cask. For <ide> <ide> ### General guidelines <ide> <del>* **Only use `strategy` when it's necessary**. For example, if livecheck is already using `Git` for a URL, it's not necessary to use `strategy :git`. However, if `Git` applies to a URL but we need to use `PageMatch`, it's necessary to use `strategy :page_match`. <add>* **Only use `strategy` when it's necessary**. For example, if livecheck is already using `Git` for a URL, it's not necessary to use `strategy :git`. However, if `Git` applies to a URL but we need to use `PageMatch`, it's necessary to specify `strategy :page_match`. <ide> <del>* **Only use the `GithubLatest` strategy when it's necessary and correct**. Github.com rate limits requests and we try to minimize our use of this strategy to avoid hitting the rate limit on CI or when using `brew livecheck --tap` on large taps (e.g. homebrew/core). The `Git` strategy is often sufficient and we only need to use `GithubLatest` when the "latest" release is different than the newest version from the tags. <add>* **Only use the `GithubLatest` strategy when it's necessary and correct**. `github.com` rate limits requests and we try to minimize our use of this strategy to avoid hitting the rate limit on CI or when using `brew livecheck --tap` on large taps (e.g. homebrew/core). The `Git` strategy is often sufficient and we only need to use `GithubLatest` when the "latest" release is different than the newest version from the tags. <ide> <ide> ### URL guidelines <ide> <ide> When in doubt, start with one of these examples instead of copy-pasting a `livec <ide> <ide> ### File names <ide> <add>When matching the version from a file name on an HTML page, we often restrict matching to `href` attributes. `href=.*?` will match the opening delimiter (`"`, `'`) as well as any part of the URL before the file name. <add> <ide> ```ruby <del> livecheck do <del> url "https://www.example.com/downloads/" <del> regex(/href=.*?example[._-]v?(\d+(?:\.\d+)+)\.t/i) <del> end <add>livecheck do <add> url "https://www.example.com/downloads/" <add> regex(/href=.*?example[._-]v?(\d+(?:\.\d+)+)\.t/i) <add>end <ide> ``` <ide> <del>When matching the version from a file name on an HTML page, we often restrict matching to `href` attributes. `href=.*?` will match the opening delimiter (`"`, `'`) as well as any part of the URL before the file name. <del> <ide> We sometimes make this more explicit to exclude unwanted matches. URLs with a preceding path can use `href=.*?/` and others can use `href=["']?`. For example, this is necessary when the page also contains unwanted files with a longer prefix (`another-example-1.2.tar.gz`). <ide> <ide> ### Version directories <ide> <add>When checking a directory listing page, sometimes files are separated into version directories (e.g. `1.2.3/`). In this case, we must identify versions from the directory names. <add> <ide> ```ruby <del> livecheck do <del> url "https://www.example.com/releases/example/" <del> regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i) <del> end <add>livecheck do <add> url "https://www.example.com/releases/example/" <add> regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i) <add>end <ide> ``` <ide> <del>When checking a directory listing page, sometimes files are separated into version directories (e.g. `1.2.3/`). In this case, we must identify versions from the directory names. <del> <ide> ### Git tags <ide> <add>When the `stable` URL uses the `Git` strategy, the following example will only match tags like `1.2`/`v1.2`, etc. <add> <ide> ```ruby <del> livecheck do <del> url :stable <del> regex(/^v?(\d+(?:\.\d+)+)$/i) <del> end <add>livecheck do <add> url :stable <add> regex(/^v?(\d+(?:\.\d+)+)$/i) <add>end <ide> ``` <ide> <del>When the `stable` URL uses the `Git` strategy, the regex above will only match tags like `1.2`/`v1.2`, etc. <del> <ide> If tags include the software name as a prefix (e.g. `example-1.2.3`), it's easy to modify the regex accordingly: `/^example[._-]v?(\d+(?:\.\d+)+)$/i` <ide> <del>### `PageMatch` `strategy` block <add>### `strategy` blocks <add> <add>If the upstream version format needs to be manipulated to match the formula/cask format, a `strategy` block can be used instead of a `regex`. <add> <add>#### `PageMatch` `strategy` block <add> <add>In the example below, we're converting a date format like `2020-01-01` into `20200101`. <ide> <ide> ```ruby <del> livecheck do <del> url :homepage <del> regex(/href=.*?example[._-]v?(\d{4}-\d{2}-\d{2})\.t/i) <del> strategy :page_match do |page, regex| <del> page.scan(regex).map { |match| match&.first&.gsub(/\D/, "") } <del> end <add>livecheck do <add> url :homepage <add> strategy :page_match do |page| <add> page.scan(/href=.*?example[._-]v?(\d{4}-\d{2}-\d{2})\.t/i) <add> .map { |match| match&.first&.gsub(/\D/, "") } <ide> end <add>end <ide> ``` <ide> <del>When necessary, a `strategy` block allows us to have greater flexibility in how upstream version information is matched and processed. Currently, they're only used when the upstream version format needs to be manipulated to match the formula/cask format. In the example above, we're converting a date format like `2020-01-01` into `20200101`. <del> <ide> The `PageMatch` `strategy` block style seen here also applies to any strategy that uses `PageMatch` internally. <ide> <del>### `Git` `strategy` block <add>#### `Git` `strategy` block <add> <add>A `strategy` block for `Git` is a bit different, as the block receives an array of tag strings instead of a page content string. Similar to the `PageMatch` example, this is converting tags with a date format like `2020-01-01` into `20200101`. <ide> <ide> ```ruby <del> livecheck do <del> url :stable <del> regex(/^(\d{4}-\d{2}-\d{2})$/i) <del> strategy :git do |tags, regex| <del> tags.map { |tag| tag[regex, 1]&.gsub(/\D/, "") }.compact <del> end <add>livecheck do <add> url :stable <add> strategy :git do |tags| <add> tags.map { |tag| tag[/^(\d{4}-\d{2}-\d{2})$/i, 1]&.gsub(/\D/, "") }.compact <ide> end <add>end <ide> ``` <ide> <del>A `strategy` block for `Git` is a bit different, as the block receives an array of tag strings instead of a page content string. Similar to the `PageMatch` example, this is converting tags with a date format like `2020-01-01` into `20200101`. <add>#### `Sparkle` `strategy` block <add> <add>A `strategy` block for `Sparkle` receives an `item` which has methods for the `short_version`, `version`, `url` and `title`. <ide> <del>### Skip <add>The default pattern for the `Sparkle` strategy is `"#{item.short_version},#{item.version}"` if both are set. In the example below, the `url` also includes a download ID which is needed: <ide> <ide> ```ruby <del> livecheck do <del> skip "No version information available" <add>livecheck do <add> url "https://www.example.com/example.xml" <add> strategy :sparkle do |item| <add> "#{item.short_version},#{item.version}:#{item.url[%r{/(\d+)/[^/]+\.zip}i, 1]}" <ide> end <add>end <ide> ``` <ide> <add>### `skip` <add> <ide> Livecheck automatically skips some formulae/casks for a number of reasons (deprecated, disabled, discontinued, etc.). However, on rare occasions we need to use a `livecheck` block to do a manual skip. The `skip` method takes a string containing a very brief reason for skipping. <add> <add>```ruby <add>livecheck do <add> skip "No version information available" <add>end <add>```
1
Text
Text
remove extra word
0ced0efec5a68548725baca6095bb2166cfc5fad
<ide><path>docs/tutorials/fundamentals/part-5-ui-and-react.md <ide> We now have a working todo app! Our app creates a store, passes the store to the <ide> <ide> Try implementing the rest of the missing UI features on your own! Here's a list of the things you'll need to add: <ide> <del>- In `<TodoListItem>` component, use the `useDispatch` hook to dispatch actions to for changing the color category and deleting the todo <add>- In `<TodoListItem>` component, use the `useDispatch` hook to dispatch actions for changing the color category and deleting the todo <ide> - In `<Footer>`, use the `useDispatch` hook to dispatch actions for marking all todos as completed, clearing completed todos, and changing the filter values. <ide> <ide> We'll cover implementing the filters in [Part 7: Standard Redux Patterns](./part-7-standard-patterns.md).
1
Javascript
Javascript
prevent unwanted references
0af5454b19a3cf15fe126e9e767b961de3046713
<ide><path>src/core/EventDispatcher.js <ide> Object.assign( EventDispatcher.prototype, { <ide> <ide> } <ide> <add> event.target = null; <add> <ide> } <ide> <ide> }
1
PHP
PHP
remove extra whitespace
d0726a34d1bc9174e713f7e249fb0d9334e60bbd
<ide><path>config/logging.php <ide> ], <ide> <ide> 'papertrail' => [ <del> 'driver' => 'monolog', <add> 'driver' => 'monolog', <ide> 'level' => 'debug', <ide> 'handler' => SyslogUdpHandler::class, <ide> 'handler_with' => [
1
Python
Python
clarify error message
1529c9c438ccc5c8f0168ebb4ae45fcf382b3c2f
<ide><path>keras/models.py <ide> def model_from_config(config, custom_objects={}): <ide> from keras.utils.layer_utils import layer_from_config <ide> if isinstance(config, list): <del> raise Exception('model_fom_config expects a dictionary.' <del> 'To load an old-style config use the appropiate' <del> '`load_config` method on Sequential or Graph') <add> raise Exception('`model_fom_config` expects a dictionary, not a list. ' <add> 'Maybe you meant to use `Sequential.from_config(config)`?') <ide> return layer_from_config(config, custom_objects=custom_objects) <ide> <ide>
1
PHP
PHP
use early return
c4f8f492731756ca53a13e656af7f9f2e3574396
<ide><path>src/Illuminate/Console/Scheduling/Event.php <ide> public function emailOutputTo($addresses) <ide> /** <ide> * E-mail the results of the scheduled operation only when it produces output. <ide> * <del> * @param array|mixed $addresses <add> * @param array|mixed $addresses <ide> * @return $this <ide> * <ide> * @throws \LogicException <ide> protected function emailOutput(Mailer $mailer, $addresses, $includeEmpty = true) <ide> { <ide> $text = file_get_contents($this->output); <ide> <del> if ($includeEmpty || ! empty($text)) { <del> $mailer->raw($text, function ($m) use ($addresses) { <del> $m->subject($this->getEmailSubject()); <del> <del> foreach ($addresses as $address) { <del> $m->to($address); <del> } <del> }); <add> if (! $includeEmpty && empty($text)) { <add> return; <ide> } <add> <add> $mailer->raw($text, function ($m) use ($addresses) { <add> $m->subject($this->getEmailSubject()); <add> <add> foreach ($addresses as $address) { <add> $m->to($address); <add> } <add> }); <ide> } <ide> <ide> /**
1
Javascript
Javascript
move reactfibererrordialog rn fork into rn itself
c45c2c3a261ab5a2878c36d9f49de531ef69a121
<ide><path>packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactFiberErrorDialog.js <add>/** <add> * Copyright (c) Facebook, Inc. and its affiliates. <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> * @flow strict <add> */ <add> <add>module.exports = { <add> showErrorDialog: jest.fn(), <add>}; <ide><path>packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js <ide> module.exports = { <ide> get BatchedBridge() { <ide> return require('./BatchedBridge.js'); <ide> }, <del> get ExceptionsManager() { <del> return require('./ExceptionsManager'); <del> }, <ide> get Platform() { <ide> return require('./Platform'); <ide> }, <ide> get RCTEventEmitter() { <ide> return require('./RCTEventEmitter'); <ide> }, <add> get ReactFiberErrorDialog() { <add> return require('./ReactFiberErrorDialog'); <add> }, <ide> get ReactNativeViewConfigRegistry() { <ide> return require('./ReactNativeViewConfigRegistry'); <ide> }, <ide><path>packages/react-reconciler/src/forks/ReactFiberErrorDialog.native.js <ide> import type {CapturedError} from '../ReactCapturedValue'; <ide> <ide> // Module provided by RN: <del>import {ExceptionsManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'; <add>import {ReactFiberErrorDialog as RNImpl} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'; <add>import invariant from 'shared/invariant'; <ide> <del>/** <del> * Intercept lifecycle errors and ensure they are shown with the correct stack <del> * trace within the native redbox component. <del> */ <del>export function showErrorDialog(capturedError: CapturedError): boolean { <del> const {componentStack, error} = capturedError; <del> <del> let errorToHandle: Error; <del> <del> // Typically Errors are thrown but eg strings or null can be thrown as well. <del> if (error instanceof Error) { <del> const {message, name} = error; <add>invariant( <add> typeof RNImpl.showErrorDialog === 'function', <add> 'Expected ReactFiberErrorDialog.showErrorDialog to be a function.', <add>); <ide> <del> const summary = message ? `${name}: ${message}` : name; <del> <del> errorToHandle = error; <del> <del> try { <del> errorToHandle.message = `${summary}\n\nThis error is located at:${componentStack}`; <del> } catch (e) {} <del> } else if (typeof error === 'string') { <del> errorToHandle = new Error( <del> `${error}\n\nThis error is located at:${componentStack}`, <del> ); <del> } else { <del> errorToHandle = new Error(`Unspecified error at:${componentStack}`); <del> } <del> <del> ExceptionsManager.handleException(errorToHandle, false); <del> <del> // Return false here to prevent ReactFiberErrorLogger default behavior of <del> // logging error details to console.error. Calls to console.error are <del> // automatically routed to the native redbox controller, which we've already <del> // done above by calling ExceptionsManager. <del> return false; <add>export function showErrorDialog(capturedError: CapturedError): boolean { <add> return RNImpl.showErrorDialog(capturedError); <ide> } <ide><path>scripts/flow/react-native-host-hooks.js <ide> import type { <ide> ViewConfigGetter, <ide> } from 'react-native-renderer/src/ReactNativeTypes'; <ide> import type {RNTopLevelEventType} from 'events/TopLevelEventTypes'; <add>import type {CapturedError} from 'react-reconciler/src/ReactCapturedValue'; <ide> <ide> declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' { <ide> declare export function deepDiffer(one: any, two: any): boolean; <ide> declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' <ide> blurTextInput: (object: any) => void, <ide> focusTextInput: (object: any) => void, <ide> }; <del> declare export var ExceptionsManager: { <del> handleException: (error: Error, isFatal: boolean) => void, <add> declare export var ReactFiberErrorDialog: { <add> showErrorDialog: (error: CapturedError) => boolean, <ide> }; <ide> declare export var Platform: { <ide> OS: string,
4
Javascript
Javascript
use nicer es6 syntax for get/set on cps
0f66c76d5c2453a06f001c1089510de8da8d22ae
<ide><path>packages/ember-metal/lib/computed_macros.js <ide> export function readOnly(dependentKey) { <ide> */ <ide> export function defaultTo(defaultPath) { <ide> return computed({ <del> get: function(key) { <add> get(key) { <ide> Ember.deprecate('Usage of Ember.computed.defaultTo is deprecated, use `Ember.computed.oneWay` instead.'); <ide> return get(this, defaultPath); <ide> }, <ide> <del> set: function(key, newValue, cachedValue) { <add> set(key, newValue, cachedValue) { <ide> Ember.deprecate('Usage of Ember.computed.defaultTo is deprecated, use `Ember.computed.oneWay` instead.'); <ide> return newValue != null ? newValue : get(this, defaultPath); <ide> } <ide> export function defaultTo(defaultPath) { <ide> */ <ide> export function deprecatingAlias(dependentKey) { <ide> return computed(dependentKey, { <del> get: function(key) { <add> get(key) { <ide> Ember.deprecate(`Usage of \`${key}\` is deprecated, use \`${dependentKey}\` instead.`); <ide> return get(this, dependentKey); <ide> }, <del> set: function(key, value) { <add> set(key, value) { <ide> Ember.deprecate(`Usage of \`${key}\` is deprecated, use \`${dependentKey}\` instead.`); <ide> set(this, dependentKey, value); <ide> return value; <ide><path>packages/ember-routing-views/lib/views/link.js <ide> var LinkView = EmberComponent.extend({ <ide> @property disabled <ide> */ <ide> disabled: computed({ <del> get: function(key, value) { <add> get(key, value) { <ide> return false; <ide> }, <del> set: function(key, value) { <add> set(key, value) { <ide> if (value !== undefined) { this.set('_isDisabled', value); } <ide> <ide> return value ? get(this, 'disabledClass') : false; <ide><path>packages/ember-runtime/lib/controllers/array_controller.js <ide> export default ArrayProxy.extend(ControllerMixin, SortableMixin, { <ide> }, <ide> <ide> model: computed({ <del> get: function(key) { <add> get(key) { <ide> return Ember.A(); <ide> }, <del> set: function(key, value) { <add> set(key, value) { <ide> Ember.assert( <ide> 'ArrayController expects `model` to implement the Ember.Array mixin. ' + <ide> 'This can often be fixed by wrapping your model with `Ember.A()`.', <ide><path>packages/ember-runtime/lib/mixins/array.js <ide> export default Mixin.create(Enumerable, { <ide> @return this <ide> */ <ide> '[]': computed({ <del> get: function(key) { <add> get(key) { <ide> return this; <ide> }, <del> set: function(key, value) { <add> set(key, value) { <ide> this.replace(0, get(this, 'length'), value); <ide> return this; <ide> } <ide><path>packages/ember-runtime/lib/mixins/enumerable.js <ide> export default Mixin.create({ <ide> @return this <ide> */ <ide> '[]': computed({ <del> get: function(key) { return this; } <add> get(key) { return this; } <ide> }), <ide> <ide> // .......................................................... <ide><path>packages/ember-runtime/lib/mixins/promise_proxy.js <ide> export default Mixin.create({ <ide> @property promise <ide> */ <ide> promise: computed({ <del> get: function() { <add> get() { <ide> throw new EmberError("PromiseProxy's promise must be set"); <ide> }, <del> set: function(key, promise) { <add> set(key, promise) { <ide> return tap(this, promise); <ide> } <ide> }), <ide><path>packages/ember-runtime/lib/mixins/sortable.js <ide> export default Mixin.create(MutableEnumerable, { <ide> @property arrangedContent <ide> */ <ide> arrangedContent: computed('content', 'sortProperties.@each', { <del> get: function(key) { <add> get(key) { <ide> var content = get(this, 'content'); <ide> var isSorted = get(this, 'isSorted'); <ide> var sortProperties = get(this, 'sortProperties'); <ide><path>packages/ember-views/lib/mixins/view_context_support.js <ide> var ViewContextSupport = Mixin.create({ <ide> @type Object <ide> */ <ide> context: computed({ <del> get: function() { <add> get() { <ide> return get(this, '_context'); <ide> }, <del> set: function(key, value) { <add> set(key, value) { <ide> set(this, '_context', value); <ide> return value; <ide> } <ide> var ViewContextSupport = Mixin.create({ <ide> @private <ide> */ <ide> _context: computed({ <del> get: function() { <add> get() { <ide> var parentView, controller; <ide> <ide> if (controller = get(this, 'controller')) { <ide> var ViewContextSupport = Mixin.create({ <ide> } <ide> return null; <ide> }, <del> set: function(key, value) { <add> set(key, value) { <ide> return value; <ide> } <ide> }), <ide> var ViewContextSupport = Mixin.create({ <ide> @type Object <ide> */ <ide> controller: computed({ <del> get: function() { <add> get() { <ide> if (this._controller) { <ide> return this._controller; <ide> } <ide> <ide> return this._parentView ? get(this._parentView, 'controller') : null; <ide> }, <del> set: function(_, value) { <add> set(_, value) { <ide> this._controller = value; <ide> return value; <ide> } <ide><path>packages/ember-views/lib/views/select.js <ide> var Select = View.extend({ <ide> @default null <ide> */ <ide> value: computed({ <del> get: function(key) { <add> get(key) { <ide> var valuePath = get(this, '_valuePath'); <ide> return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection'); <ide> }, <del> set: function(key, value) { <add> set(key, value) { <ide> return value; <ide> } <ide> }).property('_valuePath', 'selection'), <ide><path>packages/ember-views/lib/views/text_field.js <ide> function canSetTypeOfInput(type) { <ide> function getTypeComputed() { <ide> if (Ember.FEATURES.isEnabled('new-computed-syntax')) { <ide> return computed({ <del> get: function() { <add> get() { <ide> return 'text'; <ide> }, <ide> <del> set: function(key, value) { <add> set(key, value) { <ide> var type = 'text'; <ide> <ide> if (canSetTypeOfInput(value)) {
10
Text
Text
convert all tabs into spaces
20d347a806baa0dd481b31a7f847386574882d5b
<ide><path>docs/api-guide/authentication.md <ide> If the `.authenticate_header()` method is not overridden, the authentication sch <ide> <ide> The following example will authenticate any incoming request as the user given by the username in a custom request header named 'X-USERNAME'. <ide> <del> from django.contrib.auth.models import User <add> from django.contrib.auth.models import User <ide> from rest_framework import authentication <ide> from rest_framework import exceptions <ide> <ide><path>docs/api-guide/content-negotiation.md <ide> The default content negotiation class may be set globally, using the `DEFAULT_CO <ide> <ide> You can also set the content negotiation used for an individual view, or viewset, using the `APIView` class-based views. <ide> <del> from myapp.negotiation import IgnoreClientContentNegotiation <add> from myapp.negotiation import IgnoreClientContentNegotiation <ide> from rest_framework.response import Response <ide> from rest_framework.views import APIView <ide> <ide><path>docs/api-guide/reverse.md <ide> You should **include the request as a keyword argument** to the function, for ex <ide> <ide> from rest_framework.reverse import reverse <ide> from rest_framework.views import APIView <del> from django.utils.timezone import now <del> <del> class APIRootView(APIView): <del> def get(self, request): <del> year = now().year <del> data = { <del> ... <del> 'year-summary-url': reverse('year-summary', args=[year], request=request) <add> from django.utils.timezone import now <add> <add> class APIRootView(APIView): <add> def get(self, request): <add> year = now().year <add> data = { <add> ... <add> 'year-summary-url': reverse('year-summary', args=[year], request=request) <ide> } <del> return Response(data) <add> return Response(data) <ide> <ide> ## reverse_lazy <ide> <ide><path>docs/api-guide/serializers.md <ide> We can now use this class to serialize single `HighScore` instances: <ide> def high_score(request, pk): <ide> instance = HighScore.objects.get(pk=pk) <ide> serializer = HighScoreSerializer(instance) <del> return Response(serializer.data) <add> return Response(serializer.data) <ide> <ide> Or use it to serialize multiple instances: <ide> <ide> @api_view(['GET']) <ide> def all_high_scores(request): <ide> queryset = HighScore.objects.order_by('-score') <ide> serializer = HighScoreSerializer(queryset, many=True) <del> return Response(serializer.data) <add> return Response(serializer.data) <ide> <ide> #### Read-write `BaseSerializer` classes <ide> <ide> Here's a complete example of our previous `HighScoreSerializer`, that's been upd <ide> 'player_name': 'May not be more than 10 characters.' <ide> }) <ide> <del> # Return the validated values. This will be available as <del> # the `.validated_data` property. <add> # Return the validated values. This will be available as <add> # the `.validated_data` property. <ide> return { <ide> 'score': int(score), <ide> 'player_name': player_name <ide> The [drf-writable-nested][drf-writable-nested] package provides writable nested <ide> <ide> ## DRF Encrypt Content <ide> <del>The [drf-encrypt-content][drf-encrypt-content] package helps you encrypt your data, serialized through ModelSerializer. It also contains some helper functions. Which helps you to encrypt your data. <add>The [drf-encrypt-content][drf-encrypt-content] package helps you encrypt your data, serialized through ModelSerializer. It also contains some helper functions. Which helps you to encrypt your data. <ide> <ide> <ide> [cite]: https://groups.google.com/d/topic/django-users/sVFaOfQi4wY/discussion <ide><path>docs/api-guide/throttling.md <ide> The rate descriptions used in `DEFAULT_THROTTLE_RATES` may include `second`, `mi <ide> You can also set the throttling policy on a per-view or per-viewset basis, <ide> using the `APIView` class-based views. <ide> <del> from rest_framework.response import Response <add> from rest_framework.response import Response <ide> from rest_framework.throttling import UserRateThrottle <del> from rest_framework.views import APIView <add> from rest_framework.views import APIView <ide> <ide> class ExampleView(APIView): <ide> throttle_classes = [UserRateThrottle] <ide><path>docs/community/3.12-announcement.md <ide> in the URL path. <ide> <ide> For example... <ide> <del>Method | Path | Tags <add>Method | Path | Tags <ide> --------------------------------|-----------------|------------- <del>`GET`, `PUT`, `PATCH`, `DELETE` | `/users/{id}/` | `['users']` <del>`GET`, `POST` | `/users/` | `['users']` <del>`GET`, `PUT`, `PATCH`, `DELETE` | `/orders/{id}/` | `['orders']` <del>`GET`, `POST` | `/orders/` | `['orders']` <add>`GET`, `PUT`, `PATCH`, `DELETE` | `/users/{id}/` | `['users']` <add>`GET`, `POST` | `/users/` | `['users']` <add>`GET`, `PUT`, `PATCH`, `DELETE` | `/orders/{id}/` | `['orders']` <add>`GET`, `POST` | `/orders/` | `['orders']` <ide> <ide> The tags used for a particular view may also be overridden... <ide>
6
Ruby
Ruby
use double quotes
15b858ccc4de1e76e8251c69b5f1a30af223d3c3
<ide><path>Library/Homebrew/cask/spec/formatter_spec.rb <ide> describe "::columns" do <ide> let(:input) { <ide> [ <del> 'aa', <del> 'bbb', <del> 'ccc', <del> 'dd' <add> "aa", <add> "bbb", <add> "ccc", <add> "dd", <ide> ] <ide> } <ide> subject { described_class.columns(input) }
1
Python
Python
replace deprecated param from docstrings
3b41bb45e6e25c1482847e30793c2413b386589b
<ide><path>airflow/models/dag.py <ide> class DAG(LoggingMixin): <ide> accessible in templates, namespaced under `params`. These <ide> params can be overridden at the task level. <ide> :type params: dict <del> :param concurrency: the number of task instances allowed to run <add> :param max_active_tasks: the number of task instances allowed to run <ide> concurrently <del> :type concurrency: int <add> :type max_active_tasks: int <ide> :param max_active_runs: maximum number of active DAG runs, beyond this <ide> number of DAG runs in a running state, the scheduler won't create <ide> new active DAG runs
1
Javascript
Javascript
add strict parsing test for es-do
aaeb5e6a3b1d85d5c300d3e5be4ba74259b43416
<ide><path>src/test/locale/es-do.js <ide> test('weeks year starting sunday formatted', function (assert) { <ide> <ide> test('test short months proper', function (assert) { <ide> var str = '02-ago-2016'; // "02-ago-2016" <del> assert.equal(moment(str, 'DD-MMM-YYYY').month(), '7', '02-ago-2016 month should be 7'); <add> assert.equal(moment(str, 'DD-MMM-YYYY').month(), 7, '02-ago-2016 month should be 7'); <add> assert.equal(moment(str, 'DD-MMM-YYYY', true).month(), 7, '02-ago-2016 strict parse month should be 7'); <ide> }); <ide> <ide>
1
Javascript
Javascript
add promise api test for appendfile()
0d9500daedbb61770359c34383a8d4784bcabd56
<ide><path>test/parallel/test-fs-append-file.js <ide> const join = require('path').join; <ide> <ide> const tmpdir = require('../common/tmpdir'); <ide> <del>const filename = join(tmpdir.path, 'append.txt'); <del> <ide> const currentFileData = 'ABCD'; <ide> <ide> const n = 220; <ide> let ncallbacks = 0; <ide> <ide> tmpdir.refresh(); <ide> <del>// test that empty file will be created and have content added <del>fs.appendFile(filename, s, function(e) { <del> assert.ifError(e); <add>const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; <ide> <del> ncallbacks++; <add>// test that empty file will be created and have content added (callback API) <add>{ <add> const filename = join(tmpdir.path, 'append.txt'); <ide> <del> fs.readFile(filename, function(e, buffer) { <add> fs.appendFile(filename, s, common.mustCall(function(e) { <ide> assert.ifError(e); <del> ncallbacks++; <del> assert.strictEqual(Buffer.byteLength(s), buffer.length); <del> }); <del>}); <add> <add> fs.readFile(filename, common.mustCall(function(e, buffer) { <add> assert.ifError(e); <add> assert.strictEqual(Buffer.byteLength(s), buffer.length); <add> })); <add> })); <add>} <add> <add>// test that empty file will be created and have content added (promise API) <add>{ <add> const filename = join(tmpdir.path, 'append-promise.txt'); <add> <add> fs.promises.appendFile(filename, s) <add> .then(common.mustCall(() => fs.promises.readFile(filename))) <add> .then((buffer) => { <add> assert.strictEqual(Buffer.byteLength(s), buffer.length); <add> }) <add> .catch(throwNextTick); <add>} <ide> <ide> // test that appends data to a non empty file <ide> const filename2 = join(tmpdir.path, 'append2.txt'); <ide> assert.throws( <ide> { code: 'ERR_INVALID_CALLBACK' }); <ide> <ide> process.on('exit', function() { <del> assert.strictEqual(12, ncallbacks); <add> assert.strictEqual(10, ncallbacks); <ide> <del> fs.unlinkSync(filename); <ide> fs.unlinkSync(filename2); <ide> fs.unlinkSync(filename3); <ide> fs.unlinkSync(filename4);
1
PHP
PHP
add class alias for engines
05fcedc95972b9d34bca37f3b5a3b5d36784ad98
<ide><path>config/bootstrap.php <ide> <ide> // Compatibility aliases. These will be removed for the first RC release. <ide> class_alias('Cake\Error\Debugger', 'Cake\Utility\Debugger'); <add>class_alias('Cake\Core\Configure\Engine\PhpConfig', 'Cake\Configure\Engine\PhpConfig'); <add>class_alias('Cake\Core\Configure\Engine\IniConfig', 'Cake\Configure\Engine\IniConfig'); <ide> <ide> require CAKE . 'basics.php';
1
PHP
PHP
update the passwords facade constants
d297faf5e17b5ec8a705354eba5ac710454f792c
<ide><path>src/Illuminate/Support/Facades/Password.php <ide> class Password extends Facade { <ide> * <ide> * @var int <ide> */ <del> const REMINDER_SENT = 'reminders.sent'; <add> const REMINDER_SENT = 'passwords.sent'; <ide> <ide> /** <ide> * Constant representing a successfully reset password. <ide> * <ide> * @var int <ide> */ <del> const PASSWORD_RESET = 'reminders.reset'; <add> const PASSWORD_RESET = 'passwords.reset'; <ide> <ide> /** <ide> * Constant representing the user not found response. <ide> * <ide> * @var int <ide> */ <del> const INVALID_USER = 'reminders.user'; <add> const INVALID_USER = 'passwords.user'; <ide> <ide> /** <ide> * Constant representing an invalid password. <ide> * <ide> * @var int <ide> */ <del> const INVALID_PASSWORD = 'reminders.password'; <add> const INVALID_PASSWORD = 'passwords.password'; <ide> <ide> /** <ide> * Constant representing an invalid token. <ide> * <ide> * @var int <ide> */ <del> const INVALID_TOKEN = 'reminders.token'; <add> const INVALID_TOKEN = 'passwords.token'; <ide> <ide> /** <ide> * Get the registered name of the component.
1
Ruby
Ruby
handle name@v.v formulae
ab203a749f050486bd174fc7e29bd2a246333b80
<ide><path>Library/Homebrew/cmd/search.rb <ide> def search <ide> end <ide> <ide> if $stdout.tty? <del> metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ? .] <add> metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ?] <ide> bad_regex = metacharacters.any? do |char| <ide> ARGV.any? do |arg| <ide> arg.include?(char) && !arg.start_with?("/")
1
Javascript
Javascript
change browser build to umd
27bde0dd3f5823098a961bdcad32e4ec221636c5
<ide><path>webpack.config.js <ide> if (process.env.NODE_ENV === 'production') { <ide> ); <ide> } <ide> <add>var reactExternal = { <add> root: 'React', <add> commonjs2: 'react', <add> commonjs: 'react', <add> amd: 'react' <add>}; <add> <ide> module.exports = { <ide> externals: { <del> 'react': 'React', <del> 'react-native': 'React' <add> 'react': reactExternal, <add> 'react-native': reactExternal <ide> }, <ide> module: { <ide> loaders: [ <ide> module.exports = { <ide> }, <ide> output: { <ide> library: 'Redux', <del> libraryTarget: 'var' <add> libraryTarget: 'umd' <ide> }, <ide> plugins: plugins, <ide> resolve: {
1
PHP
PHP
fix additional issues with saveall()
fbba3621b5e522d1c7f7fe4c175a3298871469de
<ide><path>lib/Cake/Model/Behavior/TranslateBehavior.php <ide> public function beforeValidate(Model $model) { <ide> /** <ide> * beforeSave callback. <ide> * <add> * Copies data into the runtime property when `$options['validate']` is <add> * disabled. Or the runtime data hasn't been set yet. <add> * <ide> * @param Model $model Model save was called on. <ide> * @return boolean true. <ide> */ <del> public function beforeSave(Model $model) { <add> public function beforeSave(Model $model, $options = array()) { <add> if (isset($options['validate']) && $options['validate'] == false) { <add> unset($this->runtime[$model->alias]['beforeSave']); <add> } <add> if (isset($this->runtime[$model->alias]['beforeSave'])) { <add> return true; <add> } <ide> $this->_setRuntimeData($model); <ide> return true; <ide> } <ide> public function beforeSave(Model $model) { <ide> */ <ide> protected function _setRuntimeData(Model $model) { <ide> $locale = $this->_getLocale($model); <del> if (empty($locale) || isset($this->runtime[$model->alias]['beforeSave'])) { <add> if (empty($locale)) { <ide> return true; <ide> } <ide> $fields = array_merge($this->settings[$model->alias], $this->runtime[$model->alias]['fields']); <ide> protected function _setRuntimeData(Model $model) { <ide> * @return void <ide> */ <ide> public function afterSave(Model $model, $created) { <del> if (!isset($this->runtime[$model->alias]['beforeSave'])) { <add> if (!isset($this->runtime[$model->alias]['beforeValidate']) && !isset($this->runtime[$model->alias]['beforeSave'])) { <ide> return true; <ide> } <ide> $locale = $this->_getLocale($model); <del> $tempData = $this->runtime[$model->alias]['beforeSave']; <del> unset($this->runtime[$model->alias]['beforeSave']); <add> if (isset($this->runtime[$model->alias]['beforeValidate'])) { <add> $tempData = $this->runtime[$model->alias]['beforeValidate']; <add> } else { <add> $tempData = $this->runtime[$model->alias]['beforeSave']; <add> } <add> <add> unset($this->runtime[$model->alias]['beforeValidate'], $this->runtime[$model->alias]['beforeSave']); <ide> $conditions = array('model' => $model->alias, 'foreign_key' => $model->id); <ide> $RuntimeModel = $this->translateModel($model); <ide> <ide><path>lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php <ide> public function testSaveAllTranslatedAssociations() { <ide> 'conditions' => array('translated_article_id' => $Model->id) <ide> )); <ide> $this->assertCount(2, $result); <add> $this->assertEquals($data['TranslatedItem'][0]['title'], $result[0]['TranslatedItem']['title']); <add> $this->assertEquals($data['TranslatedItem'][1]['title'], $result[1]['TranslatedItem']['title']); <ide> } <ide> <ide> /**
2
Text
Text
add issue and pull request templates
81e35b5a2956604a6a3b9bb795a74a342702cc12
<ide><path>.github/ISSUE_TEMPLATE.md <add>_Thanks for wanting to report an issue you've found in Node.js. Please delete <add>this text and fill in the template below. If unsure about something, just do as <add>best as you're able._ <add> <add>_Note that it will be much easier for us to fix the issue if a test case that <add>reproduces the problem is provided. Ideally this test case should not have any <add>external dependencies. We understand that it is not always possible to reduce <add>your code to a small test case, but we would appreciate to have as much data as <add>possible. Thank you!_ <add> <add>* **Version**: _output of `node -v`_ <add>* **Platform**: _either `uname -a` output, or if Windows, version and 32-bit or <add> 64-bit_ <add>* **Subsystem**: _optional. if known - please specify affected core module name_ <ide><path>.github/PULL_REQUEST_TEMPLATE.md <add>### Description of change <add> <add>_Please provide a description of the change here._ <add> <add>### Pull Request check-list <add> <add>_Please make sure to review and check all of these items:_ <add> <add>- [ ] Does `make -j8 test` (UNIX) or `vcbuild test nosign` (Windows) pass with <add> this change (including linting)? <add>- [ ] Is the commit message formatted according to [CONTRIBUTING.md][0]? <add>- [ ] If this change fixes a bug (or a performance problem), is a regression <add> test (or a benchmark) included? <add>- [ ] Is a documentation update included (if this change modifies <add> existing APIs, or introduces new ones)? <add> <add>_NOTE: these things are not required to open a PR and can be done afterwards / <add>while the PR is open._ <add> <add>### Affected core subsystem(s) <add> <add>_Please provide affected core subsystem(s) (like buffer, cluster, crypto, etc)_ <add> <add>[0]: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit
2
Javascript
Javascript
add two test cases for querystring
dd2e13556020cea3daae2278bec4e9870578384b
<ide><path>test/parallel/test-querystring.js <ide> assert.strictEqual( <ide> Object.keys(qs.parse('a=1&b=1&c=1', null, null, { maxKeys: 1 })).length, <ide> 1); <ide> <add>// Test limiting with a case that starts from `&` <add>assert.strictEqual( <add> Object.keys(qs.parse('&a', null, null, { maxKeys: 1 })).length, <add> 0); <add> <ide> // Test removing limit <ide> function testUnlimitedKeys() { <ide> const query = {}; <ide> assert.strictEqual(qs.unescapeBuffer('a%20').toString(), 'a '); <ide> assert.strictEqual(qs.unescapeBuffer('a%2g').toString(), 'a%2g'); <ide> assert.strictEqual(qs.unescapeBuffer('a%%').toString(), 'a%%'); <ide> <add>// Test invalid encoded string <add>check(qs.parse('%\u0100=%\u0101'), { '%Ā': '%ā' }); <ide> <ide> // Test custom decode <ide> function demoDecode(str) {
1
Ruby
Ruby
save a hash allocation per request
dde91e9bf5ab246f0f684b40288b272f4ba9a699
<ide><path>railties/lib/rails/engine.rb <ide> def endpoint <ide> def call(env) <ide> env.merge!(env_config) <ide> if env['SCRIPT_NAME'] <del> env.merge! "ROUTES_#{routes.object_id}_SCRIPT_NAME" => env['SCRIPT_NAME'].dup <add> env["ROUTES_#{routes.object_id}_SCRIPT_NAME"] = env['SCRIPT_NAME'].dup <ide> end <ide> app.call(env) <ide> end
1
Javascript
Javascript
improve function inspection
d0667e814e8be53d329a9c7f4849996c192395c9
<ide><path>lib/internal/util/inspect.js <ide> const { <ide> } = require('internal/errors'); <ide> <ide> const { <add> isAsyncFunction, <add> isGeneratorFunction, <ide> isAnyArrayBuffer, <ide> isArrayBuffer, <ide> isArgumentsObject, <ide> function formatRaw(ctx, value, recurseTimes, typedArray) { <ide> return `${braces[0]}}`; <ide> } <ide> } else if (typeof value === 'function') { <del> const type = constructor || tag || 'Function'; <del> let name = `${type}`; <del> if (value.name && typeof value.name === 'string') { <del> name += `: ${value.name}`; <del> } <add> base = getFunctionBase(value, constructor, tag); <ide> if (keys.length === 0) <del> return ctx.stylize(`[${name}]`, 'special'); <del> base = `[${name}]`; <add> return ctx.stylize(base, 'special'); <ide> } else if (isRegExp(value)) { <ide> // Make RegExps say that they are RegExps <ide> base = RegExpPrototype.toString( <ide> function getBoxedBase(value, ctx, keys, constructor, tag) { <ide> return ctx.stylize(base, type.toLowerCase()); <ide> } <ide> <add>function getFunctionBase(value, constructor, tag) { <add> let type = 'Function'; <add> if (isAsyncFunction(value)) { <add> type = 'AsyncFunction'; <add> } else if (isGeneratorFunction(value)) { <add> type = 'GeneratorFunction'; <add> } <add> let base = `[${type}`; <add> if (constructor === null) { <add> base += ' (null prototype)'; <add> } <add> if (value.name === '') { <add> base += ' (anonymous)'; <add> } else { <add> base += `: ${value.name}`; <add> } <add> base += ']'; <add> if (constructor !== type && constructor !== null) { <add> base += ` ${constructor}`; <add> } <add> if (tag !== '' && constructor !== tag) { <add> base += ` [${tag}]`; <add> } <add> return base; <add>} <add> <ide> function formatError(err, constructor, tag, ctx) { <ide> // TODO(BridgeAR): Always show the error code if present. <ide> let stack = err.stack || ErrorPrototype.toString(err); <ide><path>test/parallel/test-assert.js <ide> testAssertionMessage(undefined, 'undefined'); <ide> testAssertionMessage(-Infinity, '-Infinity'); <ide> testAssertionMessage([1, 2, 3], '[\n+ 1,\n+ 2,\n+ 3\n+ ]'); <ide> testAssertionMessage(function f() {}, '[Function: f]'); <del>testAssertionMessage(function() {}, '[Function]'); <add>testAssertionMessage(function() {}, '[Function (anonymous)]'); <ide> testAssertionMessage(circular, '{\n+ x: [Circular],\n+ y: 1\n+ }'); <ide> testAssertionMessage({ a: undefined, b: null }, <ide> '{\n+ a: undefined,\n+ b: null\n+ }'); <ide> assert.throws( <ide> '\n' + <ide> '+ {}\n' + <ide> '- {\n' + <del> '- [Symbol(nodejs.util.inspect.custom)]: [Function],\n' + <add> '- [Symbol(nodejs.util.inspect.custom)]: [Function (anonymous)],\n' + <ide> "- loop: 'forever'\n" + <ide> '- }' <ide> }); <ide><path>test/parallel/test-console-table.js <ide> test(undefined, 'undefined\n'); <ide> test(false, 'false\n'); <ide> test('hi', 'hi\n'); <ide> test(Symbol(), 'Symbol()\n'); <del>test(function() {}, '[Function]\n'); <add>test(function() {}, '[Function (anonymous)]\n'); <ide> <ide> test([1, 2, 3], ` <ide> ┌─────────┬────────┐ <ide><path>test/parallel/test-repl.js <ide> const errorTests = [ <ide> // Functions should not evaluate twice (#2773) <ide> { <ide> send: 'var I = [1,2,3,function() {}]; I.pop()', <del> expect: '[Function]' <add> expect: '[Function (anonymous)]' <ide> }, <ide> // Multiline object <ide> { <ide><path>test/parallel/test-util-format.js <ide> assert.strictEqual(util.format('abc%', 1), 'abc% 1'); <ide> <ide> // Additional arguments after format specifiers <ide> assert.strictEqual(util.format('%i', 1, 'number'), '1 number'); <del>assert.strictEqual(util.format('%i', 1, () => {}), '1 [Function]'); <add>assert.strictEqual(util.format('%i', 1, () => {}), '1 [Function (anonymous)]'); <ide> <ide> { <ide> const o = {}; <ide> assert.strictEqual(util.format('1', '1'), '1 1'); <ide> assert.strictEqual(util.format(1, '1'), '1 1'); <ide> assert.strictEqual(util.format('1', 1), '1 1'); <ide> assert.strictEqual(util.format(1, -0), '1 -0'); <del>assert.strictEqual(util.format('1', () => {}), '1 [Function]'); <del>assert.strictEqual(util.format(1, () => {}), '1 [Function]'); <add>assert.strictEqual(util.format('1', () => {}), '1 [Function (anonymous)]'); <add>assert.strictEqual(util.format(1, () => {}), '1 [Function (anonymous)]'); <ide> assert.strictEqual(util.format('1', "'"), "1 '"); <ide> assert.strictEqual(util.format(1, "'"), "1 '"); <ide> assert.strictEqual(util.format('1', 'number'), '1 number'); <ide><path>test/parallel/test-util-inspect-proxy.js <ide> const proxy11 = new Proxy(() => {}, { <ide> return proxy11; <ide> } <ide> }); <del>const expected10 = '[Function]'; <del>const expected11 = '[Function]'; <add>const expected10 = '[Function (anonymous)]'; <add>const expected11 = '[Function (anonymous)]'; <ide> assert.strictEqual(util.inspect(proxy10), expected10); <ide> assert.strictEqual(util.inspect(proxy11), expected11); <ide><path>test/parallel/test-util-inspect.js <ide> assert.strictEqual(util.inspect(1), '1'); <ide> assert.strictEqual(util.inspect(false), 'false'); <ide> assert.strictEqual(util.inspect(''), "''"); <ide> assert.strictEqual(util.inspect('hello'), "'hello'"); <del>assert.strictEqual(util.inspect(function() {}), '[Function]'); <del>assert.strictEqual(util.inspect(() => {}), '[Function]'); <del>assert.strictEqual(util.inspect(async function() {}), '[AsyncFunction]'); <del>assert.strictEqual(util.inspect(async () => {}), '[AsyncFunction]'); <del>assert.strictEqual(util.inspect(function*() {}), '[GeneratorFunction]'); <add>assert.strictEqual(util.inspect(function abc() {}), '[Function: abc]'); <add>assert.strictEqual(util.inspect(() => {}), '[Function (anonymous)]'); <add>assert.strictEqual( <add> util.inspect(async function() {}), <add> '[AsyncFunction (anonymous)]' <add>); <add>assert.strictEqual(util.inspect(async () => {}), '[AsyncFunction (anonymous)]'); <add> <add>// Special function inspection. <add>{ <add> const fn = (() => function*() {})(); <add> assert.strictEqual( <add> util.inspect(fn), <add> '[GeneratorFunction (anonymous)]' <add> ); <add> Object.setPrototypeOf(fn, Object.getPrototypeOf(async () => {})); <add> assert.strictEqual( <add> util.inspect(fn), <add> '[GeneratorFunction (anonymous)] AsyncFunction' <add> ); <add> Object.defineProperty(fn, 'name', { value: 5, configurable: true }); <add> assert.strictEqual( <add> util.inspect(fn), <add> '[GeneratorFunction: 5] AsyncFunction' <add> ); <add> Object.defineProperty(fn, Symbol.toStringTag, { <add> value: 'Foobar', <add> configurable: true <add> }); <add> assert.strictEqual( <add> util.inspect({ ['5']: fn }), <add> "{ '5': [GeneratorFunction: 5] AsyncFunction [Foobar] }" <add> ); <add> Object.defineProperty(fn, 'name', { value: '5', configurable: true }); <add> Object.setPrototypeOf(fn, null); <add> assert.strictEqual( <add> util.inspect(fn), <add> '[GeneratorFunction (null prototype): 5] [Foobar]' <add> ); <add> assert.strictEqual( <add> util.inspect({ ['5']: fn }), <add> "{ '5': [GeneratorFunction (null prototype): 5] [Foobar] }" <add> ); <add>} <add> <ide> assert.strictEqual(util.inspect(undefined), 'undefined'); <ide> assert.strictEqual(util.inspect(null), 'null'); <ide> assert.strictEqual(util.inspect(/foo(bar\n)?/gi), '/foo(bar\\n)?/gi'); <ide> assert.strictEqual(util.inspect({}), '{}'); <ide> assert.strictEqual(util.inspect({ a: 1 }), '{ a: 1 }'); <ide> assert.strictEqual(util.inspect({ a: function() {} }), '{ a: [Function: a] }'); <ide> assert.strictEqual(util.inspect({ a: () => {} }), '{ a: [Function: a] }'); <del>assert.strictEqual(util.inspect({ a: async function() {} }), <del> '{ a: [AsyncFunction: a] }'); <add>// eslint-disable-next-line func-name-matching <add>assert.strictEqual(util.inspect({ a: async function abc() {} }), <add> '{ a: [AsyncFunction: abc] }'); <ide> assert.strictEqual(util.inspect({ a: async () => {} }), <ide> '{ a: [AsyncFunction: a] }'); <ide> assert.strictEqual(util.inspect({ a: function*() {} }), <ide> assert.strictEqual( <ide> { <ide> const value = (() => function() {})(); <ide> value.aprop = 42; <del> assert.strictEqual(util.inspect(value), '[Function] { aprop: 42 }'); <add> assert.strictEqual( <add> util.inspect(value), <add> '[Function (anonymous)] { aprop: 42 }' <add> ); <ide> } <ide> <ide> // Regular expressions with properties. <ide> util.inspect(process); <ide> out = util.inspect(o, { compact: false, breakLength: 3 }); <ide> expect = [ <ide> '{', <del> ' a: [Function],', <add> ' a: [Function (anonymous)],', <ide> ' b: [Number: 3]', <ide> '}' <ide> ].join('\n'); <ide> util.inspect(process); <ide> out = util.inspect(o, { compact: false, breakLength: 3, showHidden: true }); <ide> expect = [ <ide> '{', <del> ' a: [Function] {', <add> ' a: [Function (anonymous)] {', <ide> ' [length]: 0,', <ide> " [name]: ''", <ide> ' },', <ide> assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'"); <ide> [new Number(55), '[Number: 55]'], <ide> [Object(BigInt(55)), '[BigInt: 55n]'], <ide> [Object(Symbol('foo')), '[Symbol: Symbol(foo)]'], <del> [function() {}, '[Function]'], <del> [() => {}, '[Function]'], <add> [function() {}, '[Function (anonymous)]'], <add> [() => {}, '[Function (anonymous)]'], <ide> [[1, 2], '[ 1, 2 ]'], <ide> [[, , 5, , , , ], '[ <2 empty items>, 5, <3 empty items> ]'], <ide> [{ a: 5 }, '{ a: 5 }'], <ide> assert.strictEqual( <ide> let value = (function() { return function() {}; })(); <ide> Object.setPrototypeOf(value, null); <ide> Object.setPrototypeOf(obj, value); <del> assert.strictEqual(util.inspect(obj), '<[Function]> { a: true }'); <add> assert.strictEqual( <add> util.inspect(obj), <add> '<[Function (null prototype) (anonymous)]> { a: true }' <add> ); <ide> assert.strictEqual( <ide> util.inspect(obj, { colors: true }), <del> '<\u001b[36m[Function]\u001b[39m> { a: \u001b[33mtrue\u001b[39m }' <add> '<\u001b[36m[Function (null prototype) (anonymous)]\u001b[39m> ' + <add> '{ a: \u001b[33mtrue\u001b[39m }' <ide> ); <ide> <ide> obj = { a: true };
7
Javascript
Javascript
reverse animation with negative timescale
3dd811eebcfcf244bd916f8b5684adbc144c2f3a
<ide><path>src/extras/animation/Animation.js <ide> THREE.Animation.prototype.update = (function(){ <ide> <ide> var duration = this.data.length; <ide> <del> if ( this.loop === true && this.currentTime > duration ) { <add> if ( this.currentTime > duration || this.currentTime < 0 ) { <ide> <del> this.currentTime %= duration; <del> this.reset(); <add> if ( this.loop ) { <ide> <del> } else if ( this.loop === false && this.currentTime > duration ) { <add> this.currentTime %= duration; <ide> <del> this.stop(); <del> return; <add> if ( this.currentTime < 0 ) <add> this.currentTime += duration; <add> <add> this.reset(); <add> <add> } else { <add> <add> this.stop(); <add> return; <add> <add> } <ide> <ide> } <ide> <ide> THREE.Animation.prototype.update = (function(){ <ide> var prevKey = animationCache.prevKey[ type ]; <ide> var nextKey = animationCache.nextKey[ type ]; <ide> <del> if ( nextKey.time <= this.currentTime ) { <add> if ( ( this.timeScale > 0 && nextKey.time <= this.currentTime ) || <add> ( this.timeScale < 0 && prevKey.time >= this.currentTime ) ) { <ide> <ide> prevKey = this.data.hierarchy[ h ].keys[ 0 ]; <ide> nextKey = this.getNextKeyWith( type, h, 1 );
1
Python
Python
fix test-crypto-fips.js under shared openssl
2454aa0f1fdd41486268f711a6ad53756350f608
<ide><path>configure.py <ide> def without_ssl_error(option): <ide> if options.openssl_no_asm and options.shared_openssl: <ide> error('--openssl-no-asm is incompatible with --shared-openssl') <ide> <del> if options.openssl_is_fips and not options.shared_openssl: <add> if options.openssl_is_fips: <ide> o['defines'] += ['OPENSSL_FIPS'] <add> <add> if options.openssl_is_fips and not options.shared_openssl: <ide> variables['node_fipsinstall'] = b(True) <ide> <ide> if options.shared_openssl:
1
PHP
PHP
fix cs errors
50d7ebf0173bab8f87a27f0b82608adcbf3a6d18
<ide><path>tests/TestCase/View/Helper/FormHelperTest.php <ide> public function testSelectCheckboxMultipleOverrideName() { <ide> $expected = array( <ide> 'input' => array('type' => 'hidden', 'name' => 'fish', 'value' => ''), <ide> array('div' => array('class' => 'checkbox')), <del> array('label' => array('for' => 'fish-0')), <add> array('label' => array('for' => 'fish-0')), <ide> array('input' => array('type' => 'checkbox', 'name' => 'fish[]', 'value' => '0', 'id' => 'fish-0')), <ide> '1', <ide> '/label', <ide> '/div', <ide> array('div' => array('class' => 'checkbox')), <del> array('label' => array('for' => 'fish-1')), <add> array('label' => array('for' => 'fish-1')), <ide> array('input' => array('type' => 'checkbox', 'name' => 'fish[]', 'value' => '1', 'id' => 'fish-1')), <ide> '2', <ide> '/label',
1
Text
Text
improve changelog entry
cbe1bc29722ddeda12d8652c409cea156ddb85a3
<ide><path>activerecord/CHANGELOG.md <del>* Create indexes inline in CREATE TABLE for MySQL <add>* Create indexes inline in CREATE TABLE for MySQL. <ide> <ide> This is important, because adding an index on a temporary table after it has been created <ide> would commit the transaction. <del> It also allows creating and dropping indexed tables with fewer queries and fewer permissions required. <add> <add> It also allows creating and dropping indexed tables with fewer queries and fewer permissions <add> required. <ide> <ide> Example: <ide> <ide> end <ide> # => CREATE TEMPORARY TABLE temp (INDEX (zip)) AS SELECT id, name, zip FROM a_really_complicated_query <ide> <del> *Cody Cutrer*, *Steve Rice* <add> *Cody Cutrer*, *Steve Rice*, *Rafael Mendonça Franca* <ide> <ide> * Save `has_one` association even if the record doesn't changed. <ide>
1
PHP
PHP
fix most of the fixture tests
98780c8e449500272cfb93a9925a5101913a376b
<ide><path>lib/Cake/Test/TestCase/TestSuite/TestFixtureTest.php <ide> <?php <ide> /** <del> * TestFixture file <del> * <del> * PHP 5 <del> * <ide> * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html> <ide> * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) <ide> * <ide> * <ide> * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) <ide> * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests <del> * @package Cake.Test.Case.TestSuite <ide> * @since CakePHP(tm) v 1.2.0.4667 <ide> * @license MIT License (http://www.opensource.org/licenses/mit-license.php) <ide> */ <ide> namespace Cake\Test\TestCase\TestSuite; <add> <add>use Cake\Core\Configure; <ide> use Cake\Model\ConnectionManager; <ide> use Cake\Model\Model; <ide> use Cake\TestSuite\Fixture\TestFixture; <ide> /** <ide> * TestFixtureTestFixture class <ide> * <del> * @package Cake.Test.Case.TestSuite <add> * @package Cake.Test.TestCase.TestSuite <ide> */ <ide> class TestFixtureTestFixture extends TestFixture { <ide> <ide> class StringsTestFixture extends TestFixture { <ide> <ide> <ide> /** <del> * TestFixtureImportFixture class <add> * ImportFixture class <ide> * <ide> * @package Cake.Test.Case.TestSuite <ide> */ <del>class TestFixtureImportFixture extends TestFixture { <add>class ImportFixture extends TestFixture { <ide> <ide> /** <ide> * Name property <ide> class TestFixtureImportFixture extends TestFixture { <ide> * <ide> * @var mixed <ide> */ <del> public $import = array('table' => 'fixture_tests', 'connection' => 'fixture_test_suite'); <del>} <del> <del>/** <del> * TestFixtureDefaultImportFixture class <del> * <del> * @package Cake.Test.Case.TestSuite <del> */ <del>class TestFixtureDefaultImportFixture extends TestFixture { <del> <del>/** <del> * Name property <del> * <del> * @var string <del> */ <del> public $name = 'ImportFixture'; <add> public $import = ['table' => 'posts', 'connection' => 'test']; <ide> } <ide> <ide> /** <del> * FixtureImportTestModel class <add> * Test case for TestFixture <ide> * <ide> * @package Cake.Test.Case.TestSuite <del> * @package Cake.Test.Case.TestSuite <ide> */ <del>class FixtureImportTestModel extends Model { <del> <del> public $name = 'FixtureImport'; <del> <del> public $useTable = 'fixture_tests'; <del> <del> public $useDbConfig = 'test'; <del> <del>} <del> <del>class FixturePrefixTest extends Model { <del> <del> public $name = 'FixturePrefix'; <del> <del> public $useTable = '_tests'; <del> <del> public $tablePrefix = 'fixture'; <del> <del> public $useDbConfig = 'test'; <del>} <del> <add>class TestFixtureTest extends TestCase { <ide> <ide> /** <del> * Test case for TestFixture <add> * Fixtures for this test. <ide> * <del> * @package Cake.Test.Case.TestSuite <add> * @var array <ide> */ <del>class TestFixtureTest extends TestCase { <add> public $fixtures = ['core.post']; <ide> <ide> /** <ide> * setUp method <ide> * <ide> * @return void <ide> */ <ide> public function setUp() { <add> parent::setUp(); <ide> $methods = array_diff(get_class_methods('Cake\Model\Datasource\DboSource'), array('enabled')); <ide> $methods[] = 'connect'; <ide> <ide> public function setUp() { <ide> * @return void <ide> */ <ide> public function tearDown() { <add> parent::tearDown(); <ide> unset($this->criticDb); <ide> $this->db->config = $this->_backupConfig; <ide> } <ide> public function testInit() { <ide> * @return void <ide> */ <ide> public function testInitDbPrefix() { <del> $this->skipIf($this->db instanceof Sqlite, 'Cannot open 2 connections to Sqlite'); <add> $this->markTestSkipped('Skipped for now as table prefixes need to be re-worked.'); <add> <ide> $db = ConnectionManager::getDataSource('test'); <ide> $Source = new TestFixtureTestFixture(); <ide> $Source->drop($db); <ide> public function testInitDbPrefix() { <ide> * @return void <ide> */ <ide> public function testInitDbPrefixDuplication() { <add> $this->markTestSkipped('Skipped for now as table prefixes need to be re-worked.'); <add> <ide> $this->skipIf($this->db instanceof Sqlite, 'Cannot open 2 connections to Sqlite'); <ide> $db = ConnectionManager::getDataSource('test'); <ide> $backPrefix = $db->config['prefix']; <ide> public function testInitDbPrefixDuplication() { <ide> * @return void <ide> */ <ide> public function testInitModelTablePrefix() { <del> $this->skipIf($this->db instanceof Sqlite, 'Cannot open 2 connections to Sqlite'); <del> $this->skipIf(!empty($this->db->config['prefix']), 'Cannot run this test, you have a database connection prefix.'); <add> $this->markTestSkipped('Skipped for now as table prefixes need to be re-worked.'); <ide> <ide> $Source = new TestFixtureTestFixture(); <ide> $Source->create($this->db); <ide> public function testInitModelTablePrefix() { <ide> * @return void <ide> */ <ide> public function testImport() { <del> $testSuiteDb = ConnectionManager::getDataSource('test'); <del> $testSuiteConfig = $testSuiteDb->config; <del> ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix']))); <del> $newTestSuiteDb = ConnectionManager::getDataSource('new_test_suite'); <del> <del> $Source = new TestFixtureTestFixture(); <del> $Source->create($newTestSuiteDb); <del> $Source->insert($newTestSuiteDb); <del> <del> $Fixture = new TestFixtureDefaultImportFixture(); <add> Configure::write('App.namespace', 'TestApp'); <add> $Fixture = new ImportFixture(); <ide> $Fixture->fields = $Fixture->records = null; <del> $Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite'); <add> $Fixture->import = [ <add> 'model' => 'Post', <add> 'connection' => 'test', <add> ]; <ide> $Fixture->init(); <del> $this->assertEquals(array('id', 'name', 'created'), array_keys($Fixture->fields)); <ide> <del> $keys = array_flip(ClassRegistry::keys()); <del> $this->assertFalse(array_key_exists('fixtureimporttestmodel', $keys)); <add> $expected = [ <add> 'id', <add> 'author_id', <add> 'title', <add> 'body', <add> 'published', <add> 'created', <add> 'updated', <add> ]; <add> $this->assertEquals($expected, array_keys($Fixture->fields)); <ide> <del> $Source->drop($newTestSuiteDb); <add> $keys = array_flip(ClassRegistry::keys()); <add> $this->assertFalse(array_key_exists('post', $keys)); <ide> } <ide> <ide> /** <ide> public function testImport() { <ide> * @return void <ide> */ <ide> public function testImportWithRecords() { <del> $testSuiteDb = ConnectionManager::getDataSource('test'); <del> $testSuiteConfig = $testSuiteDb->config; <del> ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix']))); <del> $newTestSuiteDb = ConnectionManager::getDataSource('new_test_suite'); <del> <del> $Source = new TestFixtureTestFixture(); <del> $Source->create($newTestSuiteDb); <del> $Source->insert($newTestSuiteDb); <del> <del> $Fixture = new TestFixtureDefaultImportFixture(); <add> Configure::write('App.namespace', 'TestApp'); <add> $Fixture = new ImportFixture(); <ide> $Fixture->fields = $Fixture->records = null; <del> $Fixture->import = array( <del> 'model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite', 'records' => true <del> ); <add> $Fixture->import = [ <add> 'model' => 'Post', <add> 'connection' => 'test', <add> 'records' => true <add> ]; <ide> $Fixture->init(); <del> $this->assertEquals(array('id', 'name', 'created'), array_keys($Fixture->fields)); <add> $expected = [ <add> 'id', <add> 'author_id', <add> 'title', <add> 'body', <add> 'published', <add> 'created', <add> 'updated', <add> ]; <add> $this->assertEquals($expected, array_keys($Fixture->fields)); <ide> $this->assertFalse(empty($Fixture->records[0]), 'No records loaded on importing fixture.'); <del> $this->assertTrue(isset($Fixture->records[0]['name']), 'No name loaded for first record'); <del> <del> $Source->drop($newTestSuiteDb); <add> $this->assertTrue(isset($Fixture->records[0]['title']), 'No title loaded for first record'); <ide> } <ide> <ide> /** <ide> public function testInsertStrings() { <ide> */ <ide> public function testDrop() { <ide> $Fixture = new TestFixtureTestFixture(); <del> $this->criticDb->expects($this->at(1))->method('execute')->will($this->returnValue(true)); <del> $this->criticDb->expects($this->at(3))->method('execute')->will($this->returnValue(false)); <del> $this->criticDb->expects($this->exactly(2))->method('dropSchema'); <add> $this->criticDb->expects($this->at(1)) <add> ->method('execute') <add> ->will($this->returnValue(true)); <add> $this->criticDb->expects($this->at(3)) <add> ->method('execute') <add> ->will($this->returnValue(false)); <add> $this->criticDb->expects($this->exactly(2)) <add> ->method('dropSchema'); <ide> <ide> $return = $Fixture->drop($this->criticDb); <ide> $this->assertTrue($this->criticDb->fullDebug); <ide><path>lib/Cake/TestSuite/Fixture/TestFixture.php <ide> * @license MIT License (http://www.opensource.org/licenses/mit-license.php) <ide> */ <ide> namespace Cake\TestSuite\Fixture; <add> <ide> use Cake\Core\App; <ide> use Cake\Error; <ide> use Cake\Log\Log;
2
Mixed
Javascript
accept stores as an object of prop key to store
603ca22b19562c41104cb7e4052d68cee4add72f
<ide><path>README.md <ide> import { <ide> <ide> // but you can write this part anyhow you like: <ide> <del>const initialState = { counter: 0 }; <add>const initialState = 0; <ide> <del>function increment({ counter }) { <del> return { counter: counter + 1 }; <add>function increment(counter) { <add> return counter + 1; <ide> } <ide> <del>function decrement({ counter }) { <del> return { counter: counter - 1 }; <add>function decrement(counter) { <add> return counter - 1; <ide> } <ide> <ide> // what's important is that Store is a pure function too <ide> import Counter from './Counter'; <ide> <ide> export default class CounterContainer { <ide> render() { <del> // stores must be an array. <del> // actions must be a string -> function map. <add> // stores and actions must both be string -> function maps. <ide> // props passed to children will combine these actions and state. <ide> return ( <del> <Container stores={[counterStore]} <add> <Container stores={{ counter: stores.counterStore }} <ide> actions={{ increment, decrement }}> <ide> {/* Yes this is a function as a child. Bear with me. */} <del> {props => <Counter {...props} />} <add> {({ state, actions }) => <Counter {...state} {...actions} />} <ide> </Container> <ide> ); <ide> } <ide> import counterStore from './stores/counterStore'; <ide> <ide> @container({ <ide> actions: { increment, decrement }, <del> stores: [counterStore] <add> stores: { counter: counterStore } <ide> }) <ide> export default class Counter { <ide> static propTypes = { <ide><path>examples/counter/App.js <ide> import Counter from './Counter'; <ide> export default class CounterApp extends Component { <ide> render() { <ide> return ( <del> <Container stores={[stores.counterStore]} <add> <Container stores={{ counter: stores.counterStore }} <ide> actions={{ increment, decrement }}> <del> {props => <Counter {...props} />} <add> {({ state, actions }) => <Counter {...state} {...actions} />} <ide> </Container> <ide> ); <ide> } <ide><path>examples/counter/stores/counterStore.js <ide> import { <ide> DECREMENT_COUNTER <ide> } from '../constants/ActionTypes'; <ide> <del>const initialState = { counter: 0 }; <add>const initialState = 0; <ide> <del>function increment({ counter }) { <del> return { counter: counter + 1 }; <add>function increment(counter) { <add> return counter + 1; <ide> } <ide> <del>function decrement({ counter }) { <del> return { counter: counter - 1 }; <add>function decrement(counter) { <add> return counter - 1; <ide> } <ide> <ide> export default function counterStore(state = initialState, action) { <ide><path>examples/todo/Body.js <ide> import { container } from 'redux'; <ide> import { todoStore } from './stores/index'; <ide> <ide> @container({ <del> stores: [todoStore] <add> stores: { todos: todoStore } <ide> }) <ide> export default class Body { <ide> static propTypes = { <ide><path>examples/todo/stores/index.js <ide> import { ADD_TODO } from '../constants/ActionTypes'; <ide> <del>const initialState = { <del> todos: [{ <del> text: 'do something', <del> id: 0 <del> }] <del>}; <add>const initialState = [{ <add> text: 'do something', <add> id: 0 <add>}]; <ide> <ide> export function todoStore(state = initialState, action) { <ide> switch (action.type) { <ide> case ADD_TODO: <del> return { <del> todos: [{ <del> id: state.todos[0].id + 1, <del> text: action.text <del> }].concat(state.todos) <del> }; <add> return [{ <add> id: state[0].id + 1, <add> text: action.text <add> }].concat(state); <ide> } <ide> <ide> return state; <ide><path>src/Container.js <ide> import { Component, PropTypes } from 'react'; <add>import values from 'lodash/object/values'; <ide> import mapValues from 'lodash/object/mapValues'; <del>import identity from 'lodash/utility/identity'; <ide> import invariant from 'invariant'; <ide> import isPlainObject from 'lodash/lang/isPlainObject'; <ide> <ide> export default class ReduxContainer extends Component { <ide> static propTypes = { <ide> children: PropTypes.func.isRequired, <ide> actions: PropTypes.object.isRequired, <del> stores: PropTypes.arrayOf(PropTypes.func.isRequired).isRequired <add> stores: PropTypes.object.isRequired <ide> } <ide> <ide> static defaultProps = { <del> stores: [], <add> stores: {}, <ide> actions: {} <ide> }; <ide> <ide> export default class ReduxContainer extends Component { <ide> '"actions" must be a plain object with functions as values. Did you misspell an import?' <ide> ); <ide> invariant( <del> Array.isArray(stores) && <del> stores.every(s => typeof s === 'function'), <del> '"stores" must be an array of functions. Did you misspell an import?' <add> isPlainObject(stores) && <add> Object.keys(stores).every(key => typeof stores[key] === 'function'), <add> '"stores" must be a plain object with functions as values. Did you misspell an import?' <ide> ); <ide> <del> const { wrapActionCreator, observeStores, getStoreKey } = this.context.redux; <add> const { wrapActionCreator, observeStores } = this.context.redux; <ide> this.actions = mapValues(props.actions, wrapActionCreator); <ide> <ide> if (this.unsubscribe) { <ide> this.unsubscribe(); <ide> } <ide> <del> this.mapState = (stores.length === 1) ? <del> state => state[getStoreKey(stores[0])] : <del> identity; <add> this.unsubscribe = observeStores(values(stores), this.handleChange); <add> } <ide> <del> this.unsubscribe = observeStores(stores, this.handleChange); <add> mapState(stateFromStores) { <add> const { getStoreKey } = this.context.redux; <add> return mapValues(this.props.stores, store => <add> stateFromStores[getStoreKey(store)] <add> ); <ide> } <ide> <ide> handleChange(stateFromStores) { <ide> export default class ReduxContainer extends Component { <ide> <ide> render() { <ide> return this.props.children({ <del> ...this.actions, <del> ...this.state <add> state: this.state, <add> actions: this.actions <ide> }); <ide> } <ide> } <ide><path>src/addons/container.js <ide> import React from 'react'; <ide> import Container from '../Container'; <ide> import getDisplayName from './getDisplayName'; <ide> <del>export default function container({ actions, stores }) { <add>function defaultTransformProps({ state, actions }) { <add> return { ...state, ...actions }; <add>} <add> <add>export default function container( <add> { actions, stores }, <add> transformProps = defaultTransformProps <add>) { <ide> return (DecoratedComponent) => class ReduxContainerDecorator { <ide> static displayName = `ReduxContainer(${getDisplayName(DecoratedComponent)})`; <ide> <ide> render() { <ide> return ( <ide> <Container actions={actions} stores={stores}> <del> {props => <DecoratedComponent {...this.props} {...props} />} <add> {props => <DecoratedComponent {...this.props} <add> {...transformProps(props)} />} <ide> </Container> <ide> ); <ide> }
7
Ruby
Ruby
prefer class << self; def over def self
f9caa5a6dd99275aa9400ab64813a850a26a0386
<ide><path>railties/lib/rails/generators.rb <ide> module Generators <ide> } <ide> } <ide> <del> def self.configure!(config) #:nodoc: <del> api_only! if config.api_only <del> no_color! unless config.colorize_logging <del> aliases.deep_merge! config.aliases <del> options.deep_merge! config.options <del> fallbacks.merge! config.fallbacks <del> templates_path.concat config.templates <del> templates_path.uniq! <del> hide_namespaces(*config.hidden_namespaces) <del> end <add> class << self <add> def configure!(config) #:nodoc: <add> api_only! if config.api_only <add> no_color! unless config.colorize_logging <add> aliases.deep_merge! config.aliases <add> options.deep_merge! config.options <add> fallbacks.merge! config.fallbacks <add> templates_path.concat config.templates <add> templates_path.uniq! <add> hide_namespaces(*config.hidden_namespaces) <add> end <ide> <del> def self.templates_path #:nodoc: <del> @templates_path ||= [] <del> end <add> def templates_path #:nodoc: <add> @templates_path ||= [] <add> end <ide> <del> def self.aliases #:nodoc: <del> @aliases ||= DEFAULT_ALIASES.dup <del> end <add> def aliases #:nodoc: <add> @aliases ||= DEFAULT_ALIASES.dup <add> end <ide> <del> def self.options #:nodoc: <del> @options ||= DEFAULT_OPTIONS.dup <del> end <add> def options #:nodoc: <add> @options ||= DEFAULT_OPTIONS.dup <add> end <ide> <del> # Hold configured generators fallbacks. If a plugin developer wants a <del> # generator group to fallback to another group in case of missing generators, <del> # they can add a fallback. <del> # <del> # For example, shoulda is considered a test_framework and is an extension <del> # of test_unit. However, most part of shoulda generators are similar to <del> # test_unit ones. <del> # <del> # Shoulda then can tell generators to search for test_unit generators when <del> # some of them are not available by adding a fallback: <del> # <del> # Rails::Generators.fallbacks[:shoulda] = :test_unit <del> def self.fallbacks <del> @fallbacks ||= {} <del> end <add> # Hold configured generators fallbacks. If a plugin developer wants a <add> # generator group to fallback to another group in case of missing generators, <add> # they can add a fallback. <add> # <add> # For example, shoulda is considered a test_framework and is an extension <add> # of test_unit. However, most part of shoulda generators are similar to <add> # test_unit ones. <add> # <add> # Shoulda then can tell generators to search for test_unit generators when <add> # some of them are not available by adding a fallback: <add> # <add> # Rails::Generators.fallbacks[:shoulda] = :test_unit <add> def fallbacks <add> @fallbacks ||= {} <add> end <ide> <del> # Configure generators for API only applications. It basically hides <del> # everything that is usually browser related, such as assets and session <del> # migration generators, and completely disable helpers and assets <del> # so generators such as scaffold won't create them. <del> def self.api_only! <del> hide_namespaces "assets", "helper", "css", "js" <del> <del> options[:rails].merge!( <del> api: true, <del> assets: false, <del> helper: false, <del> template_engine: nil <del> ) <del> <del> if ARGV.first == "mailer" <del> options[:rails].merge!(template_engine: :erb) <add> # Configure generators for API only applications. It basically hides <add> # everything that is usually browser related, such as assets and session <add> # migration generators, and completely disable helpers and assets <add> # so generators such as scaffold won't create them. <add> def api_only! <add> hide_namespaces "assets", "helper", "css", "js" <add> <add> options[:rails].merge!( <add> api: true, <add> assets: false, <add> helper: false, <add> template_engine: nil <add> ) <add> <add> if ARGV.first == "mailer" <add> options[:rails].merge!(template_engine: :erb) <add> end <ide> end <del> end <ide> <del> # Remove the color from output. <del> def self.no_color! <del> Thor::Base.shell = Thor::Shell::Basic <del> end <add> # Remove the color from output. <add> def no_color! <add> Thor::Base.shell = Thor::Shell::Basic <add> end <ide> <del> # Returns an array of generator namespaces that are hidden. <del> # Generator namespaces may be hidden for a variety of reasons. <del> # Some are aliased such as "rails:migration" and can be <del> # invoked with the shorter "migration", others are private to other generators <del> # such as "css:scaffold". <del> def self.hidden_namespaces <del> @hidden_namespaces ||= begin <del> orm = options[:rails][:orm] <del> test = options[:rails][:test_framework] <del> template = options[:rails][:template_engine] <del> css = options[:rails][:stylesheet_engine] <del> <del> [ <del> "rails", <del> "resource_route", <del> "#{orm}:migration", <del> "#{orm}:model", <del> "#{test}:controller", <del> "#{test}:helper", <del> "#{test}:integration", <del> "#{test}:mailer", <del> "#{test}:model", <del> "#{test}:scaffold", <del> "#{test}:view", <del> "#{test}:job", <del> "#{template}:controller", <del> "#{template}:scaffold", <del> "#{template}:mailer", <del> "#{css}:scaffold", <del> "#{css}:assets", <del> "css:assets", <del> "css:scaffold" <del> ] <add> # Returns an array of generator namespaces that are hidden. <add> # Generator namespaces may be hidden for a variety of reasons. <add> # Some are aliased such as "rails:migration" and can be <add> # invoked with the shorter "migration", others are private to other generators <add> # such as "css:scaffold". <add> def hidden_namespaces <add> @hidden_namespaces ||= begin <add> orm = options[:rails][:orm] <add> test = options[:rails][:test_framework] <add> template = options[:rails][:template_engine] <add> css = options[:rails][:stylesheet_engine] <add> <add> [ <add> "rails", <add> "resource_route", <add> "#{orm}:migration", <add> "#{orm}:model", <add> "#{test}:controller", <add> "#{test}:helper", <add> "#{test}:integration", <add> "#{test}:mailer", <add> "#{test}:model", <add> "#{test}:scaffold", <add> "#{test}:view", <add> "#{test}:job", <add> "#{template}:controller", <add> "#{template}:scaffold", <add> "#{template}:mailer", <add> "#{css}:scaffold", <add> "#{css}:assets", <add> "css:assets", <add> "css:scaffold" <add> ] <add> end <ide> end <del> end <ide> <del> class << self <ide> def hide_namespaces(*namespaces) <ide> hidden_namespaces.concat(namespaces) <ide> end <ide> alias hide_namespace hide_namespaces <del> end <ide> <del> # Show help message with available generators. <del> def self.help(command = "generate") <del> puts "Usage: rails #{command} GENERATOR [args] [options]" <del> puts <del> puts "General options:" <del> puts " -h, [--help] # Print generator's options and usage" <del> puts " -p, [--pretend] # Run but do not make any changes" <del> puts " -f, [--force] # Overwrite files that already exist" <del> puts " -s, [--skip] # Skip files that already exist" <del> puts " -q, [--quiet] # Suppress status output" <del> puts <del> puts "Please choose a generator below." <del> puts <del> <del> print_generators <del> end <add> # Show help message with available generators. <add> def help(command = "generate") <add> puts "Usage: rails #{command} GENERATOR [args] [options]" <add> puts <add> puts "General options:" <add> puts " -h, [--help] # Print generator's options and usage" <add> puts " -p, [--pretend] # Run but do not make any changes" <add> puts " -f, [--force] # Overwrite files that already exist" <add> puts " -s, [--skip] # Skip files that already exist" <add> puts " -q, [--quiet] # Suppress status output" <add> puts <add> puts "Please choose a generator below." <add> puts <add> <add> print_generators <add> end <ide> <del> def self.public_namespaces <del> lookup! <del> subclasses.map(&:namespace) <del> end <add> def public_namespaces <add> lookup! <add> subclasses.map(&:namespace) <add> end <ide> <del> def self.print_generators <del> sorted_groups.each { |b, n| print_list(b, n) } <del> end <add> def print_generators <add> sorted_groups.each { |b, n| print_list(b, n) } <add> end <ide> <del> def self.sorted_groups <del> namespaces = public_namespaces <del> namespaces.sort! <add> def sorted_groups <add> namespaces = public_namespaces <add> namespaces.sort! <ide> <del> groups = Hash.new { |h, k| h[k] = [] } <del> namespaces.each do |namespace| <del> base = namespace.split(":").first <del> groups[base] << namespace <del> end <add> groups = Hash.new { |h, k| h[k] = [] } <add> namespaces.each do |namespace| <add> base = namespace.split(":").first <add> groups[base] << namespace <add> end <ide> <del> rails = groups.delete("rails") <del> rails.map! { |n| n.sub(/^rails:/, "") } <del> rails.delete("app") <del> rails.delete("plugin") <add> rails = groups.delete("rails") <add> rails.map! { |n| n.sub(/^rails:/, "") } <add> rails.delete("app") <add> rails.delete("plugin") <ide> <del> hidden_namespaces.each { |n| groups.delete(n.to_s) } <add> hidden_namespaces.each { |n| groups.delete(n.to_s) } <ide> <del> [[ "rails", rails ]] + groups.sort.to_a <del> end <add> [[ "rails", rails ]] + groups.sort.to_a <add> end <ide> <del> # Rails finds namespaces similar to thor, it only adds one rule: <del> # <del> # Generators names must end with "_generator.rb". This is required because Rails <del> # looks in load paths and loads the generator just before it's going to be used. <del> # <del> # find_by_namespace :webrat, :rails, :integration <del> # <del> # Will search for the following generators: <del> # <del> # "rails:webrat", "webrat:integration", "webrat" <del> # <del> # Notice that "rails:generators:webrat" could be loaded as well, what <del> # Rails looks for is the first and last parts of the namespace. <del> def self.find_by_namespace(name, base = nil, context = nil) #:nodoc: <del> lookups = [] <del> lookups << "#{base}:#{name}" if base <del> lookups << "#{name}:#{context}" if context <del> <del> unless base || context <del> unless name.to_s.include?(?:) <del> lookups << "#{name}:#{name}" <del> lookups << "rails:#{name}" <add> # Rails finds namespaces similar to thor, it only adds one rule: <add> # <add> # Generators names must end with "_generator.rb". This is required because Rails <add> # looks in load paths and loads the generator just before it's going to be used. <add> # <add> # find_by_namespace :webrat, :rails, :integration <add> # <add> # Will search for the following generators: <add> # <add> # "rails:webrat", "webrat:integration", "webrat" <add> # <add> # Notice that "rails:generators:webrat" could be loaded as well, what <add> # Rails looks for is the first and last parts of the namespace. <add> def find_by_namespace(name, base = nil, context = nil) #:nodoc: <add> lookups = [] <add> lookups << "#{base}:#{name}" if base <add> lookups << "#{name}:#{context}" if context <add> <add> unless base || context <add> unless name.to_s.include?(?:) <add> lookups << "#{name}:#{name}" <add> lookups << "rails:#{name}" <add> end <add> lookups << "#{name}" <ide> end <del> lookups << "#{name}" <del> end <ide> <del> lookup(lookups) <add> lookup(lookups) <add> <add> namespaces = Hash[subclasses.map { |klass| [klass.namespace, klass] }] <add> lookups.each do |namespace| <ide> <del> namespaces = Hash[subclasses.map { |klass| [klass.namespace, klass] }] <del> lookups.each do |namespace| <add> klass = namespaces[namespace] <add> return klass if klass <add> end <ide> <del> klass = namespaces[namespace] <del> return klass if klass <add> invoke_fallbacks_for(name, base) || invoke_fallbacks_for(context, name) <ide> end <ide> <del> invoke_fallbacks_for(name, base) || invoke_fallbacks_for(context, name) <del> end <add> # Receives a namespace, arguments and the behavior to invoke the generator. <add> # It's used as the default entry point for generate, destroy and update <add> # commands. <add> def invoke(namespace, args = ARGV, config = {}) <add> names = namespace.to_s.split(":") <add> if klass = find_by_namespace(names.pop, names.any? && names.join(":")) <add> args << "--help" if args.empty? && klass.arguments.any?(&:required?) <add> klass.start(args, config) <add> else <add> options = sorted_groups.flat_map(&:last) <add> suggestions = options.sort_by { |suggested| levenshtein_distance(namespace.to_s, suggested) }.first(3) <add> msg = "Could not find generator '#{namespace}'. " <add> msg << "Maybe you meant #{ suggestions.map { |s| "'#{s}'" }.to_sentence(last_word_connector: " or ", locale: :en) }\n" <add> msg << "Run `rails generate --help` for more options." <add> puts msg <add> end <add> end <ide> <del> # Receives a namespace, arguments and the behavior to invoke the generator. <del> # It's used as the default entry point for generate, destroy and update <del> # commands. <del> def self.invoke(namespace, args = ARGV, config = {}) <del> names = namespace.to_s.split(":") <del> if klass = find_by_namespace(names.pop, names.any? && names.join(":")) <del> args << "--help" if args.empty? && klass.arguments.any?(&:required?) <del> klass.start(args, config) <del> else <del> options = sorted_groups.flat_map(&:last) <del> suggestions = options.sort_by { |suggested| levenshtein_distance(namespace.to_s, suggested) }.first(3) <del> msg = "Could not find generator '#{namespace}'. " <del> msg << "Maybe you meant #{ suggestions.map { |s| "'#{s}'" }.to_sentence(last_word_connector: " or ", locale: :en) }\n" <del> msg << "Run `rails generate --help` for more options." <del> puts msg <add> def print_list(base, namespaces) <add> namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) } <add> super <ide> end <del> end <ide> <del> def self.print_list(base, namespaces) <del> namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) } <del> super <del> end <add> # Try fallbacks for the given base. <add> def invoke_fallbacks_for(name, base) #:nodoc: <add> return nil unless base && fallbacks[base.to_sym] <add> invoked_fallbacks = [] <ide> <del> # Try fallbacks for the given base. <del> def self.invoke_fallbacks_for(name, base) #:nodoc: <del> return nil unless base && fallbacks[base.to_sym] <del> invoked_fallbacks = [] <add> Array(fallbacks[base.to_sym]).each do |fallback| <add> next if invoked_fallbacks.include?(fallback) <add> invoked_fallbacks << fallback <ide> <del> Array(fallbacks[base.to_sym]).each do |fallback| <del> next if invoked_fallbacks.include?(fallback) <del> invoked_fallbacks << fallback <add> klass = find_by_namespace(name, fallback) <add> return klass if klass <add> end <ide> <del> klass = find_by_namespace(name, fallback) <del> return klass if klass <add> nil <ide> end <ide> <del> nil <del> end <del> <del> def self.command_type <del> @command_type ||= "generator" <del> end <add> def command_type <add> @command_type ||= "generator" <add> end <ide> <del> def self.lookup_paths <del> @lookup_paths ||= %w( rails/generators generators ) <del> end <add> def lookup_paths <add> @lookup_paths ||= %w( rails/generators generators ) <add> end <ide> <del> def self.file_lookup_paths <del> @file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ] <add> def file_lookup_paths <add> @file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ] <add> end <ide> end <ide> end <ide> end
1
PHP
PHP
simplify disk change
bc50a9b10097e66b59f0dfcabc6e100b8fedc760
<ide><path>src/Illuminate/Log/LogManager.php <ide> public function __construct($app) <ide> */ <ide> public function build(array $config) <ide> { <add> unset($this->channels['ondemand']); <add> <ide> return $this->get('ondemand', $config); <ide> } <ide> <ide> public function getChannels() <ide> protected function get($name, ?array $config = null) <ide> { <ide> try { <del> if ($name === 'ondemand' && ! empty($config)) { <del> unset($this->channels['ondemand']); <del> } <del> <ide> return $this->channels[$name] ?? with($this->resolve($name, $config), function ($logger) use ($name) { <ide> return $this->channels[$name] = $this->tap($name, new Logger($logger, $this->app['events'])); <ide> });
1
Javascript
Javascript
use iso getters to check the iso setters
ba9cdfea2972aad3613a66548c848b10347a15fd
<ide><path>src/test/moment/getters_setters.js <ide> test('setters programatic with weeks ISO', function (assert) { <ide> a.set('isoWeek', 49); <ide> a.set('isoWeekday', 4); <ide> <del> assert.equal(a.weekYear(), 2001, 'weekYear'); <del> assert.equal(a.week(), 49, 'week'); <del> assert.equal(a.day(), 4, 'day'); <add> assert.equal(a.isoWeekYear(), 2001, 'isoWeekYear'); <add> assert.equal(a.isoWeek(), 49, 'isoWeek'); <add> assert.equal(a.isoWeekday(), 4, 'isoWeekday'); <ide> }); <ide> <ide> test('setters strings', function (assert) {
1
Text
Text
fix typo on `componentwillreceiveprops`
c07d1cef36bac46e5ae4bc73709b4928b372cf0b
<ide><path>guide/english/react/life-cycle-methods-of-a-component/index.md <ide> d. `componentDidMount()` <ide> <ide> ## Updating: <ide> <del>a. `componentWillRecieveProps()` <add>a. `componentWillReceiveProps()` <ide> <ide> b. `shouldComponentUpdate()` <ide>
1
Javascript
Javascript
fix toggle button in example
6df103591e470ae8632eadea3d9bc7e82608e4e5
<ide><path>src/ngAnimate/module.js <ide> * <div ng-show="bool" class="fade"> <ide> * Show and hide me <ide> * </div> <del> * <button ng-click="bool=true">Toggle</button> <add> * <button ng-click="bool=!bool">Toggle</button> <ide> * <ide> * <style> <ide> * .fade.ng-hide {
1
Mixed
Text
fix more type inconsistencies
5f32024055adc2f908c582d933259f9fcf5db423
<ide><path>doc/api/assert.md <ide> added: v0.1.21 <ide> * `actual` {any} <ide> * `expected` {any} <ide> * `message` {any} <del>* `operator` {String} <add>* `operator` {string} <ide> <ide> Throws an `AssertionError`. If `message` is falsy, the error message is set as <ide> the values of `actual` and `expected` separated by the provided `operator`. <ide><path>doc/api/buffer.md <ide> changes: <ide> <ide> * `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a <ide> [`TypedArray`]. <del>* `byteOffset` {Integer} Index of first byte to expose. **Default:** `0` <del>* `length` {Integer} Number of bytes to expose. <add>* `byteOffset` {integer} Index of first byte to expose. **Default:** `0` <add>* `length` {integer} Number of bytes to expose. <ide> **Default:** `arrayBuffer.length - byteOffset` <ide> <ide> This creates a view of the [`ArrayBuffer`] without copying the underlying <ide> changes: <ide> > Stability: 0 - Deprecated: Use [`Buffer.alloc()`] instead (also see <ide> > [`Buffer.allocUnsafe()`]). <ide> <del>* `size` {Integer} The desired length of the new `Buffer` <add>* `size` {integer} The desired length of the new `Buffer` <ide> <ide> Allocates a new `Buffer` of `size` bytes. If the `size` is larger than <ide> [`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown. <ide> console.log(buf2.toString()); <ide> added: v5.10.0 <ide> --> <ide> <del>* `size` {Integer} The desired length of the new `Buffer` <del>* `fill` {string | Buffer | Integer} A value to pre-fill the new `Buffer` with. <add>* `size` {integer} The desired length of the new `Buffer` <add>* `fill` {string|Buffer|integer} A value to pre-fill the new `Buffer` with. <ide> **Default:** `0` <ide> * `encoding` {string} If `fill` is a string, this is its encoding. <ide> **Default:** `'utf8'` <ide> changes: <ide> description: Passing a negative `size` will now throw an error. <ide> --> <ide> <del>* `size` {Integer} The desired length of the new `Buffer` <add>* `size` {integer} The desired length of the new `Buffer` <ide> <ide> Allocates a new `Buffer` of `size` bytes. If the `size` is larger than <ide> [`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown. <ide> additional performance that [`Buffer.allocUnsafe()`] provides. <ide> added: v5.10.0 <ide> --> <ide> <del>* `size` {Integer} The desired length of the new `Buffer` <add>* `size` {integer} The desired length of the new `Buffer` <ide> <ide> Allocates a new `Buffer` of `size` bytes. If the `size` is larger than <ide> [`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown. <ide> changes: <ide> or `ArrayBuffer`. <ide> --> <ide> <del>* `string` {string | Buffer | TypedArray | DataView | ArrayBuffer} A value to <add>* `string` {string|Buffer|TypedArray|DataView|ArrayBuffer} A value to <ide> calculate the length of <ide> * `encoding` {string} If `string` is a string, this is its encoding. <ide> **Default:** `'utf8'` <del>* Returns: {Integer} The number of bytes contained within `string` <add>* Returns: {integer} The number of bytes contained within `string` <ide> <ide> Returns the actual byte length of a string. This is not the same as <ide> [`String.prototype.length`] since that returns the number of *characters* in <ide> changes: <ide> <ide> * `buf1` {Buffer|Uint8Array} <ide> * `buf2` {Buffer|Uint8Array} <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Compares `buf1` to `buf2` typically for the purpose of sorting arrays of <ide> `Buffer` instances. This is equivalent to calling <ide> changes: <ide> --> <ide> <ide> * `list` {Array} List of `Buffer` or [`Uint8Array`] instances to concat <del>* `totalLength` {Integer} Total length of the `Buffer` instances in `list` <add>* `totalLength` {integer} Total length of the `Buffer` instances in `list` <ide> when concatenated <ide> * Returns: {Buffer} <ide> <ide> added: v5.10.0 <ide> <ide> * `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a <ide> [`TypedArray`]. <del>* `byteOffset` {Integer} Index of first byte to expose. **Default:** `0` <del>* `length` {Integer} Number of bytes to expose. <add>* `byteOffset` {integer} Index of first byte to expose. **Default:** `0` <add>* `length` {integer} Number of bytes to expose. <ide> **Default:** `arrayBuffer.length - byteOffset` <ide> <ide> This creates a view of the [`ArrayBuffer`] without copying the underlying <ide> added: v0.1.101 <ide> --> <ide> <ide> * `obj` {Object} <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> Returns `true` if `obj` is a `Buffer`, `false` otherwise. <ide> <ide> added: v0.9.1 <ide> --> <ide> <ide> * `encoding` {string} A character encoding name to check <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> Returns `true` if `encoding` contains a supported character encoding, or `false` <ide> otherwise. <ide> otherwise. <ide> added: v0.11.3 <ide> --> <ide> <del>* {Integer} **Default:** `8192` <add>* {integer} **Default:** `8192` <ide> <ide> This is the number of bytes used to determine the size of pre-allocated, internal <ide> `Buffer` instances used for pooling. This value may be modified. <ide> changes: <ide> --> <ide> <ide> * `target` {Buffer|Uint8Array} A `Buffer` or [`Uint8Array`] to compare to <del>* `targetStart` {Integer} The offset within `target` at which to begin <add>* `targetStart` {integer} The offset within `target` at which to begin <ide> comparison. **Default:** `0` <del>* `targetEnd` {Integer} The offset with `target` at which to end comparison <add>* `targetEnd` {integer} The offset with `target` at which to end comparison <ide> (not inclusive). Ignored when `targetStart` is `undefined`. <ide> **Default:** `target.length` <del>* `sourceStart` {Integer} The offset within `buf` at which to begin comparison. <add>* `sourceStart` {integer} The offset within `buf` at which to begin comparison. <ide> Ignored when `targetStart` is `undefined`. **Default:** `0` <del>* `sourceEnd` {Integer} The offset within `buf` at which to end comparison <add>* `sourceEnd` {integer} The offset within `buf` at which to end comparison <ide> (not inclusive). Ignored when `targetStart` is `undefined`. <ide> **Default:** [`buf.length`] <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Compares `buf` with `target` and returns a number indicating whether `buf` <ide> comes before, after, or is the same as `target` in sort order. <ide> added: v0.1.90 <ide> --> <ide> <ide> * `target` {Buffer|Uint8Array} A `Buffer` or [`Uint8Array`] to copy into. <del>* `targetStart` {Integer} The offset within `target` at which to begin <add>* `targetStart` {integer} The offset within `target` at which to begin <ide> copying to. **Default:** `0` <del>* `sourceStart` {Integer} The offset within `buf` at which to begin copying from. <add>* `sourceStart` {integer} The offset within `buf` at which to begin copying from. <ide> Ignored when `targetStart` is `undefined`. **Default:** `0` <del>* `sourceEnd` {Integer} The offset within `buf` at which to stop copying (not <add>* `sourceEnd` {integer} The offset within `buf` at which to stop copying (not <ide> inclusive). Ignored when `sourceStart` is `undefined`. **Default:** [`buf.length`] <del>* Returns: {Integer} The number of bytes copied. <add>* Returns: {integer} The number of bytes copied. <ide> <ide> Copies data from a region of `buf` to a region in `target` even if the `target` <ide> memory region overlaps with `buf`. <ide> changes: <ide> --> <ide> <ide> * `otherBuffer` {Buffer} A `Buffer` or [`Uint8Array`] to compare to <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes, <ide> `false` otherwise. <ide> changes: <ide> description: The `encoding` parameter is supported now. <ide> --> <ide> <del>* `value` {string | Buffer | Integer} The value to fill `buf` with <del>* `offset` {Integer} Where to start filling `buf`. **Default:** `0` <del>* `end` {Integer} Where to stop filling `buf` (not inclusive). **Default:** [`buf.length`] <add>* `value` {string|Buffer|integer} The value to fill `buf` with <add>* `offset` {integer} Where to start filling `buf`. **Default:** `0` <add>* `end` {integer} Where to stop filling `buf` (not inclusive). **Default:** [`buf.length`] <ide> * `encoding` {string} If `value` is a string, this is its encoding. <ide> **Default:** `'utf8'` <ide> * Returns: {Buffer} A reference to `buf` <ide> console.log(Buffer.allocUnsafe(3).fill('\u0222')); <ide> added: v5.3.0 <ide> --> <ide> <del>* `value` {string | Buffer | Integer} What to search for <del>* `byteOffset` {Integer} Where to begin searching in `buf`. **Default:** `0` <add>* `value` {string|Buffer|integer} What to search for <add>* `byteOffset` {integer} Where to begin searching in `buf`. **Default:** `0` <ide> * `encoding` {string} If `value` is a string, this is its encoding. <ide> **Default:** `'utf8'` <del>* Returns: {Boolean} `true` if `value` was found in `buf`, `false` otherwise <add>* Returns: {boolean} `true` if `value` was found in `buf`, `false` otherwise <ide> <ide> Equivalent to [`buf.indexOf() !== -1`][`buf.indexOf()`]. <ide> <ide> changes: <ide> is no longer required. <ide> --> <ide> <del>* `value` {string | Buffer | Uint8Array | Integer} What to search for <del>* `byteOffset` {Integer} Where to begin searching in `buf`. **Default:** `0` <add>* `value` {string|Buffer|Uint8Array|integer} What to search for <add>* `byteOffset` {integer} Where to begin searching in `buf`. **Default:** `0` <ide> * `encoding` {string} If `value` is a string, this is its encoding. <ide> **Default:** `'utf8'` <del>* Returns: {Integer} The index of the first occurrence of `value` in `buf` or `-1` <add>* Returns: {integer} The index of the first occurrence of `value` in `buf` or `-1` <ide> if `buf` does not contain `value` <ide> <ide> If `value` is: <ide> changes: <ide> description: The `value` can now be a `Uint8Array`. <ide> --> <ide> <del>* `value` {string | Buffer | Uint8Array | Integer} What to search for <del>* `byteOffset` {Integer} Where to begin searching in `buf`. <add>* `value` {string|Buffer|Uint8Array|integer} What to search for <add>* `byteOffset` {integer} Where to begin searching in `buf`. <ide> **Default:** [`buf.length`]` - 1` <ide> * `encoding` {string} If `value` is a string, this is its encoding. <ide> **Default:** `'utf8'` <del>* Returns: {Integer} The index of the last occurrence of `value` in `buf` or `-1` <add>* Returns: {integer} The index of the last occurrence of `value` in `buf` or `-1` <ide> if `buf` does not contain `value` <ide> <ide> Identical to [`buf.indexOf()`], except `buf` is searched from back to front <ide> console.log(b.lastIndexOf('b', [])); <ide> added: v0.1.90 <ide> --> <ide> <del>* {Integer} <add>* {integer} <ide> <ide> Returns the amount of memory allocated for `buf` in bytes. Note that this <ide> does not necessarily reflect the amount of "usable" data within `buf`. <ide> The `buf.parent` property is a deprecated alias for `buf.buffer`. <ide> added: v0.11.15 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 8` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 8` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Number} <add>* Returns: {number} <ide> <ide> Reads a 64-bit double from `buf` at the specified `offset` with specified <ide> endian format (`readDoubleBE()` returns big endian, `readDoubleLE()` returns <ide> console.log(buf.readDoubleLE(1, true)); <ide> added: v0.11.15 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Number} <add>* Returns: {number} <ide> <ide> Reads a 32-bit float from `buf` at the specified `offset` with specified <ide> endian format (`readFloatBE()` returns big endian, `readFloatLE()` returns <ide> console.log(buf.readFloatLE(1, true)); <ide> added: v0.5.0 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads a signed 8-bit integer from `buf` at the specified `offset`. <ide> <ide> console.log(buf.readInt8(2)); <ide> added: v0.5.5 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads a signed 16-bit integer from `buf` at the specified `offset` with <ide> the specified endian format (`readInt16BE()` returns big endian, <ide> console.log(buf.readInt16LE(1)); <ide> added: v0.5.5 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads a signed 32-bit integer from `buf` at the specified `offset` with <ide> the specified endian format (`readInt32BE()` returns big endian, <ide> console.log(buf.readInt32LE(1)); <ide> added: v0.11.15 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` <del>* `byteLength` {Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` <add>* `byteLength` {integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` <ide> * `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads `byteLength` number of bytes from `buf` at the specified `offset` <ide> and interprets the result as a two's complement signed value. Supports up to 48 <ide> console.log(buf.readIntBE(1, 6).toString(16)); <ide> added: v0.5.0 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads an unsigned 8-bit integer from `buf` at the specified `offset`. <ide> <ide> console.log(buf.readUInt8(2)); <ide> added: v0.5.5 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads an unsigned 16-bit integer from `buf` at the specified `offset` with <ide> specified endian format (`readUInt16BE()` returns big endian, `readUInt16LE()` <ide> console.log(buf.readUInt16LE(2).toString(16)); <ide> added: v0.5.5 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` <ide> * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads an unsigned 32-bit integer from `buf` at the specified `offset` with <ide> specified endian format (`readUInt32BE()` returns big endian, <ide> console.log(buf.readUInt32LE(1).toString(16)); <ide> added: v0.11.15 <ide> --> <ide> <del>* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` <del>* `byteLength` {Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` <add>* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` <add>* `byteLength` {integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` <ide> * `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false` <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> Reads `byteLength` number of bytes from `buf` at the specified `offset` <ide> and interprets the result as an unsigned integer. Supports up to 48 <ide> changes: <ide> calculations with them. <ide> --> <ide> <del>* `start` {Integer} Where the new `Buffer` will start. **Default:** `0` <del>* `end` {Integer} Where the new `Buffer` will end (not inclusive). <add>* `start` {integer} Where the new `Buffer` will start. **Default:** `0` <add>* `end` {integer} Where the new `Buffer` will end (not inclusive). <ide> **Default:** [`buf.length`] <ide> * Returns: {Buffer} <ide> <ide> added: v0.1.90 <ide> --> <ide> <ide> * `encoding` {string} The character encoding to decode to. **Default:** `'utf8'` <del>* `start` {Integer} The byte offset to start decoding at. **Default:** `0` <del>* `end` {Integer} The byte offset to stop decoding at (not inclusive). <add>* `start` {integer} The byte offset to start decoding at. **Default:** `0` <add>* `end` {integer} The byte offset to stop decoding at (not inclusive). <ide> **Default:** [`buf.length`] <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> Decodes `buf` to a string according to the specified character encoding in <ide> `encoding`. `start` and `end` may be passed to decode only a subset of `buf`. <ide> added: v0.1.90 <ide> --> <ide> <ide> * `string` {string} String to be written to `buf` <del>* `offset` {Integer} Where to start writing `string`. **Default:** `0` <del>* `length` {Integer} How many bytes to write. **Default:** `buf.length - offset` <add>* `offset` {integer} Where to start writing `string`. **Default:** `0` <add>* `length` {integer} How many bytes to write. **Default:** `buf.length - offset` <ide> * `encoding` {string} The character encoding of `string`. **Default:** `'utf8'` <del>* Returns: {Integer} Number of bytes written <add>* Returns: {integer} Number of bytes written <ide> <ide> Writes `string` to `buf` at `offset` according to the character encoding in `encoding`. <ide> The `length` parameter is the number of bytes to write. If `buf` did not contain <ide> added: v0.11.15 <ide> --> <ide> <ide> * `value` {number} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 8` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 8` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset` with specified endian <ide> format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little <ide> added: v0.11.15 <ide> --> <ide> <ide> * `value` {number} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset` with specified endian <ide> format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little <ide> console.log(buf); <ide> added: v0.5.0 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset`. `value` *should* be a valid <ide> signed 8-bit integer. Behavior is undefined when `value` is anything other than <ide> console.log(buf); <ide> added: v0.5.5 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset` with specified endian <ide> format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little <ide> console.log(buf); <ide> added: v0.5.5 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset` with specified endian <ide> format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little <ide> console.log(buf); <ide> added: v0.11.15 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` <del>* `byteLength` {Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` <add>* `byteLength` {integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` <ide> * `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation? <ide> **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `byteLength` bytes of `value` to `buf` at the specified `offset`. <ide> Supports up to 48 bits of accuracy. Behavior is undefined when `value` is <ide> console.log(buf); <ide> added: v0.5.0 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset`. `value` *should* be a <ide> valid unsigned 8-bit integer. Behavior is undefined when `value` is anything <ide> console.log(buf); <ide> added: v0.5.5 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset` with specified endian <ide> format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little <ide> console.log(buf); <ide> added: v0.5.5 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` <ide> * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `value` to `buf` at the specified `offset` with specified endian <ide> format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little <ide> console.log(buf); <ide> added: v0.5.5 <ide> --> <ide> <del>* `value` {Integer} Number to be written to `buf` <del>* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` <del>* `byteLength` {Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` <add>* `value` {integer} Number to be written to `buf` <add>* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` <add>* `byteLength` {integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` <ide> * `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation? <ide> **Default:** `false` <del>* Returns: {Integer} `offset` plus the number of bytes written <add>* Returns: {integer} `offset` plus the number of bytes written <ide> <ide> Writes `byteLength` bytes of `value` to `buf` at the specified `offset`. <ide> Supports up to 48 bits of accuracy. Behavior is undefined when `value` is <ide> console.log(buf); <ide> added: v0.5.4 <ide> --> <ide> <del>* {Integer} **Default:** `50` <add>* {integer} **Default:** `50` <ide> <ide> Returns the maximum number of bytes that will be returned when <ide> `buf.inspect()` is called. This can be overridden by user modules. See <ide> Note that this is a property on the `buffer` module returned by <ide> added: v3.0.0 <ide> --> <ide> <del>* {Integer} The largest size allowed for a single `Buffer` instance <add>* {integer} The largest size allowed for a single `Buffer` instance <ide> <ide> On 32-bit architectures, this value is `(2^30)-1` (~1GB). <ide> On 64-bit architectures, this value is `(2^31)-1` (~2GB). <ide> deprecated: v6.0.0 <ide> <ide> > Stability: 0 - Deprecated: Use [`Buffer.allocUnsafeSlow()`] instead. <ide> <del>* `size` {Integer} The desired length of the new `SlowBuffer` <add>* `size` {integer} The desired length of the new `SlowBuffer` <ide> <ide> Allocates a new `Buffer` of `size` bytes. If the `size` is larger than <ide> [`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown. <ide><path>doc/api/child_process.md <ide> added: v0.1.90 <ide> understand the `-c` switch on UNIX or `/d /s /c` on Windows. On Windows, <ide> command line parsing should be compatible with `cmd.exe`.) <ide> * `timeout` {number} (Default: `0`) <del> * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on <add> * [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on <ide> stdout or stderr - if exceeded child process is killed (Default: `200*1024`) <del> * `killSignal` {string|Integer} (Default: `'SIGTERM'`) <add> * `killSignal` {string|integer} (Default: `'SIGTERM'`) <ide> * `uid` {number} Sets the user identity of the process. (See setuid(2).) <ide> * `gid` {number} Sets the group identity of the process. (See setgid(2).) <ide> * `callback` {Function} called with the output when process terminates <ide> added: v0.1.91 <ide> * `env` {Object} Environment key-value pairs <ide> * `encoding` {string} (Default: `'utf8'`) <ide> * `timeout` {number} (Default: `0`) <del> * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on <add> * [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on <ide> stdout or stderr - if exceeded child process is killed (Default: `200*1024`) <del> * `killSignal` {string|Integer} (Default: `'SIGTERM'`) <add> * `killSignal` {string|integer} (Default: `'SIGTERM'`) <ide> * `uid` {number} Sets the user identity of the process. (See setuid(2).) <ide> * `gid` {number} Sets the group identity of the process. (See setgid(2).) <ide> * `callback` {Function} called with the output when process terminates <ide> changes: <ide> * `input` {string|Buffer|Uint8Array} The value which will be passed as stdin <ide> to the spawned process <ide> - supplying this value will override `stdio[0]` <del> * `stdio` {string | Array} Child's stdio configuration. (Default: `'pipe'`) <add> * `stdio` {string|Array} Child's stdio configuration. (Default: `'pipe'`) <ide> - `stderr` by default will be output to the parent process' stderr unless <ide> `stdio` is specified <ide> * `env` {Object} Environment key-value pairs <ide> * `uid` {number} Sets the user identity of the process. (See setuid(2).) <ide> * `gid` {number} Sets the group identity of the process. (See setgid(2).) <ide> * `timeout` {number} In milliseconds the maximum amount of time the process <ide> is allowed to run. (Default: `undefined`) <del> * `killSignal` {string|Integer} The signal value to be used when the spawned <add> * `killSignal` {string|integer} The signal value to be used when the spawned <ide> process will be killed. (Default: `'SIGTERM'`) <del> * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on <add> * [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on <ide> stdout or stderr - if exceeded child process is killed <ide> * `encoding` {string} The encoding used for all stdio inputs and outputs. (Default: `'buffer'`) <ide> * Returns: {Buffer|string} The stdout from the command <ide> changes: <ide> * `input` {string|Buffer|Uint8Array} The value which will be passed as stdin <ide> to the spawned process <ide> - supplying this value will override `stdio[0]` <del> * `stdio` {string | Array} Child's stdio configuration. (Default: `'pipe'`) <add> * `stdio` {string|Array} Child's stdio configuration. (Default: `'pipe'`) <ide> - `stderr` by default will be output to the parent process' stderr unless <ide> `stdio` is specified <ide> * `env` {Object} Environment key-value pairs <ide> changes: <ide> * `gid` {number} Sets the group identity of the process. (See setgid(2).) <ide> * `timeout` {number} In milliseconds the maximum amount of time the process <ide> is allowed to run. (Default: `undefined`) <del> * `killSignal` {string|Integer} The signal value to be used when the spawned <add> * `killSignal` {string|integer} The signal value to be used when the spawned <ide> process will be killed. (Default: `'SIGTERM'`) <del> * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on <add> * [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on <ide> stdout or stderr - if exceeded child process is killed <ide> * `encoding` {string} The encoding used for all stdio inputs and outputs. <ide> (Default: `'buffer'`) <ide> changes: <ide> * `input` {string|Buffer|Uint8Array} The value which will be passed as stdin <ide> to the spawned process <ide> - supplying this value will override `stdio[0]` <del> * `stdio` {string | Array} Child's stdio configuration. <add> * `stdio` {string|Array} Child's stdio configuration. <ide> * `env` {Object} Environment key-value pairs <ide> * `uid` {number} Sets the user identity of the process. (See setuid(2).) <ide> * `gid` {number} Sets the group identity of the process. (See setgid(2).) <ide> * `timeout` {number} In milliseconds the maximum amount of time the process <ide> is allowed to run. (Default: `undefined`) <del> * `killSignal` {string|Integer} The signal value to be used when the spawned <add> * `killSignal` {string|integer} The signal value to be used when the spawned <ide> process will be killed. (Default: `'SIGTERM'`) <del> * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on <add> * [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on <ide> stdout or stderr - if exceeded child process is killed <ide> * `encoding` {string} The encoding used for all stdio inputs and outputs. <ide> (Default: `'buffer'`) <ide> IPC channel currently exists, this property is `undefined`. <ide> added: v0.7.2 <ide> --> <ide> <del>* {Boolean} Set to `false` after `child.disconnect()` is called <add>* {boolean} Set to `false` after `child.disconnect()` is called <ide> <ide> The `child.connected` property indicates whether it is still possible to send <ide> and receive messages from a child process. When `child.connected` is `false`, it <ide> setTimeout(() => { <ide> added: v0.1.90 <ide> --> <ide> <del>* {Number} Integer <add>* {number} Integer <ide> <ide> Returns the process identifier (PID) of the child process. <ide> <ide> changes: <ide> * `sendHandle` {Handle} <ide> * `options` {Object} <ide> * `callback` {Function} <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> When an IPC channel has been established between the parent and child ( <ide> i.e. when using [`child_process.fork()`][]), the `child.send()` method can be <ide><path>doc/api/cluster.md <ide> if (cluster.isMaster) { <ide> added: v6.0.0 <ide> --> <ide> <del>* {Boolean} <add>* {boolean} <ide> <ide> Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`. <ide> <ide> worker.kill(); <ide> added: v0.8.0 <ide> --> <ide> <del>* {Number} <add>* {number} <ide> <ide> Each new worker is given its own unique id, this id is stored in the <ide> `id`. <ide> This can only be called from the master process. <ide> added: v0.8.1 <ide> --> <ide> <del>* {Boolean} <add>* {boolean} <ide> <ide> True if the process is a master. This is determined <ide> by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` is <ide> undefined, then `isMaster` is `true`. <ide> added: v0.6.0 <ide> --> <ide> <del>* {Boolean} <add>* {boolean} <ide> <ide> True if the process is not a master (it is the negation of `cluster.isMaster`). <ide> <ide><path>doc/api/console.md <ide> added: v0.1.101 <ide> --> <ide> * `obj` {any} <ide> * `options` {Object} <del> * `showHidden` {Boolean} <del> * `depth` {Number} <del> * `colors` {Boolean} <add> * `showHidden` {boolean} <add> * `depth` {number} <add> * `colors` {boolean} <ide> <ide> Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`. <ide> This function bypasses any custom `inspect()` function defined on `obj`. An <ide> values are concatenated. See [`util.format()`][] for more information. <ide> <!-- YAML <ide> added: v0.1.104 <ide> --> <del>* `label` {String} <add>* `label` {string} <ide> <ide> Starts a timer that can be used to compute the duration of an operation. Timers <ide> are identified by a unique `label`. Use the same `label` when you call <ide> changes: <ide> description: This method no longer supports multiple calls that don’t map <ide> to individual `console.time()` calls; see below for details. <ide> --> <del>* `label` {String} <add>* `label` {string} <ide> <ide> Stops a timer that was previously started by calling [`console.time()`][] and <ide> prints the result to `stdout`: <ide><path>doc/api/crypto.md <ide> The `private_key` argument can be an object or a string. If `private_key` is a <ide> string, it is treated as a raw key with no passphrase. If `private_key` is an <ide> object, it is interpreted as a hash containing two properties: <ide> <del>* `key` : {String} - PEM encoded private key <del>* `passphrase` : {String} - passphrase for the private key <add>* `key`: {string} - PEM encoded private key <add>* `passphrase`: {string} - passphrase for the private key <ide> <ide> The `output_format` can specify one of `'latin1'`, `'hex'` or `'base64'`. If <ide> `output_format` is provided a string is returned; otherwise a [`Buffer`][] is <ide> treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. <ide> If `private_key` is an object, it is interpreted as a hash object with the <ide> keys: <ide> <del>* `key` : {String} - PEM encoded private key <del>* `passphrase` : {String} - Optional passphrase for the private key <add>* `key`: {string} - PEM encoded private key <add>* `passphrase`: {string} - Optional passphrase for the private key <ide> * `padding` : An optional padding value, one of the following: <ide> * `crypto.constants.RSA_NO_PADDING` <ide> * `crypto.constants.RSA_PKCS1_PADDING` <ide> treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. <ide> If `private_key` is an object, it is interpreted as a hash object with the <ide> keys: <ide> <del>* `key` : {String} - PEM encoded private key <del>* `passphrase` : {String} - Optional passphrase for the private key <add>* `key`: {string} - PEM encoded private key <add>* `passphrase`: {string} - Optional passphrase for the private key <ide> * `padding` : An optional padding value, one of the following: <ide> * `crypto.constants.RSA_NO_PADDING` <ide> * `crypto.constants.RSA_PKCS1_PADDING` <ide> treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. <ide> If `public_key` is an object, it is interpreted as a hash object with the <ide> keys: <ide> <del>* `key` : {String} - PEM encoded public key <del>* `passphrase` : {String} - Optional passphrase for the private key <add>* `key`: {string} - PEM encoded public key <add>* `passphrase`: {string} - Optional passphrase for the private key <ide> * `padding` : An optional padding value, one of the following: <ide> * `crypto.constants.RSA_NO_PADDING` <ide> * `crypto.constants.RSA_PKCS1_PADDING` <ide> treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. <ide> If `public_key` is an object, it is interpreted as a hash object with the <ide> keys: <ide> <del>* `key` : {String} - PEM encoded public key <del>* `passphrase` : {String} - Optional passphrase for the private key <add>* `key`: {string} - PEM encoded public key <add>* `passphrase`: {string} - Optional passphrase for the private key <ide> * `padding` : An optional padding value, one of the following: <ide> * `crypto.constants.RSA_NO_PADDING` <ide> * `crypto.constants.RSA_PKCS1_PADDING` <ide><path>doc/api/dns.md <ide> Alternatively, `options` can be an object containing these properties: <ide> <ide> * `family` {number} - The record family. If present, must be the integer <ide> `4` or `6`. If not provided, both IP v4 and v6 addresses are accepted. <del>* `hints`: {Number} - If present, it should be one or more of the supported <add>* `hints`: {number} - If present, it should be one or more of the supported <ide> `getaddrinfo` flags. If `hints` is not provided, then no flags are passed to <ide> `getaddrinfo`. Multiple flags can be passed through `hints` by bitwise <ide> `OR`ing their values. <ide> See [supported `getaddrinfo` flags][] for more information on supported <ide> flags. <del>* `all`: {Boolean} - When `true`, the callback returns all resolved addresses <add>* `all`: {boolean} - When `true`, the callback returns all resolved addresses <ide> in an array, otherwise returns a single address. Defaults to `false`. <ide> <ide> All properties are optional. <ide><path>doc/api/errors.md <ide> new MyError().stack; <ide> <ide> ### Error.stackTraceLimit <ide> <del>* {Number} <add>* {number} <ide> <ide> The `Error.stackTraceLimit` property specifies the number of stack frames <ide> collected by a stack trace (whether generated by `new Error().stack` or <ide> not capture any frames. <ide> <ide> ### error.message <ide> <del>* {String} <add>* {string} <ide> <ide> The `error.message` property is the string description of the error as set by calling `new Error(message)`. <ide> The `message` passed to the constructor will also appear in the first line of <ide> console.error(err.message); <ide> <ide> ### error.stack <ide> <del>* {String} <add>* {string} <ide> <ide> The `error.stack` property is a string describing the point in the code at which <ide> the `Error` was instantiated. <ide> added properties. <ide> <ide> #### error.code <ide> <del>* {String} <add>* {string} <ide> <ide> The `error.code` property is a string representing the error code, which is always <ide> `E` followed by a sequence of capital letters. <ide> <ide> #### error.errno <ide> <del>* {String | Number} <add>* {string|number} <ide> <ide> The `error.errno` property is a number or a string. <ide> The number is a **negative** value which corresponds to the error code defined in <ide> In case of a string, it is the same as `error.code`. <ide> <ide> #### error.syscall <ide> <del>* {String} <add>* {string} <ide> <ide> The `error.syscall` property is a string describing the [syscall][] that failed. <ide> <ide> #### error.path <ide> <del>* {String} <add>* {string} <ide> <ide> When present (e.g. in `fs` or `child_process`), the `error.path` property is a string <ide> containing a relevant invalid pathname. <ide> <ide> #### error.address <ide> <del>* {String} <add>* {string} <ide> <ide> When present (e.g. in `net` or `dgram`), the `error.address` property is a string <ide> describing the address to which the connection failed. <ide> <ide> #### error.port <ide> <del>* {Number} <add>* {number} <ide> <ide> When present (e.g. in `net` or `dgram`), the `error.port` property is a number representing <ide> the connection's port that is not available. <ide><path>doc/api/fs.md <ide> added: v0.5.8 <ide> --> <ide> <ide> * `eventType` {string} The type of fs change <del>* `filename` {string | Buffer} The filename that changed (if relevant/available) <add>* `filename` {string|Buffer} The filename that changed (if relevant/available) <ide> <ide> Emitted when something changes in a watched directory or file. <ide> See more details in [`fs.watch()`][]. <ide> using the `fs.close()` method. <ide> added: v0.1.93 <ide> --> <ide> <del>* `fd` {Integer} Integer file descriptor used by the ReadStream. <add>* `fd` {integer} Integer file descriptor used by the ReadStream. <ide> <ide> Emitted when the ReadStream's file is opened. <ide> <ide> using the `fs.close()` method. <ide> added: v0.1.93 <ide> --> <ide> <del>* `fd` {Integer} Integer file descriptor used by the WriteStream. <add>* `fd` {integer} Integer file descriptor used by the WriteStream. <ide> <ide> Emitted when the WriteStream's file is opened. <ide> <ide> argument to `fs.createWriteStream()`. If `path` is passed as a string, then <ide> added: v0.11.15 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> * `callback` {Function} <ide> <ide> Tests a user's permissions for the file or directory specified by `path`. <ide> process. <ide> added: v0.11.15 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> <ide> Synchronous version of [`fs.access()`][]. This throws if any accessibility <ide> checks fail, and does nothing otherwise. <ide> changes: <ide> description: The `file` parameter can be a file descriptor now. <ide> --> <ide> <del>* `file` {string | Buffer | Number} filename or file descriptor <del>* `data` {string | Buffer} <del>* `options` {Object | String} <del> * `encoding` {string | Null} default = `'utf8'` <del> * `mode` {Integer} default = `0o666` <add>* `file` {string|Buffer|number} filename or file descriptor <add>* `data` {string|Buffer} <add>* `options` {Object|string} <add> * `encoding` {string|null} default = `'utf8'` <add> * `mode` {integer} default = `0o666` <ide> * `flag` {string} default = `'a'` <ide> * `callback` {Function} <ide> <ide> changes: <ide> description: The `file` parameter can be a file descriptor now. <ide> --> <ide> <del>* `file` {string | Buffer | Number} filename or file descriptor <del>* `data` {string | Buffer} <del>* `options` {Object | String} <del> * `encoding` {string | Null} default = `'utf8'` <del> * `mode` {Integer} default = `0o666` <add>* `file` {string|Buffer|number} filename or file descriptor <add>* `data` {string|Buffer} <add>* `options` {Object|string} <add> * `encoding` {string|null} default = `'utf8'` <add> * `mode` {integer} default = `0o666` <ide> * `flag` {string} default = `'a'` <ide> <ide> The synchronous version of [`fs.appendFile()`][]. Returns `undefined`. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous chmod(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.6.7 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> <ide> Synchronous chmod(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `uid` {Integer} <del>* `gid` {Integer} <add>* `path` {string|Buffer} <add>* `uid` {integer} <add>* `gid` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous chown(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.1.97 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `uid` {Integer} <del>* `gid` {Integer} <add>* `path` {string|Buffer} <add>* `uid` {integer} <add>* `gid` {integer} <ide> <ide> Synchronous chown(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous close(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.1.21 <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> <ide> Synchronous close(2). Returns `undefined`. <ide> <ide> changes: <ide> description: The passed `options` object can be a string now. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `options` {string | Object} <add>* `path` {string|Buffer} <add>* `options` {string|Object} <ide> * `flags` {string} <ide> * `encoding` {string} <del> * `fd` {Integer} <del> * `mode` {Integer} <add> * `fd` {integer} <add> * `mode` {integer} <ide> * `autoClose` {boolean} <del> * `start` {Integer} <del> * `end` {Integer} <add> * `start` {integer} <add> * `end` {integer} <ide> <ide> Returns a new [`ReadStream`][] object. (See [Readable Stream][]). <ide> <ide> changes: <ide> description: The passed `options` object can be a string now. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `options` {string | Object} <add>* `path` {string|Buffer} <add>* `options` {string|Object} <ide> * `flags` {string} <ide> * `defaultEncoding` {string} <del> * `fd` {Integer} <del> * `mode` {Integer} <add> * `fd` {integer} <add> * `mode` {integer} <ide> * `autoClose` {boolean} <del> * `start` {Integer} <add> * `start` {integer} <ide> <ide> Returns a new [`WriteStream`][] object. (See [Writable Stream][]). <ide> <ide> deprecated: v1.0.0 <ide> <ide> > Stability: 0 - Deprecated: Use [`fs.stat()`][] or [`fs.access()`][] instead. <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> * `callback` {Function} <ide> <ide> Test whether or not the given path exists by checking with the file system. <ide> process. <ide> added: v0.1.21 <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> <ide> Synchronous version of [`fs.exists()`][]. <ide> Returns `true` if the file exists, `false` otherwise. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <del>* `mode` {Integer} <add>* `fd` {integer} <add>* `mode` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous fchmod(2). No arguments other than a possible exception <ide> are given to the completion callback. <ide> added: v0.4.7 <ide> --> <ide> <del>* `fd` {Integer} <del>* `mode` {Integer} <add>* `fd` {integer} <add>* `mode` {integer} <ide> <ide> Synchronous fchmod(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <del>* `uid` {Integer} <del>* `gid` {Integer} <add>* `fd` {integer} <add>* `uid` {integer} <add>* `gid` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous fchown(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.4.7 <ide> --> <ide> <del>* `fd` {Integer} <del>* `uid` {Integer} <del>* `gid` {Integer} <add>* `fd` {integer} <add>* `uid` {integer} <add>* `gid` {integer} <ide> <ide> Synchronous fchown(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous fdatasync(2). No arguments other than a possible exception are <ide> given to the completion callback. <ide> added: v0.1.96 <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> <ide> Synchronous fdatasync(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous fstat(2). The callback gets two arguments `(err, stats)` where <ide> except that the file to be stat-ed is specified by the file descriptor `fd`. <ide> added: v0.1.95 <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> <ide> Synchronous fstat(2). Returns an instance of [`fs.Stats`][]. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous fsync(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.1.96 <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> <ide> Synchronous fsync(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <del>* `len` {Integer} default = `0` <add>* `fd` {integer} <add>* `len` {integer} default = `0` <ide> * `callback` {Function} <ide> <ide> Asynchronous ftruncate(2). No arguments other than a possible exception are <ide> The last three bytes are null bytes ('\0'), to compensate the over-truncation. <ide> added: v0.8.6 <ide> --> <ide> <del>* `fd` {Integer} <del>* `len` {Integer} default = `0` <add>* `fd` {integer} <add>* `len` {integer} default = `0` <ide> <ide> Synchronous ftruncate(2). Returns `undefined`. <ide> <ide> changes: <ide> time specifiers. <ide> --> <ide> <del>* `fd` {Integer} <del>* `atime` {Integer} <del>* `mtime` {Integer} <add>* `fd` {integer} <add>* `atime` {integer} <add>* `mtime` {integer} <ide> * `callback` {Function} <ide> <ide> Change the file timestamps of a file referenced by the supplied file <ide> changes: <ide> time specifiers. <ide> --> <ide> <del>* `fd` {Integer} <del>* `atime` {Integer} <del>* `mtime` {Integer} <add>* `fd` {integer} <add>* `atime` {integer} <add>* `mtime` {integer} <ide> <ide> Synchronous version of [`fs.futimes()`][]. Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous lchmod(2). No arguments other than a possible exception <ide> Only available on Mac OS X. <ide> deprecated: v0.4.7 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> <ide> Synchronous lchmod(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `uid` {Integer} <del>* `gid` {Integer} <add>* `path` {string|Buffer} <add>* `uid` {integer} <add>* `gid` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous lchown(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> deprecated: v0.4.7 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `uid` {Integer} <del>* `gid` {Integer} <add>* `path` {string|Buffer} <add>* `uid` {integer} <add>* `gid` {integer} <ide> <ide> Synchronous lchown(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `existingPath` {string | Buffer} <del>* `newPath` {string | Buffer} <add>* `existingPath` {string|Buffer} <add>* `newPath` {string|Buffer} <ide> * `callback` {Function} <ide> <ide> Asynchronous link(2). No arguments other than a possible exception are given to <ide> the completion callback. <ide> added: v0.1.31 <ide> --> <ide> <del>* `existingPath` {string | Buffer} <del>* `newPath` {string | Buffer} <add>* `existingPath` {string|Buffer} <add>* `newPath` {string|Buffer} <ide> <ide> Synchronous link(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> * `callback` {Function} <ide> <ide> Asynchronous lstat(2). The callback gets two arguments `(err, stats)` where <ide> not the file that it refers to. <ide> added: v0.1.30 <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> <ide> Synchronous lstat(2). Returns an instance of [`fs.Stats`][]. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous mkdir(2). No arguments other than a possible exception are given <ide> to the completion callback. `mode` defaults to `0o777`. <ide> added: v0.1.21 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `mode` {integer} <ide> <ide> Synchronous mkdir(2). Returns `undefined`. <ide> <ide> changes: <ide> --> <ide> <ide> * `prefix` {string} <del>* `options` {string | Object} <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> * `callback` {Function} <ide> <ide> added: v5.10.0 <ide> --> <ide> <ide> * `prefix` {string} <del>* `options` {string | Object} <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> <ide> The synchronous version of [`fs.mkdtemp()`][]. Returns the created <ide> object with an `encoding` property specifying the character encoding to use. <ide> added: v0.0.2 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `flags` {string | Number} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `flags` {string|number} <add>* `mode` {integer} <ide> * `callback` {Function} <ide> <ide> Asynchronous file open. See open(2). `flags` can be: <ide> fs.open('<directory>', 'a+', (err, fd) => { <ide> added: v0.1.21 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `flags` {string | Number} <del>* `mode` {Integer} <add>* `path` {string|Buffer} <add>* `flags` {string|number} <add>* `mode` {integer} <ide> <ide> Synchronous version of [`fs.open()`][]. Returns an integer representing the file <ide> descriptor. <ide> changes: <ide> description: The `length` parameter can now be `0`. <ide> --> <ide> <del>* `fd` {Integer} <del>* `buffer` {string | Buffer | Uint8Array} <del>* `offset` {Integer} <del>* `length` {Integer} <del>* `position` {Integer} <add>* `fd` {integer} <add>* `buffer` {string|Buffer|Uint8Array} <add>* `offset` {integer} <add>* `length` {integer} <add>* `position` {integer} <ide> * `callback` {Function} <ide> <ide> Read data from the file specified by `fd`. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `options` {string | Object} <add>* `path` {string|Buffer} <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> * `callback` {Function} <ide> <ide> the filenames returned will be passed as `Buffer` objects. <ide> added: v0.1.21 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `options` {string | Object} <add>* `path` {string|Buffer} <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> <ide> Synchronous readdir(3). Returns an array of filenames excluding `'.'` and <ide> changes: <ide> description: The `file` parameter can be a file descriptor now. <ide> --> <ide> <del>* `file` {string | Buffer | Integer} filename or file descriptor <del>* `options` {Object | String} <del> * `encoding` {string | Null} default = `null` <add>* `file` {string|Buffer|integer} filename or file descriptor <add>* `options` {Object|string} <add> * `encoding` {string|null} default = `null` <ide> * `flag` {string} default = `'r'` <ide> * `callback` {Function} <ide> <ide> changes: <ide> description: The `file` parameter can be a file descriptor now. <ide> --> <ide> <del>* `file` {string | Buffer | Integer} filename or file descriptor <del>* `options` {Object | String} <del> * `encoding` {string | Null} default = `null` <add>* `file` {string|Buffer|integer} filename or file descriptor <add>* `options` {Object|string} <add> * `encoding` {string|null} default = `null` <ide> * `flag` {string} default = `'r'` <ide> <ide> Synchronous version of [`fs.readFile`][]. Returns the contents of the `file`. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `options` {string | Object} <add>* `path` {string|Buffer} <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> * `callback` {Function} <ide> <ide> the link path returned will be passed as a `Buffer` object. <ide> added: v0.1.31 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `options` {string | Object} <add>* `path` {string|Buffer} <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> <ide> Synchronous readlink(2). Returns the symbolic link's string value. <ide> changes: <ide> description: The `length` parameter can now be `0`. <ide> --> <ide> <del>* `fd` {Integer} <del>* `buffer` {string | Buffer | Uint8Array} <del>* `offset` {Integer} <del>* `length` {Integer} <del>* `position` {Integer} <add>* `fd` {integer} <add>* `buffer` {string|Buffer|Uint8Array} <add>* `offset` {integer} <add>* `length` {integer} <add>* `position` {integer} <ide> <ide> Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. <ide> <ide> changes: <ide> description: The `cache` parameter was removed. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `options` {string | Object} <add>* `path` {string|Buffer} <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> * `callback` {Function} <ide> <ide> changes: <ide> description: The `cache` parameter was removed. <ide> --> <ide> <del>* `path` {string | Buffer}; <del>* `options` {string | Object} <add>* `path` {string|Buffer}; <add>* `options` {string|Object} <ide> * `encoding` {string} default = `'utf8'` <ide> <ide> Synchronous realpath(3). Returns the resolved path. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `oldPath` {string | Buffer} <del>* `newPath` {string | Buffer} <add>* `oldPath` {string|Buffer} <add>* `newPath` {string|Buffer} <ide> * `callback` {Function} <ide> <ide> Asynchronous rename(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.1.21 <ide> --> <ide> <del>* `oldPath` {string | Buffer} <del>* `newPath` {string | Buffer} <add>* `oldPath` {string|Buffer} <add>* `newPath` {string|Buffer} <ide> <ide> Synchronous rename(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> * `callback` {Function} <ide> <ide> Asynchronous rmdir(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.1.21 <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> <ide> Synchronous rmdir(2). Returns `undefined`. <ide> <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> * `callback` {Function} <ide> <ide> Asynchronous stat(2). The callback gets two arguments `(err, stats)` where <ide> is recommended. <ide> added: v0.1.21 <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> <ide> Synchronous stat(2). Returns an instance of [`fs.Stats`][]. <ide> <ide> Synchronous stat(2). Returns an instance of [`fs.Stats`][]. <ide> added: v0.1.31 <ide> --> <ide> <del>* `target` {string | Buffer} <del>* `path` {string | Buffer} <add>* `target` {string|Buffer} <add>* `path` {string|Buffer} <ide> * `type` {string} <ide> * `callback` {Function} <ide> <ide> It creates a symbolic link named "new-port" that points to "foo". <ide> added: v0.1.31 <ide> --> <ide> <del>* `target` {string | Buffer} <del>* `path` {string | Buffer} <add>* `target` {string|Buffer} <add>* `path` {string|Buffer} <ide> * `type` {string} <ide> <ide> Synchronous symlink(2). Returns `undefined`. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `len` {Integer} default = `0` <add>* `path` {string|Buffer} <add>* `len` {integer} default = `0` <ide> * `callback` {Function} <ide> <ide> Asynchronous truncate(2). No arguments other than a possible exception are <ide> first argument. In this case, `fs.ftruncate()` is called. <ide> added: v0.8.6 <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `len` {Integer} default = `0` <add>* `path` {string|Buffer} <add>* `len` {integer} default = `0` <ide> <ide> Synchronous truncate(2). Returns `undefined`. A file descriptor can also be <ide> passed as the first argument. In this case, `fs.ftruncateSync()` is called. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> * `callback` {Function} <ide> <ide> Asynchronous unlink(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> added: v0.1.21 <ide> --> <ide> <del>* `path` {string | Buffer} <add>* `path` {string|Buffer} <ide> <ide> Synchronous unlink(2). Returns `undefined`. <ide> <ide> Synchronous unlink(2). Returns `undefined`. <ide> added: v0.1.31 <ide> --> <ide> <del>* `filename` {string | Buffer} <add>* `filename` {string|Buffer} <ide> * `listener` {Function} <ide> <ide> Stop watching for changes on `filename`. If `listener` is specified, only that <ide> changes: <ide> time specifiers. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `atime` {Integer} <del>* `mtime` {Integer} <add>* `path` {string|Buffer} <add>* `atime` {integer} <add>* `mtime` {integer} <ide> * `callback` {Function} <ide> <ide> Change file timestamps of the file referenced by the supplied path. <ide> changes: <ide> time specifiers. <ide> --> <ide> <del>* `path` {string | Buffer} <del>* `atime` {Integer} <del>* `mtime` {Integer} <add>* `path` {string|Buffer} <add>* `atime` {integer} <add>* `mtime` {integer} <ide> <ide> Synchronous version of [`fs.utimes()`][]. Returns `undefined`. <ide> <ide> changes: <ide> description: The passed `options` object will never be modified. <ide> --> <ide> <del>* `filename` {string | Buffer} <del>* `options` {string | Object} <add>* `filename` {string|Buffer} <add>* `options` {string|Object} <ide> * `persistent` {boolean} Indicates whether the process should continue to run <ide> as long as files are being watched. default = `true` <ide> * `recursive` {boolean} Indicates whether all subdirectories should be <ide> fs.watch('somedir', (eventType, filename) => { <ide> added: v0.1.31 <ide> --> <ide> <del>* `filename` {string | Buffer} <add>* `filename` {string|Buffer} <ide> * `options` {Object} <ide> * `persistent` {boolean} <del> * `interval` {Integer} <add> * `interval` {integer} <ide> * `listener` {Function} <ide> <ide> Watch for changes on `filename`. The callback `listener` will be called each <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <del>* `buffer` {Buffer | Uint8Array} <del>* `offset` {Integer} <del>* `length` {Integer} <del>* `position` {Integer} <add>* `fd` {integer} <add>* `buffer` {Buffer|Uint8Array} <add>* `offset` {integer} <add>* `length` {integer} <add>* `position` {integer} <ide> * `callback` {Function} <ide> <ide> Write `buffer` to the file specified by `fd`. <ide> changes: <ide> it will emit a deprecation warning. <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> * `string` {string} <del>* `position` {Integer} <add>* `position` {integer} <ide> * `encoding` {string} <ide> * `callback` {Function} <ide> <ide> changes: <ide> description: The `file` parameter can be a file descriptor now. <ide> --> <ide> <del>* `file` {string | Buffer | Integer} filename or file descriptor <del>* `data` {string | Buffer | Uint8Array} <del>* `options` {Object | String} <del> * `encoding` {string | Null} default = `'utf8'` <del> * `mode` {Integer} default = `0o666` <add>* `file` {string|Buffer|integer} filename or file descriptor <add>* `data` {string|Buffer|Uint8Array} <add>* `options` {Object|string} <add> * `encoding` {string|null} default = `'utf8'` <add> * `mode` {integer} default = `0o666` <ide> * `flag` {string} default = `'w'` <ide> * `callback` {Function} <ide> <ide> changes: <ide> description: The `file` parameter can be a file descriptor now. <ide> --> <ide> <del>* `file` {string | Buffer | Integer} filename or file descriptor <del>* `data` {string | Buffer | Uint8Array} <del>* `options` {Object | String} <del> * `encoding` {string | Null} default = `'utf8'` <del> * `mode` {Integer} default = `0o666` <add>* `file` {string|Buffer|integer} filename or file descriptor <add>* `data` {string|Buffer|Uint8Array} <add>* `options` {Object|string} <add> * `encoding` {string|null} default = `'utf8'` <add> * `mode` {integer} default = `0o666` <ide> * `flag` {string} default = `'w'` <ide> <ide> The synchronous version of [`fs.writeFile()`][]. Returns `undefined`. <ide> changes: <ide> description: The `offset` and `length` parameters are optional now. <ide> --> <ide> <del>* `fd` {Integer} <del>* `buffer` {Buffer | Uint8Array} <del>* `offset` {Integer} <del>* `length` {Integer} <del>* `position` {Integer} <add>* `fd` {integer} <add>* `buffer` {Buffer|Uint8Array} <add>* `offset` {integer} <add>* `length` {integer} <add>* `position` {integer} <ide> <ide> ## fs.writeSync(fd, string[, position[, encoding]]) <ide> <!-- YAML <ide> changes: <ide> description: The `position` parameter is optional now. <ide> --> <ide> <del>* `fd` {Integer} <add>* `fd` {integer} <ide> * `string` {string} <del>* `position` {Integer} <add>* `position` {integer} <ide> * `encoding` {string} <ide> <ide> Synchronous versions of [`fs.write()`][]. Returns the number of bytes written. <ide><path>doc/api/globals.md <ide> added: v0.1.27 <ide> <ide> <!-- type=var --> <ide> <del>* {String} <add>* {string} <ide> <ide> The directory name of the current module. This the same as the <ide> [`path.dirname()`][] of the [`__filename`][]. <ide> added: v0.0.1 <ide> <ide> <!-- type=var --> <ide> <del>* {String} <add>* {string} <ide> <ide> The file name of the current module. This is the resolved absolute path of the <ide> current module file. <ide><path>doc/api/http.md <ide> aborted, in milliseconds since 1 January 1970 00:00:00 UTC. <ide> added: v0.1.90 <ide> --> <ide> <del>* `data` {string | Buffer} <add>* `data` {string|Buffer} <ide> * `encoding` {string} <ide> * `callback` {Function} <ide> <ide> Returns `request`. <ide> added: v0.1.29 <ide> --> <ide> <del>* `chunk` {string | Buffer} <add>* `chunk` {string|Buffer} <ide> * `encoding` {string} <ide> * `callback` {Function} <ide> <ide> will result in a [`TypeError`][] being thrown. <ide> added: v0.1.90 <ide> --> <ide> <del>* `data` {string | Buffer} <add>* `data` {string|Buffer} <ide> * `encoding` {string} <ide> * `callback` {Function} <ide> <ide> status message which was sent out. <ide> added: v0.1.29 <ide> --> <ide> <del>* `chunk` {string | Buffer} <add>* `chunk` {string|Buffer} <ide> * `encoding` {string} <ide> * `callback` {Function} <ide> * Returns: {boolean} <ide><path>doc/api/modules.md <ide> function require(...) { <ide> added: v0.1.16 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The fully resolved filename to the module. <ide> <ide> The fully resolved filename to the module. <ide> added: v0.1.16 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The identifier for the module. Typically this is the fully resolved <ide> filename. <ide> filename. <ide> added: v0.1.16 <ide> --> <ide> <del>* {Boolean} <add>* {boolean} <ide> <ide> Whether or not the module is done loading, or is in the process of <ide> loading. <ide><path>doc/api/net.md <ide> server.listen({ <ide> added: v0.1.90 <ide> --> <ide> <del>* `path` {String} <add>* `path` {string} <ide> * `backlog` {number} Common parameter of [`server.listen()`][] functions <ide> * `callback` {Function} Common parameter of [`server.listen()`][] functions <ide> <ide><path>doc/api/os.md <ide> const os = require('os'); <ide> added: v0.7.8 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> A string constant defining the operating system-specific end-of-line marker: <ide> <ide> A string constant defining the operating system-specific end-of-line marker: <ide> added: v0.5.0 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.arch()` method returns a string identifying the operating system CPU <ide> architecture *for which the Node.js binary was compiled*. <ide> all processors are always 0. <ide> added: v0.9.4 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.endianness()` method returns a string identifying the endianness of the <ide> CPU *for which the Node.js binary was compiled*. <ide> Possible values are: <ide> added: v0.3.3 <ide> --> <ide> <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> The `os.freemem()` method returns the amount of free system memory in bytes as <ide> an integer. <ide> an integer. <ide> added: v2.3.0 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.homedir()` method returns the home directory of the current user as a <ide> string. <ide> string. <ide> added: v0.3.3 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.hostname()` method returns the hostname of the operating system as a <ide> string. <ide> The properties available on the assigned network address object include: <ide> added: v0.5.0 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.platform()` method returns a string identifying the operating system <ide> platform as set during compile time of Node.js. <ide> to be experimental at this time. <ide> added: v0.3.3 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.release()` method returns a string identifying the operating system <ide> release. <ide> changes: <ide> returns a path with a trailing slash on any platform <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.tmpdir()` method returns a string specifying the operating system's <ide> default directory for temporary files. <ide> default directory for temporary files. <ide> added: v0.3.3 <ide> --> <ide> <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> The `os.totalmem()` method returns the total amount of system memory in bytes <ide> as an integer. <ide> as an integer. <ide> added: v0.3.3 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `os.type()` method returns a string identifying the operating system name <ide> as returned by uname(3). For example `'Linux'` on Linux, `'Darwin'` on OS X and <ide> information about the output of running uname(3) on various operating systems. <ide> added: v0.3.3 <ide> --> <ide> <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> The `os.uptime()` method returns the system uptime in number of seconds. <ide> <ide><path>doc/api/path.md <ide> changes: <ide> <ide> * `path` {string} <ide> * `ext` {string} An optional file extension <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.basename()` methods returns the last portion of a `path`, similar to <ide> the Unix `basename` command. <ide> and is not a string. <ide> added: v0.9.3 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> Provides the platform-specific path delimiter: <ide> <ide> changes: <ide> --> <ide> <ide> * `path` {string} <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.dirname()` method returns the directory name of a `path`, similar to <ide> the Unix `dirname` command. <ide> changes: <ide> --> <ide> <ide> * `path` {string} <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.extname()` method returns the extension of the `path`, from the last <ide> occurrence of the `.` (period) character to end of string in the last portion of <ide> added: v0.11.15 <ide> * `base` {string} <ide> * `name` {string} <ide> * `ext` {string} <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.format()` method returns a path string from an object. This is the <ide> opposite of [`path.parse()`][]. <ide> added: v0.11.2 <ide> --> <ide> <ide> * `path` {string} <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> The `path.isAbsolute()` method determines if `path` is an absolute path. <ide> <ide> added: v0.1.16 <ide> --> <ide> <ide> * `...paths` {string} A sequence of path segments <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.join()` method joins all given `path` segments together using the <ide> platform specific separator as a delimiter, then normalizes the resulting path. <ide> added: v0.1.23 <ide> --> <ide> <ide> * `path` {string} <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.normalize()` method normalizes the given `path`, resolving `'..'` and <ide> `'.'` segments. <ide> changes: <ide> <ide> * `from` {string} <ide> * `to` {string} <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.relative()` method returns the relative path from `from` to `to`. <ide> If `from` and `to` each resolve to the same path (after calling `path.resolve()` <ide> added: v0.3.4 <ide> --> <ide> <ide> * `...paths` {string} A sequence of paths or path segments <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `path.resolve()` method resolves a sequence of paths or path segments into <ide> an absolute path. <ide> A [`TypeError`][] is thrown if any of the arguments is not a string. <ide> added: v0.7.9 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> Provides the platform-specific path segment separator: <ide> <ide><path>doc/api/process.md <ide> generate a core file. <ide> added: v0.5.0 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The `process.arch` property returns a String identifying the processor <ide> architecture that the Node.js process is currently running on. For instance <ide> Would generate the output: <ide> added: 6.4.0 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The `process.argv0` property stores a read-only copy of the original value of <ide> `argv[0]` passed when Node.js starts. <ide> replace the value of `process.config`. <ide> added: v0.7.2 <ide> --> <ide> <del>* {Boolean} <add>* {boolean} <ide> <ide> If the Node.js process is spawned with an IPC channel (see the [Child Process][] <ide> and [Cluster][] documentation), the `process.connected` property will return <ide> added: v6.1.0 <ide> * `previousValue` {Object} A previous return value from calling <ide> `process.cpuUsage()` <ide> * Returns: {Object} <del> * `user` {Integer} <del> * `system` {Integer} <add> * `user` {integer} <add> * `system` {integer} <ide> <ide> The `process.cpuUsage()` method returns the user and system CPU time usage of <ide> the current process, in an object with properties `user` and `system`, whose <ide> console.log(process.cpuUsage(startUsage)); <ide> added: v0.1.8 <ide> --> <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `process.cwd()` method returns the current working directory of the Node.js <ide> process. <ide> If the Node.js process was not spawned with an IPC channel, <ide> added: v6.0.0 <ide> --> <ide> <del>* `warning` {string | Error} The warning to emit. <add>* `warning` {string|Error} The warning to emit. <ide> * `type` {string} When `warning` is a String, `type` is the name to use <ide> for the *type* of warning being emitted. Default: `Warning`. <ide> * `code` {string} A unique identifier for the warning instance being emitted. <ide> And `process.argv`: <ide> added: v0.1.100 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The `process.execPath` property returns the absolute pathname of the executable <ide> that started the Node.js process. <ide> For example: <ide> added: v0.1.13 <ide> --> <ide> <del>* `code` {Integer} The exit code. Defaults to `0`. <add>* `code` {integer} The exit code. Defaults to `0`. <ide> <ide> The `process.exit()` method instructs Node.js to terminate the process <ide> synchronously with an exit status of `code`. If `code` is omitted, exit uses <ide> is safer than calling `process.exit()`. <ide> added: v0.11.8 <ide> --> <ide> <del>* {Integer} <add>* {integer} <ide> <ide> A number which will be the process exit code, when the process either <ide> exits gracefully, or is exited via [`process.exit()`][] without specifying <ide> Android) <ide> added: v0.1.28 <ide> --> <ide> <del>* Returns: {Integer} <add>* Returns: {integer} <ide> <ide> The `process.getuid()` method returns the numeric user identity of the process. <ide> (See getuid(2).) <ide> changes: <ide> --> <ide> <ide> * Returns: {Object} <del> * `rss` {Integer} <del> * `heapTotal` {Integer} <del> * `heapUsed` {Integer} <del> * `external` {Integer} <add> * `rss` {integer} <add> * `heapTotal` {integer} <add> * `heapUsed` {integer} <add> * `external` {integer} <ide> <ide> The `process.memoryUsage()` method returns an object describing the memory usage <ide> of the Node.js process measured in bytes. <ide> happening, just like a `while(true);` loop. <ide> added: v0.1.15 <ide> --> <ide> <del>* {Integer} <add>* {integer} <ide> <ide> The `process.pid` property returns the PID of the process. <ide> <ide> console.log(`This process is pid ${process.pid}`); <ide> added: v0.1.16 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The `process.platform` property returns a string identifying the operating <ide> system platform on which the Node.js process is running. For instance <ide> tarball. <ide> legacy io.js releases, this will be `'io.js'`. <ide> * `sourceUrl` {string} an absolute URL pointing to a _`.tar.gz`_ file containing <ide> the source code of the current release. <del>* `headersUrl`{String} an absolute URL pointing to a _`.tar.gz`_ file containing <add>* `headersUrl`{string} an absolute URL pointing to a _`.tar.gz`_ file containing <ide> only the source header files for the current release. This file is <ide> significantly smaller than the full source file and can be used for compiling <ide> Node.js native add-ons. <ide> added: v0.5.9 <ide> * `sendHandle` {Handle object} <ide> * `options` {Object} <ide> * `callback` {Function} <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> If Node.js is spawned with an IPC channel, the `process.send()` method can be <ide> used to send messages to the parent process. Messages will be received as a <ide> See the [TTY][] documentation for more information. <ide> added: v0.1.104 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The `process.title` property returns the current process title (i.e. returns <ide> the current value of `ps`). Assigning a new value to `process.title` modifies <ide> console.log( <ide> added: v0.5.0 <ide> --> <ide> <del>* Returns: {Number} <add>* Returns: {number} <ide> <ide> The `process.uptime()` method returns the number of seconds the current Node.js <ide> process has been running. <ide> process has been running. <ide> added: v0.1.3 <ide> --> <ide> <del>* {String} <add>* {string} <ide> <ide> The `process.version` property returns the Node.js version string. <ide> <ide><path>doc/api/repl.md <ide> changes: <ide> description: The `options` parameter is optional now. <ide> --> <ide> <del>* `options` {Object | String} <add>* `options` {Object|string} <ide> * `prompt` {string} The input prompt to display. Defaults to `> ` <ide> (with a trailing space). <ide> * `input` {Readable} The Readable stream from which REPL input will be read. <ide><path>doc/api/stream.md <ide> changes: <ide> * `chunk` {string|Buffer} The data to write <ide> * `encoding` {string} The encoding, if `chunk` is a String <ide> * `callback` {Function} Callback for when this chunk of data is flushed <del>* Returns: {Boolean} `false` if the stream wishes for the calling code to <add>* Returns: {boolean} `false` if the stream wishes for the calling code to <ide> wait for the `'drain'` event to be emitted before continuing to write <ide> additional data; otherwise `true`. <ide> <ide> preferred over the use of the `'readable'` event. <ide> added: v0.11.14 <ide> --> <ide> <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> The `readable.isPaused()` method returns the current operating state of the <ide> Readable. This is used primarily by the mechanism that underlies the <ide> added: v0.9.4 <ide> --> <ide> <ide> * `size` {number} Optional argument to specify how much data to read. <del>* Return {String|Buffer|null} <add>* Return {string|Buffer|null} <ide> <ide> The `readable.read()` method pulls some data out of the internal buffer and <ide> returns it. If no data available to be read, `null` is returned. By default, <ide> user programs. <ide> * `chunk` {Buffer|null|string} Chunk of data to push into the read queue <ide> * `encoding` {string} Encoding of String chunks. Must be a valid <ide> Buffer encoding, such as `'utf8'` or `'ascii'` <del>* Returns {Boolean} `true` if additional chunks of data may continued to be <add>* Returns {boolean} `true` if additional chunks of data may continued to be <ide> pushed; `false` otherwise. <ide> <ide> When `chunk` is a `Buffer` or `string`, the `chunk` of data will be added to the <ide><path>doc/api/url.md <ide> forward-slash characters (`/`) are required following the colon in the <ide> added: v0.1.25 <ide> --> <ide> <del>* `urlObject` {Object | String} A URL object (as returned by `url.parse()` or <add>* `urlObject` {Object|string} A URL object (as returned by `url.parse()` or <ide> constructed otherwise). If a string, it is converted to an object by passing <ide> it to `url.parse()`. <ide> <ide> object returned by `url.parse()` are shown. Below it are properties of a WHATWG <ide> #### Constructor: new URL(input[, base]) <ide> <ide> * `input` {string} The input URL to parse <del>* `base` {string | URL} The base URL to resolve against if the `input` is not <add>* `base` {string|URL} The base URL to resolve against if the `input` is not <ide> absolute. <ide> <ide> Creates a new `URL` object by parsing the `input` relative to the `base`. If <ide> Additional [examples of parsed URLs][] may be found in the WHATWG URL Standard. <ide> <ide> #### url.hash <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the fragment portion of the URL. <ide> <ide> percent-encode may vary somewhat from what the [`url.parse()`][] and <ide> <ide> #### url.host <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the host portion of the URL. <ide> <ide> Invalid host values assigned to the `host` property are ignored. <ide> <ide> #### url.hostname <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the hostname portion of the URL. The key difference between <ide> `url.host` and `url.hostname` is that `url.hostname` does *not* include the <ide> Invalid hostname values assigned to the `hostname` property are ignored. <ide> <ide> #### url.href <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the serialized URL. <ide> <ide> will be thrown. <ide> <ide> #### url.origin <ide> <del>* {String} <add>* {string} <ide> <ide> Gets the read-only serialization of the URL's origin. Unicode characters that <ide> may be contained within the hostname will be encoded as-is without [Punycode][] <ide> console.log(idnURL.hostname); <ide> <ide> #### url.password <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the password portion of the URL. <ide> <ide> percent-encode may vary somewhat from what the [`url.parse()`][] and <ide> <ide> #### url.pathname <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the path portion of the URL. <ide> <ide> to percent-encode may vary somewhat from what the [`url.parse()`][] and <ide> <ide> #### url.port <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the port portion of the URL. <ide> <ide> lies outside the range denoted above, it is ignored. <ide> <ide> #### url.protocol <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the protocol portion of the URL. <ide> <ide> Invalid URL protocol values assigned to the `protocol` property are ignored. <ide> <ide> #### url.search <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the serialized query portion of the URL. <ide> <ide> documentation for details. <ide> <ide> #### url.username <ide> <del>* {String} <add>* {string} <ide> <ide> Gets and sets the username portion of the URL. <ide> <ide> and [`url.format()`][] methods would produce. <ide> <ide> #### url.toString() <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `toString()` method on the `URL` object returns the serialized URL. The <ide> value returned is equivalent to that of [`url.href`][] and [`url.toJSON()`][]. <ide> to customize the serialization process of the URL. For more flexibility, <ide> <ide> #### url.toJSON() <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> The `toJSON()` method on the `URL` object returns the serialized URL. The <ide> value returned is equivalent to that of [`url.href`][] and <ide> no such pairs, an empty array is returned. <ide> #### urlSearchParams.has(name) <ide> <ide> * `name` {string} <del>* Returns: {Boolean} <add>* Returns: {boolean} <ide> <ide> Returns `true` if there is at least one name-value pair whose name is `name`. <ide> <ide> console.log(params.toString()); <ide> <ide> #### urlSearchParams.toString() <ide> <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> Returns the search parameters serialized as a string, with characters <ide> percent-encoded where necessary. <ide> for (const [name, value] of params) { <ide> ### require('url').domainToASCII(domain) <ide> <ide> * `domain` {string} <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> Returns the [Punycode][] ASCII serialization of the `domain`. If `domain` is an <ide> invalid domain, the empty string is returned. <ide> the new `URL` implementation but is not part of the WHATWG URL standard. <ide> ### require('url').domainToUnicode(domain) <ide> <ide> * `domain` {string} <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> Returns the Unicode serialization of the `domain`. If `domain` is an invalid <ide> domain, the empty string is returned. <ide><path>tools/doc/type-parser.js <ide> const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/'; <ide> const jsDocUrl = jsDocPrefix + 'Reference/Global_Objects/'; <ide> const jsPrimitiveUrl = jsDocPrefix + 'Data_structures'; <ide> const jsPrimitives = { <del> 'integer': 'Number', // this is for extending <del> 'number': 'Number', <del> 'string': 'String', <ide> 'boolean': 'Boolean', <add> 'integer': 'Number', // not a primitive, used for clarification <ide> 'null': 'Null', <del> 'symbol': 'Symbol' <add> 'number': 'Number', <add> 'string': 'String', <add> 'symbol': 'Symbol', <add> 'undefined': 'Undefined' <ide> }; <ide> const jsGlobalTypes = [ <ide> 'Error', 'Object', 'Function', 'Array', 'TypedArray', 'Uint8Array',
20
Text
Text
update meta naming inconsistencies
17898b0ffc0d249fb22ec74b3076a1c2932d534f
<ide><path>curriculum/challenges/english/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/613297a923965e0703b64796.md <ide> dashedName: step-2 <ide> <ide> # --description-- <ide> <del>You may be familiar with the `meta` tag already; it is used to specify information about the page, such as the title, description, keywords, and author. <add>You may be familiar with the `meta` element already; it is used to specify information about the page, such as the title, description, keywords, and author. <ide> <del>Give your page a `meta` tag with an appropriate `charset` value. <add>Give your page a `meta` element with an appropriate `charset` value. <ide> <ide> The `charset` attribute specifies the character encoding of the page, and, nowadays, `UTF-8` is the only encoding supported by most browsers. <ide> <ide><path>curriculum/challenges/english/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/61329b210dac0b08047fd6ab.md <ide> dashedName: step-3 <ide> <ide> # --description-- <ide> <del>Continuing with the `meta` tags, a `viewport` definition tells the browser how to render the page. Including one betters visual accessibility on mobile, and improves _SEO_ (search engine optimisation). <add>Continuing with the `meta` elements, a `viewport` definition tells the browser how to render the page. Including one betters visual accessibility on mobile, and improves _SEO_ (search engine optimisation). <ide> <ide> Add a `viewport` definition with a `content` attribute detailing the `width` and `initial-scale` of the page. <ide> <ide><path>curriculum/challenges/english/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/61329d52e5010e08d9b9d66b.md <ide> dashedName: step-4 <ide> <ide> # --description-- <ide> <del>Another important `meta` tag for accessibility and SEO is the `description` definition. The value of the `content` attribute is used by search engines to provide a description of your page. <add>Another important `meta` element for accessibility and SEO is the `description` definition. The value of the `content` attribute is used by search engines to provide a description of your page. <ide> <del>Add a `meta` tag with the `name` attribute set to `description`, and give it a useful `content` attribute. <add>Add a `meta` element with the `name` attribute set to `description`, and give it a useful `content` attribute. <ide> <ide> # --hints-- <ide> <del>You should add a new `meta` tag to the `head`. <add>You should add a new `meta` element to the `head`. <ide> <ide> ```js <ide> assert.equal(document.querySelectorAll('meta').length, 3);
3
Javascript
Javascript
add multiline spec
95b216f2345589aa36ea6801babb27bd6526a226
<ide><path>spec/workspace-spec.js <ide> i = /test/; #FIXME\ <ide> expect(results[0].replacements).toBe(6) <ide> }) <ide> }) <add> <add> it('uses the multiline flag when searching', () => { <add> const filePath = path.join(projectDir, 'sample.js') <add> fs.copyFileSync(path.join(fixturesDir, 'sample.js'), filePath) <add> <add> const results = [] <add> waitsForPromise(() => <add> atom.workspace.replace(/;$/gi, 'items', [filePath], result => results.push(result)) <add> ) <add> <add> runs(() => { <add> expect(results).toHaveLength(1) <add> expect(results[0].filePath).toBe(filePath) <add> expect(results[0].replacements).toBe(8) <add> }) <add> }) <ide> }) <ide> <ide> describe('when a buffer is already open', () => {
1