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
Text
Text
remove frugalware installation docs
9b8b6aa224d0e88bdd27e322ae1c922e3dfcbe12
<ide><path>docs/installation/index.md <ide> <!--[metadata]> <ide> +++ <add>aliases = ["/engine/installation/linux/frugalware/","/engine/installation/frugalware/"] <ide> title = "Install" <ide> description = "Lists the installation methods" <ide> keywords = ["Docker install "] <ide> Docker Engine is supported on Linux, Cloud, Windows, and OS X. Installation inst <ide> * [CRUX Linux](linux/cruxlinux.md) <ide> * [Debian](linux/debian.md) <ide> * [Fedora](linux/fedora.md) <del>* [FrugalWare](linux/frugalware.md) <ide> * [Gentoo](linux/gentoolinux.md) <ide> * [Oracle Linux](linux/oracle.md) <ide> * [Red Hat Enterprise Linux](linux/rhel.md) <ide><path>docs/installation/linux/frugalware.md <del><!--[metadata]> <del>+++ <del>aliases = [ "/engine/installation/frugalware/"] <del>title = "Installation on FrugalWare" <del>description = "Installation instructions for Docker on FrugalWare." <del>keywords = ["frugalware linux, docker, documentation, installation"] <del>[menu.main] <del>parent = "engine_linux" <del>+++ <del><![end-metadata]--> <del> <del># FrugalWare <del> <del>Installing on FrugalWare is handled via the official packages: <del> <del> - [lxc-docker i686](http://www.frugalware.org/packages/200141) <del> - [lxc-docker x86_64](http://www.frugalware.org/packages/200130) <del> <del>The lxc-docker package will install the latest tagged version of Docker. <del> <del>## Dependencies <del> <del>Docker depends on several packages which are specified as dependencies <del>in the packages. The core dependencies are: <del> <del> - systemd <del> - lvm2 <del> - sqlite3 <del> - libguestfs <del> - lxc <del> - iproute2 <del> - bridge-utils <del> <del>## Installation <del> <del>A simple <del> <del> $ sudo pacman -S lxc-docker <del> <del>is all that is needed. <del> <del>## Starting Docker <del> <del>There is a systemd service unit created for Docker. To start Docker as <del>service: <del> <del> $ sudo systemctl start lxc-docker <del> <del>To start on system boot: <del> <del> $ sudo systemctl enable lxc-docker <del> <del>## Custom daemon options <del> <del>If you need to add an HTTP Proxy, set a different directory or partition for the <del>Docker runtime files, or make other customizations, read our systemd article to <del>learn how to [customize your systemd Docker daemon options](../../admin/systemd.md). <del> <del>## Uninstallation <del> <del>To uninstall the Docker package: <del> <del> $ sudo pacman -R lxc-docker <del> <del>To uninstall the Docker package and dependencies that are no longer needed: <del> <del> $ sudo pacman -Rns lxc-docker <del> <del>The above commands will not remove images, containers, volumes, or user created <del>configuration files on your host. If you wish to delete all images, containers, <del>and volumes run the following command: <del> <del> $ rm -rf /var/lib/docker <del> <del>You must delete the user created configuration files manually. <ide><path>docs/installation/linux/index.md <ide> Docker Engine is supported on several Linux distributions. Installation instruct <ide> * [CRUX Linux](cruxlinux.md) <ide> * [Debian](debian.md) <ide> * [Fedora](fedora.md) <del>* [FrugalWare](frugalware.md) <ide> * [Gentoo](gentoolinux.md) <ide> * [Oracle Linux](oracle.md) <ide> * [Red Hat Enterprise Linux](rhel.md)
3
Ruby
Ruby
add test for e0e3adf
63ed6ca9989fbfcd2b323b98e4110c7504b8d3db
<ide><path>activerecord/test/cases/attribute_methods_test.rb <ide> def test_read_write_boolean_attribute <ide> # puts "" <ide> end <ide> <add> def test_read_overridden_attribute <add> topic = Topic.new(:title => 'a') <add> def topic.title() 'b' end <add> assert_equal 'a', topic[:title] <add> end <add> <ide> def test_query_attribute_string <ide> [nil, "", " "].each do |value| <ide> assert_equal false, Topic.new(:author_name => value).author_name?
1
Javascript
Javascript
upgrade nodeenvironmentplugin to es6
efc576c8b744e7a015ab26f1f46932ba3ca7d4f1
<ide><path>lib/node/NodeEnvironmentPlugin.js <ide> MIT License http://www.opensource.org/licenses/mit-license.php <ide> Author Tobias Koppers @sokra <ide> */ <del>var NodeWatchFileSystem = require("./NodeWatchFileSystem"); <del>var NodeOutputFileSystem = require("./NodeOutputFileSystem"); <del>var NodeJsInputFileSystem = require("enhanced-resolve/lib/NodeJsInputFileSystem"); <del>var CachedInputFileSystem = require("enhanced-resolve/lib/CachedInputFileSystem"); <add>"use strict"; <ide> <del>function NodeEnvironmentPlugin() {} <add>const NodeWatchFileSystem = require("./NodeWatchFileSystem"); <add>const NodeOutputFileSystem = require("./NodeOutputFileSystem"); <add>const NodeJsInputFileSystem = require("enhanced-resolve/lib/NodeJsInputFileSystem"); <add>const CachedInputFileSystem = require("enhanced-resolve/lib/CachedInputFileSystem"); <add> <add>class NodeEnvironmentPlugin { <add> apply(compiler) { <add> compiler.inputFileSystem = new CachedInputFileSystem(new NodeJsInputFileSystem(), 60000); <add> const inputFileSystem = compiler.inputFileSystem; <add> compiler.outputFileSystem = new NodeOutputFileSystem(); <add> compiler.watchFileSystem = new NodeWatchFileSystem(compiler.inputFileSystem); <add> compiler.plugin("before-run", (compiler, callback) => { <add> if(compiler.inputFileSystem === inputFileSystem) <add> inputFileSystem.purge(); <add> callback(); <add> }); <add> } <add>} <ide> module.exports = NodeEnvironmentPlugin; <del>NodeEnvironmentPlugin.prototype.apply = function(compiler) { <del> compiler.inputFileSystem = new CachedInputFileSystem(new NodeJsInputFileSystem(), 60000); <del> var inputFileSystem = compiler.inputFileSystem; <del> compiler.outputFileSystem = new NodeOutputFileSystem(); <del> compiler.watchFileSystem = new NodeWatchFileSystem(compiler.inputFileSystem); <del> compiler.plugin("before-run", function(compiler, callback) { <del> if(compiler.inputFileSystem === inputFileSystem) <del> inputFileSystem.purge(); <del> callback(); <del> }); <del>};
1
PHP
PHP
add test for released jobs
e2067d33a002386280c63e559af932cda113d873
<ide><path>tests/Integration/Queue/UniqueJobTest.php <ide> public function testLockIsNotReleasedForJobRetries() <ide> $this->assertTrue($this->app->get(Cache::class)->lock($this->getLockKey($job), 10)->get()); <ide> } <ide> <add> public function testLockIsNotReleasedForJobReleases() <add> { <add> UniqueTestReleasedJob::$handled = false; <add> dispatch($job = new UniqueTestReleasedJob); <add> <add> $this->assertFalse($this->app->get(Cache::class)->lock($this->getLockKey($job), 10)->get()); <add> <add> $this->artisan('queue:work', [ <add> 'connection' => 'database', <add> '--once' => true, <add> ]); <add> <add> $this->assertTrue($job::$handled); <add> $this->assertFalse($this->app->get(Cache::class)->lock($this->getLockKey($job), 10)->get()); <add> <add> UniqueTestReleasedJob::$handled = false; <add> $this->artisan('queue:work', [ <add> 'connection' => 'database', <add> '--once' => true, <add> ]); <add> <add> $this->assertFalse($job::$handled); <add> $this->assertTrue($this->app->get(Cache::class)->lock($this->getLockKey($job), 10)->get()); <add> } <add> <ide> protected function getLockKey($job) <ide> { <ide> return 'unique:'.(is_string($job) ? $job : get_class($job)); <ide> public function handle() <ide> <ide> class UniqueTestFailJob implements ShouldQueue, UniqueJob <ide> { <del> public $tries = 1; <del> <ide> use InteractsWithQueue, Queueable, Dispatchable; <ide> <add> public $tries = 1; <add> <ide> public static $handled = false; <ide> <ide> public function handle() <ide> public function handle() <ide> } <ide> } <ide> <add>class UniqueTestReleasedJob extends UniqueTestFailJob <add>{ <add> public $tries = 1; <add> <add> public $connection = 'database'; <add> <add> public function handle() <add> { <add> static::$handled = true; <add> <add> $this->release(); <add> } <add>} <add> <ide> class UniqueTestRetryJob extends UniqueTestFailJob <ide> { <ide> public $tries = 2;
1
Javascript
Javascript
add tests for path module
988174a6294ab863be2961267174901440100944
<ide><path>test/mjsunit/test-path.js <add>var path = require("path"); <add>process.mixin(require("./common")); <add> <add>var f = __filename; <add> <add>assert.equal(path.basename(f), "test-path.js"); <add>assert.equal(path.basename(f, ".js"), "test-path"); <add>assert.equal(path.extname(f), ".js"); <add>assert.equal(path.dirname(f).substr(-13), "/test/mjsunit"); <add>path.exists(f, function (y) { assert.equal(y, true) }); <add> <add>assert.equal(path.join(".", "fixtures/b", "..", "/b/c.js"), "fixtures/b/c.js"); <add> <add>assert.equal(path.normalize("./fixtures///b/../b/c.js"), "fixtures/b/c.js"); <add>assert.equal(path.normalize("./fixtures///b/../b/c.js",true), "fixtures///b/c.js"); <add> <add>assert.deepEqual(path.normalizeArray(["fixtures","b","","..","b","c.js"]), ["fixtures","b","c.js"]); <add>assert.deepEqual(path.normalizeArray(["fixtures","","b","..","b","c.js"], true), ["fixtures","","b","c.js"]); <add> <add>assert.equal(path.normalize("a//b//../b", true), "a//b/b"); <add>assert.equal(path.normalize("a//b//../b"), "a/b"); <add> <add>assert.equal(path.normalize("a//b//./c", true), "a//b//c"); <add>assert.equal(path.normalize("a//b//./c"), "a/b/c"); <add>assert.equal(path.normalize("a//b//.", true), "a//b/"); <add>assert.equal(path.normalize("a//b//."), "a/b"); <add>
1
Text
Text
put correct marker in the hint
63439b452514a970c264af03c57ab637ae4fa413
<ide><path>curriculum/challenges/english/14-responsive-web-design-22/learn-css-colors-by-building-a-set-of-colored-markers/61b0a1b2af494934b7ec1a72.md <ide> const blueMarkerChildren = [...document.querySelector('.blue')?.children]; <ide> assert(blueMarkerChildren.every(child => child?.localName === 'div') && blueMarkerChildren.length === 2); <ide> ``` <ide> <del>Your green marker's cap `div` element should be before the sleeve `div` element. <add>Your blue marker's cap `div` element should be before the sleeve `div` element. <ide> <ide> ```js <ide> const blueMarkerChildren = [...document.querySelector('.blue')?.children];
1
Javascript
Javascript
cuechange handler not triggering correctly
15df4e16b4064984df3ba43036a7478137516317
<ide><path>src/js/tracks/text-track.js <ide> class TextTrack extends Track { <ide> return; <ide> } <ide> mode = newMode; <del> if (mode === 'showing') { <del> <add> if (mode !== 'disabled') { <ide> this.tech_.ready(() => { <ide> this.tech_.on('timeupdate', timeupdateHandler); <ide> }, true); <add> } else { <add> this.tech_.off('timeupdate', timeupdateHandler); <ide> } <ide> /** <ide> * An event that fires when mode changes on this track. This allows <ide><path>test/unit/tracks/text-track.test.js <ide> QUnit.test('fires cuechange when cues become active and inactive', function(asse <ide> player.dispose(); <ide> }); <ide> <add>QUnit.test('enabled and disabled cuechange handler when changing mode to hidden', function(assert) { <add> const player = TestHelpers.makePlayer(); <add> let changes = 0; <add> const tt = new TextTrack({ <add> tech: player.tech_ <add> }); <add> const cuechangeHandler = function() { <add> changes++; <add> }; <add> <add> tt.mode = 'hidden'; <add> <add> tt.addCue({ <add> id: '1', <add> startTime: 1, <add> endTime: 5 <add> }); <add> <add> tt.addEventListener('cuechange', cuechangeHandler); <add> <add> player.tech_.currentTime = function() { <add> return 2; <add> }; <add> player.tech_.trigger('timeupdate'); <add> <add> assert.equal(changes, 1, 'a cuechange event trigger'); <add> <add> changes = 0; <add> tt.mode = 'disabled'; <add> <add> player.tech_.currentTime = function() { <add> return 7; <add> }; <add> player.tech_.trigger('timeupdate'); <add> <add> assert.equal(changes, 0, 'NO cuechange event trigger'); <add> <add> player.dispose(); <add>}); <add> <add>QUnit.test('enabled and disabled cuechange handler when changing mode to showing', function(assert) { <add> const player = TestHelpers.makePlayer(); <add> let changes = 0; <add> const tt = new TextTrack({ <add> tech: player.tech_ <add> }); <add> const cuechangeHandler = function() { <add> changes++; <add> }; <add> <add> tt.mode = 'showing'; <add> <add> tt.addCue({ <add> id: '1', <add> startTime: 1, <add> endTime: 5 <add> }); <add> <add> tt.addEventListener('cuechange', cuechangeHandler); <add> <add> player.tech_.currentTime = function() { <add> return 2; <add> }; <add> player.tech_.trigger('timeupdate'); <add> <add> assert.equal(changes, 1, 'a cuechange event trigger'); <add> <add> changes = 0; <add> tt.mode = 'disabled'; <add> <add> player.tech_.currentTime = function() { <add> return 7; <add> }; <add> player.tech_.trigger('timeupdate'); <add> <add> assert.equal(changes, 0, 'NO cuechange event trigger'); <add> <add> player.dispose(); <add>}); <add> <ide> QUnit.test('tracks are parsed if vttjs is loaded', function(assert) { <ide> const clock = sinon.useFakeTimers(); <ide> const oldVTT = window.WebVTT;
2
Javascript
Javascript
improve performance of tojs
43835aa4da6dfc32188bef8918a0541efcf2f9cc
<ide><path>perf/toJS.js <add>/** <add> * Copyright (c) 2014-present, Facebook, Inc. <add> * <add> * This source code is licensed under the MIT license found in the <add> * LICENSE file in the root directory of this source tree. <add> */ <add> <add>describe('toJS', () => { <add> const array32 = []; <add> for (let ii = 0; ii < 32; ii++) { <add> array32[ii] = ii; <add> } <add> const list = Immutable.List(array32); <add> <add> it('List of 32', () => { <add> Immutable.toJS(list); <add> }); <add> <add> const obj32 = {}; <add> for (let ii = 0; ii < 32; ii++) { <add> obj32[ii] = ii; <add> } <add> const map = Immutable.Map(obj32); <add> <add> it('Map of 32', () => { <add> Immutable.toJS(map); <add> }); <add>}); <ide><path>src/toJS.js <ide> */ <ide> <ide> import { Seq } from './Seq'; <add>import { isCollection, isKeyed } from './Predicates'; <ide> import isDataStructure from './utils/isDataStructure'; <ide> <ide> export function toJS(value) { <del> return isDataStructure(value) <del> ? Seq(value) <del> .map(toJS) <del> .toJSON() <del> : value; <add> if (!value || typeof value !== 'object') { <add> return value; <add> } <add> if (!isCollection(value)) { <add> if (!isDataStructure(value)) { <add> return value; <add> } <add> value = Seq(value); <add> } <add> if (isKeyed(value)) { <add> const result = {}; <add> value.__iterate((v, k) => { <add> result[k] = toJS(v); <add> }); <add> return result; <add> } <add> const result = []; <add> value.__iterate(v => { <add> result.push(toJS(v)); <add> }); <add> return result; <ide> } <ide><path>src/utils/isDataStructure.js <ide> import isPlainObj from './isPlainObj'; <ide> * provided by Immutable.js or a plain Array or Object. <ide> */ <ide> export default function isDataStructure(value) { <del> return isImmutable(value) || Array.isArray(value) || isPlainObj(value); <add> return ( <add> typeof value === 'object' && <add> (isImmutable(value) || Array.isArray(value) || isPlainObj(value)) <add> ); <ide> }
3
Text
Text
use a lower case 'i' in the typescript reference
8f213db8001c89753ce7572900190ca0a4ba02fa
<ide><path>README.md <ide> Just add a reference with a relative path to the type declarations at the top <ide> of your file. <ide> <ide> ```javascript <del>///<reference path='./node_modules/immutable/dist/Immutable.d.ts'/> <add>///<reference path='./node_modules/immutable/dist/immutable.d.ts'/> <ide> import Immutable = require('immutable'); <ide> var map1: Immutable.Map<string, number>; <ide> map1 = Immutable.Map({a:1, b:2, c:3});
1
Go
Go
add more tests to strslice
cac8f4f0d057dd89fd2ef16e3a58e96d2fee2e70
<ide><path>pkg/stringutils/strslice_test.go <ide> package stringutils <ide> <ide> import ( <ide> "encoding/json" <add> "reflect" <ide> "testing" <ide> ) <ide> <ide> func TestStrSliceToString(t *testing.T) { <ide> } <ide> } <ide> } <add> <add>func TestStrSliceLen(t *testing.T) { <add> var emptyStrSlice *StrSlice <add> slices := map[*StrSlice]int{ <add> NewStrSlice(""): 1, <add> NewStrSlice("one"): 1, <add> NewStrSlice("one", "two"): 2, <add> emptyStrSlice: 0, <add> } <add> for s, expected := range slices { <add> if s.Len() != expected { <add> t.Fatalf("Expected %d, got %d", s.Len(), expected) <add> } <add> } <add>} <add> <add>func TestStrSliceSlice(t *testing.T) { <add> var emptyStrSlice *StrSlice <add> slices := map[*StrSlice][]string{ <add> NewStrSlice("one"): {"one"}, <add> NewStrSlice("one", "two"): {"one", "two"}, <add> emptyStrSlice: nil, <add> } <add> for s, expected := range slices { <add> if !reflect.DeepEqual(s.Slice(), expected) { <add> t.Fatalf("Expected %v, got %v", s.Slice(), expected) <add> } <add> } <add>}
1
Python
Python
update head revision to 0.9.9
3f7fc98591d11b0a67372699371843f9fd019e36
<ide><path>numpy/version.py <del>version='0.9.7' <add>version='0.9.9' <ide> <ide> import os <ide> svn_version_file = os.path.join(os.path.dirname(__file__),
1
PHP
PHP
skip autoloaders for apciterator
59c3b73f7aefc55a6676473e83e371de60c38b53
<ide><path>lib/Cake/Cache/Engine/ApcEngine.php <ide> public function clear($check) { <ide> if ($check) { <ide> return true; <ide> } <del> if (class_exists('APCIterator')) { <add> if (class_exists('APCIterator', false)) { <ide> $iterator = new APCIterator( <ide> 'user', <ide> '/^' . preg_quote($this->settings['prefix'], '/') . '/',
1
Python
Python
fix automatic detection for msvcrt version
1012141a15a432c1c7a3f3d964c38ca04970bd1b
<ide><path>numpy/distutils/mingw32ccompiler.py <ide> def _build_import_library_x86(): <ide> _MSVCRVER_TO_FULLVER['100'] = "10.0.30319.460" <ide> # Python 3.7 uses 1415, but get_build_version returns 140 ?? <ide> _MSVCRVER_TO_FULLVER['140'] = "14.15.26726.0" <del> if hasattr(msvcrt, "CRT_ASSEMBLY_VERSION"): <del> major, minor, rest = msvcrt.CRT_ASSEMBLY_VERSION.split(".", 2) <del> _MSVCRVER_TO_FULLVER[major + minor] = msvcrt.CRT_ASSEMBLY_VERSION <del> del major, minor, rest <add> crt_ver = getattr(msvcrt, 'CRT_ASSEMBLY_VERSION', None) <add> if crt_ver is not None: # Available at least back to Python 3.3 <add> maj, min = re.match(r'(\d+)\.(\d)', crt_ver).groups() <add> _MSVCRVER_TO_FULLVER[maj + min] = crt_ver <add> del maj, min <add> del crt_ver <ide> except ImportError: <ide> # If we are here, means python was not built with MSVC. Not sure what <ide> # to do in that case: manifest building will fail, but it should not be
1
PHP
PHP
remove old url handling code
f334cd224effef8e6e6bd09c63d6895c887a4af7
<ide><path>src/Network/Request.php <ide> protected function _processGet($query, $queryString = '') <ide> return $query; <ide> } <ide> <del> /** <del> * Get the request uri. Looks in PATH_INFO first, as this is the exact value we need prepared <del> * by PHP. Following that, REQUEST_URI, PHP_SELF, HTTP_X_REWRITE_URL and argv are checked in that order. <del> * Each of these server variables have the base path, and query strings stripped off <del> * <del> * @param array $config Configuration to set. <del> * @return string URI The CakePHP request path that is being accessed. <del> */ <del> protected static function _url($config) <del> { <del> if (!empty($_SERVER['PATH_INFO'])) { <del> return $_SERVER['PATH_INFO']; <del> } <del> if (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '://') === false) { <del> $uri = $_SERVER['REQUEST_URI']; <del> } elseif (isset($_SERVER['REQUEST_URI'])) { <del> $uri = $_SERVER['REQUEST_URI']; <del> $fullBaseUrl = Configure::read('App.fullBaseUrl'); <del> if (strpos($uri, $fullBaseUrl) === 0) { <del> $uri = substr($_SERVER['REQUEST_URI'], strlen($fullBaseUrl)); <del> } <del> } elseif (isset($_SERVER['PHP_SELF'], $_SERVER['SCRIPT_NAME'])) { <del> $uri = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']); <del> } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { <del> $uri = $_SERVER['HTTP_X_REWRITE_URL']; <del> } elseif ($var = env('argv')) { <del> $uri = $var[0]; <del> } <del> <del> $base = $config['base']; <del> <del> if (strlen($base) > 0 && strpos($uri, $base) === 0) { <del> $uri = substr($uri, strlen($base)); <del> } <del> if (strpos($uri, '?') !== false) { <del> list($uri) = explode('?', $uri, 2); <del> } <del> if (empty($uri) || $uri === '/' || $uri === '//' || $uri === '/index.php') { <del> $uri = '/'; <del> } <del> $endsWithIndex = '/webroot/index.php'; <del> $endsWithLength = strlen($endsWithIndex); <del> if (strlen($uri) >= $endsWithLength && <del> substr($uri, -$endsWithLength) === $endsWithIndex <del> ) { <del> $uri = '/'; <del> } <del> <del> return $uri; <del> } <del> <del> /** <del> * Returns a base URL and sets the proper webroot <del> * <del> * If CakePHP is called with index.php in the URL even though <del> * URL Rewriting is activated (and thus not needed) it swallows <del> * the unnecessary part from $base to prevent issue #3318. <del> * <del> * @return array Base URL, webroot dir ending in / <del> */ <del> protected static function _base() <del> { <del> $base = $webroot = $baseUrl = null; <del> $config = Configure::read('App'); <del> extract($config); <del> <del> if ($base !== false && $base !== null) { <del> return [$base, $base . '/']; <del> } <del> <del> if (!$baseUrl) { <del> $base = dirname(env('PHP_SELF')); <del> // Clean up additional / which cause following code to fail.. <del> $base = preg_replace('#/+#', '/', $base); <del> <del> $indexPos = strpos($base, '/' . $webroot . '/index.php'); <del> if ($indexPos !== false) { <del> $base = substr($base, 0, $indexPos) . '/' . $webroot; <del> } <del> if ($webroot === basename($base)) { <del> $base = dirname($base); <del> } <del> <del> if ($base === DIRECTORY_SEPARATOR || $base === '.') { <del> $base = ''; <del> } <del> $base = implode('/', array_map('rawurlencode', explode('/', $base))); <del> <del> return [$base, $base . '/']; <del> } <del> <del> $file = '/' . basename($baseUrl); <del> $base = dirname($baseUrl); <del> <del> if ($base === DIRECTORY_SEPARATOR || $base === '.') { <del> $base = ''; <del> } <del> $webrootDir = $base . '/'; <del> <del> $docRoot = env('DOCUMENT_ROOT'); <del> $docRootContainsWebroot = strpos($docRoot, $webroot); <del> <del> if (!empty($base) || !$docRootContainsWebroot) { <del> if (strpos($webrootDir, '/' . $webroot . '/') === false) { <del> $webrootDir .= $webroot . '/'; <del> } <del> } <del> <del> return [$base . $file, $webrootDir]; <del> } <del> <ide> /** <ide> * Process uploaded files and move things onto the post data. <ide> *
1
Ruby
Ruby
move flash into middleware
ead93c5be5b0f1945b7d0302f1aae4685ee3f2fb
<ide><path>actionpack/lib/action_controller/metal/compatibility.rb <ide> class << self <ide> @variables_added @request_origin @url <ide> @parent_controller @action_name <ide> @before_filter_chain_aborted @_headers @_params <del> @_flash @_response) <add> @_response) <ide> <ide> # Controls the resource action separator <ide> cattr_accessor :resource_action_separator <ide><path>actionpack/lib/action_controller/metal/flash.rb <ide> module ActionController #:nodoc: <del> # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed <del> # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create <del> # action that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can <del> # then expose the flash to its template. Actually, that exposure is automatically done. Example: <del> # <del> # class PostsController < ActionController::Base <del> # def create <del> # # save post <del> # flash[:notice] = "Successfully created post" <del> # redirect_to posts_path(@post) <del> # end <del> # <del> # def show <del> # # doesn't need to assign the flash notice to the template, that's done automatically <del> # end <del> # end <del> # <del> # show.html.erb <del> # <% if flash[:notice] %> <del> # <div class="notice"><%= flash[:notice] %></div> <del> # <% end %> <del> # <del> # This example just places a string in the flash, but you can put any object in there. And of course, you can put as <del> # many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed. <del> # <del> # See docs on the FlashHash class for more details about the flash. <ide> module Flash <ide> extend ActiveSupport::Concern <ide> <ide> included do <add> delegate :flash, :to => :request <add> delegate :alert, :notice, :to => "request.flash" <ide> helper_method :alert, :notice <ide> end <ide> <del> class FlashNow #:nodoc: <del> def initialize(flash) <del> @flash = flash <del> end <del> <del> def []=(k, v) <del> @flash[k] = v <del> @flash.discard(k) <del> v <del> end <del> <del> def [](k) <del> @flash[k] <del> end <del> end <del> <del> class FlashHash < Hash <del> def initialize #:nodoc: <del> super <del> @used = Set.new <del> end <del> <del> def []=(k, v) #:nodoc: <del> keep(k) <del> super <del> end <del> <del> def update(h) #:nodoc: <del> h.keys.each { |k| keep(k) } <del> super <del> end <del> <del> alias :merge! :update <del> <del> def replace(h) #:nodoc: <del> @used = Set.new <del> super <del> end <del> <del> # Sets a flash that will not be available to the next action, only to the current. <del> # <del> # flash.now[:message] = "Hello current action" <del> # <del> # This method enables you to use the flash as a central messaging system in your app. <del> # When you need to pass an object to the next action, you use the standard flash assign (<tt>[]=</tt>). <del> # When you need to pass an object to the current action, you use <tt>now</tt>, and your object will <del> # vanish when the current action is done. <del> # <del> # Entries set via <tt>now</tt> are accessed the same way as standard entries: <tt>flash['my-key']</tt>. <del> def now <del> FlashNow.new(self) <del> end <del> <del> # Keeps either the entire current flash or a specific flash entry available for the next action: <del> # <del> # flash.keep # keeps the entire flash <del> # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded <del> def keep(k = nil) <del> use(k, false) <del> end <del> <del> # Marks the entire flash or a single flash entry to be discarded by the end of the current action: <del> # <del> # flash.discard # discard the entire flash at the end of the current action <del> # flash.discard(:warning) # discard only the "warning" entry at the end of the current action <del> def discard(k = nil) <del> use(k) <del> end <del> <del> # Mark for removal entries that were kept, and delete unkept ones. <del> # <del> # This method is called automatically by filters, so you generally don't need to care about it. <del> def sweep #:nodoc: <del> keys.each do |k| <del> unless @used.include?(k) <del> @used << k <del> else <del> delete(k) <del> @used.delete(k) <del> end <del> end <del> <del> # clean up after keys that could have been left over by calling reject! or shift on the flash <del> (@used - keys).each{ |k| @used.delete(k) } <del> end <del> <del> def store(session) <del> return if self.empty? <del> session["flash"] = self <del> end <del> <del> private <del> # Used internally by the <tt>keep</tt> and <tt>discard</tt> methods <del> # use() # marks the entire flash as used <del> # use('msg') # marks the "msg" entry as used <del> # use(nil, false) # marks the entire flash as unused (keeps it around for one more action) <del> # use('msg', false) # marks the "msg" entry as unused (keeps it around for one more action) <del> # Returns the single value for the key you asked to be marked (un)used or the FlashHash itself <del> # if no key is passed. <del> def use(key = nil, used = true) <del> Array(key || keys).each { |k| used ? @used << k : @used.delete(k) } <del> return key ? self[key] : self <del> end <del> end <del> <del> # Access the contents of the flash. Use <tt>flash["notice"]</tt> to <del> # read a notice you put there or <tt>flash["notice"] = "hello"</tt> <del> # to put a new one. <del> def flash #:doc: <del> unless @_flash <del> @_flash = session["flash"] || FlashHash.new <del> @_flash.sweep <del> end <del> <del> @_flash <del> end <del> <del> # Convenience accessor for flash[:alert] <del> def alert <del> flash[:alert] <del> end <del> <del> # Convenience accessor for flash[:alert]= <del> def alert=(message) <del> flash[:alert] = message <del> end <del> <del> # Convenience accessor for flash[:notice] <del> def notice <del> flash[:notice] <del> end <del> <del> # Convenience accessor for flash[:notice]= <del> def notice=(message) <del> flash[:notice] = message <del> end <del> <ide> protected <del> def process_action(method_name) <del> @_flash = nil <del> super <del> @_flash.store(session) if @_flash <del> @_flash = nil <del> end <del> <del> def reset_session <del> super <del> @_flash = nil <del> end <del> <ide> def redirect_to(options = {}, response_status_and_flash = {}) #:doc: <ide> if alert = response_status_and_flash.delete(:alert) <ide> flash[:alert] = alert <ide><path>actionpack/lib/action_controller/test_case.rb <ide> def process(action, parameters = nil, session = nil, flash = nil, http_method = <ide> @request.assign_parameters(@controller.class.name.underscore.sub(/_controller$/, ''), action.to_s, parameters) <ide> <ide> @request.session = ActionController::TestSession.new(session) unless session.nil? <del> @request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash <add> @request.session["flash"] = @request.flash.update(flash || {}) <add> @request.session["flash"].sweep <ide> <ide> @controller.request = @request <ide> @controller.params.merge!(parameters) <ide> build_request_uri(action, parameters) <ide> Base.class_eval { include Testing } <ide> @controller.process_with_new_base_test(@request, @response) <add> @request.session.delete('flash') if @request.session['flash'].blank? <ide> @response <ide> end <ide> <ide><path>actionpack/lib/action_dispatch.rb <ide> module ActionDispatch <ide> autoload_under 'middleware' do <ide> autoload :Callbacks <ide> autoload :Cascade <add> autoload :Flash <ide> autoload :Head <ide> autoload :ParamsParser <ide> autoload :Rescue <ide><path>actionpack/lib/action_dispatch/http/request.rb <ide> def session_options=(options) <ide> @env['rack.session.options'] = options <ide> end <ide> <del> def flash <del> session['flash'] || {} <del> end <del> <ide> # Returns the authorization header regardless of whether it was specified directly or through one of the <ide> # proxy alternatives. <ide> def authorization <ide><path>actionpack/lib/action_dispatch/middleware/flash.rb <add>module ActionDispatch <add> class Request <add> # Access the contents of the flash. Use <tt>flash["notice"]</tt> to <add> # read a notice you put there or <tt>flash["notice"] = "hello"</tt> <add> # to put a new one. <add> def flash <add> session['flash'] ||= Flash::FlashHash.new <add> end <add> end <add> <add> # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed <add> # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create <add> # action that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can <add> # then expose the flash to its template. Actually, that exposure is automatically done. Example: <add> # <add> # class PostsController < ActionController::Base <add> # def create <add> # # save post <add> # flash[:notice] = "Successfully created post" <add> # redirect_to posts_path(@post) <add> # end <add> # <add> # def show <add> # # doesn't need to assign the flash notice to the template, that's done automatically <add> # end <add> # end <add> # <add> # show.html.erb <add> # <% if flash[:notice] %> <add> # <div class="notice"><%= flash[:notice] %></div> <add> # <% end %> <add> # <add> # This example just places a string in the flash, but you can put any object in there. And of course, you can put as <add> # many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed. <add> # <add> # See docs on the FlashHash class for more details about the flash. <add> class Flash <add> class FlashNow #:nodoc: <add> def initialize(flash) <add> @flash = flash <add> end <add> <add> def []=(k, v) <add> @flash[k] = v <add> @flash.discard(k) <add> v <add> end <add> <add> def [](k) <add> @flash[k] <add> end <add> end <add> <add> class FlashHash < Hash <add> def initialize #:nodoc: <add> super <add> @used = Set.new <add> end <add> <add> def []=(k, v) #:nodoc: <add> keep(k) <add> super <add> end <add> <add> def update(h) #:nodoc: <add> h.keys.each { |k| keep(k) } <add> super <add> end <add> <add> alias :merge! :update <add> <add> def replace(h) #:nodoc: <add> @used = Set.new <add> super <add> end <add> <add> # Sets a flash that will not be available to the next action, only to the current. <add> # <add> # flash.now[:message] = "Hello current action" <add> # <add> # This method enables you to use the flash as a central messaging system in your app. <add> # When you need to pass an object to the next action, you use the standard flash assign (<tt>[]=</tt>). <add> # When you need to pass an object to the current action, you use <tt>now</tt>, and your object will <add> # vanish when the current action is done. <add> # <add> # Entries set via <tt>now</tt> are accessed the same way as standard entries: <tt>flash['my-key']</tt>. <add> def now <add> FlashNow.new(self) <add> end <add> <add> # Keeps either the entire current flash or a specific flash entry available for the next action: <add> # <add> # flash.keep # keeps the entire flash <add> # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded <add> def keep(k = nil) <add> use(k, false) <add> end <add> <add> # Marks the entire flash or a single flash entry to be discarded by the end of the current action: <add> # <add> # flash.discard # discard the entire flash at the end of the current action <add> # flash.discard(:warning) # discard only the "warning" entry at the end of the current action <add> def discard(k = nil) <add> use(k) <add> end <add> <add> # Mark for removal entries that were kept, and delete unkept ones. <add> # <add> # This method is called automatically by filters, so you generally don't need to care about it. <add> def sweep #:nodoc: <add> keys.each do |k| <add> unless @used.include?(k) <add> @used << k <add> else <add> delete(k) <add> @used.delete(k) <add> end <add> end <add> <add> # clean up after keys that could have been left over by calling reject! or shift on the flash <add> (@used - keys).each{ |k| @used.delete(k) } <add> end <add> <add> # Convenience accessor for flash[:alert] <add> def alert <add> self[:alert] <add> end <add> <add> # Convenience accessor for flash[:alert]= <add> def alert=(message) <add> self[:alert] = message <add> end <add> <add> # Convenience accessor for flash[:notice] <add> def notice <add> self[:notice] <add> end <add> <add> # Convenience accessor for flash[:notice]= <add> def notice=(message) <add> self[:notice] = message <add> end <add> <add> private <add> # Used internally by the <tt>keep</tt> and <tt>discard</tt> methods <add> # use() # marks the entire flash as used <add> # use('msg') # marks the "msg" entry as used <add> # use(nil, false) # marks the entire flash as unused (keeps it around for one more action) <add> # use('msg', false) # marks the "msg" entry as unused (keeps it around for one more action) <add> # Returns the single value for the key you asked to be marked (un)used or the FlashHash itself <add> # if no key is passed. <add> def use(key = nil, used = true) <add> Array(key || keys).each { |k| used ? @used << k : @used.delete(k) } <add> return key ? self[key] : self <add> end <add> end <add> <add> def initialize(app) <add> @app = app <add> end <add> <add> def call(env) <add> if (session = env['rack.session']) && (flash = session['flash']) <add> flash.sweep <add> end <add> <add> @app.call(env) <add> ensure <add> if (session = env['rack.session']) && (flash = session['flash']) && flash.empty? <add> session.delete('flash') <add> end <add> end <add> end <add>end <ide><path>actionpack/test/abstract_unit.rb <ide> class ActiveSupport::TestCase <ide> <ide> class ActionController::IntegrationTest < ActiveSupport::TestCase <ide> def self.build_app(routes = nil) <add> ActionDispatch::Flash <ide> ActionDispatch::MiddlewareStack.new { |middleware| <ide> middleware.use "ActionDispatch::ShowExceptions" <ide> middleware.use "ActionDispatch::Callbacks" <ide> middleware.use "ActionDispatch::ParamsParser" <add> middleware.use "ActionDispatch::Flash" <ide> middleware.use "ActionDispatch::Head" <ide> }.build(routes || ActionController::Routing::Routes) <ide> end <ide><path>actionpack/test/controller/flash_test.rb <ide> def test_sweep_after_halted_filter_chain <ide> end <ide> <ide> def test_keep_and_discard_return_values <del> flash = ActionController::Flash::FlashHash.new <add> flash = ActionDispatch::Flash::FlashHash.new <ide> flash.update(:foo => :foo_indeed, :bar => :bar_indeed) <ide> <ide> assert_equal(:foo_indeed, flash.discard(:foo)) # valid key passed <ide> def test_redirect_to_with_other_flashes <ide> get :redirect_with_other_flashes <ide> assert_equal "Horses!", @controller.send(:flash)[:joyride] <ide> end <del>end <ide>\ No newline at end of file <add>end <add> <add>class FlashIntegrationTest < ActionController::IntegrationTest <add> SessionKey = '_myapp_session' <add> SessionSecret = 'b3c631c314c0bbca50c1b2843150fe33' <add> <add> class TestController < ActionController::Base <add> def set_flash <add> flash["that"] = "hello" <add> head :ok <add> end <add> <add> def use_flash <add> render :inline => "flash: #{flash["that"]}" <add> end <add> end <add> <add> def test_flash <add> with_test_route_set do <add> get '/set_flash' <add> assert_response :success <add> assert_equal "hello", @request.flash["that"] <add> <add> get '/use_flash' <add> assert_response :success <add> assert_equal "flash: hello", @response.body <add> end <add> end <add> <add> private <add> def with_test_route_set <add> with_routing do |set| <add> set.draw do |map| <add> match ':action', :to => ActionDispatch::Session::CookieStore.new(TestController, :key => SessionKey, :secret => SessionSecret) <add> end <add> yield <add> end <add> end <add>end <ide><path>railties/lib/rails/configuration.rb <ide> def self.default_middleware_stack <ide> middleware.use('ActionDispatch::ShowExceptions', lambda { ActionController::Base.consider_all_requests_local }) <ide> middleware.use('ActionDispatch::Callbacks', lambda { ActionController::Dispatcher.prepare_each_request }) <ide> middleware.use(lambda { ActionController::Base.session_store }, lambda { ActionController::Base.session_options }) <add> middleware.use('ActionDispatch::Flash', :if => lambda { ActionController::Base.session_store }) <ide> middleware.use('ActionDispatch::ParamsParser') <ide> middleware.use('::Rack::MethodOverride') <ide> middleware.use('::ActionDispatch::Head') <ide><path>railties/test/application/middleware_test.rb <ide> def setup <ide> "ActionDispatch::ShowExceptions", <ide> "ActionDispatch::Callbacks", <ide> "ActionDispatch::Session::CookieStore", <add> "ActionDispatch::Flash", <ide> "ActionDispatch::Cascade", <ide> "ActionDispatch::ParamsParser", <ide> "Rack::MethodOverride",
10
Javascript
Javascript
move function declaration out of conditional
7e7d5d38eae74ac92daf304624a81c951be6ebf6
<ide><path>lib/repl.js <ide> exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster', <ide> 'string_decoder', 'tls', 'tty', 'url', 'util', 'vm', 'zlib']; <ide> <ide> <del>function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { <add>function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) { <ide> if (!(this instanceof REPLServer)) { <del> return new REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined); <add> return new REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined); <ide> } <ide> <ide> EventEmitter.call(this); <ide> function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { <ide> stream = options.stream || options.socket; <ide> input = options.input; <ide> output = options.output; <del> eval = options.eval; <add> eval_ = options.eval; <ide> useGlobal = options.useGlobal; <ide> ignoreUndefined = options.ignoreUndefined; <ide> prompt = options.prompt; <ide> function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { <ide> self.useGlobal = !!useGlobal; <ide> self.ignoreUndefined = !!ignoreUndefined; <ide> <del> self.eval = eval || function(code, context, file, cb) { <add> self.eval = eval_ || function(code, context, file, cb) { <ide> var err, result; <ide> try { <ide> if (self.useGlobal) { <ide> exports.REPLServer = REPLServer; <ide> <ide> // prompt is a string to print on each line for the prompt, <ide> // source is a stream to use for I/O, defaulting to stdin/stdout. <del>exports.start = function(prompt, source, eval, useGlobal, ignoreUndefined) { <del> var repl = new REPLServer(prompt, source, eval, useGlobal, ignoreUndefined); <add>exports.start = function(prompt, source, eval_, useGlobal, ignoreUndefined) { <add> var repl = new REPLServer(prompt, source, eval_, useGlobal, ignoreUndefined); <ide> if (!exports.repl) exports.repl = repl; <ide> return repl; <ide> }; <ide> REPLServer.prototype.complete = function(line, callback) { <ide> expr = bits.join('.'); <ide> } <ide> <del> // console.log("expression completion: completeOn='" + completeOn + <del> // "' expr='" + expr + "'"); <del> <ide> // Resolve expr and get its completions. <ide> var obj, memberGroups = []; <ide> if (!expr) { <ide> REPLServer.prototype.complete = function(line, callback) { <ide> completionGroups.push(Object.getOwnPropertyNames(contextProto)); <ide> } <ide> completionGroups.push(Object.getOwnPropertyNames(this.context)); <del> addStandardGlobals(); <add> addStandardGlobals(completionGroups, filter); <ide> completionGroupsLoaded(); <ide> } else { <ide> this.eval('.scope', this.context, 'repl', function(err, globals) { <ide> if (err || !globals) { <del> addStandardGlobals(); <add> addStandardGlobals(completionGroups, filter); <ide> } else if (Array.isArray(globals[0])) { <ide> // Add grouped globals <ide> globals.forEach(function(group) { <ide> completionGroups.push(group); <ide> }); <ide> } else { <ide> completionGroups.push(globals); <del> addStandardGlobals(); <add> addStandardGlobals(completionGroups, filter); <ide> } <ide> completionGroupsLoaded(); <ide> }); <ide> } <del> <del> function addStandardGlobals() { <del> // Global object properties <del> // (http://www.ecma-international.org/publications/standards/Ecma-262.htm) <del> completionGroups.push(['NaN', 'Infinity', 'undefined', <del> 'eval', 'parseInt', 'parseFloat', 'isNaN', 'isFinite', 'decodeURI', <del> 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', <del> 'Object', 'Function', 'Array', 'String', 'Boolean', 'Number', <del> 'Date', 'RegExp', 'Error', 'EvalError', 'RangeError', <del> 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', <del> 'Math', 'JSON']); <del> // Common keywords. Exclude for completion on the empty string, b/c <del> // they just get in the way. <del> if (filter) { <del> completionGroups.push(['break', 'case', 'catch', 'const', <del> 'continue', 'debugger', 'default', 'delete', 'do', 'else', <del> 'export', 'false', 'finally', 'for', 'function', 'if', <del> 'import', 'in', 'instanceof', 'let', 'new', 'null', 'return', <del> 'switch', 'this', 'throw', 'true', 'try', 'typeof', 'undefined', <del> 'var', 'void', 'while', 'with', 'yield']); <del> } <del> } <del> <ide> } else { <ide> this.eval(expr, this.context, 'repl', function(e, obj) { <ide> // if (e) console.log(e); <ide> REPLServer.prototype.memory = function memory(cmd) { <ide> } <ide> }; <ide> <add>function addStandardGlobals(completionGroups, filter) { <add> // Global object properties <add> // (http://www.ecma-international.org/publications/standards/Ecma-262.htm) <add> completionGroups.push(['NaN', 'Infinity', 'undefined', <add> 'eval', 'parseInt', 'parseFloat', 'isNaN', 'isFinite', 'decodeURI', <add> 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', <add> 'Object', 'Function', 'Array', 'String', 'Boolean', 'Number', <add> 'Date', 'RegExp', 'Error', 'EvalError', 'RangeError', <add> 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', <add> 'Math', 'JSON']); <add> // Common keywords. Exclude for completion on the empty string, b/c <add> // they just get in the way. <add> if (filter) { <add> completionGroups.push(['break', 'case', 'catch', 'const', <add> 'continue', 'debugger', 'default', 'delete', 'do', 'else', <add> 'export', 'false', 'finally', 'for', 'function', 'if', <add> 'import', 'in', 'instanceof', 'let', 'new', 'null', 'return', <add> 'switch', 'this', 'throw', 'true', 'try', 'typeof', 'undefined', <add> 'var', 'void', 'while', 'with', 'yield']); <add> } <add>} <ide> <ide> function defineDefaultCommands(repl) { <ide> // TODO remove me after 0.3.x
1
Java
Java
avoid reflection on optionalvalidatorfactorybean
cd2b7afc8751804fa97d28bbf95b41fe03347dac
<ide><path>spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractMessageBrokerConfiguration.java <ide> import java.util.List; <ide> import java.util.Map; <ide> <del>import org.springframework.beans.BeanUtils; <ide> import org.springframework.beans.factory.BeanInitializationException; <ide> import org.springframework.beans.factory.annotation.Qualifier; <ide> import org.springframework.context.ApplicationContext; <ide> import org.springframework.util.StringUtils; <ide> import org.springframework.validation.Errors; <ide> import org.springframework.validation.Validator; <add>import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean; <ide> <ide> /** <ide> * Provides essential configuration for handling messages with simple messaging <ide> protected Validator simpValidator() { <ide> validator = this.applicationContext.getBean(MVC_VALIDATOR_NAME, Validator.class); <ide> } <ide> else if (ClassUtils.isPresent("jakarta.validation.Validator", getClass().getClassLoader())) { <del> Class<?> clazz; <ide> try { <del> String className = "org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean"; <del> clazz = ClassUtils.forName(className, AbstractMessageBrokerConfiguration.class.getClassLoader()); <add> validator = new OptionalValidatorFactoryBean(); <ide> } <ide> catch (Throwable ex) { <del> throw new BeanInitializationException("Could not find default validator class", ex); <add> throw new BeanInitializationException("Failed to create default validator", ex); <ide> } <del> validator = (Validator) BeanUtils.instantiateClass(clazz); <ide> } <ide> else { <ide> validator = new Validator() { <ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java <ide> <ide> import reactor.core.publisher.Mono; <ide> <del>import org.springframework.beans.BeanUtils; <ide> import org.springframework.beans.factory.BeanInitializationException; <ide> import org.springframework.beans.factory.annotation.Qualifier; <ide> import org.springframework.context.ApplicationContext; <ide> import org.springframework.validation.Errors; <ide> import org.springframework.validation.MessageCodesResolver; <ide> import org.springframework.validation.Validator; <add>import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean; <ide> import org.springframework.web.bind.WebDataBinder; <ide> import org.springframework.web.bind.annotation.WebAnnotationsRuntimeHintsRegistrar; <ide> import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; <ide> public Validator webFluxValidator() { <ide> Validator validator = getValidator(); <ide> if (validator == null) { <ide> if (ClassUtils.isPresent("jakarta.validation.Validator", getClass().getClassLoader())) { <del> Class<?> clazz; <ide> try { <del> String name = "org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean"; <del> clazz = ClassUtils.forName(name, getClass().getClassLoader()); <add> validator = new OptionalValidatorFactoryBean(); <ide> } <del> catch (ClassNotFoundException | LinkageError ex) { <del> throw new BeanInitializationException("Failed to resolve default validator class", ex); <add> catch (Throwable ex) { <add> throw new BeanInitializationException("Failed to create default validator", ex); <ide> } <del> validator = (Validator) BeanUtils.instantiateClass(clazz); <ide> } <ide> else { <ide> validator = new NoOpValidator(); <ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java <ide> <ide> import jakarta.servlet.ServletContext; <ide> <del>import org.springframework.beans.BeanUtils; <ide> import org.springframework.beans.factory.BeanFactoryUtils; <ide> import org.springframework.beans.factory.BeanInitializationException; <ide> import org.springframework.beans.factory.annotation.Qualifier; <ide> import org.springframework.validation.Errors; <ide> import org.springframework.validation.MessageCodesResolver; <ide> import org.springframework.validation.Validator; <add>import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean; <ide> import org.springframework.web.HttpRequestHandler; <ide> import org.springframework.web.accept.ContentNegotiationManager; <ide> import org.springframework.web.bind.WebDataBinder; <ide> public Validator mvcValidator() { <ide> Validator validator = getValidator(); <ide> if (validator == null) { <ide> if (ClassUtils.isPresent("jakarta.validation.Validator", getClass().getClassLoader())) { <del> Class<?> clazz; <ide> try { <del> String className = "org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean"; <del> clazz = ClassUtils.forName(className, WebMvcConfigurationSupport.class.getClassLoader()); <add> validator = new OptionalValidatorFactoryBean(); <ide> } <del> catch (ClassNotFoundException | LinkageError ex) { <del> throw new BeanInitializationException("Failed to resolve default validator class", ex); <add> catch (Throwable ex) { <add> throw new BeanInitializationException("Failed to create default validator", ex); <ide> } <del> validator = (Validator) BeanUtils.instantiateClass(clazz); <ide> } <ide> else { <ide> validator = new NoOpValidator();
3
Javascript
Javascript
remove unused expression arguments
79d2b9a5a6f2a57c33955e9ba8ddf24ebf3e63ff
<ide><path>src/ng/parse.js <ide> ASTCompiler.prototype = { <ide> 'getStringValue', <ide> 'ifDefined', <ide> 'plus', <del> 'text', <ide> fnString))( <ide> this.$filter, <ide> getStringValue, <ide> ifDefined, <del> plusFn, <del> expression); <add> plusFn); <ide> this.state = this.stage = undefined; <ide> fn.literal = isLiteral(ast); <ide> fn.constant = isConstant(ast); <ide> ASTInterpreter.prototype = { <ide> compile: function(expression) { <ide> var self = this; <ide> var ast = this.astBuilder.ast(expression); <del> this.expression = expression; <ide> findConstantAndWatchExpressions(ast, self.$filter); <ide> var assignable; <ide> var assign; <ide> ASTInterpreter.prototype = { <ide> context <ide> ); <ide> case AST.Identifier: <del> return self.identifier(ast.name, <del> context, create, self.expression); <add> return self.identifier(ast.name, context, create); <ide> case AST.MemberExpression: <ide> left = this.recurse(ast.object, false, !!create); <ide> if (!ast.computed) { <ide> right = ast.property.name; <ide> } <ide> if (ast.computed) right = this.recurse(ast.property); <ide> return ast.computed ? <del> this.computedMember(left, right, context, create, self.expression) : <del> this.nonComputedMember(left, right, context, create, self.expression); <add> this.computedMember(left, right, context, create) : <add> this.nonComputedMember(left, right, context, create); <ide> case AST.CallExpression: <ide> args = []; <ide> forEach(ast.arguments, function(expr) { <ide> ASTInterpreter.prototype = { <ide> value: function(value, context) { <ide> return function() { return context ? {context: undefined, name: undefined, value: value} : value; }; <ide> }, <del> identifier: function(name, context, create, expression) { <add> identifier: function(name, context, create) { <ide> return function(scope, locals, assign, inputs) { <ide> var base = locals && (name in locals) ? locals : scope; <ide> if (create && create !== 1 && base && base[name] == null) { <ide> ASTInterpreter.prototype = { <ide> } <ide> }; <ide> }, <del> computedMember: function(left, right, context, create, expression) { <add> computedMember: function(left, right, context, create) { <ide> return function(scope, locals, assign, inputs) { <ide> var lhs = left(scope, locals, assign, inputs); <ide> var rhs; <ide> ASTInterpreter.prototype = { <ide> } <ide> }; <ide> }, <del> nonComputedMember: function(left, right, context, create, expression) { <add> nonComputedMember: function(left, right, context, create) { <ide> return function(scope, locals, assign, inputs) { <ide> var lhs = left(scope, locals, assign, inputs); <ide> if (create && create !== 1) {
1
Javascript
Javascript
add filter option for benchmark
ea7750bddd8051f39fa538905e05f9bf1d1afa5f
<ide><path>benchmark/common.js <ide> exports.PORT = process.env.PORT || 12346; <ide> // If this is the main module, then run the benchmarks <ide> if (module === require.main) { <ide> var type = process.argv[2]; <add> var testFilter = process.argv[3]; <ide> if (!type) { <del> console.error('usage:\n ./iojs benchmark/common.js <type>'); <add> console.error('usage:\n ./iojs benchmark/common.js <type> [testFilter]'); <ide> process.exit(1); <ide> } <ide> <ide> if (module === require.main) { <ide> var tests = fs.readdirSync(dir); <ide> var spawn = require('child_process').spawn; <ide> <add> if (testFilter) { <add> var filteredTests = tests.filter(function(item){ <add> if (item.lastIndexOf(testFilter) >= 0) { <add> return item; <add> } <add> }); <add> if (filteredTests.length === 0) { <add> console.error(`${testFilter} is not found in \n ${tests.join(' \n')}`); <add> return; <add> } <add> tests = filteredTests; <add> } <add> <ide> runBenchmarks(); <ide> } <ide>
1
Javascript
Javascript
eliminate double `getenv()`
4f1ae11a62b97052bc83756f8cb8700cc1f61661
<ide><path>lib/module.js <ide> Module._initPaths = function() { <ide> paths.unshift(path.resolve(homeDir, '.node_modules')); <ide> } <ide> <del> if (process.env['NODE_PATH']) { <add> var nodePath = process.env['NODE_PATH']; <add> if (nodePath) { <ide> var splitter = isWindows ? ';' : ':'; <del> paths = process.env['NODE_PATH'].split(splitter).concat(paths); <add> paths = nodePath.split(splitter).concat(paths); <ide> } <ide> <ide> modulePaths = paths;
1
Javascript
Javascript
improve pushnotificationios documentation
7e445e6cfa46d87bfd85d7f39e3254a6bb5a60ee
<ide><path>Libraries/PushNotificationIOS/PushNotificationIOS.js <ide> const DEVICE_LOCAL_NOTIF_EVENT = 'localNotificationReceived'; <ide> * <ide> * [Manually link](docs/linking-libraries-ios.html#manual-linking) the PushNotificationIOS library <ide> * <del> * - Be sure to add the following to your `Header Search Paths`: <del> * `$(SRCROOT)/../node_modules/react-native/Libraries/PushNotificationIOS` <del> * - Set the search to `recursive` <add> * - Add the following to your Project: `node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj` <add> * - Add the following to `Link Binary With Libraries`: `libRCTPushNotification.a` <add> * - Add the following to your `Header Search Paths`: <add> * `$(SRCROOT)/../node_modules/react-native/Libraries/PushNotificationIOS` and set the search to `recursive` <ide> * <ide> * Finally, to enable support for `notification` and `register` events you need to augment your AppDelegate. <ide> *
1
Text
Text
fix typos [ci skip]
3bcecf8258d6b63ded2714672f92ad767423e41f
<ide><path>guides/source/migrations.md <ide> version to migrate to. <ide> ### Setup the Database <ide> <ide> The `rake db:setup` task will create the database, load the schema and initialize <del>it with seed data. <add>it with the seed data. <ide> <ide> ### Resetting the Database <ide> <ide> The `rake db:reset` task will drop the database and set it up again. This is <del>functionally eqivalent to `rake db:drop db:setup` <add>functionally equivalent to `rake db:drop db:setup`. <ide> <ide> NOTE: This is not the same as running all the migrations. It will only use the <ide> contents of the current schema.rb file. If a migration can't be rolled back,
1
Text
Text
remove experimental flag
5054e943d4590b3e426760be9bc5f96ef933ee1b
<ide><path>packages/next/README.md <ide> The [polyfills](https://github.com/zeit/next.js/tree/canary/examples/with-polyfi <ide> To enable AMP support for a page, first enable experimental AMP support in your `next.config.js` and then import `withAmp` from `next/amp` and wrap your page's component in it. <ide> <ide> ```js <del>// next.config.js <del>module.exports = { <del> experimental: { amp: true } <del>} <del> <ide> // pages/about.js <ide> import { withAmp } from 'next/amp' <ide>
1
PHP
PHP
unify namespaces for doc block params
8777df7774bdfa00eeb79cdbd9f2716660ccf743
<ide><path>src/Database/Dialect/SqlserverDialectTrait.php <ide> trait SqlserverDialectTrait { <ide> /** <ide> * Modify the limit/offset to TSQL <ide> * <del> * @param Cake\Database\Query $query The query to translate <del> * @return Cake\Database\Query The modified query <add> * @param \Cake\Database\Query $query The query to translate <add> * @return \Cake\Database\Query The modified query <ide> */ <ide> protected function _selectQueryTranslator($query) { <ide> $limit = $query->clause('limit'); <ide> protected function _expressionTranslators() { <ide> * Receives a FunctionExpression and changes it so that it conforms to this <ide> * SQL dialect. <ide> * <del> * @param Cake\Database\Expression\FunctionExpression $expression The function expression to convert to TSQL. <add> * @param \Cake\Database\Expression\FunctionExpression $expression The function expression to convert to TSQL. <ide> * @return void <ide> */ <ide> protected function _transformFunctionExpression(FunctionExpression $expression) { <ide> protected function _transformFunctionExpression(FunctionExpression $expression) <ide> * Used by Cake\Schema package to reflect schema and <ide> * generate schema. <ide> * <del> * @return Cake\Database\Schema\MysqlSchema <add> * @return \Cake\Database\Schema\MysqlSchema <ide> */ <ide> public function schemaDialect() { <ide> return new \Cake\Database\Schema\SqlserverSchema($this); <ide><path>src/Network/Http/Auth/Basic.php <ide> class Basic { <ide> /** <ide> * Add Authorization header to the request. <ide> * <del> * @param Cake\Network\Request $request Request instance. <add> * @param \Cake\Network\Request $request Request instance. <ide> * @param array $credentials Credentials. <ide> * @return void <ide> * @see http://www.ietf.org/rfc/rfc2617.txt <ide> public function authentication(Request $request, array $credentials) { <ide> /** <ide> * Proxy Authentication <ide> * <del> * @param Cake\Network\Request $request Request instance. <add> * @param \Cake\Network\Request $request Request instance. <ide> * @param array $credentials Credentials. <ide> * @return void <ide> * @see http://www.ietf.org/rfc/rfc2617.txt <ide><path>src/Network/Session.php <ide> class Session { <ide> * - timeout: The time in minutes the session should stay active <ide> * <ide> * @param array $sessionConfig Session config. <del> * @return Cake\Network\Session <add> * @return \Cake\Network\Session <ide> * @see Session::__construct() <ide> */ <ide> public static function create($sessionConfig = []) { <ide><path>src/View/Helper/TimeHelper.php <ide> class TimeHelper extends Helper { <ide> * <ide> * @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object <ide> * @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object <del> * @return Cake\Utility\Time <add> * @return \Cake\Utility\Time <ide> * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting <ide> */ <ide> public function fromString($dateString, $timezone = null) { <ide><path>src/View/JsonView.php <ide> class JsonView extends View { <ide> /** <ide> * Constructor <ide> * <del> * @param Cake\Network\Request $request Request instance. <del> * @param Cake\Network\Response $response Response instance. <del> * @param Cake\Event\EventManager $eventManager EventManager instance. <add> * @param \Cake\Network\Request $request Request instance. <add> * @param \Cake\Network\Response $response Response instance. <add> * @param \Cake\Event\EventManager $eventManager EventManager instance. <ide> * @param array $viewOptions An array of view options <ide> */ <ide> public function __construct(Request $request = null, Response $response = null, <ide><path>src/View/XmlView.php <ide> class XmlView extends View { <ide> /** <ide> * Constructor <ide> * <del> * @param Cake\Network\Request $request Request instance <del> * @param Cake\Network\Response $response Response instance <del> * @param Cake\Event\EventManager $eventManager Event Manager <add> * @param \Cake\Network\Request $request Request instance <add> * @param \Cake\Network\Response $response Response instance <add> * @param \Cake\Event\EventManager $eventManager Event Manager <ide> * @param array $viewOptions View options. <ide> */ <ide> public function __construct(Request $request = null, Response $response = null,
6
PHP
PHP
fix typo in database/connectionmanager
c43f375351b157d8c5f6c2f55a07a77f49a41bf8
<ide><path>lib/Cake/Database/ConnectionManager.php <ide> public static function config($key, $config = null) { <ide> * <ide> * @param string $name The connection name. <ide> * @return Connection A connection object. <del> * @throws Cake\Error\MissingDataSourceConfigException When config data is missing. <add> * @throws Cake\Error\MissingDatasourceConfigException When config data is missing. <ide> */ <ide> public static function get($name) { <ide> if (empty(static::$_config[$name])) { <del> throw new Error\MissingDataSourceConfigException(['name' => $name]); <add> throw new Error\MissingDatasourceConfigException(['name' => $name]); <ide> } <ide> if (empty(static::$_registry)) { <ide> static::$_registry = new ConnectionRegistry();
1
Java
Java
reset charset field in mockhttpservletresponse
5576321b04bd4112dd7414eff264cb46db931501
<ide><path>spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java <ide> public boolean isCommitted() { <ide> public void reset() { <ide> resetBuffer(); <ide> this.characterEncoding = null; <add> this.charset = false; <ide> this.contentLength = 0; <ide> this.contentType = null; <ide> this.locale = Locale.getDefault(); <ide><path>spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java <ide> private void assertPrimarySessionCookie(String expectedValue) { <ide> assertThat(((MockCookie) cookie).getSameSite()).isEqualTo("Lax"); <ide> } <ide> <add> @Test // gh-25501 <add> void resetResetsCharset() { <add> assertThat(response.isCharset()).isFalse(); <add> response.setCharacterEncoding("UTF-8"); <add> assertThat(response.isCharset()).isTrue(); <add> assertThat(response.getCharacterEncoding()).isEqualTo("UTF-8"); <add> response.setContentType("text/plain"); <add> assertThat(response.getContentType()).isEqualTo("text/plain"); <add> String contentTypeHeader = response.getHeader(CONTENT_TYPE); <add> assertThat(contentTypeHeader).isEqualTo("text/plain;charset=UTF-8"); <add> <add> response.reset(); <add> <add> assertThat(response.isCharset()).isFalse(); <add> // Do not invoke setCharacterEncoding() since that sets the charset flag to true. <add> // response.setCharacterEncoding("UTF-8"); <add> response.setContentType("text/plain"); <add> assertThat(response.isCharset()).isFalse(); // should still be false <add> assertThat(response.getContentType()).isEqualTo("text/plain"); <add> contentTypeHeader = response.getHeader(CONTENT_TYPE); <add> assertThat(contentTypeHeader).isEqualTo("text/plain"); <add> } <add> <ide> } <ide><path>spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java <ide> public boolean isCommitted() { <ide> public void reset() { <ide> resetBuffer(); <ide> this.characterEncoding = null; <add> this.charset = false; <ide> this.contentLength = 0; <ide> this.contentType = null; <ide> this.locale = Locale.getDefault();
3
Text
Text
fix readme conflict
40290f85c356ba720e4415a2cf6e219d0eae0e87
<ide><path>readme.md <ide> Then run `now` and enjoy! <ide> <ide> Next.js can be deployed to other hosting solutions too. Please have a look at the ['Deployment'](https://github.com/zeit/next.js/wiki/Deployment) section of the wiki. <ide> <del><<<<<<< HEAD <del>Note: we recommend putting `.next`, or your custom dist folder (you can set a custom folder in ['Custom Config'](https://github.com/zeit/next.js#custom-configuration)), in `.npmignore` or `.gitignore`. Otherwise, use `files` or `now.files` to opt-into a whitelist of files you want to deploy (and obviously exclude `.next` or your custom dist folder) <del>======= <ide> Note: we recommend putting `.next`, or your custom dist folder (Please have a look at ['Custom Config'](https://github.com/zeit/next.js#custom-configuration). You can set a custom folder in config, `.npmignore`, or `.gitignore`. Otherwise, use `files` or `now.files` to opt-into a whitelist of files you want to deploy (and obviously exclude `.next` or your custom dist folder). <del>>>>>>>> 0ec33c8ccdf8e55f6fedd64d7d358b030527813c <ide> <ide> ## Static HTML export <ide>
1
Ruby
Ruby
add advice about keychain credentials
8aaa95ee993187f763b0953d3720b5f6308472d3
<ide><path>Library/Homebrew/utils.rb <ide> def initialize(reset, error) <ide> GitHub #{error} <ide> Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token: <ide> #{Tty.em}https://github.com/settings/tokens/new?scopes=&description=Homebrew#{Tty.reset} <del> and then set the token as: HOMEBREW_GITHUB_API_TOKEN <add> and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token" <ide> EOS <ide> end <ide> <ide> def pretty_ratelimit_reset(reset) <ide> <ide> class AuthenticationFailedError < Error <ide> def initialize(error) <del> super <<-EOS.undent <del> GitHub #{error} <del> HOMEBREW_GITHUB_API_TOKEN may be invalid or expired, check: <add> message = "GitHub #{error}\n" <add> if ENV["HOMEBREW_GITHUB_API_TOKEN"] <add> message << <<-EOS.undent <add> HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check: <ide> #{Tty.em}https://github.com/settings/tokens#{Tty.reset} <del> EOS <add> EOS <add> else <add> message << <<-EOS.undent <add> The GitHub credentials in the OS X keychain are invalid. <add> Clear them with: <add> printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase <add> EOS <add> end <add> super message <ide> end <ide> end <ide>
1
Text
Text
remove unused links from docs
d5c34aa8130164ecf07a786668a1272ddcf483af
<ide><path>docs/api-guide/authentication.md <ide> HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a <ide> [http401]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2 <ide> [http403]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4 <ide> [basicauth]: http://tools.ietf.org/html/rfc2617 <del>[oauth]: http://oauth.net/2/ <ide> [permission]: permissions.md <ide> [throttling]: throttling.md <ide> [csrf-ajax]: https://docs.djangoproject.com/en/stable/ref/csrf/#ajax <ide> HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a <ide> [juanriaza]: https://github.com/juanriaza <ide> [djangorestframework-digestauth]: https://github.com/juanriaza/django-rest-framework-digestauth <ide> [oauth-1.0a]: http://oauth.net/core/1.0a <del>[django-oauth-plus]: http://code.larlet.fr/django-oauth-plus <del>[django-oauth2-provider]: https://github.com/caffeinehit/django-oauth2-provider <del>[django-oauth2-provider-docs]: https://django-oauth2-provider.readthedocs.io/en/latest/ <del>[rfc6749]: http://tools.ietf.org/html/rfc6749 <ide> [django-oauth-toolkit]: https://github.com/evonove/django-oauth-toolkit <ide> [evonove]: https://github.com/evonove/ <ide> [oauthlib]: https://github.com/idan/oauthlib <ide><path>docs/api-guide/caching.md <ide> class PostView(APIView): <ide> **NOTE:** The [`cache_page`][page] decorator only caches the <ide> `GET` and `HEAD` responses with status 200. <ide> <del> <del>[django]: https://docs.djangoproject.com/en/dev/topics/cache/ <ide> [page]: https://docs.djangoproject.com/en/dev/topics/cache/#the-per-view-cache <ide> [cookie]: https://docs.djangoproject.com/en/dev/topics/http/decorators/#django.views.decorators.vary.vary_on_cookie <ide> [decorator]: https://docs.djangoproject.com/en/dev/topics/class-based-views/intro/#decorating-the-class <ide><path>docs/api-guide/fields.md <ide> The [django-rest-framework-hstore][django-rest-framework-hstore] package provide <ide> [cite]: https://docs.djangoproject.com/en/stable/ref/forms/api/#django.forms.Form.cleaned_data <ide> [html-and-forms]: ../topics/html-and-forms.md <ide> [FILE_UPLOAD_HANDLERS]: https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-FILE_UPLOAD_HANDLERS <del>[ecma262]: http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.15 <ide> [strftime]: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior <del>[django-widgets]: https://docs.djangoproject.com/en/stable/ref/forms/widgets/ <ide> [iso8601]: http://www.w3.org/TR/NOTE-datetime <ide> [drf-compound-fields]: https://drf-compound-fields.readthedocs.io <ide> [drf-extra-fields]: https://github.com/Hipo/drf-extra-fields <ide><path>docs/api-guide/filtering.md <ide> The [djangorestframework-word-filter][django-rest-framework-word-search-filter] <ide> [drf-url-filter][drf-url-filter] is a simple Django app to apply filters on drf `ModelViewSet`'s `Queryset` in a clean, simple and configurable way. It also supports validations on incoming query params and their values. A beautiful python package `Voluptuous` is being used for validations on the incoming query parameters. The best part about voluptuous is you can define your own validations as per your query params requirements. <ide> <ide> [cite]: https://docs.djangoproject.com/en/stable/topics/db/queries/#retrieving-specific-objects-with-filters <del>[django-filter]: https://github.com/alex/django-filter <ide> [django-filter-docs]: https://django-filter.readthedocs.io/en/latest/index.html <ide> [django-filter-drf-docs]: https://django-filter.readthedocs.io/en/latest/guide/rest_framework.html <ide> [guardian]: https://django-guardian.readthedocs.io/ <ide> [view-permissions]: https://django-guardian.readthedocs.io/en/latest/userguide/assign.html <ide> [view-permissions-blogpost]: http://blog.nyaruka.com/adding-a-view-permission-to-django-models <del>[nullbooleanselect]: https://github.com/django/django/blob/master/django/forms/widgets.py <ide> [search-django-admin]: https://docs.djangoproject.com/en/stable/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields <ide> [django-rest-framework-filters]: https://github.com/philipn/django-rest-framework-filters <ide> [django-rest-framework-word-search-filter]: https://github.com/trollknurr/django-rest-framework-word-search-filter <ide><path>docs/api-guide/pagination.md <ide> The [`drf-proxy-pagination` package][drf-proxy-pagination] includes a `ProxyPagi <ide> The [`django-rest-framework-link-header-pagination` package][drf-link-header-pagination] includes a `LinkHeaderPagination` class which provides pagination via an HTTP `Link` header as desribed in [Github's developer documentation](github-link-pagination). <ide> <ide> [cite]: https://docs.djangoproject.com/en/stable/topics/pagination/ <del>[github-link-pagination]: https://developer.github.com/guides/traversing-with-pagination/ <ide> [link-header]: ../img/link-header-pagination.png <ide> [drf-extensions]: http://chibisov.github.io/drf-extensions/docs/ <ide> [paginate-by-max-mixin]: http://chibisov.github.io/drf-extensions/docs/#paginatebymaxmixin <ide><path>docs/api-guide/permissions.md <ide> The [Django Rest Framework API Key][django-rest-framework-api-key] package allow <ide> [contribauth]: https://docs.djangoproject.com/en/stable/topics/auth/customizing/#custom-permissions <ide> [objectpermissions]: https://docs.djangoproject.com/en/stable/topics/auth/customizing/#handling-object-permissions <ide> [guardian]: https://github.com/lukaszb/django-guardian <del>[get_objects_for_user]: http://pythonhosted.org/django-guardian/api/guardian.shortcuts.html#get-objects-for-user <del>[2.2-announcement]: ../topics/2.2-announcement.md <ide> [filtering]: filtering.md <del>[drf-any-permissions]: https://github.com/kevin-brown/drf-any-permissions <ide> [composed-permissions]: https://github.com/niwibe/djangorestframework-composed-permissions <ide> [rest-condition]: https://github.com/caxap/rest_condition <ide> [dry-rest-permissions]: https://github.com/Helioscene/dry-rest-permissions <ide><path>docs/api-guide/relations.md <ide> The [rest-framework-generic-relations][drf-nested-relations] library provides re <ide> [reverse-relationships]: https://docs.djangoproject.com/en/stable/topics/db/queries/#following-relationships-backward <ide> [routers]: http://www.django-rest-framework.org/api-guide/routers#defaultrouter <ide> [generic-relations]: https://docs.djangoproject.com/en/stable/ref/contrib/contenttypes/#id1 <del>[2.2-announcement]: ../topics/2.2-announcement.md <ide> [drf-nested-routers]: https://github.com/alanjds/drf-nested-routers <ide> [drf-nested-relations]: https://github.com/Ian-Foote/rest-framework-generic-relations <ide><path>docs/index.md <ide> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <ide> [django-filter]: http://pypi.python.org/pypi/django-filter <ide> [django-crispy-forms]: https://github.com/maraujop/django-crispy-forms <ide> [django-guardian]: https://github.com/django-guardian/django-guardian <del>[0.4]: https://github.com/encode/django-rest-framework/tree/0.4.X <del>[image]: img/quickstart.png <ide> [index]: . <ide> [oauth1-section]: api-guide/authentication/#django-rest-framework-oauth <ide> [oauth2-section]: api-guide/authentication/#django-oauth-toolkit <ide> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <ide> [release-notes]: topics/release-notes.md <ide> [jobs]: topics/jobs.md <ide> <del>[tox]: http://testrun.org/tox/latest/ <del> <ide> [group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework <ide> [botbot]: https://botbot.me/freenode/restframework/ <ide> [stack-overflow]: http://stackoverflow.com/ <ide> [django-rest-framework-tag]: http://stackoverflow.com/questions/tagged/django-rest-framework <del>[django-tag]: http://stackoverflow.com/questions/tagged/django <ide> [security-mail]: mailto:rest-framework-security@googlegroups.com <del>[paid-support]: http://dabapps.com/services/build/api-development/ <del>[dabapps]: http://dabapps.com <del>[contact-dabapps]: http://dabapps.com/contact/ <ide> [twitter]: https://twitter.com/_tomchristie <ide><path>docs/topics/2.2-announcement.md <ide> From version 2.2 onwards, serializers with hyperlinked relationships *always* re <ide> [mailing-list]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework <ide> [django-rest-framework-docs]: https://github.com/marcgibbons/django-rest-framework-docs <ide> [marcgibbons]: https://github.com/marcgibbons/ <del>[issues]: https://github.com/encode/django-rest-framework/issues <ide> [564]: https://github.com/encode/django-rest-framework/issues/564 <ide><path>docs/topics/browsable-api.md <ide> There are [a variety of packages for autocomplete widgets][autocomplete-packages <ide> [bootstrap]: http://getbootstrap.com <ide> [cerulean]: ../img/cerulean.png <ide> [slate]: ../img/slate.png <del>[bcustomize]: http://getbootstrap.com/2.3.2/customize.html <ide> [bswatch]: http://bootswatch.com/ <ide> [bcomponents]: http://getbootstrap.com/2.3.2/components.html <ide> [bcomponentsnav]: http://getbootstrap.com/2.3.2/components.html#navbar <ide> [autocomplete-packages]: https://www.djangopackages.com/grids/g/auto-complete/ <ide> [django-autocomplete-light]: https://github.com/yourlabs/django-autocomplete-light <del>[django-autocomplete-light-install]: https://django-autocomplete-light.readthedocs.io/en/master/install.html <ide><path>docs/topics/internationalization.md <ide> For API clients the most appropriate of these will typically be to use the `Acce <ide> [django-language-preference]: https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#how-django-discovers-language-preference <ide> [django-locale-paths]: https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-LOCALE_PATHS <ide> [django-locale-name]: https://docs.djangoproject.com/en/1.7/topics/i18n/#term-locale-name <del>[contributing]: ../../CONTRIBUTING.md <ide><path>docs/topics/release-notes.md <ide> For older release notes, [please see the version 2.x documentation][old-release- <ide> [cite]: http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/ar01s04.html <ide> [deprecation-policy]: #deprecation-policy <ide> [django-deprecation-policy]: https://docs.djangoproject.com/en/stable/internals/release-process/#internal-release-deprecation-policy <del>[defusedxml-announce]: http://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html <del>[743]: https://github.com/encode/django-rest-framework/pull/743 <del>[staticfiles14]: https://docs.djangoproject.com/en/1.4/howto/static-files/#with-a-template-tag <del>[staticfiles13]: https://docs.djangoproject.com/en/1.3/howto/static-files/#with-a-template-tag <del>[2.1.0-notes]: https://groups.google.com/d/topic/django-rest-framework/Vv2M0CMY9bg/discussion <del>[ticket-582]: https://github.com/encode/django-rest-framework/issues/582 <del>[rfc-6266]: http://tools.ietf.org/html/rfc6266#section-4.3 <ide> [old-release-notes]: https://github.com/encode/django-rest-framework/blob/version-2.4.x/docs/topics/release-notes.md <ide> [3.6-release]: 3.6-announcement.md <ide> <ide> For older release notes, [please see the version 2.x documentation][old-release- <ide> [gh3249]: https://github.com/encode/django-rest-framework/issues/3249 <ide> [gh3250]: https://github.com/encode/django-rest-framework/issues/3250 <ide> [gh3275]: https://github.com/encode/django-rest-framework/issues/3275 <del>[gh3288]: https://github.com/encode/django-rest-framework/issues/3288 <ide> [gh3290]: https://github.com/encode/django-rest-framework/issues/3290 <ide> [gh3303]: https://github.com/encode/django-rest-framework/issues/3303 <ide> [gh3313]: https://github.com/encode/django-rest-framework/issues/3313 <ide> For older release notes, [please see the version 2.x documentation][old-release- <ide> <ide> <!-- 3.4.4 --> <ide> <del>[gh2829]: https://github.com/encode/django-rest-framework/issues/2829 <ide> [gh3329]: https://github.com/encode/django-rest-framework/issues/3329 <ide> [gh3330]: https://github.com/encode/django-rest-framework/issues/3330 <ide> [gh3365]: https://github.com/encode/django-rest-framework/issues/3365 <ide> For older release notes, [please see the version 2.x documentation][old-release- <ide> [gh5457]: https://github.com/encode/django-rest-framework/issues/5457 <ide> [gh5376]: https://github.com/encode/django-rest-framework/issues/5376 <ide> [gh5422]: https://github.com/encode/django-rest-framework/issues/5422 <del>[gh5408]: https://github.com/encode/django-rest-framework/issues/5408 <ide> [gh3732]: https://github.com/encode/django-rest-framework/issues/3732 <ide> [djangodocs-set-timezone]: https://docs.djangoproject.com/en/1.11/topics/i18n/timezones/#default-time-zone-and-current-time-zone <ide> [gh5273]: https://github.com/encode/django-rest-framework/issues/5273 <ide><path>docs/topics/rest-framework-2-announcement.md <ide> There's also a [live sandbox version of the tutorial API][sandbox] available for <ide> [quote2]: https://groups.google.com/d/msg/django-rest-framework/heRGHzG6BWQ/ooVURgpwVC0J <ide> [quote3]: https://groups.google.com/d/msg/django-rest-framework/flsXbvYqRoY/9lSyntOf5cUJ <ide> [image]: ../img/quickstart.png <del>[readthedocs]: https://readthedocs.org/ <ide> [tut]: ../tutorial/1-serialization.md <ide> [sandbox]: http://restframework.herokuapp.com/ <ide><path>docs/topics/rest-hypermedia-hateoas.md <ide> What REST framework doesn't do is give you machine readable hypermedia formats s <ide> [restful-web-apis]: http://restfulwebapis.org/ <ide> [building-hypermedia-apis]: http://www.amazon.com/Building-Hypermedia-APIs-HTML5-Node/dp/1449306578 <ide> [designing-hypermedia-apis]: http://designinghypermediaapis.com/ <del>[restisover]: http://blog.steveklabnik.com/posts/2012-02-23-rest-is-over <ide> [readinglist]: http://blog.steveklabnik.com/posts/2012-02-27-hypermedia-api-reading-list <ide> [maturitymodel]: http://martinfowler.com/articles/richardsonMaturityModel.html <ide> <ide><path>docs/tutorial/quickstart.md <ide> Great, that was easy! <ide> <ide> If you want to get a more in depth understanding of how REST framework fits together head on over to [the tutorial][tutorial], or start browsing the [API guide][guide]. <ide> <del>[readme-example-api]: ../#example <ide> [image]: ../img/quickstart.png <ide> [tutorial]: 1-serialization.md <ide> [guide]: ../#api-guide
15
PHP
PHP
remove unneccesary elseif
817015e6b306bc9b39087d9ac911f9147a8917b3
<ide><path>lib/Cake/Model/Datasource/CakeSession.php <ide> protected static function _startSession() { <ide> if (empty($_SESSION)) { <ide> $_SESSION = array(); <ide> } <del> } elseif (!isset($_SESSION)) { <del> session_start(); <ide> } else { <ide> session_start(); <ide> }
1
Python
Python
add test for doc.char_span
c606b4a42c9f87caea01d8d4308924f00d3c5d10
<ide><path>spacy/tests/spans/test_span.py <ide> def test_spans_are_hashable(en_tokenizer): <ide> span3 = tokens[0:2] <ide> assert hash(span3) == hash(span1) <ide> <add> <add>def test_spans_by_character(doc): <add> span1 = doc[1:-2] <add> span2 = doc.char_span(span1.start_char, span1.end_char, label='GPE') <add> assert span1.start_char == span2.start_char <add> assert span1.end_char == span2.end_char <add> assert span2.label_ == 'GPE'
1
PHP
PHP
allow multi-dimentional arrays
5ce38d712d381cff62849b935c1bc3a701331d9e
<ide><path>src/Illuminate/Pagination/AbstractPaginator.php <ide> public function url($page) <ide> } <ide> <ide> return $this->path.'?' <del> .http_build_query($parameters, null, '&') <add> .url_decode(http_build_query($parameters, null, '&')) <ide> .$this->buildFragment(); <ide> } <ide>
1
Go
Go
update push and pull to registry 2.1 specification
0336b0cdaa74ac03003c4a933eb866fb0cec8125
<ide><path>graph/manifest.go <ide> package graph <ide> <ide> import ( <ide> "encoding/json" <add> "errors" <ide> "fmt" <ide> "io" <ide> "io/ioutil" <ide> func (s *TagStore) CmdManifest(job *engine.Job) engine.Status { <ide> } <ide> <ide> // Resolve the Repository name from fqn to endpoint + name <del> _, remoteName, err := registry.ResolveRepositoryName(name) <add> repoInfo, err := registry.ParseRepositoryInfo(name) <ide> if err != nil { <ide> return job.Error(err) <ide> } <ide> <add> manifestBytes, err := s.newManifest(name, repoInfo.RemoteName, tag) <add> if err != nil { <add> return job.Error(err) <add> } <add> <add> _, err = job.Stdout.Write(manifestBytes) <add> if err != nil { <add> return job.Error(err) <add> } <add> <add> return engine.StatusOK <add>} <add> <add>func (s *TagStore) newManifest(localName, remoteName, tag string) ([]byte, error) { <ide> manifest := &registry.ManifestData{ <ide> Name: remoteName, <ide> Tag: tag, <ide> SchemaVersion: 1, <ide> } <del> localRepo, exists := s.Repositories[name] <add> localRepo, exists := s.Repositories[localName] <ide> if !exists { <del> return job.Errorf("Repo does not exist: %s", name) <add> return nil, fmt.Errorf("Repo does not exist: %s", localName) <ide> } <ide> <ide> layerId, exists := localRepo[tag] <ide> if !exists { <del> return job.Errorf("Tag does not exist for %s: %s", name, tag) <add> return nil, fmt.Errorf("Tag does not exist for %s: %s", localName, tag) <ide> } <ide> layersSeen := make(map[string]bool) <ide> <ide> layer, err := s.graph.Get(layerId) <ide> if err != nil { <del> return job.Error(err) <add> return nil, err <ide> } <ide> if layer.Config == nil { <del> return job.Errorf("Missing layer configuration") <add> return nil, errors.New("Missing layer configuration") <ide> } <ide> manifest.Architecture = layer.Architecture <ide> manifest.FSLayers = make([]*registry.FSLayer, 0, 4) <ide> func (s *TagStore) CmdManifest(job *engine.Job) engine.Status { <ide> <ide> for ; layer != nil; layer, err = layer.GetParent() { <ide> if err != nil { <del> return job.Error(err) <add> return nil, err <ide> } <ide> <ide> if layersSeen[layer.ID] { <ide> func (s *TagStore) CmdManifest(job *engine.Job) engine.Status { <ide> if layer.Config != nil && metadata.Image != layer.ID { <ide> err = runconfig.Merge(&metadata, layer.Config) <ide> if err != nil { <del> return job.Error(err) <add> return nil, err <ide> } <ide> } <ide> <ide> archive, err := layer.TarLayer() <ide> if err != nil { <del> return job.Error(err) <add> return nil, err <ide> } <ide> <del> tarSum, err := tarsum.NewTarSum(archive, true, tarsum.VersionDev) <add> tarSum, err := tarsum.NewTarSum(archive, true, tarsum.Version1) <ide> if err != nil { <del> return job.Error(err) <add> return nil, err <ide> } <ide> if _, err := io.Copy(ioutil.Discard, tarSum); err != nil { <del> return job.Error(err) <add> return nil, err <ide> } <ide> <ide> tarId := tarSum.Sum(nil) <ide> func (s *TagStore) CmdManifest(job *engine.Job) engine.Status { <ide> layersSeen[layer.ID] = true <ide> jsonData, err := ioutil.ReadFile(path.Join(s.graph.Root, layer.ID, "json")) <ide> if err != nil { <del> return job.Error(fmt.Errorf("Cannot retrieve the path for {%s}: %s", layer.ID, err)) <add> return nil, fmt.Errorf("Cannot retrieve the path for {%s}: %s", layer.ID, err) <ide> } <ide> manifest.History = append(manifest.History, &registry.ManifestHistory{V1Compatibility: string(jsonData)}) <ide> } <ide> <ide> manifestBytes, err := json.MarshalIndent(manifest, "", " ") <ide> if err != nil { <del> return job.Error(err) <del> } <del> <del> _, err = job.Stdout.Write(manifestBytes) <del> if err != nil { <del> return job.Error(err) <add> return nil, err <ide> } <ide> <del> return engine.StatusOK <add> return manifestBytes, nil <ide> } <ide><path>graph/pull.go <ide> func (s *TagStore) CmdPull(job *engine.Job) engine.Status { <ide> return job.Errorf("error updating trust base graph: %s", err) <ide> } <ide> <del> if err := s.pullV2Repository(job.Eng, r, job.Stdout, repoInfo, tag, sf, job.GetenvBool("parallel")); err == nil { <add> auth, err := r.GetV2Authorization(repoInfo.RemoteName, true) <add> if err != nil { <add> return job.Errorf("error getting authorization: %s", err) <add> } <add> <add> if err := s.pullV2Repository(job.Eng, r, job.Stdout, repoInfo, tag, sf, job.GetenvBool("parallel"), auth); err == nil { <ide> if err = job.Eng.Job("log", "pull", logName, "").Run(); err != nil { <ide> log.Errorf("Error logging event 'pull' for %s: %s", logName, err) <ide> } <ide> type downloadInfo struct { <ide> err chan error <ide> } <ide> <del>func (s *TagStore) pullV2Repository(eng *engine.Engine, r *registry.Session, out io.Writer, repoInfo *registry.RepositoryInfo, tag string, sf *utils.StreamFormatter, parallel bool) error { <add>func (s *TagStore) pullV2Repository(eng *engine.Engine, r *registry.Session, out io.Writer, repoInfo *registry.RepositoryInfo, tag string, sf *utils.StreamFormatter, parallel bool, auth *registry.RequestAuthorization) error { <ide> var layersDownloaded bool <ide> if tag == "" { <ide> log.Debugf("Pulling tag list from V2 registry for %s", repoInfo.CanonicalName) <del> tags, err := r.GetV2RemoteTags(repoInfo.RemoteName, nil) <add> tags, err := r.GetV2RemoteTags(repoInfo.RemoteName, auth) <ide> if err != nil { <ide> return err <ide> } <ide> for _, t := range tags { <del> if downloaded, err := s.pullV2Tag(eng, r, out, repoInfo, t, sf, parallel); err != nil { <add> if downloaded, err := s.pullV2Tag(eng, r, out, repoInfo, t, sf, parallel, auth); err != nil { <ide> return err <ide> } else if downloaded { <ide> layersDownloaded = true <ide> } <ide> } <ide> } else { <del> if downloaded, err := s.pullV2Tag(eng, r, out, repoInfo, tag, sf, parallel); err != nil { <add> if downloaded, err := s.pullV2Tag(eng, r, out, repoInfo, tag, sf, parallel, auth); err != nil { <ide> return err <ide> } else if downloaded { <ide> layersDownloaded = true <ide> func (s *TagStore) pullV2Repository(eng *engine.Engine, r *registry.Session, out <ide> return nil <ide> } <ide> <del>func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Writer, repoInfo *registry.RepositoryInfo, tag string, sf *utils.StreamFormatter, parallel bool) (bool, error) { <add>func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Writer, repoInfo *registry.RepositoryInfo, tag string, sf *utils.StreamFormatter, parallel bool, auth *registry.RequestAuthorization) (bool, error) { <ide> log.Debugf("Pulling tag from V2 registry: %q", tag) <del> manifestBytes, err := r.GetV2ImageManifest(repoInfo.RemoteName, tag, nil) <add> manifestBytes, err := r.GetV2ImageManifest(repoInfo.RemoteName, tag, auth) <ide> if err != nil { <ide> return false, err <ide> } <ide> func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri <ide> return err <ide> } <ide> <del> r, l, err := r.GetV2ImageBlobReader(repoInfo.RemoteName, sumType, checksum, nil) <add> r, l, err := r.GetV2ImageBlobReader(repoInfo.RemoteName, sumType, checksum, auth) <ide> if err != nil { <ide> return err <ide> } <ide><path>graph/push.go <ide> func (s *TagStore) CmdPush(job *engine.Job) engine.Status { <ide> return job.Error(err2) <ide> } <ide> <del> var isOfficial bool <del> if endpoint.String() == registry.IndexServerAddress() { <del> isOfficial = isOfficialName(remoteName) <del> if isOfficial && strings.IndexRune(remoteName, '/') == -1 { <del> remoteName = "library/" + remoteName <del> } <del> } <del> <ide> if len(tag) == 0 { <ide> tag = DEFAULTTAG <ide> } <del> if isOfficial || endpoint.Version == registry.APIVersion2 { <add> <add> if repoInfo.Official || endpoint.Version == registry.APIVersion2 { <ide> j := job.Eng.Job("trust_update_base") <ide> if err = j.Run(); err != nil { <ide> return job.Errorf("error updating trust base graph: %s", err) <ide> } <ide> <del> repoData, err := r.PushImageJSONIndex(remoteName, []*registry.ImgData{}, false, nil) <add> // Get authentication type <add> auth, err := r.GetV2Authorization(repoInfo.RemoteName, false) <ide> if err != nil { <del> return job.Error(err) <add> return job.Errorf("error getting authorization: %s", err) <add> } <add> <add> if len(manifestBytes) == 0 { <add> // TODO Create manifest and sign <ide> } <ide> <ide> // try via manifest <ide> func (s *TagStore) CmdPush(job *engine.Job) engine.Status { <ide> } <ide> <ide> // Call mount blob <del> exists, err := r.PostV2ImageMountBlob(remoteName, sumParts[0], manifestSum, repoData.Tokens) <add> exists, err := r.PostV2ImageMountBlob(repoInfo.RemoteName, sumParts[0], manifestSum, auth) <ide> if err != nil { <ide> job.Stdout.Write(sf.FormatProgress(utils.TruncateID(img.ID), "Image push failed", nil)) <ide> return job.Error(err) <ide> } <ide> if !exists { <del> _, err = r.PutV2ImageBlob(remoteName, sumParts[0], manifestSum, utils.ProgressReader(arch, int(img.Size), job.Stdout, sf, false, utils.TruncateID(img.ID), "Pushing"), repoData.Tokens) <add> err = r.PutV2ImageBlob(repoInfo.RemoteName, sumParts[0], manifestSum, utils.ProgressReader(arch, int(img.Size), job.Stdout, sf, false, utils.TruncateID(img.ID), "Pushing"), auth) <ide> if err != nil { <ide> job.Stdout.Write(sf.FormatProgress(utils.TruncateID(img.ID), "Image push failed", nil)) <ide> return job.Error(err) <ide> func (s *TagStore) CmdPush(job *engine.Job) engine.Status { <ide> } <ide> <ide> // push the manifest <del> err = r.PutV2ImageManifest(remoteName, tag, bytes.NewReader([]byte(manifestBytes)), repoData.Tokens) <add> err = r.PutV2ImageManifest(repoInfo.RemoteName, tag, bytes.NewReader([]byte(manifestBytes)), auth) <ide> if err != nil { <ide> return job.Error(err) <ide> } <ide> <ide> // done, no fallback to V1 <ide> return engine.StatusOK <del> } <add> } else { <ide> <del> if err != nil { <del> reposLen := 1 <del> if tag == "" { <del> reposLen = len(s.Repositories[repoInfo.LocalName]) <del> } <del> job.Stdout.Write(sf.FormatStatus("", "The push refers to a repository [%s] (len: %d)", repoInfo.CanonicalName, reposLen)) <del> // If it fails, try to get the repository <del> if localRepo, exists := s.Repositories[repoInfo.LocalName]; exists { <del> if err := s.pushRepository(r, job.Stdout, repoInfo, localRepo, tag, sf); err != nil { <del> return job.Error(err) <add> if err != nil { <add> reposLen := 1 <add> if tag == "" { <add> reposLen = len(s.Repositories[repoInfo.LocalName]) <add> } <add> job.Stdout.Write(sf.FormatStatus("", "The push refers to a repository [%s] (len: %d)", repoInfo.CanonicalName, reposLen)) <add> // If it fails, try to get the repository <add> if localRepo, exists := s.Repositories[repoInfo.LocalName]; exists { <add> if err := s.pushRepository(r, job.Stdout, repoInfo, localRepo, tag, sf); err != nil { <add> return job.Error(err) <add> } <add> return engine.StatusOK <ide> } <del> return engine.StatusOK <add> return job.Error(err) <ide> } <del> return job.Error(err) <del> } <ide> <del> var token []string <del> job.Stdout.Write(sf.FormatStatus("", "The push refers to an image: [%s]", repoInfo.CanonicalName)) <del> if _, err := s.pushImage(r, job.Stdout, img.ID, endpoint.String(), token, sf); err != nil { <del> return job.Error(err) <add> var token []string <add> job.Stdout.Write(sf.FormatStatus("", "The push refers to an image: [%s]", repoInfo.CanonicalName)) <add> if _, err := s.pushImage(r, job.Stdout, img.ID, endpoint.String(), token, sf); err != nil { <add> return job.Error(err) <add> } <add> return engine.StatusOK <ide> } <del> return engine.StatusOK <ide> } <ide><path>registry/auth.go <ide> type ConfigFile struct { <ide> rootPath string <ide> } <ide> <add>type RequestAuthorization struct { <add> Token string <add> Username string <add> Password string <add>} <add> <add>func NewRequestAuthorization(authConfig *AuthConfig, registryEndpoint *Endpoint, resource, scope string, actions []string) (*RequestAuthorization, error) { <add> var auth RequestAuthorization <add> <add> client := &http.Client{ <add> Transport: &http.Transport{ <add> DisableKeepAlives: true, <add> Proxy: http.ProxyFromEnvironment, <add> }, <add> CheckRedirect: AddRequiredHeadersToRedirectedRequests, <add> } <add> factory := HTTPRequestFactory(nil) <add> <add> for _, challenge := range registryEndpoint.AuthChallenges { <add> log.Debugf("Using %q auth challenge with params %s for %s", challenge.Scheme, challenge.Parameters, authConfig.Username) <add> <add> switch strings.ToLower(challenge.Scheme) { <add> case "basic": <add> auth.Username = authConfig.Username <add> auth.Password = authConfig.Password <add> case "bearer": <add> params := map[string]string{} <add> for k, v := range challenge.Parameters { <add> params[k] = v <add> } <add> params["scope"] = fmt.Sprintf("%s:%s:%s", resource, scope, strings.Join(actions, ",")) <add> token, err := getToken(authConfig.Username, authConfig.Password, params, registryEndpoint, client, factory) <add> if err != nil { <add> return nil, err <add> } <add> <add> auth.Token = token <add> default: <add> log.Infof("Unsupported auth scheme: %q", challenge.Scheme) <add> } <add> } <add> <add> return &auth, nil <add>} <add> <add>func (auth *RequestAuthorization) Authorize(req *http.Request) { <add> if auth.Token != "" { <add> req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", auth.Token)) <add> } else if auth.Username != "" && auth.Password != "" { <add> req.SetBasicAuth(auth.Username, auth.Password) <add> } <add>} <add> <ide> // create a base64 encoded auth string to store in config <ide> func encodeAuth(authConfig *AuthConfig) string { <ide> authStr := authConfig.Username + ":" + authConfig.Password <ide><path>registry/session_v2.go <ide> import ( <ide> "strconv" <ide> <ide> log "github.com/Sirupsen/logrus" <add> "github.com/docker/docker/registry/v2" <ide> "github.com/docker/docker/utils" <del> "github.com/gorilla/mux" <ide> ) <ide> <del>func newV2RegistryRouter() *mux.Router { <del> router := mux.NewRouter() <add>var registryURLBuilder *v2.URLBuilder <ide> <del> v2Router := router.PathPrefix("/v2/").Subrouter() <del> <del> // Version Info <del> v2Router.Path("/version").Name("version") <del> <del> // Image Manifests <del> v2Router.Path("/manifest/{imagename:[a-z0-9-._/]+}/{tagname:[a-zA-Z0-9-._]+}").Name("manifests") <del> <del> // List Image Tags <del> v2Router.Path("/tags/{imagename:[a-z0-9-._/]+}").Name("tags") <del> <del> // Download a blob <del> v2Router.Path("/blob/{imagename:[a-z0-9-._/]+}/{sumtype:[a-z0-9._+-]+}/{sum:[a-fA-F0-9]{4,}}").Name("downloadBlob") <del> <del> // Upload a blob <del> v2Router.Path("/blob/{imagename:[a-z0-9-._/]+}/{sumtype:[a-z0-9._+-]+}").Name("uploadBlob") <del> <del> // Mounting a blob in an image <del> v2Router.Path("/blob/{imagename:[a-z0-9-._/]+}/{sumtype:[a-z0-9._+-]+}/{sum:[a-fA-F0-9]{4,}}").Name("mountBlob") <del> <del> return router <del>} <del> <del>// APIVersion2 /v2/ <del>var v2HTTPRoutes = newV2RegistryRouter() <del> <del>func getV2URL(e *Endpoint, routeName string, vars map[string]string) (*url.URL, error) { <del> route := v2HTTPRoutes.Get(routeName) <del> if route == nil { <del> return nil, fmt.Errorf("unknown regisry v2 route name: %q", routeName) <del> } <del> <del> varReplace := make([]string, 0, len(vars)*2) <del> for key, val := range vars { <del> varReplace = append(varReplace, key, val) <del> } <del> <del> routePath, err := route.URLPath(varReplace...) <del> if err != nil { <del> return nil, fmt.Errorf("unable to make registry route %q with vars %v: %s", routeName, vars, err) <del> } <add>func init() { <ide> u, err := url.Parse(REGISTRYSERVER) <ide> if err != nil { <del> return nil, fmt.Errorf("invalid registry url: %s", err) <add> panic(fmt.Errorf("invalid registry url: %s", err)) <ide> } <del> <del> return &url.URL{ <del> Scheme: u.Scheme, <del> Host: u.Host, <del> Path: routePath.Path, <del> }, nil <add> registryURLBuilder = v2.NewURLBuilder(u) <ide> } <ide> <del>// V2 Provenance POC <del> <del>func (r *Session) GetV2Version(token []string) (*RegistryInfo, error) { <del> routeURL, err := getV2URL(r.indexEndpoint, "version", nil) <del> if err != nil { <del> return nil, err <del> } <del> <del> method := "GET" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <del> <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), nil) <del> if err != nil { <del> return nil, err <del> } <del> setTokenAuth(req, token) <del> res, _, err := r.doRequest(req) <del> if err != nil { <del> return nil, err <del> } <del> defer res.Body.Close() <del> if res.StatusCode != 200 { <del> return nil, utils.NewHTTPRequestError(fmt.Sprintf("Server error: %d fetching Version", res.StatusCode), res) <del> } <del> <del> decoder := json.NewDecoder(res.Body) <del> versionInfo := new(RegistryInfo) <add>func getV2Builder(e *Endpoint) *v2.URLBuilder { <add> return registryURLBuilder <add>} <ide> <del> err = decoder.Decode(versionInfo) <del> if err != nil { <del> return nil, fmt.Errorf("unable to decode GetV2Version JSON response: %s", err) <add>// GetV2Authorization gets the authorization needed to the given image <add>// If readonly access is requested, then only the authorization may <add>// only be used for Get operations. <add>func (r *Session) GetV2Authorization(imageName string, readOnly bool) (*RequestAuthorization, error) { <add> scopes := []string{"pull"} <add> if !readOnly { <add> scopes = append(scopes, "push") <ide> } <ide> <del> return versionInfo, nil <add> return NewRequestAuthorization(r.GetAuthConfig(true), r.indexEndpoint, "repository", imageName, scopes) <ide> } <ide> <ide> // <ide> func (r *Session) GetV2Version(token []string) (*RegistryInfo, error) { <ide> // 1.c) if anything else, err <ide> // 2) PUT the created/signed manifest <ide> // <del>func (r *Session) GetV2ImageManifest(imageName, tagName string, token []string) ([]byte, error) { <del> vars := map[string]string{ <del> "imagename": imageName, <del> "tagname": tagName, <del> } <del> <del> routeURL, err := getV2URL(r.indexEndpoint, "manifests", vars) <add>func (r *Session) GetV2ImageManifest(imageName, tagName string, auth *RequestAuthorization) ([]byte, error) { <add> routeURL, err := getV2Builder(r.indexEndpoint).BuildManifestURL(imageName, tagName) <ide> if err != nil { <ide> return nil, err <ide> } <ide> <ide> method := "GET" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <add> log.Debugf("[registry] Calling %q %s", method, routeURL) <ide> <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), nil) <add> req, err := r.reqFactory.NewRequest(method, routeURL, nil) <ide> if err != nil { <ide> return nil, err <ide> } <del> setTokenAuth(req, token) <add> auth.Authorize(req) <ide> res, _, err := r.doRequest(req) <ide> if err != nil { <ide> return nil, err <ide> func (r *Session) GetV2ImageManifest(imageName, tagName string, token []string) <ide> // - Succeeded to mount for this image scope <ide> // - Failed with no error (So continue to Push the Blob) <ide> // - Failed with error <del>func (r *Session) PostV2ImageMountBlob(imageName, sumType, sum string, token []string) (bool, error) { <del> vars := map[string]string{ <del> "imagename": imageName, <del> "sumtype": sumType, <del> "sum": sum, <del> } <del> <del> routeURL, err := getV2URL(r.indexEndpoint, "mountBlob", vars) <add>func (r *Session) PostV2ImageMountBlob(imageName, sumType, sum string, auth *RequestAuthorization) (bool, error) { <add> routeURL, err := getV2Builder(r.indexEndpoint).BuildBlobURL(imageName, sumType+":"+sum) <ide> if err != nil { <ide> return false, err <ide> } <ide> <del> method := "POST" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <add> method := "HEAD" <add> log.Debugf("[registry] Calling %q %s", method, routeURL) <ide> <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), nil) <add> req, err := r.reqFactory.NewRequest(method, routeURL, nil) <ide> if err != nil { <ide> return false, err <ide> } <del> setTokenAuth(req, token) <add> auth.Authorize(req) <ide> res, _, err := r.doRequest(req) <ide> if err != nil { <ide> return false, err <ide> func (r *Session) PostV2ImageMountBlob(imageName, sumType, sum string, token []s <ide> return false, fmt.Errorf("Failed to mount %q - %s:%s : %d", imageName, sumType, sum, res.StatusCode) <ide> } <ide> <del>func (r *Session) GetV2ImageBlob(imageName, sumType, sum string, blobWrtr io.Writer, token []string) error { <del> vars := map[string]string{ <del> "imagename": imageName, <del> "sumtype": sumType, <del> "sum": sum, <del> } <del> <del> routeURL, err := getV2URL(r.indexEndpoint, "downloadBlob", vars) <add>func (r *Session) GetV2ImageBlob(imageName, sumType, sum string, blobWrtr io.Writer, auth *RequestAuthorization) error { <add> routeURL, err := getV2Builder(r.indexEndpoint).BuildBlobURL(imageName, sumType+":"+sum) <ide> if err != nil { <ide> return err <ide> } <ide> <ide> method := "GET" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), nil) <add> log.Debugf("[registry] Calling %q %s", method, routeURL) <add> req, err := r.reqFactory.NewRequest(method, routeURL, nil) <ide> if err != nil { <ide> return err <ide> } <del> setTokenAuth(req, token) <add> auth.Authorize(req) <ide> res, _, err := r.doRequest(req) <ide> if err != nil { <ide> return err <ide> func (r *Session) GetV2ImageBlob(imageName, sumType, sum string, blobWrtr io.Wri <ide> return err <ide> } <ide> <del>func (r *Session) GetV2ImageBlobReader(imageName, sumType, sum string, token []string) (io.ReadCloser, int64, error) { <del> vars := map[string]string{ <del> "imagename": imageName, <del> "sumtype": sumType, <del> "sum": sum, <del> } <del> <del> routeURL, err := getV2URL(r.indexEndpoint, "downloadBlob", vars) <add>func (r *Session) GetV2ImageBlobReader(imageName, sumType, sum string, auth *RequestAuthorization) (io.ReadCloser, int64, error) { <add> routeURL, err := getV2Builder(r.indexEndpoint).BuildBlobURL(imageName, sumType+":"+sum) <ide> if err != nil { <ide> return nil, 0, err <ide> } <ide> <ide> method := "GET" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), nil) <add> log.Debugf("[registry] Calling %q %s", method, routeURL) <add> req, err := r.reqFactory.NewRequest(method, routeURL, nil) <ide> if err != nil { <ide> return nil, 0, err <ide> } <del> setTokenAuth(req, token) <add> auth.Authorize(req) <ide> res, _, err := r.doRequest(req) <ide> if err != nil { <ide> return nil, 0, err <ide> func (r *Session) GetV2ImageBlobReader(imageName, sumType, sum string, token []s <ide> // Push the image to the server for storage. <ide> // 'layer' is an uncompressed reader of the blob to be pushed. <ide> // The server will generate it's own checksum calculation. <del>func (r *Session) PutV2ImageBlob(imageName, sumType, sumStr string, blobRdr io.Reader, token []string) (serverChecksum string, err error) { <del> vars := map[string]string{ <del> "imagename": imageName, <del> "sumtype": sumType, <add>func (r *Session) PutV2ImageBlob(imageName, sumType, sumStr string, blobRdr io.Reader, auth *RequestAuthorization) error { <add> routeURL, err := getV2Builder(r.indexEndpoint).BuildBlobUploadURL(imageName) <add> if err != nil { <add> return err <ide> } <ide> <del> routeURL, err := getV2URL(r.indexEndpoint, "uploadBlob", vars) <add> log.Debugf("[registry] Calling %q %s", "POST", routeURL) <add> req, err := r.reqFactory.NewRequest("POST", routeURL, nil) <ide> if err != nil { <del> return "", err <add> return err <ide> } <ide> <add> auth.Authorize(req) <add> res, _, err := r.doRequest(req) <add> if err != nil { <add> return err <add> } <add> location := res.Header.Get("Location") <add> <ide> method := "PUT" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), blobRdr) <add> log.Debugf("[registry] Calling %q %s", method, location) <add> req, err = r.reqFactory.NewRequest(method, location, blobRdr) <ide> if err != nil { <del> return "", err <add> return err <ide> } <del> setTokenAuth(req, token) <del> req.Header.Set("X-Tarsum", sumStr) <del> res, _, err := r.doRequest(req) <add> queryParams := url.Values{} <add> queryParams.Add("digest", sumType+":"+sumStr) <add> req.URL.RawQuery = queryParams.Encode() <add> auth.Authorize(req) <add> res, _, err = r.doRequest(req) <ide> if err != nil { <del> return "", err <add> return err <ide> } <ide> defer res.Body.Close() <add> <ide> if res.StatusCode != 201 { <ide> if res.StatusCode == 401 { <del> return "", errLoginRequired <add> return errLoginRequired <ide> } <del> return "", utils.NewHTTPRequestError(fmt.Sprintf("Server error: %d trying to push %s blob", res.StatusCode, imageName), res) <del> } <del> <del> type sumReturn struct { <del> Checksum string `json:"checksum"` <del> } <del> <del> decoder := json.NewDecoder(res.Body) <del> var sumInfo sumReturn <del> <del> err = decoder.Decode(&sumInfo) <del> if err != nil { <del> return "", fmt.Errorf("unable to decode PutV2ImageBlob JSON response: %s", err) <add> return utils.NewHTTPRequestError(fmt.Sprintf("Server error: %d trying to push %s blob", res.StatusCode, imageName), res) <ide> } <ide> <del> if sumInfo.Checksum != sumStr { <del> return "", fmt.Errorf("failed checksum comparison. serverChecksum: %q, localChecksum: %q", sumInfo.Checksum, sumStr) <del> } <del> <del> // XXX this is a json struct from the registry, with its checksum <del> return sumInfo.Checksum, nil <add> return nil <ide> } <ide> <ide> // Finally Push the (signed) manifest of the blobs we've just pushed <del>func (r *Session) PutV2ImageManifest(imageName, tagName string, manifestRdr io.Reader, token []string) error { <del> vars := map[string]string{ <del> "imagename": imageName, <del> "tagname": tagName, <del> } <del> <del> routeURL, err := getV2URL(r.indexEndpoint, "manifests", vars) <add>func (r *Session) PutV2ImageManifest(imageName, tagName string, manifestRdr io.Reader, auth *RequestAuthorization) error { <add> routeURL, err := getV2Builder(r.indexEndpoint).BuildManifestURL(imageName, tagName) <ide> if err != nil { <ide> return err <ide> } <ide> <ide> method := "PUT" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), manifestRdr) <add> log.Debugf("[registry] Calling %q %s", method, routeURL) <add> req, err := r.reqFactory.NewRequest(method, routeURL, manifestRdr) <ide> if err != nil { <ide> return err <ide> } <del> setTokenAuth(req, token) <add> auth.Authorize(req) <ide> res, _, err := r.doRequest(req) <ide> if err != nil { <ide> return err <ide> } <add> b, _ := ioutil.ReadAll(res.Body) <ide> res.Body.Close() <del> if res.StatusCode != 201 { <add> if res.StatusCode != 200 { <ide> if res.StatusCode == 401 { <ide> return errLoginRequired <ide> } <add> log.Debugf("Unexpected response from server: %q %#v", b, res.Header) <ide> return utils.NewHTTPRequestError(fmt.Sprintf("Server error: %d trying to push %s:%s manifest", res.StatusCode, imageName, tagName), res) <ide> } <ide> <ide> return nil <ide> } <ide> <ide> // Given a repository name, returns a json array of string tags <del>func (r *Session) GetV2RemoteTags(imageName string, token []string) ([]string, error) { <del> vars := map[string]string{ <del> "imagename": imageName, <del> } <del> <del> routeURL, err := getV2URL(r.indexEndpoint, "tags", vars) <add>func (r *Session) GetV2RemoteTags(imageName string, auth *RequestAuthorization) ([]string, error) { <add> routeURL, err := getV2Builder(r.indexEndpoint).BuildTagsURL(imageName) <ide> if err != nil { <ide> return nil, err <ide> } <ide> <ide> method := "GET" <del> log.Debugf("[registry] Calling %q %s", method, routeURL.String()) <add> log.Debugf("[registry] Calling %q %s", method, routeURL) <ide> <del> req, err := r.reqFactory.NewRequest(method, routeURL.String(), nil) <add> req, err := r.reqFactory.NewRequest(method, routeURL, nil) <ide> if err != nil { <ide> return nil, err <ide> } <del> setTokenAuth(req, token) <add> auth.Authorize(req) <ide> res, _, err := r.doRequest(req) <ide> if err != nil { <ide> return nil, err <ide><path>utils/jsonmessage.go <ide> func (p *JSONProgress) String() string { <ide> } <ide> total := units.HumanSize(float64(p.Total)) <ide> percentage := int(float64(p.Current)/float64(p.Total)*100) / 2 <add> if percentage > 50 { <add> percentage = 50 <add> } <ide> if width > 110 { <ide> // this number can't be negetive gh#7136 <ide> numSpaces := 0
6
Text
Text
use python -m for spacy validate
343fd2969d5c37799428f0b1fbc840667a2eb8a3
<ide><path>CONTRIBUTING.md <ide> even format them as Markdown to copy-paste into GitHub issues: <ide> * **Checking the model compatibility:** If you're having problems with a <ide> [statistical model](https://spacy.io/models), it may be because to the <ide> model is incompatible with your spaCy installation. In spaCy v2.0+, you can check <del>this on the command line by running `spacy validate`. <add>this on the command line by running `python -m spacy validate`. <ide> <ide> * **Sharing a model's output, like dependencies and entities:** spaCy v2.0+ <ide> comes with [built-in visualizers](https://spacy.io/usage/visualizers) that
1
Javascript
Javascript
fix tests after removed deprecations
cfab47a45d16da734e8fbcad77ee9636c1bc9d11
<ide><path>packages/@ember/-internals/glimmer/tests/integration/components/input-angle-test.js <ide> moduleFor( <ide> ['@test sends an action with `<Input @enter={{action "foo"}} />` when <enter> is pressed']( <ide> assert <ide> ) { <del> assert.expect(2); <add> assert.expect(1); <ide> <ide> this.render(`<Input @enter={{action 'foo'}} />`, { <ide> actions: { <ide> moduleFor( <ide> } <ide> <ide> ['@test sends `insert-newline` when <enter> is pressed'](assert) { <del> assert.expect(2); <add> assert.expect(1); <ide> <ide> this.render(`<Input @insert-newline={{action 'foo'}} />`, { <ide> actions: { <ide> moduleFor( <ide> ['@test sends an action with `<Input @escape-press={{action "foo"}} />` when <escape> is pressed']( <ide> assert <ide> ) { <del> assert.expect(2); <add> assert.expect(1); <ide> <ide> this.render(`<Input @escape-press={{action 'foo'}} />`, { <ide> actions: { <ide><path>packages/@ember/-internals/glimmer/tests/integration/components/input-curly-test.js <ide> moduleFor( <ide> ['@test sends an action with `{{input enter=(action "foo")}}` when <enter> is pressed']( <ide> assert <ide> ) { <del> assert.expect(2); <add> assert.expect(1); <ide> <ide> this.render(`{{input enter=(action 'foo')}}`, { <ide> actions: { <ide> moduleFor( <ide> } <ide> <ide> ['@test sends `insert-newline` when <enter> is pressed'](assert) { <del> assert.expect(2); <add> assert.expect(1); <ide> <ide> this.render(`{{input insert-newline=(action 'foo')}}`, { <ide> actions: { <ide> moduleFor( <ide> ['@test sends an action with `{{input escape-press=(action "foo")}}` when <escape> is pressed']( <ide> assert <ide> ) { <del> assert.expect(2); <add> assert.expect(1); <ide> <ide> this.render(`{{input escape-press=(action 'foo')}}`, { <ide> actions: {
2
Python
Python
fix an error in fmax docstring
6acf2969b5b35551dc3363881f4067c18052777a
<ide><path>numpy/core/code_generators/ufunc_docstrings.py <ide> def add_newdoc(place, name, doc): <ide> Returns <ide> ------- <ide> y : ndarray or scalar <del> The minimum of `x1` and `x2`, element-wise. Returns scalar if <add> The maximum of `x1` and `x2`, element-wise. Returns scalar if <ide> both `x1` and `x2` are scalars. <ide> <ide> See Also
1
Java
Java
fix touch target for views with z-index
6f092a4264591d543a1afca981b31ce0287d9b28
<ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.java <add>// Copyright 2004-present Facebook. All Rights Reserved. <add> <add>package com.facebook.react.uimanager; <add> <add>/** <add> * ViewGroup that supports z-index. <add> */ <add>public interface ReactZIndexedViewGroup { <add> /** <add> * Determine the index of a child view at {@param index} considering z-index. <add> * @param index The child view index <add> * @return The child view index considering z-index <add> */ <add> int getZIndexMappedChildIndex(int index); <add>} <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java <ide> private static View findClosestReactAncestor(View view) { <ide> */ <ide> private static View findTouchTargetView(float[] eventCoords, ViewGroup viewGroup) { <ide> int childrenCount = viewGroup.getChildCount(); <add> // Consider z-index when determining the touch target. <add> ReactZIndexedViewGroup zIndexedViewGroup = viewGroup instanceof ReactZIndexedViewGroup ? <add> (ReactZIndexedViewGroup) viewGroup : <add> null; <ide> for (int i = childrenCount - 1; i >= 0; i--) { <del> View child = viewGroup.getChildAt(i); <add> int childIndex = zIndexedViewGroup != null ? zIndexedViewGroup.getZIndexMappedChildIndex(i) : i; <add> View child = viewGroup.getChildAt(childIndex); <ide> PointF childPoint = mTempPoint; <ide> if (isTransformedTouchPointInView(eventCoords[0], eventCoords[1], viewGroup, child, childPoint)) { <ide> // If it is contained within the child View, the childPoint value will contain the view <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java <ide> import com.facebook.react.uimanager.ReactClippingViewGroup; <ide> import com.facebook.react.uimanager.ReactClippingViewGroupHelper; <ide> import com.facebook.react.uimanager.ReactPointerEventsView; <add>import com.facebook.react.uimanager.ReactZIndexedViewGroup; <ide> import com.facebook.react.uimanager.ViewGroupDrawingOrderHelper; <ide> <ide> /** <ide> * Backing for a React View. Has support for borders, but since borders aren't common, lazy <ide> * initializes most of the storage needed for them. <ide> */ <ide> public class ReactViewGroup extends ViewGroup implements <del> ReactInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView, ReactHitSlopView { <add> ReactInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView, ReactHitSlopView, <add> ReactZIndexedViewGroup { <ide> <ide> private static final int ARRAY_CAPACITY_INCREMENT = 12; <ide> private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT; <ide> protected int getChildDrawingOrder(int childCount, int index) { <ide> return mDrawingOrderHelper.getChildDrawingOrder(childCount, index); <ide> } <ide> <add> @Override <add> public int getZIndexMappedChildIndex(int index) { <add> if (mDrawingOrderHelper.shouldEnableCustomDrawingOrder()) { <add> return mDrawingOrderHelper.getChildDrawingOrder(getChildCount(), index); <add> } else { <add> return index; <add> } <add> } <add> <ide> @Override <ide> public PointerEvents getPointerEvents() { <ide> return mPointerEvents;
3
Go
Go
move testforbiddencontextpath to integration-cli
686786f107582c27c69a6f40655c8fc52a8e4d00
<ide><path>integration-cli/docker_cli_build_test.go <ide> func TestBuildEntrypointRunCleanup(t *testing.T) { <ide> } <ide> logDone("build - cleanup cmd after RUN") <ide> } <add> <add>func TestBuldForbiddenContextPath(t *testing.T) { <add> name := "testbuildforbidpath" <add> defer deleteImages(name) <add> ctx, err := fakeContext(`FROM scratch <add> ADD ../../ test/ <add> `, <add> map[string]string{ <add> "test.txt": "test1", <add> "other.txt": "other", <add> }) <add> <add> defer ctx.Close() <add> if err != nil { <add> t.Fatal(err) <add> } <add> if _, err := buildImageFromContext(name, ctx, true); err != nil { <add> if !strings.Contains(err.Error(), "Forbidden path outside the build context: ../../ (/)") { <add> t.Fatal("Wrong error, must be about forbidden ../../ path") <add> } <add> } else { <add> t.Fatal("Error must not be nil") <add> } <add> logDone("build - forbidden context path") <add>} <ide><path>integration/buildfile_test.go <ide> func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u <ide> return image, err <ide> } <ide> <del>func TestForbiddenContextPath(t *testing.T) { <del> eng := NewTestEngine(t) <del> defer nuke(mkDaemonFromEngine(eng, t)) <del> srv := mkServerFromEngine(eng, t) <del> <del> context := testContextTemplate{` <del> from {IMAGE} <del> maintainer dockerio <del> add ../../ test/ <del> `, <del> [][2]string{{"test.txt", "test1"}, {"other.txt", "other"}}, nil} <del> <del> httpServer, err := mkTestingFileServer(context.remoteFiles) <del> if err != nil { <del> t.Fatal(err) <del> } <del> defer httpServer.Close() <del> <del> idx := strings.LastIndex(httpServer.URL, ":") <del> if idx < 0 { <del> t.Fatalf("could not get port from test http server address %s", httpServer.URL) <del> } <del> port := httpServer.URL[idx+1:] <del> <del> iIP := eng.Hack_GetGlobalVar("httpapi.bridgeIP") <del> if iIP == nil { <del> t.Fatal("Legacy bridgeIP field not set in engine") <del> } <del> ip, ok := iIP.(net.IP) <del> if !ok { <del> panic("Legacy bridgeIP field in engine does not cast to net.IP") <del> } <del> dockerfile := constructDockerfile(context.dockerfile, ip, port) <del> <del> buildfile := server.NewBuildFile(srv, ioutil.Discard, ioutil.Discard, false, true, false, false, ioutil.Discard, utils.NewStreamFormatter(false), nil, nil) <del> _, err = buildfile.Build(context.Archive(dockerfile, t)) <del> <del> if err == nil { <del> t.Log("Error should not be nil") <del> t.Fail() <del> } <del> <del> if err.Error() != "Forbidden path outside the build context: ../../ (/)" { <del> t.Logf("Error message is not expected: %s", err.Error()) <del> t.Fail() <del> } <del>} <del> <ide> func TestBuildADDFileNotFound(t *testing.T) { <ide> eng := NewTestEngine(t) <ide> defer nuke(mkDaemonFromEngine(eng, t))
2
Ruby
Ruby
close our connection when we are done
16e4d013d8a264aed99deeba18d96a1ac541a715
<ide><path>activerecord/test/cases/scoping/default_scoping_test.rb <ide> def test_default_scope_with_conditions_hash <ide> <ide> def test_default_scoping_with_threads <ide> 2.times do <del> Thread.new { assert DeveloperOrderedBySalary.all.to_sql.include?('salary DESC') }.join <add> Thread.new { <add> assert DeveloperOrderedBySalary.all.to_sql.include?('salary DESC') <add> DeveloperOrderedBySalary.connection.close <add> }.join <ide> end <ide> end <ide> <ide> def test_default_scope_is_threadsafe <ide> threads << Thread.new do <ide> Thread.current[:long_default_scope] = true <ide> assert_equal 1, ThreadsafeDeveloper.all.to_a.count <add> ThreadsafeDeveloper.connection.close <ide> end <ide> threads << Thread.new do <ide> assert_equal 1, ThreadsafeDeveloper.all.to_a.count <add> ThreadsafeDeveloper.connection.close <ide> end <ide> threads.each(&:join) <ide> end <ide><path>activerecord/test/cases/transactions_test.rb <ide> class ConcurrentTransactionTest < TransactionTest <ide> # This will cause transactions to overlap and fail unless they are performed on <ide> # separate database connections. <ide> def test_transaction_per_thread <del> assert_nothing_raised do <del> threads = (1..3).map do <del> Thread.new do <del> Topic.transaction do <del> topic = Topic.find(1) <del> topic.approved = !topic.approved? <del> topic.save! <del> topic.approved = !topic.approved? <del> topic.save! <del> end <del> Topic.connection.close <add> threads = 3.times.map do <add> Thread.new do <add> Topic.transaction do <add> topic = Topic.find(1) <add> topic.approved = !topic.approved? <add> assert topic.save! <add> topic.approved = !topic.approved? <add> assert topic.save! <ide> end <add> Topic.connection.close <ide> end <del> <del> threads.each { |t| t.join } <ide> end <add> <add> threads.each { |t| t.join } <ide> end <ide> <ide> # Test for dirty reads among simultaneous transactions.
2
Javascript
Javascript
add sourcefilename for swc compiled core files
04bbea2cbe2e1f365c00bb95ef0b6f855f10ccdf
<ide><path>packages/next/taskfile-swc.js <ide> module.exports = function (task) { <ide> <ide> const swcOptions = isClient ? swcClientOptions : swcServerOptions <ide> <add> const filePath = path.join(file.dir, file.base) <add> const fullFilePath = path.join(__dirname, filePath) <add> const distFilePath = path.dirname(path.join(__dirname, 'dist', filePath)) <add> <ide> const options = { <ide> filename: path.join(file.dir, file.base), <ide> sourceMaps: true, <add> sourceFileName: path.relative(distFilePath, fullFilePath), <ide> <ide> ...swcOptions, <ide> }
1
Ruby
Ruby
fix duration check for longer sleep
66fda6b8949cde07966ab098125e1da7969e9468
<ide><path>activesupport/test/notifications_test.rb <ide> def test_nested_events_can_be_instrumented <ide> assert_equal 2, @events.size <ide> assert_equal :awesome, @events.last.name <ide> assert_equal Hash[:payload => "notifications"], @events.last.payload <del> assert_in_delta 100, @events.last.duration, 70 <add> assert_in_delta 1000, @events.last.duration, 70 <ide> end <ide> <ide> def test_event_is_pushed_even_if_block_fails
1
Ruby
Ruby
remove unused scp exception
774adaf43537c536ccdaaf0ffe0b208d737d44cc
<ide><path>Library/Homebrew/exceptions.rb <ide> def initialize(url) <ide> end <ide> end <ide> <del># Raised in {ScpDownloadStrategy#fetch}. <del>class ScpDownloadStrategyError < RuntimeError <del> def initialize(cause) <del> super "Download failed: #{cause}" <del> end <del>end <del> <ide> # Raised by {#safe_system} in `utils.rb`. <ide> class ErrorDuringExecution < RuntimeError <ide> attr_reader :cmd
1
Javascript
Javascript
add missing formcontroller extern definitions
1d5e18b062c3e33b2a8d96aa58d905ed2cd48649
<ide><path>closure/angular.js <ide> angular.NgModelController.prototype.$viewValue; <ide> */ <ide> angular.FormController = function() {}; <ide> <add>/** <add> * @param {*} control <add> */ <add>angular.FormController.prototype.$addControl = function(control) {}; <add> <ide> /** <ide> * @type {boolean} <ide> */ <ide> angular.FormController.prototype.$error; <ide> */ <ide> angular.FormController.prototype.$invalid; <ide> <add>/** <add> * @type {string} <add> */ <add>angular.FormController.prototype.$name; <add> <ide> /** <ide> * @type {boolean} <ide> */ <ide> angular.FormController.prototype.$pristine; <ide> <add>/** <add> * @param {*} control <add> */ <add>angular.FormController.prototype.$removeControl = function(control) {}; <add> <add>/** <add> * @type {function()} <add> */ <add>angular.FormController.prototype.$setDirty = function() {}; <add> <add>/** <add> * @type {function()} <add> */ <add>angular.FormController.prototype.$setPristine = function() {}; <add> <add>/** <add> * @param {string} validationToken <add> * @param {boolean} isValid <add> * @param {*} control <add> */ <add>angular.FormController.prototype.$setValidity = function( <add> validationToken, isValid, control) {}; <add> <ide> /** <ide> * @type {boolean} <ide> */
1
Javascript
Javascript
remove extra space
5eae4d03254f3fb6871cd40a5360381520b77495
<ide><path>packages/ember-views/lib/views/text_field.js <ide> @module ember <ide> @submodule ember-views <ide> */ <del>import { computed } from "ember-metal/computed"; <add>import { computed } from "ember-metal/computed"; <ide> import environment from "ember-metal/environment"; <ide> import create from "ember-metal/platform/create"; <ide> import Component from "ember-views/views/component";
1
Java
Java
add @functionalinterface to messagepostprocessor
6a7e58ac82e4e2c5e31031587da45428c1b46e89
<ide><path>spring-jms/src/main/java/org/springframework/jms/core/MessagePostProcessor.java <ide> * @see JmsTemplate#convertAndSend(javax.jms.Destination, Object, MessagePostProcessor) <ide> * @see org.springframework.jms.support.converter.MessageConverter <ide> */ <add>@FunctionalInterface <ide> public interface MessagePostProcessor { <ide> <ide> /** <ide><path>spring-messaging/src/main/java/org/springframework/messaging/core/MessagePostProcessor.java <ide> * @see MessageSendingOperations <ide> * @see MessageRequestReplyOperations <ide> */ <add>@FunctionalInterface <ide> public interface MessagePostProcessor { <ide> <ide> /**
2
Text
Text
add e-book `mastering software development in r`
8f285d07920a476a23bfe6fe0d8ee209bb3741c9
<ide><path>guide/english/r/index.md <ide> Now install it on your computer. For help in installation refer to reference sec <ide> * [Coursera -allows to audit course for free but certification is paid.](https://www.coursera.org/learn/r-programming) <ide> * [DataCamp -allows to complete the introductory part for free.](https://www.datacamp.com) <ide> * [R for Data Science -is a book which is available free to read online.](http://r4ds.had.co.nz/) <add> * [Mastering Software Development in R -is a free e-book addressing the Tidyverse among other topics](https://bookdown.org/rdpeng/RProgDA/) <ide> * [edX -allows to audit course for free but certification is paid.](https://www.edx.org/learn/r-programming) <ide> * [Advanced R](https://adv-r.hadley.nz/) <ide> * [RSeek](http://rseek.org/)
1
Go
Go
use direct registry url
a152f37674df3f2a31e60cbfb764fa348333e805
<ide><path>registry/auth.go <ide> import ( <ide> "github.com/docker/docker/utils" <ide> ) <ide> <del>// Where we store the config file <del>const CONFIGFILE = ".dockercfg" <add>const ( <add> // Where we store the config file <add> CONFIGFILE = ".dockercfg" <ide> <del>// Only used for user auth + account creation <del>const INDEXSERVER = "https://index.docker.io/v1/" <add> // Only used for user auth + account creation <add> INDEXSERVER = "https://index.docker.io/v1/" <add> REGISTRYSERVER = "https://registry-1.docker.io/v1/" <ide> <del>//const INDEXSERVER = "https://registry-stage.hub.docker.com/v1/" <add> // INDEXSERVER = "https://registry-stage.hub.docker.com/v1/" <add>) <ide> <ide> var ( <ide> ErrConfigFileMissing = errors.New("The Auth config file is missing") <ide><path>registry/session_v2.go <ide> func getV2URL(e *Endpoint, routeName string, vars map[string]string) (*url.URL, <ide> if err != nil { <ide> return nil, fmt.Errorf("unable to make registry route %q with vars %v: %s", routeName, vars, err) <ide> } <add> u, err := url.Parse(REGISTRYSERVER) <add> if err != nil { <add> return nil, fmt.Errorf("invalid registry url: %s", err) <add> } <ide> <ide> return &url.URL{ <del> Scheme: e.URL.Scheme, <del> Host: e.URL.Host, <add> Scheme: u.Scheme, <add> Host: u.Host, <ide> Path: routePath.Path, <ide> }, nil <ide> }
2
Python
Python
copy tarballs and superpack into release dir
c7927eb658b9616b42368e9496cb0304bdd2e4ae
<ide><path>pavement.py <ide> import sys <ide> import subprocess <ide> import re <add>import shutil <ide> try: <ide> from hash import md5 <ide> except ImportError: <ide> DMG_CONTENT = paver.path.path('numpy-macosx-installer') / 'content' <ide> <ide> # Where to put the final installers, as put on sourceforge <del>INSTALLERS_DIR = 'installers' <add>INSTALLERS_DIR = 'release/installers' <ide> <ide> options(sphinx=Bunch(builddir="build", sourcedir="source", docroot='doc'), <ide> virtualenv=Bunch(script_name=BOOTSTRAP_SCRIPT), <ide> def build_latex(): <ide> ref = paths.latexdir / "numpy-ref.pdf" <ide> ref.copy(PDF_DESTDIR / "reference.pdf") <ide> <add>def tarball_name(type='gztar'): <add> root = 'numpy-%s' % FULLVERSION <add> if type == 'gztar': <add> return root + '.tar.gz' <add> elif type == 'zip': <add> return root + '.zip' <add> raise ValueError("Unknown type %s" % type) <add> <ide> @task <ide> def sdist(): <ide> # To be sure to bypass paver when building sdist... paver + numpy.distutils <ide> # do not play well together. <ide> sh('python setup.py sdist --formats=gztar,zip') <ide> <add> # Copy the superpack into installers dir <add> if not os.path.exists(INSTALLERS_DIR): <add> os.makedirs(INSTALLERS_DIR) <add> <add> for t in ['gztar', 'zip']: <add> source = os.path.join('dist', tarball_name(t)) <add> target = os.path.join(INSTALLERS_DIR, tarball_name(t)) <add> shutil.copy(source, target) <add> <ide> #------------------ <ide> # Wine-based builds <ide> #------------------ <ide> def bdist_superpack(options): <ide> subprocess.check_call(['makensis', 'numpy-superinstaller.nsi'], <ide> cwd=SUPERPACK_BUILD) <ide> <add> # Copy the superpack into installers dir <add> if not os.path.exists(INSTALLERS_DIR): <add> os.makedirs(INSTALLERS_DIR) <add> <add> source = os.path.join(SUPERPACK_BUILD, <add> superpack_name(options.wininst.pyver, FULLVERSION)) <add> target = os.path.join(INSTALLERS_DIR, <add> superpack_name(options.wininst.pyver, FULLVERSION)) <add> shutil.copy(source, target) <add> <ide> @task <ide> @needs('clean', 'bdist_wininst') <ide> def bdist_wininst_simple():
1
Text
Text
add changelog entry for
0c0a69b5fa2bc5c004d7e9406e635bb1d696a4a3
<ide><path>railties/CHANGELOG.md <add>* Replace `chromedriver-helper` gem with `webdrivers` in default Gemfile. <add> `chromedriver-helper` is deprecated as of March 31, 2019 and won't <add> recieve any further updates. <add> <add> *Guillermo Iguaran‮* <add> <ide> * Applications running in `:zeitwerk` mode that use `bootsnap` need <ide> to upgrade `bootsnap` to at least 1.4.2. <ide>
1
PHP
PHP
remove unnecessary is_null check
c15fd12dc866a602dbc27a03366fa3b53bd06466
<ide><path>src/Illuminate/Database/Eloquent/Model.php <ide> public function touchOwners() <ide> { <ide> $this->$relation()->touch(); <ide> <del> if ( ! is_null($this->$relation)) <add> if ($this->$relation instanceof Model) <ide> { <del> if ($this->$relation instanceof Model) <del> { <del> $this->$relation->touchOwners(); <del> } <del> elseif ($this->$relation instanceof Collection) <add> $this->$relation->touchOwners(); <add> } <add> elseif ($this->$relation instanceof Collection) <add> { <add> $this->$relation->each(function (Model $relation) <ide> { <del> $this->$relation->each(function (Model $relation) <del> { <del> $relation->touchOwners(); <del> }); <del> } <add> $relation->touchOwners(); <add> }); <ide> } <ide> } <ide> }
1
Javascript
Javascript
switch arguments in strictequal
8272e7fba46688deabcedb284da384e12030906c
<ide><path>test/parallel/test-vm-create-and-run-in-context.js <ide> const vm = require('vm'); <ide> // Run in a new empty context <ide> let context = vm.createContext(); <ide> let result = vm.runInContext('"passed";', context); <del>assert.strictEqual('passed', result); <add>assert.strictEqual(result, 'passed'); <ide> <ide> // Create a new pre-populated context <ide> context = vm.createContext({ 'foo': 'bar', 'thing': 'lala' });
1
Go
Go
move 'auth' to the registry subsystem
3d605683b3d272982399635a55ee81b2a7535e81
<ide><path>builtins/builtins.go <ide> import ( <ide> api "github.com/dotcloud/docker/api/server" <ide> "github.com/dotcloud/docker/daemon/networkdriver/bridge" <ide> "github.com/dotcloud/docker/engine" <add> "github.com/dotcloud/docker/registry" <ide> "github.com/dotcloud/docker/server" <ide> ) <ide> <ide> func Register(eng *engine.Engine) { <ide> daemon(eng) <ide> remote(eng) <add> // FIXME: engine.Installer.Install can fail. These errors <add> // should be passed up. <add> registry.NewService().Install(eng) <ide> } <ide> <ide> // remote: a RESTful api for cross-docker communication <ide><path>registry/registry.go <ide> import ( <ide> "net/http/cookiejar" <ide> "net/url" <ide> "regexp" <add> "runtime" <ide> "strconv" <ide> "strings" <ide> "time" <ide> <add> "github.com/dotcloud/docker/dockerversion" <ide> "github.com/dotcloud/docker/utils" <ide> ) <ide> <ide> func NewRegistry(authConfig *AuthConfig, factory *utils.HTTPRequestFactory, inde <ide> r.reqFactory = factory <ide> return r, nil <ide> } <add> <add>func HTTPRequestFactory(metaHeaders map[string][]string) *utils.HTTPRequestFactory { <add> // FIXME: this replicates the 'info' job. <add> httpVersion := make([]utils.VersionInfo, 0, 4) <add> httpVersion = append(httpVersion, &simpleVersionInfo{"docker", dockerversion.VERSION}) <add> httpVersion = append(httpVersion, &simpleVersionInfo{"go", runtime.Version()}) <add> httpVersion = append(httpVersion, &simpleVersionInfo{"git-commit", dockerversion.GITCOMMIT}) <add> if kernelVersion, err := utils.GetKernelVersion(); err == nil { <add> httpVersion = append(httpVersion, &simpleVersionInfo{"kernel", kernelVersion.String()}) <add> } <add> httpVersion = append(httpVersion, &simpleVersionInfo{"os", runtime.GOOS}) <add> httpVersion = append(httpVersion, &simpleVersionInfo{"arch", runtime.GOARCH}) <add> ud := utils.NewHTTPUserAgentDecorator(httpVersion...) <add> md := &utils.HTTPMetaHeadersDecorator{ <add> Headers: metaHeaders, <add> } <add> factory := utils.NewHTTPRequestFactory(ud, md) <add> return factory <add>} <add> <add>// simpleVersionInfo is a simple implementation of <add>// the interface VersionInfo, which is used <add>// to provide version information for some product, <add>// component, etc. It stores the product name and the version <add>// in string and returns them on calls to Name() and Version(). <add>type simpleVersionInfo struct { <add> name string <add> version string <add>} <add> <add>func (v *simpleVersionInfo) Name() string { <add> return v.name <add>} <add> <add>func (v *simpleVersionInfo) Version() string { <add> return v.version <add>} <ide><path>registry/service.go <add>package registry <add> <add>import ( <add> "github.com/dotcloud/docker/engine" <add>) <add> <add>// Service exposes registry capabilities in the standard Engine <add>// interface. Once installed, it extends the engine with the <add>// following calls: <add>// <add>// 'auth': Authenticate against the public registry <add>// 'search': Search for images on the public registry (TODO) <add>// 'pull': Download images from any registry (TODO) <add>// 'push': Upload images to any registry (TODO) <add>type Service struct { <add>} <add> <add>// NewService returns a new instance of Service ready to be <add>// installed no an engine. <add>func NewService() *Service { <add> return &Service{} <add>} <add> <add>// Install installs registry capabilities to eng. <add>func (s *Service) Install(eng *engine.Engine) error { <add> eng.Register("auth", s.Auth) <add> return nil <add>} <add> <add>// Auth contacts the public registry with the provided credentials, <add>// and returns OK if authentication was sucessful. <add>// It can be used to verify the validity of a client's credentials. <add>func (s *Service) Auth(job *engine.Job) engine.Status { <add> var ( <add> err error <add> authConfig = &AuthConfig{} <add> ) <add> <add> job.GetenvJson("authConfig", authConfig) <add> // TODO: this is only done here because auth and registry need to be merged into one pkg <add> if addr := authConfig.ServerAddress; addr != "" && addr != IndexServerAddress() { <add> addr, err = ExpandAndVerifyRegistryUrl(addr) <add> if err != nil { <add> return job.Error(err) <add> } <add> authConfig.ServerAddress = addr <add> } <add> status, err := Login(authConfig, HTTPRequestFactory(nil)) <add> if err != nil { <add> return job.Error(err) <add> } <add> job.Printf("%s\n", status) <add> return engine.StatusOK <add>} <ide><path>server/server.go <ide> func InitServer(job *engine.Job) engine.Status { <ide> "events": srv.Events, <ide> "push": srv.ImagePush, <ide> "containers": srv.Containers, <del> "auth": srv.Auth, <ide> } { <ide> if err := job.Eng.Register(name, handler); err != nil { <ide> return job.Error(err) <ide> func InitServer(job *engine.Job) engine.Status { <ide> return engine.StatusOK <ide> } <ide> <del>// simpleVersionInfo is a simple implementation of <del>// the interface VersionInfo, which is used <del>// to provide version information for some product, <del>// component, etc. It stores the product name and the version <del>// in string and returns them on calls to Name() and Version(). <del>type simpleVersionInfo struct { <del> name string <del> version string <del>} <del> <del>func (v *simpleVersionInfo) Name() string { <del> return v.name <del>} <del> <del>func (v *simpleVersionInfo) Version() string { <del> return v.version <del>} <del> <ide> // ContainerKill send signal to the container <ide> // If no signal is given (sig 0), then Kill with SIGKILL and wait <ide> // for the container to exit. <ide> func (srv *Server) ContainerKill(job *engine.Job) engine.Status { <ide> return engine.StatusOK <ide> } <ide> <del>func (srv *Server) Auth(job *engine.Job) engine.Status { <del> var ( <del> err error <del> authConfig = &registry.AuthConfig{} <del> ) <del> <del> job.GetenvJson("authConfig", authConfig) <del> // TODO: this is only done here because auth and registry need to be merged into one pkg <del> if addr := authConfig.ServerAddress; addr != "" && addr != registry.IndexServerAddress() { <del> addr, err = registry.ExpandAndVerifyRegistryUrl(addr) <del> if err != nil { <del> return job.Error(err) <del> } <del> authConfig.ServerAddress = addr <del> } <del> status, err := registry.Login(authConfig, srv.HTTPRequestFactory(nil)) <del> if err != nil { <del> return job.Error(err) <del> } <del> job.Printf("%s\n", status) <del> return engine.StatusOK <del>} <del> <ide> func (srv *Server) Events(job *engine.Job) engine.Status { <ide> if len(job.Args) != 1 { <ide> return job.Errorf("Usage: %s FROM", job.Name) <ide> func (srv *Server) ImagesSearch(job *engine.Job) engine.Status { <ide> job.GetenvJson("authConfig", authConfig) <ide> job.GetenvJson("metaHeaders", metaHeaders) <ide> <del> r, err := registry.NewRegistry(authConfig, srv.HTTPRequestFactory(metaHeaders), registry.IndexServerAddress()) <add> r, err := registry.NewRegistry(authConfig, registry.HTTPRequestFactory(metaHeaders), registry.IndexServerAddress()) <ide> if err != nil { <ide> return job.Error(err) <ide> } <ide> func (srv *Server) ImagePull(job *engine.Job) engine.Status { <ide> return job.Error(err) <ide> } <ide> <del> r, err := registry.NewRegistry(&authConfig, srv.HTTPRequestFactory(metaHeaders), endpoint) <add> r, err := registry.NewRegistry(&authConfig, registry.HTTPRequestFactory(metaHeaders), endpoint) <ide> if err != nil { <ide> return job.Error(err) <ide> } <ide> func (srv *Server) ImagePush(job *engine.Job) engine.Status { <ide> } <ide> <ide> img, err := srv.daemon.Graph().Get(localName) <del> r, err2 := registry.NewRegistry(authConfig, srv.HTTPRequestFactory(metaHeaders), endpoint) <add> r, err2 := registry.NewRegistry(authConfig, registry.HTTPRequestFactory(metaHeaders), endpoint) <ide> if err2 != nil { <ide> return job.Error(err2) <ide> } <ide> func NewServer(eng *engine.Engine, config *daemonconfig.Config) (*Server, error) <ide> return srv, nil <ide> } <ide> <del>func (srv *Server) HTTPRequestFactory(metaHeaders map[string][]string) *utils.HTTPRequestFactory { <del> httpVersion := make([]utils.VersionInfo, 0, 4) <del> httpVersion = append(httpVersion, &simpleVersionInfo{"docker", dockerversion.VERSION}) <del> httpVersion = append(httpVersion, &simpleVersionInfo{"go", goruntime.Version()}) <del> httpVersion = append(httpVersion, &simpleVersionInfo{"git-commit", dockerversion.GITCOMMIT}) <del> if kernelVersion, err := utils.GetKernelVersion(); err == nil { <del> httpVersion = append(httpVersion, &simpleVersionInfo{"kernel", kernelVersion.String()}) <del> } <del> httpVersion = append(httpVersion, &simpleVersionInfo{"os", goruntime.GOOS}) <del> httpVersion = append(httpVersion, &simpleVersionInfo{"arch", goruntime.GOARCH}) <del> ud := utils.NewHTTPUserAgentDecorator(httpVersion...) <del> md := &utils.HTTPMetaHeadersDecorator{ <del> Headers: metaHeaders, <del> } <del> factory := utils.NewHTTPRequestFactory(ud, md) <del> return factory <del>} <del> <ide> func (srv *Server) LogEvent(action, id, from string) *utils.JSONMessage { <ide> now := time.Now().UTC().Unix() <ide> jm := utils.JSONMessage{Status: action, ID: id, From: from, Time: now}
4
PHP
PHP
apply fixes from styleci
befcfbcf1b0ed79e5d585b443fa06b88686d782a
<ide><path>tests/Validation/ValidationValidatorTest.php <ide> public function testDisplayableAttributesAreReplacedInCustomReplacers() <ide> $v->addExtension('alliteration', function ($attribute, $value, $parameters, $validator) { <ide> $other = array_get($validator->getData(), $parameters[0]); <ide> <del> return $value{0} == $other{0}; <add> return $value[0] == $other[0]; <ide> }); <ide> $v->addReplacer('alliteration', function ($message, $attribute, $rule, $parameters, $validator) { <ide> return str_replace(':other', $validator->getDisplayableAttribute($parameters[0]), $message); <ide> public function testDisplayableAttributesAreReplacedInCustomReplacers() <ide> $v->addExtension('alliteration', function ($attribute, $value, $parameters, $validator) { <ide> $other = array_get($validator->getData(), $parameters[0]); <ide> <del> return $value{0} == $other{0}; <add> return $value[0] == $other[0]; <ide> }); <ide> $v->addReplacer('alliteration', function ($message, $attribute, $rule, $parameters, $validator) { <ide> return str_replace(':other', $validator->getDisplayableAttribute($parameters[0]), $message);
1
PHP
PHP
update authenticatesession.php
a7b21b84732e8d1139003d30f72a5cc20a2f726d
<ide><path>src/Illuminate/Session/Middleware/AuthenticateSession.php <ide> public function handle($request, Closure $next) <ide> } <ide> } <ide> <del> if (! $request->session()->has('password_hash_'.$this->auth->getDefaultDriver())) { <add> if (! $request->session()->has('password_hash_'.$this->guard()->getDefaultDriver())) { <ide> $this->storePasswordHashInSession($request); <ide> } <ide> <del> if ($request->session()->get('password_hash_'.$this->auth->getDefaultDriver()) !== $request->user()->getAuthPassword()) { <add> if ($request->session()->get('password_hash_'.$this->guard()->getDefaultDriver()) !== $request->user()->getAuthPassword()) { <ide> $this->logout($request); <ide> } <ide> <ide> protected function storePasswordHashInSession($request) <ide> } <ide> <ide> $request->session()->put([ <del> 'password_hash_'.$this->auth->getDefaultDriver() => $request->user()->getAuthPassword(), <add> 'password_hash_'.$this->guard()->getDefaultDriver() => $request->user()->getAuthPassword(), <ide> ]); <ide> } <ide> <ide> protected function logout($request) <ide> <ide> $request->session()->flush(); <ide> <del> throw new AuthenticationException('Unauthenticated.', [$this->auth->getDefaultDriver()]); <add> throw new AuthenticationException('Unauthenticated.', [$this->guard()->getDefaultDriver()]); <ide> } <ide> <ide> /**
1
Javascript
Javascript
remove command from hotkeys
a7c42446be65043bfcd154e3a47d63e896ffa7c1
<ide><path>client/src/templates/Challenges/classic/Editor.js <ide> class Editor extends Component { <ide> label: 'Run tests', <ide> keybindings: [ <ide> /* eslint-disable no-bitwise */ <del> monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter) <add> monaco.KeyMod.chord(monaco.KeyMod.WinCtrl | monaco.KeyCode.Enter) <ide> ], <ide> run: this.props.executeChallenge <ide> }); <ide><path>client/src/templates/Challenges/components/Hotkeys.js <ide> import { HotKeys, GlobalHotKeys } from 'react-hotkeys'; <ide> import { navigate } from 'gatsby'; <ide> <ide> const keyMap = { <del> EXECUTE_CHALLENGE: ['ctrl+enter', 'cmd+enter'], <del> NAVIGATE_PREV: ['ctrl+left', 'cmd+left'], <del> NAVIGATE_NEXT: ['ctrl+right', 'cmd+right'] <add> EXECUTE_CHALLENGE: ['ctrl+enter'], <add> NAVIGATE_PREV: ['ctrl+left'], <add> NAVIGATE_NEXT: ['ctrl+right'] <ide> }; <ide> <ide> const propTypes = {
2
Python
Python
add roberta to run_ner.py
4e5f88b74fa914a5f45aec3260977acfc3513536
<ide><path>examples/run_ner.py <ide> <ide> from transformers import AdamW, WarmupLinearSchedule <ide> from transformers import WEIGHTS_NAME, BertConfig, BertForTokenClassification, BertTokenizer <add>from transformers import RobertaConfig, RobertaForTokenClassification, RobertaTokenizer <ide> <ide> logger = logging.getLogger(__name__) <ide> <ide> ALL_MODELS = sum( <del> (tuple(conf.pretrained_config_archive_map.keys()) for conf in (BertConfig, )), <add> (tuple(conf.pretrained_config_archive_map.keys()) for conf in (BertConfig, RobertaConfig)), <ide> ()) <ide> <ide> MODEL_CLASSES = { <ide> "bert": (BertConfig, BertForTokenClassification, BertTokenizer), <add> "roberta": (RobertaConfig, RobertaForTokenClassification, RobertaTokenizer) <ide> } <ide> <ide>
1
Javascript
Javascript
fix failing unit tests after rebase
c4839016aa566a21958e4649b9878615f2d2a284
<ide><path>packages/sproutcore-handlebars/lib/controls/button.js <ide> SC.Button = SC.View.extend({ <ide> tagName: 'button', <ide> <ide> targetObject: function() { <del> var target = this.get('target'); <add> var target = get(this, 'target'); <ide> <ide> if (SC.typeOf(target) === "string") { <ide> return SC.getPath(target); <ide><path>packages/sproutcore-handlebars/lib/controls/checkbox.js <ide> require("sproutcore-views/views/view"); <ide> require("sproutcore-handlebars/ext"); <ide> <add>var set = SC.set, get = SC.get; <add> <ide> // TODO: Be explicit in the class documentation that you <ide> // *MUST* set the value of a checkbox through SproutCore. <ide> // Updating the value of a checkbox directly via jQuery objects <ide> SC.Checkbox = SC.View.extend({ <ide> defaultTemplate: SC.Handlebars.compile('<label><input type="checkbox" {{bindAttr checked="value"}}>{{title}}</label>'), <ide> <ide> change: function() { <del> this.invokeOnce(this._updateElementValue) <add> SC.run.once(this, this._updateElementValue); <ide> return false; <ide> }, <ide> <ide> _updateElementValue: function() { <ide> var input = this.$('input:checkbox'); <del> this.set('value', input.prop('checked')); <add> set(this, 'value', input.prop('checked')); <ide> } <ide> }); <ide> <ide><path>packages/sproutcore-handlebars/tests/controls/checkbox_test.js <ide> test("checking the checkbox updates the value", function() { <ide> checkboxView = SC.Checkbox.create({ value: true }); <ide> checkboxView.append(); <ide> <del> equals(checkboxView.get('value'), true, "precond - initially starts with a true value"); <add> equals(get(checkboxView, 'value'), true, "precond - initially starts with a true value"); <ide> equals(!!checkboxView.$('input').prop('checked'), true, "precond - the initial checked property is true"); <ide> <ide> checkboxView.$('input:checkbox').change(); <ide> <ide> equals(checkboxView.$('input').prop('checked'), true, "precond - after clicking a checkbox, the checked property changed"); <del> equals(checkboxView.get('value'), true, "changing the checkbox causes the view's value to get updated"); <del>}) <add> equals(get(checkboxView, 'value'), true, "changing the checkbox causes the view's value to get updated"); <add>}); <add> <ide><path>packages/sproutcore-handlebars/tests/controls/text_field_test.js <ide> test("value binding works properly for inputs that haven't been created", functi <ide> }); <ide> }); <ide> <del> equals(get(textField, 'value'), "", "precond - default value is null"); <add> equals(get(textField, 'value'), null, "precond - default value is null"); <ide> equals(textField.$('input').length, 0, "precond - view doesn't have its layer created yet, thus no input element"); <ide> <ide> SC.run(function() { <ide><path>packages/sproutcore-handlebars/tests/views/collection_view_test.js <ide> test("tagName works in the #collection helper", function() { <ide> equals(view.$('li').length, 2, "rerenders with correct number of items"); <ide> <ide> SC.run(function() { <del> view.childViews[0].set('content', ['bing', 'bat', 'bang']); <add> set(view.childViews[0], 'content', ['bing', 'bat', 'bang']); <ide> }); <ide> <ide> equals(view.$('li').length, 3, "rerenders with correct number of items");
5
Text
Text
add another backer url
d78686b42102bd25ecade0ac9006dc9baf150c39
<ide><path>SUPPORTERS.md <ide> These wonderful people supported our Kickstarter by giving us £10 or more: <ide> * [Slobodan Miskovic](https://miskovic.ca) <ide> * [Kurt Ostergaard](http://KurtOstergaard.com) <ide> * [Simply Business](http://www.simplybusiness.co.uk/) <del>* Tate Johnson <add>* [Tate Johnson](http://tatey.com) <ide> * [Gerry Cardinal III](http://gerrycardinal.com/) <ide> * [Andrew Kalek](http://anlek.com) <ide> * [Bryan Coe](http://www.BryanACoe.com)
1
PHP
PHP
fix missing round bracket
fc38e00289d848163c4da024877f31951c55b353
<ide><path>src/Illuminate/Cache/FileStore.php <ide> public function put($key, $value, $minutes) <ide> protected function createCacheDirectory($path) <ide> { <ide> try { <del> if (!file_exists(dirname($path)) { <add> if (!file_exists(dirname($path))) { <ide> $this->files->makeDirectory(dirname($path), 0777, true, true); <ide> } <ide> } catch (Exception $e) {
1
Ruby
Ruby
remove pointless `private`
409e7e4fc5332bf6199ac927d816c51f1d6a3307
<ide><path>activerecord/lib/active_record/attribute_set/builder.rb <ide> def build_from_database(values = {}, additional_types = {}) <ide> attributes = LazyAttributeHash.new(types, values, additional_types) <ide> AttributeSet.new(attributes) <ide> end <del> <del> private <ide> end <ide> end <ide>
1
Go
Go
notify agentinitdone after joining the cluster
8a1092fe78c533fa8104315f5b874758351f196c
<ide><path>libnetwork/agent.go <ide> func (c *controller) agentSetup() error { <ide> } <ide> return false <ide> }) <del> <del> if c.agent != nil { <del> close(c.agentInitDone) <del> } <ide> } <ide> } <add> <ide> if remoteAddr != "" { <ide> if err := c.agentJoin(remoteAddr); err != nil { <ide> logrus.Errorf("Error in agentJoin : %v", err) <add> return nil <ide> } <ide> } <add> <add> if c.agent != nil { <add> close(c.agentInitDone) <add> } <add> <ide> return nil <ide> } <ide>
1
Ruby
Ruby
allow optional override
93d46c6d6c69d5279404bce211cb2f48120076f9
<ide><path>Library/Homebrew/extend/pathname.rb <ide> def install_symlink_p(src, new_basename) <ide> alias old_write write <ide> <ide> # We assume this pathname object is a file, obviously <del> def write(content, *open_args) <del> raise "Will not overwrite #{self}" if exist? <add> def write(content, overwrite = false, *open_args) <add> raise "Will not overwrite #{self}" if exist? && !overwrite <ide> <ide> dirname.mkpath <ide> open("w", *open_args) { |f| f.write(content) }
1
Text
Text
update key event property - closes issue
86aedfc8c4c821014a70f967445257c3068dec7f
<ide><path>docs/tutorials/fundamentals/part-5-ui-and-react.md <ide> const Header = () => { <ide> const handleKeyDown = e => { <ide> const trimmedText = e.target.value.trim() <ide> // If the user pressed the Enter key: <del> if (e.which === 13 && trimmedText) { <add> if (e.key === 'Enter' && trimmedText) { <ide> // highlight-start <ide> // Dispatch the "todo added" action with this text <ide> dispatch({ type: 'todos/todoAdded', payload: trimmedText })
1
Python
Python
add a protocol for representing nested sequences
5580a4c4ba3bab701c17bca56d77105eedfa75c9
<ide><path>numpy/typing/__init__.py <ide> class _32Bit(_64Bit): ... # type: ignore[misc] <ide> class _16Bit(_32Bit): ... # type: ignore[misc] <ide> class _8Bit(_16Bit): ... # type: ignore[misc] <ide> <add>from ._nested_sequence import _NestedSequence <ide> from ._nbit import ( <ide> _NBitByte, <ide> _NBitShort, <ide><path>numpy/typing/_nested_sequence.py <add>"""A module containing the `_NestedSequence` protocol.""" <add> <add>from __future__ import annotations <add> <add>import sys <add>from typing import ( <add> Any, <add> Iterator, <add> overload, <add> TypeVar, <add> Protocol, <add>) <add> <add>__all__ = ["_NestedSequence"] <add> <add>_T_co = TypeVar("_T_co", covariant=True) <add> <add> <add>class _NestedSequence(Protocol[_T_co]): <add> """A protocol for representing nested sequences. <add> <add> Warning <add> ------- <add> `_NestedSequence` currently does not work in combination with typevars, <add> *e.g.* ``def func(a: _NestedSequnce[T]) -> T: ...``. <add> <add> See Also <add> -------- <add> `collections.abc.Sequence` <add> ABCs for read-only and mutable :term:`sequences`. <add> <add> Examples <add> -------- <add> .. code-block:: python <add> <add> >>> from __future__ import annotations <add> <add> >>> from typing import TYPE_CHECKING <add> >>> import numpy as np <add> >>> from numpy.typing import _NestedSequnce <add> <add> >>> def get_dtype(seq: _NestedSequnce[float]) -> np.dtype[np.float64]: <add> ... return np.asarray(seq).dtype <add> <add> >>> a = get_dtype([1.0]) <add> >>> b = get_dtype([[1.0]]) <add> >>> c = get_dtype([[[1.0]]]) <add> >>> d = get_dtype([[[[1.0]]]]) <add> <add> >>> if TYPE_CHECKING: <add> ... reveal_locals() <add> ... # note: Revealed local types are: <add> ... # note: a: numpy.dtype[numpy.floating[numpy.typing._64Bit]] <add> ... # note: b: numpy.dtype[numpy.floating[numpy.typing._64Bit]] <add> ... # note: c: numpy.dtype[numpy.floating[numpy.typing._64Bit]] <add> ... # note: d: numpy.dtype[numpy.floating[numpy.typing._64Bit]] <add> <add> """ <add> <add> def __len__(self, /) -> int: <add> """Implement ``len(self)``.""" <add> raise NotImplementedError <add> <add> @overload <add> def __getitem__(self, index: int, /) -> _T_co | _NestedSequence[_T_co]: ... <add> @overload <add> def __getitem__(self, index: slice, /) -> _NestedSequence[_T_co]: ... <add> <add> def __getitem__(self, index, /): <add> """Implement ``self[x]``.""" <add> raise NotImplementedError <add> <add> def __contains__(self, x: object, /) -> bool: <add> """Implement ``x in self``.""" <add> raise NotImplementedError <add> <add> def __iter__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]: <add> """Implement ``iter(self)``.""" <add> raise NotImplementedError <add> <add> def __reversed__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]: <add> """Implement ``reversed(self)``.""" <add> raise NotImplementedError <add> <add> def count(self, value: Any, /) -> int: <add> """Return the number of occurrences of `value`.""" <add> raise NotImplementedError <add> <add> def index( <add> self, value: Any, start: int = 0, stop: int = sys.maxsize, / <add> ) -> int: <add> """Return the first index of `value`.""" <add> raise NotImplementedError
2
Ruby
Ruby
remove deprecation comment
18bb644ce72cc70ef0c2d9f1d354269a8982ad2d
<ide><path>Library/Homebrew/cmd/tap.rb <ide> def tap_args <ide> assumptions, so taps can be cloned from places other than GitHub and <ide> using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync. <ide> EOS <del> # odeprecated "brew tap --full" <ide> switch "--full", <ide> description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\ <ide> "shallow clones if `--shallow` was originally passed."
1
Javascript
Javascript
add picture to xjs.knowntags
5f56f4ac36136fe2c61ee14a292c192298dd863d
<ide><path>vendor/fbtransform/transforms/xjs.js <ide> var knownTags = { <ide> param: true, <ide> path: true, <ide> pattern: false, <add> picture: true, <ide> polygon: true, <ide> polyline: true, <ide> pre: true,
1
PHP
PHP
fix more failing tests
5815cf8b9c5ad8b232507f39ae5ecab21b5146a5
<ide><path>lib/Cake/Test/TestCase/Routing/DispatcherTest.php <ide> public function testDispatchBasic() { <ide> $this->assertEquals($expected, $Dispatcher->controller->name); <ide> <ide> $expected = array('0' => 'home'); <del> $this->assertSame($expected, $controller->request->params['pass']); <add> $this->assertSame($expected, $Dispatcher->controller->request->params['pass']); <ide> <ide> Configure::write('App.baseUrl', '/pages/index.php'); <ide> <ide> public function testDispatcherFilterCallable() { <ide> $response = $this->getMock('Cake\Network\Response', array('send')); <ide> $dispatcher->dispatch($request, $response); <ide> $this->assertEmpty($dispatcher->controller); <del> $expected = array('controller' => null, 'action' => null, 'plugin' => null, 'named' => array(), 'pass' => array()); <add> $expected = array('controller' => null, 'action' => null, 'plugin' => null, 'pass' => array()); <ide> $this->assertEquals($expected, $request->params); <ide> <ide> $dispatcher = new TestDispatcher(); <ide><path>lib/Cake/Test/TestCase/View/Helper/PrototypeEngineHelperTest.php <ide> namespace Cake\Test\TestCase\View\Helper; <ide> <ide> use Cake\TestSuite\TestCase; <add>use Cake\Routing\Router; <ide> use Cake\View\Helper\HtmlHelper; <ide> use Cake\View\Helper\JsHelper; <ide> use Cake\View\Helper\PrototypeEngineHelper; <ide> public function testEffect() { <ide> * @return void <ide> */ <ide> public function testRequest() { <add> Router::connect('/:controller/:action/*'); <add> <ide> $result = $this->Proto->request(array('controller' => 'posts', 'action' => 'view', 1)); <ide> $expected = 'var jsRequest = new Ajax.Request("/posts/view/1");'; <ide> $this->assertEquals($expected, $result); <ide><path>lib/Cake/Test/TestCase/View/HelperTest.php <ide> * @license MIT License (http://www.opensource.org/licenses/mit-license.php) <ide> */ <ide> namespace Cake\Test\TestCase\View; <add> <ide> use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> public function testAssetTimestamp() { <ide> * @return void <ide> */ <ide> public function testAssetUrl() { <add> Router::connect('/:controller/:action/*'); <add> <ide> $this->Helper->webroot = ''; <ide> $result = $this->Helper->assetUrl(array( <ide> 'controller' => 'js',
3
Ruby
Ruby
move generic assertions into actiondispatch
7b3b7cb2ab1ccf96d4c8a1bafd87dbfbd2ac8c84
<ide><path>actionpack/lib/action_controller/testing/integration.rb <ide> module Integration #:nodoc: <ide> # Integration::Session directly. <ide> class Session <ide> include Test::Unit::Assertions <del> include ActionController::TestCase::Assertions <add> include ActionDispatch::Assertions <ide> include ActionController::TestProcess <ide> <ide> # The integer HTTP status code of the last request. <ide><path>actionpack/lib/action_controller/testing/test_case.rb <ide> module ActionController <ide> class TestCase < ActiveSupport::TestCase <ide> include TestProcess <ide> <del> module Assertions <del> %w(response selector tag dom routing model).each do |kind| <del> include ActionController::Assertions.const_get("#{kind.camelize}Assertions") <del> end <del> end <del> include Assertions <add> include ActionDispatch::Assertions <ide> <ide> # When the request.remote_addr remains the default for testing, which is 0.0.0.0, the exception is simply raised inline <ide> # (bystepping the regular exception handling from rescue_action). If the request.remote_addr is anything else, the regular <ide><path>actionpack/lib/action_dispatch.rb <ide> module ActionDispatch <ide> autoload :Reloader, 'action_dispatch/middleware/reloader' <ide> autoload :MiddlewareStack, 'action_dispatch/middleware/stack' <ide> <add> autoload :Assertions, 'action_dispatch/testing/assertions' <add> <ide> module Http <ide> autoload :Headers, 'action_dispatch/http/headers' <ide> end <ide><path>actionpack/lib/action_dispatch/testing/assertions.rb <add>module ActionDispatch <add> module Assertions <add> %w(response selector tag dom routing model).each do |kind| <add> require "action_dispatch/testing/assertions/#{kind}" <add> include const_get("#{kind.camelize}Assertions") <add> end <add> end <add>end <add><path>actionpack/lib/action_dispatch/testing/assertions/dom.rb <del><path>actionpack/lib/action_controller/testing/assertions/dom.rb <del>module ActionController <add>module ActionDispatch <ide> module Assertions <ide> module DomAssertions <ide> # Test two HTML strings for equivalency (e.g., identical up to reordering of attributes) <add><path>actionpack/lib/action_dispatch/testing/assertions/model.rb <del><path>actionpack/lib/action_controller/testing/assertions/model.rb <del>module ActionController <add>module ActionDispatch <ide> module Assertions <ide> module ModelAssertions <ide> # Ensures that the passed record is valid by Active Record standards and <add><path>actionpack/lib/action_dispatch/testing/assertions/response.rb <del><path>actionpack/lib/action_controller/testing/assertions/response.rb <del>module ActionController <add>module ActionDispatch <ide> module Assertions <ide> # A small suite of assertions that test responses from Rails applications. <ide> module ResponseAssertions <add><path>actionpack/lib/action_dispatch/testing/assertions/routing.rb <del><path>actionpack/lib/action_controller/testing/assertions/routing.rb <del>module ActionController <add>module ActionDispatch <ide> module Assertions <ide> # Suite of assertions to test routes generated by Rails and the handling of requests made to them. <ide> module RoutingAssertions <add><path>actionpack/lib/action_dispatch/testing/assertions/selector.rb <del><path>actionpack/lib/action_controller/testing/assertions/selector.rb <ide> # Under MIT and/or CC By license. <ide> #++ <ide> <del>module ActionController <add>module ActionDispatch <ide> module Assertions <ide> unless const_defined?(:NO_STRIP) <ide> NO_STRIP = %w{pre script style textarea} <add><path>actionpack/lib/action_dispatch/testing/assertions/tag.rb <del><path>actionpack/lib/action_controller/testing/assertions/tag.rb <del>module ActionController <add>module ActionDispatch <ide> module Assertions <ide> # Pair of assertions to testing elements in the HTML output of the response. <ide> module TagAssertions <ide><path>actionpack/lib/action_view/test_case.rb <ide> def _render_template(template, local_assigns = {}) <ide> end <ide> <ide> class TestCase < ActiveSupport::TestCase <del> include ActionController::TestCase::Assertions <add> include ActionDispatch::Assertions <ide> include ActionController::TestProcess <ide> <ide> class_inheritable_accessor :helper_class
11
PHP
PHP
fix loose matching when validating route schemes
8e2e5fea08e26530ee3a8965de78c57329a50d6f
<ide><path>src/Illuminate/Routing/Route.php <ide> public function methods() <ide> */ <ide> public function httpOnly() <ide> { <del> return in_array('http', $this->action); <add> return in_array('http', $this->action, true); <ide> } <ide> <ide> /** <ide> public function httpsOnly() <ide> */ <ide> public function secure() <ide> { <del> return in_array('https', $this->action); <add> return in_array('https', $this->action, true); <ide> } <ide> <ide> /** <ide><path>tests/Routing/RoutingRouteTest.php <ide> public function testMatchesMethodAgainstRequests() <ide> $route = new Route('GET', 'foo/{bar}', array('https', function() {})); <ide> $this->assertTrue($route->matches($request)); <ide> <add> $request = Request::create('https://foo.com/foo/bar', 'GET'); <add> $route = new Route('GET', 'foo/{bar}', array('https', 'baz' => true, function() {})); <add> $this->assertTrue($route->matches($request)); <add> <ide> $request = Request::create('http://foo.com/foo/bar', 'GET'); <ide> $route = new Route('GET', 'foo/{bar}', array('https', function() {})); <ide> $this->assertFalse($route->matches($request)); <ide> public function testMatchesMethodAgainstRequests() <ide> $request = Request::create('http://foo.com/foo/bar', 'GET'); <ide> $route = new Route('GET', 'foo/{bar}', array('http', function() {})); <ide> $this->assertTrue($route->matches($request)); <add> <add> $request = Request::create('http://foo.com/foo/bar', 'GET'); <add> $route = new Route('GET', 'foo/{bar}', array('baz' => true, function() {})); <add> $this->assertTrue($route->matches($request)); <ide> } <ide> <ide>
2
Ruby
Ruby
fix syntactical issues
6d4bce4baafcb34c11cbca12b0d75458a0111ed9
<ide><path>Library/Homebrew/dev-cmd/bump.rb <ide> def parse_livecheck_response(response) <ide> end <ide> <ide> def display(outdated_packages) <del> ohai "Outdated formulae\n" <del> <add> ohai "Outdated formulae" <add> puts <ide> outdated_packages.each do |formula, package_details| <ide> ohai formula <ide> puts "Current formula version: #{package_details[:current_formula_version]}" <ide><path>Library/Homebrew/diagnostic.rb <ide> def check_git_status <ide> next if status.blank? <ide> <ide> # these will result in uncommitted gems. <del> next if path == HOMEBREW_REPOSITORY && (ENV["HOMEBREW_SORBET"] || ENV["HOMEBREW_PATCHELF_RB"]) <add> if path == HOMEBREW_REPOSITORY <add> next if ENV["HOMEBREW_SORBET"] || ENV["HOMEBREW_PATCHELF_RB"] <add> end <ide> <ide> message ||= "" <ide> message += "\n" unless message.empty?
2
PHP
PHP
remove unrequired method getlayout
2b621879bae4669c27201f057106665e62456fa5
<ide><path>src/Illuminate/Routing/Controller.php <ide> public function callAction($method, $parameters) <ide> return $response; <ide> } <ide> <del> /** <del> * Get the layout used by the controller. <del> * <del> * @return \Illuminate\View\View|null <del> */ <del> public function getLayout() <del> { <del> return $this->layout; <del> } <del> <ide> /** <ide> * Handle calls to missing methods on the controller. <ide> *
1
PHP
PHP
add the ability to add automatic fields
44fee92558f540433d92ae5adfee37fae262977d
<ide><path>src/ORM/Association.php <ide> protected function _dispatchBeforeFind($query) { <ide> protected function _appendFields($query, $surrogate, $options) { <ide> $options['fields'] = $surrogate->clause('select') ?: $options['fields']; <ide> $target = $this->_targetTable; <del> if (empty($options['fields'])) { <add> $autoFields = $surrogate->autoFields(); <add> if (empty($options['fields']) && !$autoFields) { <ide> $f = isset($options['fields']) ? $options['fields'] : null; <ide> if ($options['includeFields'] && ($f === null || $f !== false)) { <ide> $options['fields'] = $target->schema()->columns(); <ide> } <ide> } <ide> <add> if ($autoFields === true) { <add> $options['fields'] = array_merge((array)$options['fields'], $target->schema()->columns()); <add> } <add> <ide> if (!empty($options['fields'])) { <ide> $query->select($query->aliasFields($options['fields'], $target->alias())); <ide> } <ide><path>src/ORM/Query.php <ide> class Query extends DatabaseQuery implements JsonSerializable { <ide> */ <ide> protected $_hasFields; <ide> <add>/** <add> * Tracks whether or not the original query should include <add> * fields from the top level model. <add> * <add> * @var bool <add> */ <add> protected $_autoFields; <add> <ide> /** <ide> * Boolean for tracking whether or not buffered results <ide> * are enabled. <ide> protected function _addDefaultFields() { <ide> $select = $this->clause('select'); <ide> $this->_hasFields = true; <ide> <del> if (!count($select)) { <add> if (!count($select) || $this->_autoFields === true) { <ide> $this->_hasFields = false; <ide> $this->select($this->repository()->schema()->columns()); <ide> $select = $this->clause('select'); <ide> public function jsonSerialize() { <ide> return $this->all(); <ide> } <ide> <add>/** <add> * Get/Set whether or not the ORM should automatically append fields. <add> * <add> * By default calling select() will disable auto-fields. You can re-enable <add> * auto-fields with this method. <add> * <add> * @param bool $value The value to set or null to read the current value. <add> * @return bool|$this Either the current value or the query object. <add> */ <add> public function autoFields($value = null) { <add> if ($value === null) { <add> return $this->_autoFields; <add> } <add> $this->_autoFields = (bool)$value; <add> return $this; <add> } <add> <ide> } <ide><path>tests/TestCase/ORM/QueryTest.php <ide> <ide> /** <ide> * Tests Query class <del> * <ide> */ <ide> class QueryTest extends TestCase { <ide> <ide> public function testJsonSerialize() { <ide> ); <ide> } <ide> <add>/** <add> * Test that addFields() works in the basic case. <add> * <add> * @return void <add> */ <add> public function testAutoFields() { <add> $table = TableRegistry::get('Articles'); <add> $result = $table->find('all') <add> ->select(['myField' => 'id + 20']) <add> ->autoFields(true) <add> ->hydrate(false) <add> ->first(); <add> <add> $this->assertArrayHasKey('myField', $result); <add> $this->assertArrayHasKey('id', $result); <add> $this->assertArrayHasKey('title', $result); <add> } <add> <add>/** <add> * Test autoFields with auto fields. <add> * <add> * @return void <add> */ <add> public function testAutoFieldsWithAssociations() { <add> $table = TableRegistry::get('Articles'); <add> $table->belongsTo('Authors'); <add> <add> $result = $table->find() <add> ->select(['myField' => '(SELECT RAND())']) <add> ->autoFields(true) <add> ->hydrate(false) <add> ->contain('Authors') <add> ->first(); <add> <add> $this->assertArrayHasKey('myField', $result); <add> $this->assertArrayHasKey('title', $result); <add> $this->assertArrayHasKey('author', $result); <add> $this->assertNotNull($result['author']); <add> $this->assertArrayHasKey('name', $result['author']); <add> } <add> <add>/** <add> * Test autoFields in contain query builder <add> * <add> * @return void <add> */ <add> public function testAutoFieldsWithContainQueryBuilder() { <add> $table = TableRegistry::get('Articles'); <add> $table->belongsTo('Authors'); <add> <add> $result = $table->find() <add> ->select(['myField' => '(SELECT RAND())']) <add> ->autoFields(true) <add> ->hydrate(false) <add> ->contain(['Authors' => function($q) { <add> return $q->select(['compute' => '2 + 20']) <add> ->autoFields(true); <add> }]) <add> ->first(); <add> <add> $this->assertArrayHasKey('myField', $result); <add> $this->assertArrayHasKey('title', $result); <add> $this->assertArrayHasKey('author', $result); <add> $this->assertNotNull($result['author']); <add> $this->assertArrayHasKey('name', $result['author']); <add> $this->assertArrayHasKey('compute', $result); <add> } <add> <ide> }
3
Javascript
Javascript
allow relative links in docs
43b2cd45f0b42efb67497a6471f3a1b26d792bd9
<ide><path>docs/spec/ngdocSpec.js <ide> describe('ngdoc', function(){ <ide> expect(doc.links).toContain('api/angular.link'); <ide> }); <ide> <add> describe('convertUrlToAbsolute', function() { <add> var doc; <add> <add> beforeEach(function() { <add> doc = new Doc({section: 'section'}); <add> }); <add> <add> it('should not change absolute url', function() { <add> expect(doc.convertUrlToAbsolute('guide/index')).toEqual('guide/index'); <add> }); <add> <add> it('should prepend current section to relative url', function() { <add> expect(doc.convertUrlToAbsolute('angular.widget')).toEqual('section/angular.widget'); <add> }); <add> <add> }); <add> <ide> describe('sorting', function(){ <ide> function property(name) { <ide> return function(obj) {return obj[name];}; <ide> describe('ngdoc', function(){ <ide> 'external{@link http://angularjs.org}\n\n' + <ide> 'external{@link ./static.html}\n\n' + <ide> '{@link angular.directive.ng:foo ng:foo}'); <add> <add> doc.section = 'api'; <ide> doc.parse(); <add> <ide> expect(doc.description). <ide> toContain('foo <a href="#!api/angular.foo"><code>angular.foo</code></a>'); <ide> expect(doc.description). <ide><path>docs/src/ngdoc.js <ide> Doc.prototype = { <ide> return words.join(' '); <ide> }, <ide> <del> <del> /* <del> * This function is here to act as a huristic based translator from the old style urls to <del> * the new style which use sections. <add> /** <add> * Converts relative urls (without section) into absolute <add> * Absolute url means url with section <add> * <add> * @example <add> * - if the link is inside any api doc: <add> * angular.widget -> api/angular.widget <add> * <add> * - if the link is inside any guid doc: <add> * intro -> guide/intro <add> * <add> * @param {string} url Absolute or relative url <add> * @returns {string} Absolute url <ide> */ <del> sectionHuristic: function (url){ <del> // if we are new styl URL with section/id then just return; <add> convertUrlToAbsolute: function(url) { <ide> if (url.match(/\//)) return url; <del> var match = url.match(/(\w+)(\.(.*))?/); <del> var section = match[1]; <del> var id = match[3] || 'index'; <del> switch(section) { <del> case 'angular': <del> section = 'api'; <del> id = 'angular.' + id; <del> break; <del> case 'api': <del> case 'cookbook': <del> case 'guide': <del> case 'intro': <del> case 'tutorial': <del> break; <del> default: <del> id = section + '.' + id; <del> section = 'intro'; <del> } <del> var newUrl = section + '/' + (id || 'index'); <del> console.log('WARNING:', 'found old style url', url, 'at', this.file, this.line, <del> 'converting to', newUrl); <del> return newUrl; <add> <add> // remove this after <add> return this.section + '/' + url; <ide> }, <ide> <ide> markdown: function (text) { <ide> Doc.prototype = { <ide> text = text.replace(/{@link\s+([^\s}]+)\s*([^}]*?)\s*}/g, <ide> function(_all, url, title){ <ide> var isFullUrl = url.match(IS_URL), <del> // FIXME(vojta) angular link could be api.angular now with sections <del> isAngular = url.match(IS_ANGULAR); <add> // FIXME(vojta) angular link could be api/angular now with sections <add> isAngular = url.match(IS_ANGULAR), <add> absUrl = isFullUrl ? url : self.convertUrlToAbsolute(url); <ide> <del> if (!isFullUrl) { <del> // TODO(vojta) there could be relative link, but not angular <del> // do we want to store all links (and check even the full links like http://github.com ? <del> self.links.push(self.sectionHuristic(url)); <del> } <add> if (!isFullUrl) self.links.push(absUrl); <ide> <del> return '<a href="' + (isFullUrl ? '' + url : '#!' + self.sectionHuristic(url)) + '">' <add> return '<a href="' + (isFullUrl ? '' + url : '#!' + absUrl) + '">' <ide> + (isAngular ? '<code>' : '') <ide> + (title || url).replace(/\n/g, ' ') <ide> + (isAngular ? '</code>' : '')
2
Python
Python
allow specification of terms to fit in hermfit
acc294dcd7d3998f8f2b82cad8f3ed6db48c1f00
<ide><path>numpy/polynomial/hermite.py <ide> def hermfit(x, y, deg, rcond=None, full=False, w=None): <ide> y-coordinates of the sample points. Several data sets of sample <ide> points sharing the same x-coordinates can be fitted at once by <ide> passing in a 2D-array that contains one dataset per column. <del> deg : int <del> Degree of the fitting polynomial <add> deg : int or array_like <add> Degree of the fitting polynomial. If `deg` is a single integer <add> all terms up to and including the `deg`'th term are included. <add> `deg` may alternatively be a list or array specifying which <add> terms in the Legendre expansion to include in the fit. <add> <add> .. versionchanged:: 1.11.0 <add> `deg` may be a list specifying which terms to fit <ide> rcond : float, optional <ide> Relative condition number of the fit. Singular values smaller than <ide> this relative to the largest singular value will be ignored. The <ide> def hermfit(x, y, deg, rcond=None, full=False, w=None): <ide> array([ 0.97902637, 1.99849131, 3.00006 ]) <ide> <ide> """ <del> order = int(deg) + 1 <ide> x = np.asarray(x) + 0.0 <ide> y = np.asarray(y) + 0.0 <add> deg = np.asarray([deg,], dtype=int).flatten() <ide> <ide> # check arguments. <del> if deg < 0: <add> if deg.size < 1: <add> raise TypeError("expected deg to be one or more integers") <add> if deg.min() < 0: <ide> raise ValueError("expected deg >= 0") <ide> if x.ndim != 1: <ide> raise TypeError("expected 1D vector for x") <ide> def hermfit(x, y, deg, rcond=None, full=False, w=None): <ide> if len(x) != len(y): <ide> raise TypeError("expected x and y to have same length") <ide> <add> if deg.size == 1: <add> restricted_fit = False <add> lmax = deg[0] <add> order = lmax + 1 <add> else: <add> restricted_fit = True <add> lmax = deg.max() <add> order = deg.size <add> <ide> # set up the least squares matrices in transposed form <del> lhs = hermvander(x, deg).T <add> van = hermvander(x, lmax) <add> if restricted_fit: <add> van = van[:, deg] <add> lhs = van.T <ide> rhs = y.T <ide> if w is not None: <ide> w = np.asarray(w) + 0.0 <ide> def hermfit(x, y, deg, rcond=None, full=False, w=None): <ide> c, resids, rank, s = la.lstsq(lhs.T/scl, rhs.T, rcond) <ide> c = (c.T/scl).T <ide> <add> # Expand c to include non-fitted coefficients which are set to zero <add> if restricted_fit: <add> if c.ndim == 2: <add> cc = np.zeros((lmax+1, c.shape[1]), dtype=c.dtype) <add> else: <add> cc = np.zeros(lmax+1, dtype=c.dtype) <add> cc[deg] = c <add> c = cc <add> <ide> # warn on rank reduction <ide> if rank != order and not full: <ide> msg = "The fit may be poorly conditioned"
1
Ruby
Ruby
provide access to the application's keygenerator
0479bff32dfb26a420b9ab4e2c2e6c2ed17550a3
<ide><path>railties/lib/rails/application.rb <ide> def reload_routes! <ide> routes_reloader.reload! <ide> end <ide> <add> <add> # Return the application's KeyGenerator <add> def key_generator <add> # number of iterations selected based on consultation with the google security <add> # team. Details at https://github.com/rails/rails/pull/6952#issuecomment-7661220 <add> @key_generator ||= ActiveSupport::KeyGenerator.new(config.secret_token, :iterations=>1000) <add> end <add> <ide> # Stores some of the Rails initial environment parameters which <ide> # will be used by middlewares and engines to configure themselves. <ide> # Currently stores: <ide> def env_config <ide> "action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions, <ide> "action_dispatch.show_detailed_exceptions" => config.consider_all_requests_local, <ide> "action_dispatch.logger" => Rails.logger, <del> "action_dispatch.backtrace_cleaner" => Rails.backtrace_cleaner <add> "action_dispatch.backtrace_cleaner" => Rails.backtrace_cleaner, <add> "action_dispatch.key_generator" => key_generator <ide> }) <ide> end <ide> <ide><path>railties/test/application/configuration_test.rb <ide> def index <ide> assert_equal app.env_config['action_dispatch.show_exceptions'], app.config.action_dispatch.show_exceptions <ide> assert_equal app.env_config['action_dispatch.logger'], Rails.logger <ide> assert_equal app.env_config['action_dispatch.backtrace_cleaner'], Rails.backtrace_cleaner <add> assert_equal app.env_config['action_dispatch.key_generator'], Rails.application.key_generator <ide> end <ide> <ide> test "config.colorize_logging default is true" do
2
Javascript
Javascript
add 10 to ylabelwidth on set, rather than on use
5ab5e8400afad4ea3e3d3d47531465984f31a2ee
<ide><path>src/Chart.Core.js <ide> for (var i=0; i<=this.steps; i++){ <ide> this.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)})); <ide> } <del> this.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) : 0; <add> this.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) + 10 : 0; <ide> }, <ide> addXLabel : function(label){ <ide> this.xLabels.push(label); <ide> <ide> <ide> this.xScalePaddingRight = lastWidth/2 + 3; <del> this.xScalePaddingLeft = (firstWidth/2 > this.yLabelWidth + 10) ? firstWidth/2 : this.yLabelWidth + 10; <add> this.xScalePaddingLeft = (firstWidth/2 > this.yLabelWidth) ? firstWidth/2 : this.yLabelWidth; <ide> <ide> this.xLabelRotation = 0; <ide> if (this.display){ <ide> lastRotated = cosRotation * lastWidth; <ide> <ide> // We're right aligning the text now. <del> if (firstRotated + this.fontSize / 2 > this.yLabelWidth + 8){ <add> if (firstRotated + this.fontSize / 2 > this.yLabelWidth){ <ide> this.xScalePaddingLeft = firstRotated + this.fontSize / 2; <ide> } <ide> this.xScalePaddingRight = this.fontSize/2;
1
Python
Python
exclude everything under apidocs/*
5e5f7a5f603361ff4f7e56de5308668f60ce3053
<ide><path>docs/conf.py <ide> # List of patterns, relative to source directory, that match files and <ide> # directories to ignore when looking for source files. <ide> exclude_patterns = [ <del> 'apidocs/modules.rst', # generated during build (orphan) <add> 'apidocs/*', # generated during build (orphans) <ide> '_build', <ide> '*/_*.rst' <ide> ]
1
Python
Python
add armpl as blas/lapack provider
10113d6cf392e6a2077687dff386d2765700904d
<ide><path>numpy/distutils/system_info.py <ide> def get_info(name, notfound_action=0): <ide> 1 - display warning message <ide> 2 - raise error <ide> """ <del> cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead <add> cl = {'armpl': armpl_info, <add> 'blas_armpl': blas_armpl_info, <add> 'lapack_armpl': lapack_armpl_info, <add> 'fftw3_armpl' : fftw3_armpl_info, <add> 'atlas': atlas_info, # use lapack_opt or blas_opt instead <ide> 'atlas_threads': atlas_threads_info, # ditto <ide> 'atlas_blas': atlas_blas_info, <ide> 'atlas_blas_threads': atlas_blas_threads_info, <ide> class fftw3_info(fftw_info): <ide> 'macros':[('SCIPY_FFTW3_H', None)]}, <ide> ] <ide> <add> <add>class fftw3_armpl_info(fftw_info): <add> section = 'fftw3' <add> dir_env_var = 'ARMPL_DIR' <add> notfounderror = FFTWNotFoundError <add> ver_info = [{'name':'fftw3', <add> 'libs':['armpl_lp64_mp'], <add> 'includes':['fftw3.h'], <add> 'macros':[('SCIPY_FFTW3_H', None)]}, <add> ] <add> <ide> <ide> class dfftw_info(fftw_info): <ide> section = 'fftw' <ide> class blas_mkl_info(mkl_info): <ide> pass <ide> <ide> <add>class armpl_info(system_info): <add> section = 'armpl' <add> dir_env_var = 'ARMPL_DIR' <add> _lib_armpl = ['armpl_lp64_mp'] <add> <add> def calc_info(self): <add> lib_dirs = self.get_lib_dirs() <add> incl_dirs = self.get_include_dirs() <add> armpl_libs = self.get_libs('armpl_libs', self._lib_armpl) <add> info = self.check_libs2(lib_dirs, armpl_libs) <add> if info is None: <add> return <add> dict_append(info, <add> define_macros=[('SCIPY_MKL_H', None), <add> ('HAVE_CBLAS', None)], <add> include_dirs=incl_dirs) <add> self.set_info(**info) <add> <add>class lapack_armpl_info(armpl_info): <add> pass <add> <add>class blas_armpl_info(armpl_info): <add> pass <add> <add> <ide> class atlas_info(system_info): <ide> section = 'atlas' <ide> dir_env_var = 'ATLAS' <ide> class lapack_opt_info(system_info): <ide> notfounderror = LapackNotFoundError <ide> <ide> # List of all known LAPACK libraries, in the default order <del> lapack_order = ['mkl', 'openblas', 'flame', <add> lapack_order = ['armpl', 'mkl', 'openblas', 'flame', <ide> 'accelerate', 'atlas', 'lapack'] <ide> order_env_var_name = 'NPY_LAPACK_ORDER' <add> <add> def _calc_info_armpl(self): <add> info = get_info('lapack_armpl') <add> if info: <add> self.set_info(**info) <add> return True <add> return False <ide> <ide> def _calc_info_mkl(self): <ide> info = get_info('lapack_mkl') <ide> class blas_opt_info(system_info): <ide> notfounderror = BlasNotFoundError <ide> # List of all known BLAS libraries, in the default order <ide> <del> blas_order = ['mkl', 'blis', 'openblas', <add> blas_order = ['armpl', 'mkl', 'blis', 'openblas', <ide> 'accelerate', 'atlas', 'blas'] <ide> order_env_var_name = 'NPY_BLAS_ORDER' <add> <add> def _calc_info_armpl(self): <add> info = get_info('blas_armpl') <add> if info: <add> self.set_info(**info) <add> return True <add> return False <ide> <ide> def _calc_info_mkl(self): <ide> info = get_info('blas_mkl')
1
Text
Text
remove the getting started section
564ae2b98287d346ee2a9705858db5115448d46f
<ide><path>readme.md <ide> <ide> Next.js is a minimalistic framework for server-rendered React applications. <ide> <add>**Visit https://learnnextjs.com to get started with Next.js.** <add> <add>--- <add> <ide> <!-- START doctoc generated TOC please keep comment here to allow auto update --> <ide> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <ide> <!-- https://github.com/thlorenz/doctoc --> <ide> <ide> - [How to use](#how-to-use) <del> - [Getting Started](#getting-started) <ide> - [Setup](#setup) <ide> - [Automatic code splitting](#automatic-code-splitting) <ide> - [CSS](#css) <ide> Next.js is a minimalistic framework for server-rendered React applications. <ide> <ide> ## How to use <ide> <del>### Getting Started <del> <del>A step by step interactive guide of next features is available at [learnnextjs.com](https://learnnextjs.com/) <del> <ide> ### Setup <ide> <ide> Install it:
1
Go
Go
fix error in rmi when conflict
dea29e7c999b7ef76a816867a2cb75c2da658fa2
<ide><path>api_test.go <ide> func TestDeleteImages(t *testing.T) { <ide> t.Errorf("Expected %d images, %d found", len(initialImages)+1, len(images)) <ide> } <ide> <del> req, err := http.NewRequest("DELETE", "/images/test:test", nil) <add> req, err := http.NewRequest("DELETE", "/images/"+unitTestImageID, nil) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> <ide> r := httptest.NewRecorder() <del> if err := deleteImages(srv, APIVERSION, r, req, map[string]string{"name": "test:test"}); err != nil { <add> if err := deleteImages(srv, APIVERSION, r, req, map[string]string{"name": unitTestImageID}); err == nil { <add> t.Fatalf("Expected conflict error, got none") <add> } <add> <add> req2, err := http.NewRequest("DELETE", "/images/test:test", nil) <add> if err != nil { <ide> t.Fatal(err) <ide> } <del> if r.Code != http.StatusOK { <add> <add> r2 := httptest.NewRecorder() <add> if err := deleteImages(srv, APIVERSION, r2, req2, map[string]string{"name": "test:test"}); err != nil { <add> t.Fatal(err) <add> } <add> if r2.Code != http.StatusOK { <ide> t.Fatalf("%d OK expected, received %d\n", http.StatusOK, r.Code) <ide> } <ide> <ide> var outs []APIRmi <del> if err := json.Unmarshal(r.Body.Bytes(), &outs); err != nil { <add> if err := json.Unmarshal(r2.Body.Bytes(), &outs); err != nil { <ide> t.Fatal(err) <ide> } <ide> if len(outs) != 1 { <ide><path>server.go <ide> func (srv *Server) deleteImageParents(img *Image, imgs *[]APIRmi) error { <ide> <ide> func (srv *Server) deleteImage(img *Image, repoName, tag string) ([]APIRmi, error) { <ide> //Untag the current image <del> var imgs []APIRmi <add> imgs := []APIRmi{} <ide> tagDeleted, err := srv.runtime.repositories.Delete(repoName, tag) <ide> if err != nil { <ide> return nil, err
2
Javascript
Javascript
add string-hash to compilation for styled-jsx
b04923775b9046e35a5e9c3bc7568ae4ec8182cf
<ide><path>packages/next/build/webpack.js <ide> function externalsConfig (dir, isServer) { <ide> return externals <ide> } <ide> <del> const notExternalModules = ['next/app', 'next/document', 'next/error', 'http-status'] <add> const notExternalModules = ['next/app', 'next/document', 'next/error', 'http-status', 'string-hash'] <ide> <ide> externals.push((context, request, callback) => { <ide> if (notExternalModules.indexOf(request) !== -1) {
1
Javascript
Javascript
implement tty.readstream and tty.writestream
87d898929ff18a5167ecaec32446bd64b0b07750
<ide><path>lib/tty.js <del>var spawn = require('child_process').spawn; <add> <ide> var binding = process.binding('stdio'); <ide> <add>if (process.platform === 'win32') { <add> exports = module.exports = require('tty_win32'); <add>} else { <add> exports = module.exports = require('tty_posix'); <add>} <ide> <ide> exports.isatty = binding.isatty; <ide> exports.setRawMode = binding.setRawMode; <ide> exports.getWindowSize = binding.getWindowSize; <ide> exports.setWindowSize = binding.setWindowSize; <del> <del> <del>exports.open = function(path, args) { <del> var fds = binding.openpty(); <del> <del> var slaveFD = fds[0]; <del> var masterFD = fds[1]; <del> <del> var env = { TERM: 'vt100' }; <del> for (var k in process.env) { <del> env[k] = process.env[k]; <del> } <del> <del> var stream = require('net').Stream(slaveFD); <del> stream.readable = stream.writable = true; <del> stream.resume(); <del> <del> <del> child = spawn(path, args, { <del> env: env, <del> customFds: [masterFD, masterFD, masterFD], <del> setuid: true <del> }); <del> <del> return [stream, child]; <del>}; <del> <del> <del> <del> <ide><path>lib/tty_posix.js <add> <add>var binding = process.binding('stdio'), <add> net = require('net'), <add> inherits = require('util').inherits, <add> spawn = require('child_process').spawn; <add> <add> <add>exports.open = function(path, args) { <add> var fds = binding.openpty(); <add> <add> var slaveFD = fds[0]; <add> var masterFD = fds[1]; <add> <add> var env = { TERM: 'vt100' }; <add> for (var k in process.env) { <add> env[k] = process.env[k]; <add> } <add> <add> var stream = require('net').Stream(slaveFD); <add> stream.readable = stream.writable = true; <add> stream.resume(); <add> <add> <add> child = spawn(path, args, { <add> env: env, <add> customFds: [masterFD, masterFD, masterFD], <add> setuid: true <add> }); <add> <add> return [stream, child]; <add>}; <add> <add> <add>function ReadStream(fd) { <add> if (!(this instanceof ReadStream)) return new ReadStream(fd); <add> net.Socket.call(this, fd); <add> <add> var self = this, <add> keypressListeners = this.listeners('keypress'); <add> <add> function onData(b) { <add> if (keypressListeners.length) { <add> self._emitKey(b); <add> } else { <add> // Nobody's watching anyway <add> self.removeListener('data', onData); <add> self.on('newlistener', onNewListener); <add> } <add> } <add> <add> function onNewListener(event) { <add> if (event == 'keypress') { <add> self.on('data', onData); <add> self.removeListener('newlistener', onNewListener); <add> } <add> } <add> <add> this.on('newListener', onNewListener); <add>} <add>inherits(ReadStream, net.Socket); <add>exports.ReadStream = ReadStream; <add> <add>ReadStream.prototype.isTTY = true; <add> <add>/* <add> Some patterns seen in terminal key escape codes, derived from combos seen <add> at http://www.midnight-commander.org/browser/lib/tty/key.c <add> <add> ESC [ letter <add> ESC [ modifier letter <add> ESC [ 1 ; modifier letter <add> ESC [ num char <add> ESC [ num ; modifier char <add> ESC O letter <add> ESC O modifier letter <add> ESC O 1 ; modifier letter <add> ESC N letter <add> ESC [ [ num ; modifier char <add> ESC [ [ 1 ; modifier letter <add> ESC ESC [ num char <add> ESC ESC O letter <add> <add> - char is usually ~ but $ and ^ also happen with rxvt <add> - modifier is 1 + <add> (shift * 1) + <add> (left_alt * 2) + <add> (ctrl * 4) + <add> (right_alt * 8) <add> - two leading ESCs apparently mean the same as one leading ESC <add>*/ <add> <add>// Regex used for ansi escape code splitting <add>var splitKeyCodeRe = <add> /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;(\d+))?([a-zA-Z]))/; <add> <add>ReadStream.prototype._emitKey = function(s) { <add> var char, <add> key = { <add> name: undefined, <add> ctrl: false, <add> meta: false, <add> shift: false <add> }, <add> parts; <add> <add> if (Buffer.isBuffer(s)) { <add> s = s.toString(this.encoding || 'utf-8'); <add> } <add> <add> if (s === '\r') { <add> // enter <add> key.name = 'enter'; <add> <add> } else if (s === '\t') { <add> // tab <add> key.tab = 'tab'; <add> <add> } else if (s === '\b' || s === '\x7f') { <add> // backspace or ctrl+h <add> key.name = 'backspace'; <add> <add> } else if (s === '\x1b') { <add> // escape key <add> key.name = 'escape'; <add> <add> } else if (s === ' ') { <add> key.name = 'space'; <add> <add> } else if (s <= '\x1a') { <add> // ctrl+letter <add> key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1); <add> key.ctrl = true; <add> <add> } else if (s >= 'a' && s <= 'z') { <add> // lowercase letter <add> key.name = s; <add> <add> } else if (s >= 'A' && s <= 'Z') { <add> // shift+letter <add> key.name = s.toLowerCase(); <add> key.shift = true; <add> <add> } else if (parts = splitKeyCodeRe.exec(s)) { <add> // ansi escape sequence <add> <add> // reassemble the key code leaving out leading \x1b's, <add> // the modifier key bitflag and any meaningless "1;" sequence <add> var code = (parts[1] || '') + (parts[2] || '') + <add> (parts[4] || '') + (parts[6] || ''), <add> modifier = (parts[3] || parts[5] || 1) - 1; <add> <add> // Parse the key modifier <add> key.ctrl = !!(modifier & 4); <add> key.meta = !!(modifier & 10); <add> key.shift = !!(modifier & 1); <add> <add> // Parse the key itself <add> switch (code) { <add> /* xterm/gnome ESC O letter */ <add> case 'OP': key.name = 'f1'; break; <add> case 'OQ': key.name = 'f2'; break; <add> case 'OR': key.name = 'f3'; break; <add> case 'OS': key.name = 'f4'; break; <add> <add> /* xterm/rxvt ESC [ number ~ */ <add> case '[11~': key.name = 'f1'; break; <add> case '[12~': key.name = 'f2'; break; <add> case '[13~': key.name = 'f3'; break; <add> case '[14~': key.name = 'f4'; break; <add> <add> /* common */ <add> case '[15~': key.name = 'f5'; break; <add> case '[17~': key.name = 'f6'; break; <add> case '[18~': key.name = 'f7'; break; <add> case '[19~': key.name = 'f8'; break; <add> case '[20~': key.name = 'f9'; break; <add> case '[21~': key.name = 'f10'; break; <add> case '[23~': key.name = 'f11'; break; <add> case '[24~': key.name = 'f12'; break; <add> <add> /* xterm ESC [ letter */ <add> case '[A': key.name = 'up'; break; <add> case '[B': key.name = 'down'; break; <add> case '[C': key.name = 'right'; break; <add> case '[D': key.name = 'left'; break; <add> case '[E': key.name = 'clear'; break; <add> case '[F': key.name = 'end'; break; <add> case '[H': key.name = 'home'; break; <add> <add> /* xterm/gnome ESC O letter */ <add> case 'OA': key.name = 'up'; break; <add> case 'OB': key.name = 'down'; break; <add> case 'OC': key.name = 'right'; break; <add> case 'OD': key.name = 'left'; break; <add> case 'OE': key.name = 'clear'; break; <add> case 'OF': key.name = 'end'; break; <add> case 'OH': key.name = 'home'; break; <add> <add> /* xterm/rxvt ESC [ number ~ */ <add> case '[1~': key.name = 'home'; break; <add> case '[2~': key.name = 'insert'; break; <add> case '[3~': key.name = 'delete'; break; <add> case '[4~': key.name = 'end'; break; <add> case '[5~': key.name = 'pageup'; break; <add> case '[6~': key.name = 'pagedown'; break; <add> <add> /* putty */ <add> case '[[5~': key.name = 'pageup'; break; <add> case '[[6~': key.name = 'pagedown'; break; <add> <add> /* rxvt */ <add> case '[7~': key.name = 'home'; break; <add> case '[8~': key.name = 'end'; break; <add> <add> /* rxvt keys with modifiers */ <add> case '[a': key.name = 'up'; key.shift = true; break; <add> case '[b': key.name = 'down'; key.shift = true; break; <add> case '[c': key.name = 'right'; key.shift = true; break; <add> case '[d': key.name = 'left'; key.shift = true; break; <add> case '[e': key.name = 'clear'; key.shift = true; break; <add> <add> case '[2$': key.name = 'insert'; key.shift = true; break; <add> case '[3$': key.name = 'delete'; key.shift = true; break; <add> case '[5$': key.name = 'pageup'; key.shift = true; break; <add> case '[6$': key.name = 'pagedown'; key.shift = true; break; <add> case '[7$': key.name = 'home'; key.shift = true; break; <add> case '[8$': key.name = 'end'; key.shift = true; break; <add> <add> case 'Oa': key.name = 'up'; key.ctrl = true; break; <add> case 'Ob': key.name = 'down'; key.ctrl = true; break; <add> case 'Oc': key.name = 'right'; key.ctrl = true; break; <add> case 'Od': key.name = 'left'; key.ctrl = true; break; <add> case 'Oe': key.name = 'clear'; key.ctrl = true; break; <add> <add> case '[2^': key.name = 'insert'; key.ctrl = true; break; <add> case '[3^': key.name = 'delete'; key.ctrl = true; break; <add> case '[5^': key.name = 'pageup'; key.ctrl = true; break; <add> case '[6^': key.name = 'pagedown'; key.ctrl = true; break; <add> case '[7^': key.name = 'home'; key.ctrl = true; break; <add> case '[8^': key.name = 'end'; key.ctrl = true; break; <add> <add> /* misc. */ <add> case '[Z': key.name = 'tab'; key.shift = true; break; <add> } <add> } <add> <add> // Don't emit a key if no name was found <add> if (key.name === undefined) { <add> key = undefined; <add> } <add> <add> if (s.length === 1) { <add> char = s; <add> } <add> <add> if (key || char) { <add> this.emit('keypress', char, key); <add> } <add>}; <add> <add> <add>function WriteStream(fd) { <add> if (!(this instanceof WriteStream)) return new WriteStream(fd); <add> net.Socket.call(this, fd); <add>} <add>inherits(WriteStream, net.Socket); <add>exports.WriteStream = WriteStream; <add> <add>WriteStream.prototype.isTTY = true; <add> <add>WriteStream.prototype.cursorTo = function(x, y) { <add> if (typeof x !== 'number' && typeof y !== 'number') <add> return; <add> <add> if (typeof x !== 'number') <add> throw new Error("Can't set cursor row without also setting it's column"); <add> <add> if (typeof x === 'number') { <add> this.write('\x1b[' + (x + 1) + 'G'); <add> } else { <add> this.write('\x1b[' + (y + 1) + ';' + (x + 1) + 'H'); <add> } <add>}; <add> <add>WriteStream.prototype.moveCursor = function(dx, dy) { <add> if (dx < 0) { <add> this.write('\x1b[' + (-dx) + 'D'); <add> } else if (dx > 0) { <add> this.write('\x1b[' + dx + 'C'); <add> } <add> <add> if (dy < 0) { <add> this.write('\x1b[' + (-dy) + 'A'); <add> } else if (dy > 0) { <add> this.write('\x1b[' + dy + 'B'); <add> } <add>}; <add> <add>WriteStream.prototype.clearLine = function(dir) { <add> if (dir < 0) { <add> // to the beginning <add> this.write('\x1b[1K'); <add> } else if (dir > 0) { <add> // to the end <add> this.write('\x1b[0K'); <add> } else { <add> // entire line <add> this.write('\x1b[2K'); <add> } <add>}; <add> <ide><path>lib/tty_win32.js <add> <add>var binding = process.binding('stdio'), <add> Stream = require('stream').Stream, <add> inherits = require('util').inherits, <add> writeTTY = binding.writeTTY, <add> closeTTY = binding.closeTTY; <add> <add> <add>function ReadStream(fd) { <add> if (!(this instanceof ReadStream)) return new ReadStream(fd); <add> Stream.call(this); <add> <add> var self = this; <add> this.fd = fd; <add> this.paused = true; <add> this.readable = true; <add> <add> var dataListeners = this.listeners('data'), <add> dataUseString = false; <add> <add> function onError(err) { <add> self.emit('error', err); <add> } <add> function onKeypress(char, key) { <add> self.emit('keypress', char, key); <add> if (dataListeners.length && char) { <add> self.emit('data', dataUseString ? char : new Buffer(char, 'utf-8')); <add> } <add> } <add> function onResize(h, w) { <add> process.emit('SIGWINCH'); <add> } <add> <add> // A windows console stream is always UTF-16, actually <add> // So it makes no sense to set the encoding, however someone could call <add> // setEncoding to tell us he wants strings not buffers <add> this.setEncoding = function(encoding) { <add> dataUseString = !!encoding; <add> } <add> <add> binding.initTTYWatcher(fd, onError, onKeypress, onResize); <add>} <add>inherits(ReadStream, Stream); <add>exports.ReadStream = ReadStream; <add> <add>ReadStream.prototype.isTTY = true; <add> <add>ReadStream.prototype.pause = function() { <add> if (this.paused) <add> return; <add> <add> this.paused = true; <add> binding.stopTTYWatcher(); <add>}; <add> <add>ReadStream.prototype.resume = function() { <add> if (!this.readable) <add> throw new Error('Cannot resume() closed tty.ReadStream.'); <add> if (!this.paused) <add> return; <add> <add> this.paused = false; <add> binding.startTTYWatcher(); <add>}; <add> <add>ReadStream.prototype.destroy = function() { <add> if (!this.readable) <add> return; <add> <add> this.readable = false; <add> binding.destroyTTYWatcher(); <add> <add> var self = this; <add> process.nextTick(function() { <add> try { <add> closeTTY(self.fd); <add> self.emit('close'); <add> } catch (err) { <add> self.emit('error', err); <add> } <add> }); <add>}; <add> <add>ReadStream.prototype.destroySoon = ReadStream.prototype.destroy; <add> <add> <add>function WriteStream(fd) { <add> if (!(this instanceof WriteStream)) return new WriteStream(fd); <add> Stream.call(this); <add> <add> var self = this; <add> this.fd = fd; <add> this.writable = true; <add>} <add>inherits(WriteStream, Stream); <add>exports.WriteStream = WriteStream; <add> <add>WriteStream.prototype.isTTY = true; <add> <add>WriteStream.prototype.write = function(data, encoding) { <add> if (!this.writable) { <add> throw new Error('stream not writable'); <add> } <add> <add> if (Buffer.isBuffer(data)) { <add> data = data.toString('utf-8'); <add> } <add> <add> try { <add> writeTTY(this.fd, data); <add> } catch (err) { <add> this.emit('error', err); <add> } <add> return true; <add>}; <add> <add>WriteStream.prototype.end = function(data, encoding) { <add> if (data) { <add> this.write(data, encoding); <add> } <add> this.destroy(); <add>}; <add> <add>WriteStream.prototype.destroy = function() { <add> if (!this.writable) <add> return; <add> <add> this.writable = false; <add> <add> var self = this; <add> process.nextTick(function() { <add> var closed = false; <add> try { <add> closeTTY(self.fd); <add> closed = true; <add> } catch (err) { <add> self.emit('error', err); <add> } <add> if (closed) { <add> self.emit('close'); <add> } <add> }); <add>}; <add> <add>WriteStream.prototype.moveCursor = function(dx, dy) { <add> if (!this.writable) <add> throw new Error('Stream not writable'); <add> <add> binding.moveCursor(this.fd, dx, dy); <add>}; <add> <add>WriteStream.prototype.cursorTo = function(x, y) { <add> if (!this.writable) <add> throw new Error('Stream not writable'); <add> <add> binding.cursorTo(this.fd, x, y); <add>}; <add> <add>WriteStream.prototype.clearLine = function(direction) { <add> if (!this.writable) <add> throw new Error('Stream not writable'); <add> <add> binding.clearLine(this.fd, direction || 0); <add>}; <ide>\ No newline at end of file
3
Text
Text
add future changelog for 15.6.0 addon release
e2cf6f61c2a3636b5291dd692f7f61c10657cc47
<ide><path>CHANGELOG.md <ide> <ide> ### React Addons <ide> <del>* Remove PropTypes dependency from ReactLink. ([@gaearon](https://github.com/gaearon) in [#9766](https://github.com/facebook/react/pull/9766)) <del>* Fix issue where environment variable was not being transformed by browserify. ([@mridgway](https://github.com/mridgway) in [#9642](https://github.com/facebook/react/pull/9642)) <add>* Fix AMD support for addons depending on `react`. ([@flarnie](https://github.com/flarnie) in [#9919](https://github.com/facebook/react/issues/9919)) <add>* Fix `isMounted()` to return `true` in `componentWillUnmount`. ([@mridgway](https://github.com/mridgway) in [#9638](https://github.com/facebook/react/issues/9638)) <add>* Fix `react-addons-update` to not depend on native `Object.assign`. ([@gaearon](https://github.com/gaearon) in [#9937](https://github.com/facebook/react/pull/9937)) <add>* Remove broken Google Closure Compiler annotation from `create-react-class`. ([@gaearon](https://github.com/gaearon) in [#9933](https://github.com/facebook/react/pull/9933)) <add>* Remove unnecessary dependency from `react-linked-input`. ([@gaearon](https://github.com/gaearon) in [#9766](https://github.com/facebook/react/pull/9766)) <add>* Point `react-addons-(css-)transition-group` to the new package. ([@gaearon](https://github.com/gaearon) in [#9937](https://github.com/facebook/react/pull/9937)) <ide> <ide> </details> <ide>
1
PHP
PHP
replace attributes for arrays in validation
d3efa151cf1922b891134bffaf952533ad51e6a7
<ide><path>src/Illuminate/Validation/Validator.php <ide> protected function getAttribute($attribute) <ide> // The developer may dynamically specify the array of custom attributes <ide> // on this Validator instance. If the attribute exists in this array <ide> // it takes precedence over all other ways we can pull attributes. <del> if (isset($this->customAttributes[$attribute])) { <del> return $this->customAttributes[$attribute]; <add> if ($customAttribute = $this->getCustomAttribute($attribute)) { <add> return $customAttribute; <ide> } <ide> <ide> $key = "validation.attributes.{$attribute}"; <ide> protected function getAttribute($attribute) <ide> return str_replace('_', ' ', Str::snake($attribute)); <ide> } <ide> <add> /** <add> * Get the value of a custom attribute. <add> * <add> * @param string $attribute <add> * @return string|null <add> */ <add> protected function getCustomAttribute($attribute) <add> { <add> return array_first($this->customAttributes, function ($custom) use ($attribute) { <add> return Str::is($custom, $attribute); <add> }); <add> } <add> <ide> /** <ide> * Get the displayable name of the value. <ide> * <ide><path>tests/Validation/ValidationValidatorTest.php <ide> public function testAttributeNamesAreReplaced() <ide> $this->assertEquals('NAME is required!', $v->messages()->first('name')); <ide> } <ide> <add> public function testAttributeNamesAreReplacedInArrays() <add> { <add> $trans = $this->getRealTranslator(); <add> $trans->addResource('array', ['validation.string' => ':attribute must be a string!'], 'en', 'messages'); <add> $v = new Validator($trans, ['name' => ['Jon', 2]], ['name.*' => 'string']); <add> $v->setAttributeNames(['name.*' => 'Any name']); <add> $this->assertFalse($v->passes()); <add> $v->messages()->setFormat(':message'); <add> $this->assertEquals('Any name must be a string!', $v->messages()->first('name.1')); <add> <add> $v = new Validator($trans, ['users' => [['name' => 'Jon'], ['name' => 2]]], ['users.*.name' => 'string']); <add> $v->setAttributeNames(['users.*.name' => 'Any name']); <add> $this->assertFalse($v->passes()); <add> $v->messages()->setFormat(':message'); <add> $this->assertEquals('Any name must be a string!', $v->messages()->first('users.1.name')); <add> } <add> <ide> public function testDisplayableValuesAreReplaced() <ide> { <ide> //required_if:foo,bar
2
Javascript
Javascript
fix loopprotect comment detection
4cc3d0e4a428bfdafb046f6d3e6d7efe39b3dbbd
<ide><path>public/js/lib/loop-protect/loop-protect.js <ide> if (typeof DEBUG === 'undefined') { DEBUG = true; } <ide> } <ide> } <ide> j -= 1; <del> } while (j !== 0); <add> } while (j >= 0); <ide> <ide> return false; <ide> } <ide> if (typeof DEBUG === 'undefined') { DEBUG = true; } <ide> } <ide> if (character === '/' || character === '*') { <ide> // looks like a comment, go back one to confirm or not <del> --index; <del> if (character === '/') { <add> var prevCharacter = line.substr(index - 1, 1); <add> if (prevCharacter === '/') { <ide> // we've found a comment, so let's exit and ignore this line <ide> DEBUG && debug('- exit: part of a comment'); // jshint ignore:line <ide> return true;
1
PHP
PHP
update doc for findornew method
e76168d60dfcda3341503998e21ac0608caed92c
<ide><path>src/Illuminate/Database/Eloquent/Model.php <ide> public static function all($columns = ['*']) <ide> * <ide> * @param mixed $id <ide> * @param array $columns <del> * @return \Illuminate\Support\Collection|static <add> * @return \Illuminate\Database\Eloquent\Model|static <ide> */ <ide> public static function findOrNew($id, $columns = ['*']) <ide> {
1
Javascript
Javascript
remove timer in test-dgram-send-empty-array
968fc72ad163cd635f6f33ad598048e327a7a791
<ide><path>test/parallel/test-dgram-send-empty-array.js <ide> if (common.isOSX) { <ide> <ide> const client = dgram.createSocket('udp4'); <ide> <del>const timer = setTimeout(function() { <del> throw new Error('Timeout'); <del>}, common.platformTimeout(200)); <del> <ide> client.on('message', common.mustCall(function onMessage(buf, info) { <ide> const expected = Buffer.alloc(0); <ide> assert.ok(buf.equals(expected), 'message was received correctly'); <del> clearTimeout(timer); <ide> client.close(); <ide> })); <ide>
1
Javascript
Javascript
fix handling of incorrect uid/gid in spawn
22789fd6d0a53a986073373136c269016d4267c8
<ide><path>lib/child_process.js <ide> const { <ide> ERR_INVALID_OPT_VALUE, <ide> ERR_OUT_OF_RANGE <ide> } = require('internal/errors').codes; <del>const { validateString } = require('internal/validators'); <add>const { validateString, isInt32 } = require('internal/validators'); <ide> const child_process = require('internal/child_process'); <ide> const { <ide> _validateStdio, <ide> function normalizeSpawnArguments(file, args, options) { <ide> } <ide> <ide> // Validate the uid, if present. <del> if (options.uid != null && !Number.isInteger(options.uid)) { <del> throw new ERR_INVALID_ARG_TYPE('options.uid', 'integer', options.uid); <add> if (options.uid != null && !isInt32(options.uid)) { <add> throw new ERR_INVALID_ARG_TYPE('options.uid', 'int32', options.uid); <ide> } <ide> <ide> // Validate the gid, if present. <del> if (options.gid != null && !Number.isInteger(options.gid)) { <del> throw new ERR_INVALID_ARG_TYPE('options.gid', 'integer', options.gid); <add> if (options.gid != null && !isInt32(options.gid)) { <add> throw new ERR_INVALID_ARG_TYPE('options.gid', 'int32', options.gid); <ide> } <ide> <ide> // Validate the shell, if present. <ide><path>test/parallel/test-child-process-spawn-typeerror.js <ide> const invalidArgValueError = <ide> common.expectsError({ code: 'ERR_INVALID_ARG_VALUE', type: TypeError }, 14); <ide> <ide> const invalidArgTypeError = <del> common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 10); <add> common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 12); <ide> <ide> assert.throws(function() { <ide> const child = spawn(invalidcmd, 'this is not an array'); <ide> assert.throws(function() { <ide> spawn(cmd, [], 1); <ide> }, invalidArgTypeError); <ide> <add>assert.throws(function() { <add> spawn(cmd, [], { uid: 2 ** 63 }); <add>}, invalidArgTypeError); <add> <add>assert.throws(function() { <add> spawn(cmd, [], { gid: 2 ** 63 }); <add>}, invalidArgTypeError); <add> <ide> // Argument types for combinatorics. <ide> const a = []; <ide> const o = {};
2
Ruby
Ruby
use xargs to batch file arguments
d8a6863283048cd2cc1f7fb78178b2fc19420e0c
<ide><path>Library/Homebrew/keg_relocate.rb <ide> def text_files <ide> # file with that fix is only available in macOS Sierra. <ide> # http://bugs.gw.com/view.php?id=292 <ide> with_custom_locale("C") do <del> path.find do |pn| <del> next if pn.symlink? || pn.directory? <del> next if Metafiles::EXTENSIONS.include? pn.extname <del> if Utils.popen_read("/usr/bin/file", "--brief", pn).include?("text") || <del> pn.text_executable? <del> text_files << pn <del> end <add> files = path.find.reject { |pn| <add> pn.symlink? || pn.directory? || Metafiles::EXTENSIONS.include?(pn.extname) <add> } <add> output, _status = Open3.capture2("/usr/bin/xargs -0 /usr/bin/file --no-dereference --brief", <add> stdin_data: files.join("\0")) <add> output.each_line.with_index do |line, i| <add> next unless line.include?("text") <add> text_files << files[i] <ide> end <ide> end <ide>
1
Go
Go
fix issue with cp to container volume dir
e6eef7eb4911252c38c829775aa0d510a432476a
<ide><path>pkg/chrootarchive/chroot_linux.go <ide> func chroot(path string) (err error) { <ide> if err := mount.MakeRPrivate("/"); err != nil { <ide> return err <ide> } <del> // ensure path is a mountpoint <del> if err := mount.MakePrivate(path); err != nil { <del> return err <add> <add> if mounted, _ := mount.Mounted(path); !mounted { <add> if err := mount.Mount(path, path, "bind", "rbind,rw"); err != nil { <add> return realChroot(path) <add> } <ide> } <ide> <ide> // setup oldRoot for pivot_root
1
Javascript
Javascript
turn non cta buttons to ghost
c413995a4f7876b77717fff29babeb0461f9c7c4
<ide><path>client/src/templates/Challenges/components/CompletionModal.js <ide> export class CompletionModal extends Component { <ide> block={true} <ide> bsSize='lg' <ide> bsStyle='primary' <del> className='btn-primary-invert' <add> className='btn-invert' <ide> download={`${dashedName}.json`} <ide> href={this.state.downloadURL} <ide> > <ide><path>client/src/templates/Challenges/components/Tool-Panel.js <ide> function ToolPanel({ <ide> <Button <ide> block={true} <ide> bsStyle='primary' <del> className='btn-primary-invert' <add> className='btn-invert' <ide> onClick={openResetModal} <ide> > <ide> {isMobile ? 'Reset' : 'Reset All Code'} <ide> function ToolPanel({ <ide> <Button <ide> block={true} <ide> bsStyle='primary' <del> className='btn-primary-invert' <add> className='btn-invert' <ide> href={guideUrl} <ide> target='_blank' <ide> > <ide> function ToolPanel({ <ide> <Button <ide> block={true} <ide> bsStyle='primary' <del> className='btn-primary-invert' <add> className='btn-invert' <ide> onClick={openVideoModal} <ide> > <ide> {isMobile ? 'Video' : 'Watch a video'} <ide> function ToolPanel({ <ide> <Button <ide> block={true} <ide> bsStyle='primary' <del> className='btn-primary-invert' <add> className='btn-invert' <ide> onClick={openHelpModal} <ide> > <ide> {isMobile ? 'Help' : 'Ask for help'} <ide><path>client/src/templates/Challenges/project/Tool-Panel.js <ide> export class ToolPanel extends Component { <ide> <Button <ide> block={true} <ide> bsStyle='primary' <del> className='btn-primary-invert' <add> className='btn-invert' <ide> href={guideUrl} <ide> target='_blank' <ide> > <ide> export class ToolPanel extends Component { <ide> <Button <ide> block={true} <ide> bsStyle='primary' <del> className='btn-primary-invert' <add> className='btn-invert' <ide> onClick={openHelpModal} <ide> > <ide> Ask for help <ide><path>client/src/templates/Introduction/Intro.js <ide> function IntroductionPage({ data: { markdownRemark, allChallengeNode } }) { <ide> </Link> <ide> <ButtonSpacer /> <ide> <Link to='/learn'> <del> <Button block={true} bsSize='lg' className='btn-primary-invert'> <add> <Button block={true} bsSize='lg' className='btn-invert'> <ide> View the curriculum <ide> </Button> <ide> </Link>
4
PHP
PHP
fix some docblocks
ed86dcda3078d0cd470199b7cf4853d8b2cde808
<ide><path>src/Illuminate/Mail/Mailable.php <ide> class Mailable implements MailableContract <ide> /** <ide> * Send the message using the given mailer. <ide> * <del> * @param MailerContract $mailer <add> * @param \Illuminate\Contracts\Mail\Mailer $mailer <ide> * @return void <ide> */ <ide> public function send(MailerContract $mailer) <ide> public function send(MailerContract $mailer) <ide> /** <ide> * Queue the message for sending. <ide> * <del> * @param Queue $queue <add> * @param \Illuminate\Contracts\Queue\Factory $queue <ide> * @return mixed <ide> */ <ide> public function queue(Queue $queue) <ide> public function view($view, array $data = []) <ide> /** <ide> * Set the plain text view for the message. <ide> * <del> * @param string $view <add> * @param string $textView <ide> * @param array $data <ide> * @return $this <ide> */
1
Ruby
Ruby
leave all our tests as order_dependent! for now
2f52f969885b2834198de0045748436a4651a94e
<ide><path>actionmailer/test/abstract_unit.rb <ide> def jruby_skip(message = '') <ide> end <ide> <ide> require 'mocha/setup' # FIXME: stop using mocha <add> <add># FIXME: we have tests that depend on run order, we should fix that and <add># remove this method call. <add>require 'active_support/test_case' <add>ActiveSupport::TestCase.my_tests_are_order_dependent! <ide><path>actionpack/test/abstract_unit.rb <ide> def translate_exceptions(result) <ide> # Use N processes (N defaults to 4) <ide> Minitest.parallel_executor = ForkingExecutor.new(PROCESS_COUNT) <ide> end <add> <add># FIXME: we have tests that depend on run order, we should fix that and <add># remove this method call. <add>require 'active_support/test_case' <add>ActiveSupport::TestCase.my_tests_are_order_dependent! <ide><path>actionview/test/abstract_unit.rb <ide> def jruby_skip(message = '') <ide> end <ide> <ide> require 'mocha/setup' # FIXME: stop using mocha <add> <add># FIXME: we have tests that depend on run order, we should fix that and <add># remove this method call. <add>require 'active_support/test_case' <add>ActiveSupport::TestCase.my_tests_are_order_dependent! <ide><path>activemodel/test/cases/helper.rb <ide> require 'active_support/testing/autorun' <ide> <ide> require 'mocha/setup' # FIXME: stop using mocha <add> <add># FIXME: we have tests that depend on run order, we should fix that and <add># remove this method call. <add>require 'active_support/test_case' <add>ActiveSupport::TestCase.my_tests_are_order_dependent! <ide><path>activerecord/test/cases/helper.rb <ide> def in_time_zone(zone) <ide> end <ide> <ide> require 'mocha/setup' # FIXME: stop using mocha <add> <add># FIXME: we have tests that depend on run order, we should fix that and <add># remove this method call. <add>require 'active_support/test_case' <add>ActiveSupport::TestCase.my_tests_are_order_dependent! <ide><path>activesupport/test/abstract_unit.rb <ide> def jruby_skip(message = '') <ide> end <ide> <ide> require 'mocha/setup' # FIXME: stop using mocha <add> <add># FIXME: we have tests that depend on run order, we should fix that and <add># remove this method call. <add>require 'active_support/test_case' <add>ActiveSupport::TestCase.my_tests_are_order_dependent! <ide><path>railties/test/abstract_unit.rb <ide> def jruby_skip(message = '') <ide> end <ide> <ide> class ActiveSupport::TestCase <add> # FIXME: we have tests that depend on run order, we should fix that and <add> # remove this method call. <add> self.my_tests_are_order_dependent! <add> <ide> private <ide> <ide> unless defined?(:capture)
7
Text
Text
add builder dev-report for 2017-05-07
63c16a443a9d5728dec19ae5de4abb61bdb9441c
<ide><path>reports/builder/2017-05-07.md <add># Development Report for May 07, 2017 <add> <add> <add>### Quality: Dependency interface switch <add> <add>Proposal for [switching the dependency interface](https://github.com/moby/moby/issues/32904) for current builder package. That should fix the current problems with data leakage and conflicts caused by daemon state cleanup scripts. <add> <add>Merged as part of this effort: <add> <add>- [Move dispatch state to a new struct](https://github.com/moby/moby/pull/32952) <add>- [Cleanup unnecessary mutate then revert of b.runConfig](https://github.com/moby/moby/pull/32773) <add> <add>In review: <add>- [Refactor builder probe cache and container backend](https://github.com/moby/moby/pull/33061) <add>- [Expose GetImage interface for builder](https://github.com/moby/moby/pull/33054) <add> <add>### Merged: docker build --iidfile <add> <add>[`docker build --iidfile` to capture the ID of the build result](https://github.com/moby/moby/pull/32406). New option can be used by the CLI applications to get back the image ID of build result. API users can use the `Aux` messages in progress stream to also get the IDs for intermediate build stages, for example to share them for build cache. <add> <add>### New feature: Long running session <add> <add>PR for [adding long-running session between daemon and cli](https://github.com/moby/moby/pull/32677) that enables advanced features like incremental context send, build credentials from the client, ssh forwarding etc. <add> <add>@simonferquel proposed a [grpc-only version of that interface](https://github.com/moby/moby/pull/33047) that should simplify the setup needed for describing new features for the session. Looking for design reviews. <add> <add>The feature also needs to be reworked after CLI split. <add> <add>### buildkit <add> <add>Not much progress [apart from some design discussion](https://github.com/moby/moby/issues/32925). Next step would be to open up a repo. <add> <add>### Proposals for new Dockerfile features that need design feedback: <add> <add>[Add IMPORT/EXPORT commands to Dockerfile](https://github.com/moby/moby/issues/32100) <add> <add>[Add `DOCKEROS/DOCKERARCH` default ARG to Dockerfile](https://github.com/moby/moby/issues/32487) <add> <add>[Add support for `RUN --mount`](https://github.com/moby/moby/issues/32507) <add> <add>[DAG image builder](https://github.com/moby/moby/issues/32550) <add> <add>[Option to export the hash of the build context](https://github.com/moby/moby/issues/32963) (new) <add> <add>[Allow --cache-from=*](https://github.com/moby/moby/issues/33002#issuecomment-299041162) (new) <add> <add>If you are interested in implementing any of them, leave a comment on the specific issues. <add> <add>### Other new builder features currently in code-review: <add> <add>[Allow builds from any git remote ref](https://github.com/moby/moby/pull/32502) <add> <add>[Fix a case where using FROM scratch as NAME would fail](https://github.com/moby/moby/pull/32997) <add> <add>### Backlog: <add> <add>[Build secrets](https://github.com/moby/moby/pull/30637) will be brought up again in next maintainer's meeting to evaluate how to move on with this, if any other proposals have changed the objective and if we should wait for swarm secrets to be available first.
1
Javascript
Javascript
remove indirection in checking proptypes
a8d37a7aa0033d1af9eb886509a96f778881fe12
<ide><path>src/isomorphic/classic/element/ReactElementValidator.js <ide> var ReactCurrentOwner = require('ReactCurrentOwner'); <ide> var ReactElement = require('ReactElement'); <ide> <del>var checkReactTypeSpec = require('checkReactTypeSpec'); <del> <ide> var canDefineProperty = require('canDefineProperty'); <ide> var getComponentName = require('getComponentName'); <ide> var getIteratorFn = require('getIteratorFn'); <ide> <ide> if (__DEV__) { <add> var checkPropTypes = require('checkPropTypes'); <ide> var warning = require('fbjs/lib/warning'); <ide> var ReactDebugCurrentFrame = require('ReactDebugCurrentFrame'); <ide> var { <ide> function validatePropTypes(element) { <ide> : componentClass.propTypes; <ide> <ide> if (propTypes) { <del> checkReactTypeSpec(propTypes, element.props, 'prop', name); <add> checkPropTypes( <add> propTypes, <add> element.props, <add> 'prop', <add> name, <add> ReactDebugCurrentFrame.getStackAddendum, <add> ); <ide> } <ide> if (typeof componentClass.getDefaultProps === 'function') { <ide> warning( <ide><path>src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js <ide> <ide> var PropTypes; <ide> var checkPropTypes; <del>var checkReactTypeSpec; <ide> var React; <ide> var ReactDOM; <ide> <ide> var MyComponent; <ide> <ide> function resetWarningCache() { <ide> jest.resetModules(); <del> checkReactTypeSpec = require('checkReactTypeSpec'); <ide> checkPropTypes = require('checkPropTypes'); <ide> } <ide> <ide> function getPropTypeWarningMessage(propTypes, object, componentName) { <ide> console.error.calls.reset(); <ide> } <ide> resetWarningCache(); <del> checkReactTypeSpec(propTypes, object, 'prop', 'testComponent'); <add> checkPropTypes(propTypes, object, 'prop', 'testComponent'); <ide> const callCount = console.error.calls.count(); <ide> if (callCount > 1) { <ide> throw new Error('Too many warnings.'); <ide><path>src/renderers/shared/fiber/ReactFiberContext.js <ide> import type {Fiber} from 'ReactFiber'; <ide> import type {StackCursor} from 'ReactFiberStack'; <ide> <add>var React = require('react'); <ide> var emptyObject = require('fbjs/lib/emptyObject'); <ide> var getComponentName = require('getComponentName'); <ide> var invariant = require('fbjs/lib/invariant'); <ide> const { <ide> } = require('ReactFiberStack'); <ide> <ide> if (__DEV__) { <del> var checkReactTypeSpec = require('checkReactTypeSpec'); <ide> var ReactDebugCurrentFrame = require('react/lib/ReactDebugCurrentFrame'); <ide> var ReactDebugCurrentFiber = require('ReactDebugCurrentFiber'); <ide> var { <ide> exports.getMaskedContext = function( <ide> if (__DEV__) { <ide> const name = getComponentName(workInProgress) || 'Unknown'; <ide> ReactDebugCurrentFrame.current = workInProgress; <del> checkReactTypeSpec(contextTypes, context, 'context', name); <add> // $FlowFixMe - We know this export exists now, need to wait for Flow update <add> React.checkPropTypes( <add> contextTypes, <add> context, <add> 'context', <add> name, <add> ReactDebugCurrentFrame.getStackAddendum, <add> ); <ide> ReactDebugCurrentFrame.current = null; <ide> } <ide> <ide> function processChildContext( <ide> // TODO: remove this hack when we delete unstable_renderSubtree in Fiber. <ide> const workInProgress = isReconciling ? fiber : null; <ide> ReactDebugCurrentFrame.current = workInProgress; <del> checkReactTypeSpec(childContextTypes, childContext, 'child context', name); <add> // $FlowFixMe - We know this export exists now, need to wait for Flow update <add> React.checkPropTypes( <add> childContextTypes, <add> childContext, <add> 'child context', <add> name, <add> ReactDebugCurrentFrame.getStackAddendum, <add> ); <ide> ReactDebugCurrentFrame.current = null; <ide> } <ide> <ide><path>src/renderers/shared/stack/reconciler/ReactCompositeComponent.js <ide> var ReactNodeTypes = require('ReactNodeTypes'); <ide> var ReactReconciler = require('ReactReconciler'); <ide> <ide> if (__DEV__) { <del> var checkReactTypeSpec = require('checkReactTypeSpec'); <ide> var ReactDebugCurrentFrame = require('react/lib/ReactDebugCurrentFrame'); <ide> var warningAboutMissingGetChildContext = {}; <ide> } <ide> var ReactCompositeComponent = { <ide> _checkContextTypes: function(typeSpecs, values, location: string) { <ide> if (__DEV__) { <ide> ReactDebugCurrentFrame.current = this._debugID; <del> checkReactTypeSpec(typeSpecs, values, location, this.getName()); <add> React.checkPropTypes( <add> typeSpecs, <add> values, <add> location, <add> this.getName(), <add> ReactDebugCurrentFrame.getStackAddendum, <add> ); <ide> ReactDebugCurrentFrame.current = null; <ide> } <ide> }, <ide><path>src/shared/types/checkReactTypeSpec.js <del>/** <del> * Copyright 2013-present, Facebook, Inc. <del> * All rights reserved. <del> * <del> * This source code is licensed under the BSD-style license found in the <del> * LICENSE file in the root directory of this source tree. An additional grant <del> * of patent rights can be found in the PATENTS file in the same directory. <del> * <del> * @providesModule checkReactTypeSpec <del> */ <del> <del>'use strict'; <del> <del>var checkPropTypes = require('react/lib/checkPropTypes'); <del>var {getStackAddendum} = require('react/lib/ReactDebugCurrentFrame'); <del> <del>function checkReactTypeSpec( <del> typeSpecs, <del> values, <del> location: string, <del> componentName, <del>) { <del> checkPropTypes(typeSpecs, values, location, componentName, getStackAddendum); <del>} <del> <del>module.exports = checkReactTypeSpec;
5
Javascript
Javascript
remove unnecessary assignments with _extend
dce37dc35b48f1de9f69e11e68deae73a20b6c7a
<ide><path>lib/_http_agent.js <ide> Agent.prototype.addRequest = function addRequest(req, options) { <ide> } <ide> <ide> options = util._extend({}, options); <del> options = util._extend(options, this.options); <add> util._extend(options, this.options); <ide> <ide> if (!options.servername) { <ide> options.servername = options.host; <ide> Agent.prototype.addRequest = function addRequest(req, options) { <ide> Agent.prototype.createSocket = function createSocket(req, options, cb) { <ide> var self = this; <ide> options = util._extend({}, options); <del> options = util._extend(options, self.options); <add> util._extend(options, self.options); <ide> <ide> if (!options.servername) { <ide> options.servername = options.host; <ide><path>lib/_tls_wrap.js <ide> function normalizeConnectArgs(listArgs) { <ide> // the host/port/path args that it knows about, not the tls options. <ide> // This means that options.host overrides a host arg. <ide> if (listArgs[1] !== null && typeof listArgs[1] === 'object') { <del> options = util._extend(options, listArgs[1]); <add> util._extend(options, listArgs[1]); <ide> } else if (listArgs[2] !== null && typeof listArgs[2] === 'object') { <del> options = util._extend(options, listArgs[2]); <add> util._extend(options, listArgs[2]); <ide> } <ide> <ide> return (cb) ? [options, cb] : [options]; <ide><path>lib/child_process.js <ide> exports.execFile = function(file /*, args, options, callback*/) { <ide> } <ide> <ide> if (pos < arguments.length && typeof arguments[pos] === 'object') { <del> options = util._extend(options, arguments[pos++]); <add> util._extend(options, arguments[pos++]); <ide> } else if (pos < arguments.length && arguments[pos] == null) { <ide> pos++; <ide> } <ide><path>lib/internal/cluster/master.js <ide> cluster.setupMaster = function(options) { <ide> execArgv: process.execArgv, <ide> silent: false <ide> }; <del> settings = util._extend(settings, cluster.settings); <del> settings = util._extend(settings, options || {}); <add> util._extend(settings, cluster.settings); <add> util._extend(settings, options || {}); <ide> <ide> // Tell V8 to write profile data for each process to a separate file. <ide> // Without --logfile=v8-%p.log, everything ends up in a single, unusable <ide> function createWorkerProcess(id, env) { <ide> var execArgv = cluster.settings.execArgv.slice(); <ide> var debugPort = 0; <ide> <del> workerEnv = util._extend(workerEnv, env); <add> util._extend(workerEnv, env); <ide> workerEnv.NODE_UNIQUE_ID = '' + id; <ide> <ide> for (var i = 0; i < execArgv.length; i++) {
4
Python
Python
add support for listing user objects.
6f646fd107aa0a09bc020b3dedd627c65664af34
<ide><path>airflow/www/views.py <ide> class CustomUserStatsChartView(UserStatsChartView): <ide> route_base = "/userstatschartview" <ide> method_permission_name = { <ide> 'chart': 'read', <add> 'list': 'read', <ide> } <ide> base_permissions = [permissions.ACTION_CAN_READ] <ide> <ide> class CustomUserLDAPModelView(UserLDAPModelView): <ide> class_permission_name = permissions.RESOURCE_MY_PROFILE <ide> method_permission_name = { <ide> 'userinfo': 'read', <add> 'list': 'read', <ide> } <ide> base_permissions = [ <ide> permissions.ACTION_CAN_READ, <ide> class CustomUserOAuthModelView(UserOAuthModelView): <ide> class_permission_name = permissions.RESOURCE_MY_PROFILE <ide> method_permission_name = { <ide> 'userinfo': 'read', <add> 'list': 'read', <ide> } <ide> base_permissions = [ <ide> permissions.ACTION_CAN_READ, <ide> class CustomUserOIDModelView(UserOIDModelView): <ide> class_permission_name = permissions.RESOURCE_MY_PROFILE <ide> method_permission_name = { <ide> 'userinfo': 'read', <add> 'list': 'read', <ide> } <ide> base_permissions = [ <ide> permissions.ACTION_CAN_READ, <ide> class CustomUserRemoteUserModelView(UserRemoteUserModelView): <ide> class_permission_name = permissions.RESOURCE_MY_PROFILE <ide> method_permission_name = { <ide> 'userinfo': 'read', <add> 'list': 'read', <ide> } <ide> base_permissions = [ <ide> permissions.ACTION_CAN_READ,
1
PHP
PHP
tweak a few things
4c78958b5b7de2b80a1b7a2699a7218d3caf478f
<ide><path>app/Console/Commands/Inspire.php <ide> <ide> class Inspire extends Command <ide> { <add> <ide> /** <ide> * The console command name. <ide> * <ide><path>app/Console/Kernel.php <ide> <ide> class Kernel extends ConsoleKernel <ide> { <add> <ide> /** <ide> * The Artisan commands provided by your application. <ide> * <ide><path>app/Exceptions/Handler.php <ide> <ide> class Handler extends ExceptionHandler <ide> { <add> <ide> /** <ide> * A list of the exception types that should not be reported. <ide> * <ide><path>app/Http/Controllers/Auth/AuthController.php <ide> <ide> class AuthController extends Controller <ide> { <add> <ide> /* <ide> |-------------------------------------------------------------------------- <ide> | Registration & Login Controller <ide><path>app/Http/Controllers/Auth/PasswordController.php <ide> <ide> class PasswordController extends Controller <ide> { <add> <ide> /* <ide> |-------------------------------------------------------------------------- <ide> | Password Reset Controller <ide><path>app/Http/Controllers/HomeController.php <ide> <ide> class HomeController extends Controller <ide> { <add> <ide> /* <ide> |-------------------------------------------------------------------------- <ide> | Home Controller <ide><path>app/Http/Controllers/WelcomeController.php <ide> <ide> class WelcomeController extends Controller <ide> { <add> <ide> /* <ide> |-------------------------------------------------------------------------- <ide> | Welcome Controller <ide><path>app/Http/Kernel.php <ide> <ide> class Kernel extends HttpKernel <ide> { <add> <ide> /** <ide> * The application's global HTTP middleware stack. <ide> * <ide><path>app/Http/Middleware/Authenticate.php <ide> <ide> class Authenticate <ide> { <add> <ide> /** <ide> * The Guard implementation. <ide> * <ide><path>app/Http/Middleware/RedirectIfAuthenticated.php <ide> <ide> class RedirectIfAuthenticated <ide> { <add> <ide> /** <ide> * The Guard implementation. <ide> * <ide><path>app/Http/Middleware/VerifyCsrfToken.php <ide> <ide> class VerifyCsrfToken extends BaseVerifier <ide> { <add> <ide> /** <ide> * Handle an incoming request. <ide> * <ide><path>app/Jobs/Job.php <ide> <ide> abstract class Job <ide> { <del> <ide> // <ide> } <ide><path>database/migrations/2014_10_12_000000_create_users_table.php <ide> <ide> class CreateUsersTable extends Migration <ide> { <add> <ide> /** <ide> * Run the migrations. <ide> * <ide><path>database/migrations/2014_10_12_100000_create_password_resets_table.php <ide> <ide> class CreatePasswordResetsTable extends Migration <ide> { <add> <ide> /** <ide> * Run the migrations. <ide> * <ide><path>database/seeds/DatabaseSeeder.php <ide> <ide> class DatabaseSeeder extends Seeder <ide> { <add> <ide> /** <ide> * Run the database seeds. <ide> * <ide><path>tests/ExampleTest.php <ide> <ide> class ExampleTest extends TestCase <ide> { <add> <ide> /** <ide> * A basic functional test example. <ide> * <ide><path>tests/TestCase.php <ide> <ide> class TestCase extends Illuminate\Foundation\Testing\TestCase <ide> { <add> <ide> /** <ide> * Creates the application. <ide> *
17
Ruby
Ruby
move pathename property tests to separate file
e4766639dc00f3844e4ab18fbd36d90633549dcf
<ide><path>Library/Homebrew/test/test_bucket.rb <ide> def test_pathname_plus_yeast <ide> abcd.cp HOMEBREW_CACHE <ide> assert orig_abcd.exist? <ide> <del> foo1=HOMEBREW_CACHE+'foo-0.1.tar.gz' <del> FileUtils.cp ABS__FILE__, foo1 <del> assert foo1.file? <del> <del> assert_equal '.tar.gz', foo1.extname <del> assert_equal 'foo-0.1', foo1.stem <del> assert_equal '0.1', foo1.version <del> <ide> HOMEBREW_CACHE.chmod_R 0777 <ide> end <ide> end <ide> end <ide> <add> def test_pathname_properties <add> foo1=HOMEBREW_CACHE+'foo-0.1.tar.gz' <add> <add> assert_equal '.tar.gz', foo1.extname <add> assert_equal 'foo-0.1', foo1.stem <add> assert_equal '0.1', foo1.version <add> end <add> <ide> def test_class_naming <ide> assert_equal 'ShellFm', Formula.class_s('shell.fm') <ide> assert_equal 'Fooxx', Formula.class_s('foo++')
1
Python
Python
add stringstore test for api docs
804dbb8d258c2c5e58c0b7fcdff21c68d818706a
<ide><path>spacy/tests/stringstore/test_stringstore.py <ide> import pytest <ide> <ide> <add>def test_stringstore_from_api_docs(stringstore): <add> apple_hash = stringstore.add('apple') <add> assert apple_hash == 8566208034543834098 <add> assert stringstore[apple_hash] == u'apple' <add> <add> assert u'apple' in stringstore <add> assert u'cherry' not in stringstore <add> <add> orange_hash = stringstore.add('orange') <add> all_strings = [s for s in stringstore] <add> assert all_strings == [u'apple', u'orange'] <add> <add> banana_hash = stringstore.add('banana') <add> assert len(stringstore) == 3 <add> assert banana_hash == 2525716904149915114 <add> assert stringstore[banana_hash] == u'banana' <add> assert stringstore[u'banana'] == banana_hash <add> <add> <ide> @pytest.mark.parametrize('text1,text2,text3', [(b'Hello', b'goodbye', b'hello')]) <ide> def test_stringstore_save_bytes(stringstore, text1, text2, text3): <ide> key = stringstore.add(text1)
1