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
Go
Go
remove dead code
927d13bc3c2030bb0e0429dbc500f13d72e7ccf6
<ide><path>daemon/daemon_unix.go <ide> import ( <ide> "github.com/docker/libnetwork/options" <ide> ) <ide> <del>const runDir = "/var/run/docker" <del>const defaultVolumesPathName = "volumes" <del> <ide> func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) { <ide> initID := fmt.Sprintf("%s-init", container.ID) <ide> return daemon.driver.Changes(container.ID, initID) <ide><path>daemon/daemon_windows.go <ide> import ( <ide> "github.com/docker/libnetwork" <ide> ) <ide> <del>var runDir = os.Getenv("TEMP") <del> <ide> func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) { <ide> return daemon.driver.Changes(container.ID, container.ImageID) <ide> } <ide><path>docker/client.go <ide> import ( <ide> "log" // see gh#8745, client needs to use go log pkg <ide> ) <ide> <del>const CanDaemon = false <del> <ide> func mainDaemon() { <ide> log.Fatal("This is a client-only binary - running the Docker daemon is not supported.") <ide> } <ide><path>docker/daemon.go <ide> import ( <ide> "github.com/docker/docker/utils" <ide> ) <ide> <del>const CanDaemon = true <del> <ide> var ( <ide> daemonCfg = &daemon.Config{} <ide> registryCfg = &registry.Options{} <ide><path>graph/graph.go <ide> func bufferToFile(f *os.File, src io.Reader) (int64, digest.Digest, error) { <ide> return n, digest.NewDigest("sha256", h), nil <ide> } <ide> <del>// Check if given error is "not empty". <del>// Note: this is the way golang does it internally with os.IsNotExists. <del>func isNotEmpty(err error) bool { <del> switch pe := err.(type) { <del> case nil: <del> return false <del> case *os.PathError: <del> err = pe.Err <del> case *os.LinkError: <del> err = pe.Err <del> } <del> return strings.Contains(err.Error(), " not empty") <del>} <del> <ide> // Delete atomically removes an image from the graph. <ide> func (graph *Graph) Delete(name string) error { <ide> id, err := graph.idIndex.Get(name) <ide><path>registry/registry.go <ide> import ( <ide> "io/ioutil" <ide> "net" <ide> "net/http" <del> "net/http/httputil" <ide> "os" <ide> "path" <ide> "path/filepath" <ide> func DockerHeaders(metaHeaders http.Header) []transport.RequestModifier { <ide> return modifiers <ide> } <ide> <del>type debugTransport struct { <del> http.RoundTripper <del> log func(...interface{}) <del>} <del> <del>func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) { <del> dump, err := httputil.DumpRequestOut(req, false) <del> if err != nil { <del> tr.log("could not dump request") <del> } <del> tr.log(string(dump)) <del> resp, err := tr.RoundTripper.RoundTrip(req) <del> if err != nil { <del> return nil, err <del> } <del> dump, err = httputil.DumpResponse(resp, false) <del> if err != nil { <del> tr.log("could not dump response") <del> } <del> tr.log(string(dump)) <del> return resp, err <del>} <del> <ide> func HTTPClient(transport http.RoundTripper) *http.Client { <ide> if transport == nil { <ide> transport = NewTransport(ConnectTimeout, true) <ide><path>registry/registry_test.go <ide> package registry <ide> import ( <ide> "fmt" <ide> "net/http" <add> "net/http/httputil" <ide> "net/url" <ide> "strings" <ide> "testing" <ide> func TestIsSecureIndex(t *testing.T) { <ide> } <ide> } <ide> } <add> <add>type debugTransport struct { <add> http.RoundTripper <add> log func(...interface{}) <add>} <add> <add>func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) { <add> dump, err := httputil.DumpRequestOut(req, false) <add> if err != nil { <add> tr.log("could not dump request") <add> } <add> tr.log(string(dump)) <add> resp, err := tr.RoundTripper.RoundTrip(req) <add> if err != nil { <add> return nil, err <add> } <add> dump, err = httputil.DumpResponse(resp, false) <add> if err != nil { <add> tr.log("could not dump response") <add> } <add> tr.log(string(dump)) <add> return resp, err <add>} <ide><path>runconfig/parse.go <ide> func ParseRestartPolicy(policy string) (RestartPolicy, error) { <ide> return p, nil <ide> } <ide> <del>// options will come in the format of name.key=value or name.option <del>func parseDriverOpts(opts opts.ListOpts) (map[string][]string, error) { <del> out := make(map[string][]string, len(opts.GetAll())) <del> for _, o := range opts.GetAll() { <del> parts := strings.SplitN(o, ".", 2) <del> if len(parts) < 2 { <del> return nil, fmt.Errorf("invalid opt format %s", o) <del> } else if strings.TrimSpace(parts[0]) == "" { <del> return nil, fmt.Errorf("key cannot be empty %s", o) <del> } <del> values, exists := out[parts[0]] <del> if !exists { <del> values = []string{} <del> } <del> out[parts[0]] = append(values, parts[1]) <del> } <del> return out, nil <del>} <del> <ide> func parseKeyValueOpts(opts opts.ListOpts) ([]KeyValuePair, error) { <ide> out := make([]KeyValuePair, opts.Len()) <ide> for i, o := range opts.GetAll() {
8
Python
Python
enable deprecation warnings
97efffad9a9858c0d966723d543e1186629631d4
<ide><path>tests/flask_tests.py <ide> def has_encoding(name): <ide> def catch_warnings(): <ide> """Catch warnings in a with block in a list""" <ide> import warnings <add> <add> # make sure deprecation warnings are active in tests <add> warnings.simplefilter('default', category=DeprecationWarning) <add> <ide> filters = warnings.filters <ide> warnings.filters = filters[:] <ide> old_showwarning = warnings.showwarning
1
Ruby
Ruby
add `--bottle` option for json bottle info
d60f549a483a1a0d1f7061f8b8f1a68fc39ad8c4
<ide><path>Library/Homebrew/cmd/info.rb <ide> def info_args <ide> description: "Print a JSON representation. Currently the default value for <version> is `v1` for "\ <ide> "<formula>. For <formula> and <cask> use `v2`. See the docs for examples of using the "\ <ide> "JSON output: <https://docs.brew.sh/Querying-Brew>" <add> switch "--bottle", <add> depends_on: "--json", <add> description: "Output information about the bottles for <formula> and its dependencies." <ide> switch "--installed", <ide> depends_on: "--json", <ide> description: "Print JSON of formulae that are currently installed." <ide> def info_args <ide> conflicts "--installed", "--all" <ide> conflicts "--formula", "--cask" <ide> <add> %w[--cask --analytics --github].each do |conflict| <add> conflicts "--bottle", conflict <add> end <add> <ide> named_args [:formula, :cask] <ide> end <ide> end <ide> def print_json(args:) <ide> args.named.to_formulae <ide> end <ide> <del> formulae.map(&:to_hash) <add> if args.bottle? <add> formulae.map(&:to_recursive_bottle_hash) <add> else <add> formulae.map(&:to_hash) <add> end <ide> when :v2 <ide> formulae, casks = if args.all? <ide> [Formula.sort, Cask::Cask.to_a.sort_by(&:full_name)] <ide> def print_json(args:) <ide> args.named.to_formulae_to_casks <ide> end <ide> <del> { <del> "formulae" => formulae.map(&:to_hash), <del> "casks" => casks.map(&:to_h), <del> } <add> if args.bottle? <add> { "formulae" => formulae.map(&:to_recursive_bottle_hash) } <add> else <add> { <add> "formulae" => formulae.map(&:to_hash), <add> "casks" => casks.map(&:to_h), <add> } <add> end <ide> else <ide> raise <ide> end <ide><path>Library/Homebrew/formula.rb <ide> def to_hash <ide> <ide> # @api private <ide> # Generate a hash to be used to install a formula from a JSON file <del> def to_bottle_hash(top_level: true) <add> def to_recursive_bottle_hash(top_level: true) <ide> bottle = bottle_hash <ide> <ide> bottles = bottle["files"].map do |tag, file| <ide> def to_bottle_hash(top_level: true) <ide> <ide> return bottles unless top_level <ide> <add> dependencies = declared_runtime_dependencies.map do |dep| <add> dep.to_formula.to_recursive_bottle_hash(top_level: false) <add> end <add> <ide> { <add> "name" => name, <ide> "bottles" => bottles, <del> "dependencies" => declared_runtime_dependencies.map { |dep| dep.to_formula.to_bottle_hash(top_level: false) }, <add> "dependencies" => dependencies, <ide> } <ide> end <ide> <ide><path>Library/Homebrew/test/formula_spec.rb <ide> expect(h["versions"]["bottle"]).to be_truthy <ide> end <ide> <del> specify "#to_bottle_hash" do <add> specify "#to_recursive_bottle_hash" do <ide> f1 = formula "foo" do <ide> url "foo-1.0" <ide> <ide> end <ide> end <ide> <del> h = f1.to_bottle_hash <add> h = f1.to_recursive_bottle_hash <ide> <ide> expect(h).to be_a(Hash) <add> expect(h["name"]).to eq "foo" <ide> expect(h["bottles"].keys).to eq [Utils::Bottles.tag.to_s, "x86_64_foo"] <ide> expect(h["bottles"][Utils::Bottles.tag.to_s].keys).to eq ["url", "sha256"] <ide> expect(h["bottles"][Utils::Bottles.tag.to_s]["sha256"]).to eq TEST_SHA256
3
Python
Python
update layer utils
b666ef18a126c847eb6d25da08434c92cf988b7b
<ide><path>keras/utils/layer_utils.py <ide> from __future__ import print_function <ide> <ide> from .conv_utils import convert_kernel <del>from ..models import Model, Sequential <ide> from .. import backend as K <ide> import numpy as np <ide> <ide> def print_summary(model, line_length=None, positions=None): <ide> positions: relative or absolute positions of log elements in each line. <ide> If not provided, defaults to `[.33, .55, .67, 1.]`. <ide> """ <del> <del> if isinstance(model, Sequential): <del> sequential_like = True <del> else: <del> sequential_like = True <del> for v in model.nodes_by_depth.values(): <del> if len(v) > 1: <del> sequential_like = False <add> sequential_like = True <add> for v in model.nodes_by_depth.values(): <add> if len(v) > 1: <add> sequential_like = False <ide> <ide> if sequential_like: <ide> line_length = line_length or 65 <ide> def count_total_params(layers, layer_set=None): <ide> if layer in layer_set: <ide> continue <ide> layer_set.add(layer) <del> if isinstance(layer, (Model, Sequential)): <add> if hasattr(layer, 'layers'): <ide> t, nt = count_total_params(layer.layers, layer_set) <ide> trainable_count += t <ide> non_trainable_count += nt <ide> def convert_all_kernels_in_model(model): <ide> # Note: SeparableConvolution not included <ide> # since only supported by TF. <ide> conv_classes = { <del> 'Convolution1D', <del> 'Convolution2D', <del> 'Convolution3D', <del> 'AtrousConvolution2D', <del> 'Deconvolution2D', <add> 'Conv1D', <add> 'Conv2D', <add> 'Conv3D', <add> 'Conv2DTranspose', <ide> } <ide> to_assign = [] <ide> for layer in model.layers: <ide> if layer.__class__.__name__ in conv_classes: <del> original_w = K.get_value(layer.W) <del> converted_w = convert_kernel(original_w) <del> to_assign.append((layer.W, converted_w)) <add> original_kernel = K.get_value(layer.kernel) <add> converted_kernel = convert_kernel(original_kernel) <add> to_assign.append((layer.kernel, converted_kernel)) <ide> K.batch_set_value(to_assign) <ide> <ide>
1
Ruby
Ruby
correct bad jquery syntax
7cf2912f062f5836d8fa772325411ab1e04715f2
<ide><path>actionpack/lib/action_view/helpers/form_helper.rb <ide> def label(object_name, method, content_or_options = nil, options = nil, &block) <ide> # text_field(:post, :title, class: "create_input") <ide> # # => <input type="text" id="post_title" name="post[title]" value="#{@post.title}" class="create_input" /> <ide> # <del> # text_field(:session, :user, onchange: "if $('session[user]').value == 'admin' { alert('Your login can not be admin!'); }") <del> # # => <input type="text" id="session_user" name="session[user]" value="#{@session.user}" onchange = "if $('session[user]').value == 'admin' { alert('Your login can not be admin!'); }"/> <add> # text_field(:session, :user, onchange: "if $('#session_user').value == 'admin' { alert('Your login can not be admin!'); }") <add> # # => <input type="text" id="session_user" name="session[user]" value="#{@session.user}" onchange = "if $('#session_user').value == 'admin' { alert('Your login can not be admin!'); }"/> <ide> # <ide> # text_field(:snippet, :code, size: 20, class: 'code_input') <ide> # # => <input type="text" id="snippet_code" name="snippet[code]" size="20" value="#{@snippet.code}" class="code_input" />
1
Python
Python
remove .data comparisons in tests. fix whitespace
1845fe92109f611d441765d39fb0ac05fa5948b2
<ide><path>numpy/ma/tests/test_core.py <ide> def test_copy(self): <ide> x = masked_array([1,2,3], mask=[0,1,0]) <ide> # Copy is False by default <ide> y = masked_array(x) <del># assert_equal(id(y._data), id(x._data)) <del># assert_equal(id(y._mask), id(x._mask)) <ide> assert_equal(y._data.ctypes.data, x._data.ctypes.data) <ide> assert_equal(y._mask.ctypes.data, x._mask.ctypes.data) <ide> y = masked_array(x, copy=True) <del># assert_not_equal(id(y._data), id(x._data)) <del># assert_not_equal(id(y._mask), id(x._mask)) <ide> assert_not_equal(y._data.ctypes.data, x._data.ctypes.data) <ide> assert_not_equal(y._mask.ctypes.data, x._mask.ctypes.data) <ide> #........................ <ide> def test_tolist(self): <ide> dtype=[('a',int_),('b',float_),('c','|S8')]) <ide> x[-1] = masked <ide> assert_equal(x.tolist(), [(1,1.1,'one'),(2,2.2,'two'),(None,None,None)]) <del> <ide> <ide> <ide> def test_squeeze(self): <ide> def test_compress(self): <ide> assert_equal(b._mask, [1,1,0,0]) <ide> # <ide> x = numpy.array([3,1,2]) <del> b = a.compress(x >= 2, axis=1) <add> b = a.compress(x >= 2, axis=1) <ide> assert_equal(b._data, [[10,30],[40,60]]) <ide> assert_equal(b._mask, [[0,1],[1,0]]) <ide> # <ide><path>numpy/ma/tests/test_old_ma.py <ide> def check_testCopySize(self): <ide> self.failUnless( y1.mask is m) <ide> <ide> y1a = array(y1, copy=0) <del> self.failUnless( y1a.data is y1.data) <ide> self.failUnless( y1a.mask is y1.mask) <ide> <ide> y2 = array(x1, mask=m, copy=0) <del> self.failUnless( y2.data is x1) <ide> self.failUnless( y2.mask is m) <ide> self.failUnless( y2[2] is masked) <ide> y2[2]=9
2
PHP
PHP
keep the transliterator identifier getter/setter
847d5bbc3aaad2c2321bc8ececa1a65c937aa65c
<ide><path>src/Utility/Text.php <ide> class Text <ide> { <ide> <ide> /** <del> * Default transliterator id string. <add> * Default transliterator. <ide> * <del> * @deprecated 3.7.0 Use $_defaultTransliterator instead. <del> * @var string $_defaultTransliteratorId Transliterator identifier string. <add> * @var \Transliterator Transliterator instance. <ide> */ <del> protected static $_defaultTransliteratorId; <add> protected static $_defaultTransliterator; <ide> <ide> /** <del> * Default transliterator. <add> * Default transliterator id string. <ide> * <del> * @var \Transliterator|string Either a Transliterator instance, or a <del> * transliterator identifier string. <add> * @var string $_defaultTransliteratorId Transliterator identifier string. <ide> */ <del> protected static $_defaultTransliterator = 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove'; <add> protected static $_defaultTransliteratorId = 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove'; <ide> <ide> /** <ide> * Default html tags who must not be count for truncate text. <ide> public static function parseFileSize($size, $default = false) <ide> } <ide> <ide> /** <del> * Get default transliterator identifier string. <add> * Get the default transliterator. <ide> * <del> * @deprecated 3.7.0 Use getTransliterator() instead. <del> * @return string Transliterator identifier. <add> * @return \Transliterator|null Either a Transliterator instance, or `null` <add> * in case no transliterator has been set yet. <add> * @since 3.7.0 <ide> */ <del> public static function getTransliteratorId() <add> public static function getTransliterator() <ide> { <del> deprecationWarning( <del> 'Text::getTransliteratorId() is deprecated. ' . <del> 'Use Text::getTransliterator() instead.' <del> ); <del> <del> return static::getTransliterator(); <add> return static::$_defaultTransliterator; <ide> } <ide> <ide> /** <del> * Set default transliterator identifier string. <add> * Set the default transliterator. <ide> * <del> * @deprecated 3.7.0 Use setTransliterator() instead. <del> * @param string $transliteratorId Transliterator identifier. <add> * @param \Transliterator $transliterator A `Transliterator` instance. <ide> * @return void <add> * @since 3.7.0 <ide> */ <del> public static function setTransliteratorId($transliteratorId) <add> public static function setTransliterator(\Transliterator $transliterator) <ide> { <del> deprecationWarning( <del> 'Text::setTransliteratorId() is deprecated. ' . <del> 'Use Text::setTransliterator() instead.' <del> ); <del> <del> static::setTransliterator($transliteratorId); <add> static::$_defaultTransliterator = $transliterator; <ide> } <ide> <ide> /** <del> * Get the default transliterator. <add> * Get default transliterator identifier string. <ide> * <del> * @return \Transliterator|string Either a Transliterator instance, or a <del> * transliterator identifier string. <del> * @since 3.7.0 <add> * @return string Transliterator identifier. <ide> */ <del> public static function getTransliterator() <add> public static function getTransliteratorId() <ide> { <del> return static::$_defaultTransliterator; <add> return static::$_defaultTransliteratorId; <ide> } <ide> <ide> /** <ide> * Set default transliterator identifier string. <ide> * <del> * @param \Transliterator|string $transliterator Either a Transliterator <del> * instance, or a transliterator identifier string. <add> * @param string $transliteratorId Transliterator identifier. <ide> * @return void <del> * @since 3.7.0 <ide> */ <del> public static function setTransliterator($transliterator) <add> public static function setTransliteratorId($transliteratorId) <ide> { <del> static::$_defaultTransliterator = $transliterator; <add> static::setTransliterator(transliterator_create($transliteratorId)); <add> static::$_defaultTransliteratorId = $transliteratorId; <ide> } <ide> <ide> /** <ide> * Transliterate string. <ide> * <ide> * @param string $string String to transliterate. <ide> * @param \Transliterator|string|null $transliterator Either a Transliterator <del> * instance, or a transliterator identifier string. If `null` <del> * `Text::$_defaultTransliterator` will be used. <add> * instance, or a transliterator identifier string. If `null`, the default <add> * transliterator (identifier) set via `setTransliteratorId()` or <add> * `setTransliterator()` will be used. <ide> * @return string <ide> * @see https://secure.php.net/manual/en/transliterator.transliterate.php <ide> */ <ide> public static function transliterate($string, $transliterator = null) <ide> { <ide> if (!$transliterator) { <del> if (static::$_defaultTransliteratorId !== null) { <del> deprecationWarning( <del> '`Text::$_defaultTransliteratorId` is deprecated. ' . <del> 'Use `Text::$_defaultTransliterator` instead.' <del> ); <del> $transliterator = static::$_defaultTransliteratorId; <del> } else { <del> $transliterator = static::$_defaultTransliterator; <del> } <add> $transliterator = static::$_defaultTransliterator ?: static::$_defaultTransliteratorId; <ide> } <ide> <ide> return transliterator_transliterate($transliterator, $string); <ide> public static function transliterate($string, $transliterator = null) <ide> * ### Options: <ide> * <ide> * - `replacement`: Replacement string. Default '-'. <del> * - `transliterator`: A Transliterator instance, or a transliterator id string. <del> * If `null` (default) `Text::$_defaultTransliterator` will be used. <add> * - `transliteratorId`: A valid transliterator id string. <add> * If `null` (default) the transliterator (identifier) set via <add> * `setTransliteratorId()` or `setTransliterator()` will be used. <ide> * If `false` no transliteration will be done, only non words will be removed. <del> * - `transliteratorId`: Deprecated as of 3.7.0, use the `transliterator` option <del> * instead. <ide> * - `preserve`: Specific non-word character to preserve. Default `null`. <ide> * For e.g. this option can be set to '.' to generate clean file names. <ide> * <ide> * @param string $string the string you want to slug <ide> * @param array $options If string it will be use as replacement character <ide> * or an array of options. <ide> * @return string <add> * @see setTransliterator() <add> * @see setTransliteratorId() <ide> */ <ide> public static function slug($string, $options = []) <ide> { <ide> public static function slug($string, $options = []) <ide> } <ide> $options += [ <ide> 'replacement' => '-', <del> 'transliterator' => null, <add> 'transliteratorId' => null, <ide> 'preserve' => null <ide> ]; <ide> <del> if (array_key_exists('transliteratorId', $options)) { <del> deprecationWarning( <del> 'The `transliteratorId` option is deprecated. ' . <del> 'Use `transliterator` instead.' <del> ); <del> $options['transliterator'] = $options['transliteratorId']; <del> } <del> if ($options['transliterator'] !== false) { <del> $string = static::transliterate($string, $options['transliterator']); <add> if ($options['transliteratorId'] !== false) { <add> $string = static::transliterate($string, $options['transliteratorId']); <ide> } <ide> <ide> $regex = '^\s\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}'; <ide><path>tests/TestCase/Utility/TextTest.php <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Utility\Text; <ide> <del>/** <del> * Helper class that assists with testing overloading of a deprecated property. <del> */ <del>class TextOverloadDeprecatedTransliteratorIdProperty extends Text <del>{ <del> protected static $_defaultTransliteratorId = 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove'; <del>} <del> <ide> /** <ide> * TextTest class <ide> */ <ide> public function filesizes() <ide> ]; <ide> } <ide> <del> /** <del> * Test getting/setting default transliterator id. <del> * <del> * @return void <del> */ <del> public function testDeprecatedGetSetTransliteratorId() <del> { <del> $this->deprecated(function () { <del> $defaultTransliteratorId = 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove'; <del> $this->assertEquals($defaultTransliteratorId, Text::getTransliteratorId()); <del> <del> $expected = 'Latin-ASCII; [\u0080-\u7fff] remove'; <del> Text::setTransliteratorId($expected); <del> $this->assertEquals($expected, Text::getTransliteratorId()); <del> <del> Text::setTransliteratorId($defaultTransliteratorId); <del> }); <del> } <del> <ide> /** <ide> * Test getting/setting default transliterator. <ide> * <ide> * @return void <ide> */ <ide> public function testGetSetTransliterator() <ide> { <del> $defaultTransliterator = 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove'; <del> $this->assertEquals($defaultTransliterator, Text::getTransliterator()); <del> <del> $expected = 'Latin-ASCII; [\u0080-\u7fff] remove'; <del> Text::setTransliterator($expected); <del> $this->assertEquals($expected, Text::getTransliterator()); <add> $this->assertNull(Text::getTransliterator()); <ide> <ide> $transliterator = \Transliterator::createFromRules(' <ide> $nonletter = [:^Letter:]; <ide> public function testGetSetTransliterator() <ide> $this->assertInstanceOf(\Transliterator::class, $transliterator); <ide> Text::setTransliterator($transliterator); <ide> $this->assertSame($transliterator, Text::getTransliterator()); <add> } <add> <add> /** <add> * Test getting/setting default transliterator id. <add> * <add> * @return void <add> */ <add> public function testGetSetTransliteratorId() <add> { <add> $defaultTransliteratorId = 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove'; <add> $this->assertEquals($defaultTransliteratorId, Text::getTransliteratorId()); <add> <add> $expected = 'Latin-ASCII;[\u0080-\u7fff] remove'; <add> Text::setTransliteratorId($expected); <add> $this->assertEquals($expected, Text::getTransliteratorId()); <ide> <del> Text::setTransliterator($defaultTransliterator); <add> $this->assertInstanceOf(\Transliterator::class, Text::getTransliterator()); <add> $this->assertEquals($expected, Text::getTransliterator()->id); <add> <add> Text::setTransliteratorId($defaultTransliteratorId); <ide> } <ide> <ide> /** <ide> public function transliterateInputProvider() <ide> 'A ae Ubermensch pa hoyeste niva! I a lublu PHP! est. fi ' <ide> ], <ide> [ <del> 'Äpfel Über Öl grün ärgert groß öko', null, <del> 'Apfel Uber Ol grun argert gross oko' <add> 'Äpfel Über Öl grün ärgert groß öko', <add> transliterator_create_from_rules(' <add> $AE = [Ä {A \u0308}]; <add> $OE = [Ö {O \u0308}]; <add> $UE = [Ü {U \u0308}]; <add> [ä {a \u0308}] → ae; <add> [ö {o \u0308}] → oe; <add> [ü {u \u0308}] → ue; <add> {$AE} [:Lowercase:] → Ae; <add> {$OE} [:Lowercase:] → Oe; <add> {$UE} [:Lowercase:] → Ue; <add> $AE → AE; <add> $OE → OE; <add> $UE → UE; <add> ::Latin-ASCII; <add> '), <add> 'Aepfel Ueber Oel gruen aergert gross oeko' <ide> ], <ide> [ <ide> 'La langue française est un attribut de souveraineté en France', null, <ide> public function testTransliterate($string, $transliterator, $expected) <ide> $this->assertEquals($expected, $result); <ide> } <ide> <del> /** <del> * testTransliterateOverloadDeprecatedTransliteratorIdProperty method <del> * <del> * Tests that extending classes that overload the deprecated `$_defaultTransliteratorId` <del> * property still work as expected, and trigger a deprecation notice. <del> * <del> * @return void <del> */ <del> public function testTransliterateOverloadDeprecatedTransliteratorIdProperty() <del> { <del> $this->deprecated(function () { <del> $this->assertEquals( <del> 'ringo', <del> TextOverloadDeprecatedTransliteratorIdProperty::transliterate('りんご') <del> ); <del> }); <del> } <del> <ide> public function slugInputProvider() <ide> { <ide> return [ <ide> public function slugInputProvider() <ide> 'A-ae-Ubermensch-pa-hoyeste-niva-I-a-lublu-PHP-est-fi' <ide> ], <ide> [ <del> 'A æ Übérmensch på høyeste nivå! И я люблю PHP! есть. fi ¦', ['transliterator' => 'Latin-ASCII'], <add> 'A æ Übérmensch på høyeste nivå! И я люблю PHP! есть. fi ¦', ['transliteratorId' => 'Latin-ASCII'], <ide> 'A-ae-Ubermensch-pa-hoyeste-niva-И-я-люблю-PHP-есть-fi' <ide> ], <ide> [ <del> 'Äpfel Über Öl grün ärgert groß öko', <del> [ <del> 'transliterator' => \Transliterator::createFromRules(' <del> $AE = [Ä {A \u0308}]; <del> $OE = [Ö {O \u0308}]; <del> $UE = [Ü {U \u0308}]; <del> [ä {a \u0308}] → ae; <del> [ö {o \u0308}] → oe; <del> [ü {u \u0308}] → ue; <del> {$AE} [:Lowercase:] → Ae; <del> {$OE} [:Lowercase:] → Oe; <del> {$UE} [:Lowercase:] → Ue; <del> $AE → AE; <del> $OE → OE; <del> $UE → UE; <del> ::Latin-ASCII; <del> '), <del> ], <del> 'Aepfel-Ueber-Oel-gruen-aergert-gross-oeko' <add> 'Äpfel Über Öl grün ärgert groß öko', [], <add> 'Apfel-Uber-Ol-grun-argert-gross-oko' <ide> ], <ide> [ <ide> 'The truth - and- more- news', [], <ide> public function slugInputProvider() <ide> 'this-melts-your-face1-2-3' <ide> ], <ide> [ <del> 'controller/action/りんご/1', ['transliterator' => false], <add> 'controller/action/りんご/1', ['transliteratorId' => false], <ide> 'controller-action-りんご-1' <ide> ], <ide> [ <del> 'の話が出たので大丈夫かなあと', ['transliterator' => false], <add> 'の話が出たので大丈夫かなあと', ['transliteratorId' => false], <ide> 'の話が出たので大丈夫かなあと' <ide> ], <ide> [ <del> 'posts/view/한국어/page:1/sort:asc', ['transliterator' => false], <add> 'posts/view/한국어/page:1/sort:asc', ['transliteratorId' => false], <ide> 'posts-view-한국어-page-1-sort-asc' <ide> ], <ide> [ <ide> public function testSlug($string, $options, $expected) <ide> $this->assertEquals($expected, $result); <ide> } <ide> <del> public function slugDeprecatedTransliteratorIdOptionInputProvider() <del> { <del> return [ <del> [ <del> 'A æ Übérmensch på høyeste nivå! И я люблю PHP! есть. fi ¦', <del> ['transliteratorId' => 'Latin-ASCII'], <del> 'A-ae-Ubermensch-pa-hoyeste-niva-И-я-люблю-PHP-есть-fi' <del> ], <del> [ <del> 'Äpfel Über Öl grün ärgert groß öko', <del> [ <del> 'transliterator' => \Transliterator::createFromRules(' <del> $AE = [Ä {A \u0308}]; <del> $OE = [Ö {O \u0308}]; <del> $UE = [Ü {U \u0308}]; <del> [ä {a \u0308}] → ae; <del> [ö {o \u0308}] → oe; <del> [ü {u \u0308}] → ue; <del> {$AE} [:Lowercase:] → Ae; <del> {$OE} [:Lowercase:] → Oe; <del> {$UE} [:Lowercase:] → Ue; <del> $AE → AE; <del> $OE → OE; <del> $UE → UE; <del> ::Latin-ASCII; <del> '), <del> ], <del> 'Aepfel-Ueber-Oel-gruen-aergert-gross-oeko' <del> ], <del> [ <del> 'controller/action/りんご/1', <del> ['transliteratorId' => false], <del> 'controller-action-りんご-1' <del> ], <del> [ <del> 'cl#ean(me', <del> ['transliteratorId' => null], <del> 'cl-ean-me' <del> ] <del> ]; <del> } <del> <del> /** <del> * testSlugDeprecatedTransliteratorIdOption method <del> * <del> * @param string $string String <del> * @param array $options Options <del> * @param String $expected Expected string <del> * @return void <del> * @dataProvider slugDeprecatedTransliteratorIdOptionInputProvider <del> */ <del> public function testSlugDeprecatedTransliteratorIdOption($string, $options, $expected) <del> { <del> $this->deprecated(function () use ($string, $options, $expected) { <del> $result = Text::slug($string, $options); <del> $this->assertEquals($expected, $result); <del> }); <del> } <del> <ide> /** <ide> * Text truncateByWidth method <ide> *
2
Text
Text
add tutorial 7 to homepage [ci skip]
7c171dfd83c47e276628d3fc060a7589f96d3d71
<ide><path>docs/index.md <ide> The tutorial will walk you through the building blocks that make up REST framewo <ide> * [4 - Authentication & permissions][tut-4] <ide> * [5 - Relationships & hyperlinked APIs][tut-5] <ide> * [6 - Viewsets & routers][tut-6] <add>* [7 - Schemas & client libraries][tut-7] <ide> <ide> There is a live example API of the finished tutorial API for testing purposes, [available here][sandbox]. <ide>
1
Ruby
Ruby
extract some boilerplate into an each_tap method
b0cd6b03765b46c648f55c709a637c308c6942d6
<ide><path>Library/Homebrew/cmd/tap.rb <ide> module Homebrew extend self <ide> <ide> def tap <ide> if ARGV.empty? <del> tapd = HOMEBREW_LIBRARY/"Taps" <del> tapd.children.each do |user| <del> next unless user.directory? <del> user.children.each do |repo| <del> puts "#{user.basename}/#{repo.basename.sub("homebrew-", "")}" if (repo/".git").directory? <del> end <del> end if tapd.directory? <add> each_tap do |user, repo| <add> puts "#{user.basename}/#{repo.basename.sub("homebrew-", "")}" if (repo/".git").directory? <add> end <ide> elsif ARGV.first == "--repair" <ide> repair_taps <ide> else <ide> def repair_taps <ide> <ide> count = 0 <ide> # check symlinks are all set in each tap <del> HOMEBREW_REPOSITORY.join("Library/Taps").children.each do |user| <del> next unless user.directory? <del> user.children.each do |repo| <del> files = [] <del> repo.find_formula{ |file| files << user.basename.join(repo.basename, file) } if repo.directory? <del> count += link_tap_formula(files) <del> end <add> each_tap do |user, repo| <add> files = [] <add> repo.find_formula { |file| files << user.basename.join(repo.basename, file) } <add> count += link_tap_formula(files) <ide> end <ide> <ide> puts "Tapped #{count} formula" <ide> end <ide> <ide> private <ide> <add> def each_tap <add> taps = HOMEBREW_LIBRARY.join("Taps") <add> <add> if taps.directory? <add> taps.subdirs.each do |user| <add> user.subdirs.each do |repo| <add> yield user, repo <add> end <add> end <add> end <add> end <add> <ide> def tap_args <ide> ARGV.first =~ %r{^([\w_-]+)/(homebrew-)?([\w_-]+)$} <ide> raise "Invalid tap name" unless $1 && $3 <ide><path>Library/Homebrew/cmd/update.rb <ide> def update <ide> # this procedure will be removed in the future if it seems unnecessasry <ide> rename_taps_dir_if_necessary <ide> <del> Dir["Library/Taps/*/"].each do |user| <del> Dir["#{user}*/"].each do |repo| <del> cd repo do <del> begin <del> updater = Updater.new <del> updater.pull! <del> report.merge!(updater.report) do |key, oldval, newval| <del> oldval.concat(newval) <del> end <del> rescue <del> repo =~ %r{^Library/Taps/([\w_-]+)/(homebrew-)?([\w_-]+)} <del> onoe "Failed to update tap: #$1/#$3" <add> each_tap do |user, repo| <add> repo.cd do <add> begin <add> updater = Updater.new <add> updater.pull! <add> report.merge!(updater.report) do |key, oldval, newval| <add> oldval.concat(newval) <ide> end <add> rescue <add> onoe "Failed to update tap: #{user.basename}/#{repo.basename.sub("homebrew-", "")}" <ide> end <ide> end <ide> end
2
Ruby
Ruby
honor the order in the new finder
9dd8d3d3e4dc1b91cf8489ea9f3fee9bb0c27c65
<ide><path>activerecord/lib/active_record/associations/has_many_association.rb <ide> def find(*args) <ide> end <ide> else <ide> options[:conditions] = @finder_sql + (options[:conditions] ? " AND #{options[:conditions]}" : "") <add> options[:order] = options[:order] ? "#{options[:order]}, #{@options[:order]}" : @options[:order] <ide> @association_class.find(args.size == 1 ? args.first : args, options) <ide> end <ide> end
1
Mixed
Ruby
remove rackdelegation module
d47438745e34d75e03347b54b604b71b7a92c3ac
<ide><path>actionpack/lib/action_controller.rb <ide> module ActionController <ide> autoload :Instrumentation <ide> autoload :MimeResponds <ide> autoload :ParamsWrapper <del> autoload :RackDelegation <ide> autoload :Redirecting <ide> autoload :Renderers <ide> autoload :Rendering <ide><path>actionpack/lib/action_controller/api.rb <ide> def self.without_modules(*modules) <ide> Rendering, <ide> Renderers::All, <ide> ConditionalGet, <del> RackDelegation, <ide> BasicImplicitRender, <ide> StrongParameters, <ide> <ide><path>actionpack/lib/action_controller/base.rb <ide> def self.without_modules(*modules) <ide> Renderers::All, <ide> ConditionalGet, <ide> EtagWithTemplateDigest, <del> RackDelegation, <ide> Caching, <ide> MimeResponds, <ide> ImplicitRender, <ide><path>actionpack/lib/action_controller/caching.rb <ide> def cache_configured? <ide> end <ide> end <ide> <del> include RackDelegation <ide> include AbstractController::Callbacks <ide> <ide> include ConfigMethods <ide><path>actionpack/lib/action_controller/metal.rb <ide> require 'active_support/core_ext/array/extract_options' <ide> require 'action_dispatch/middleware/stack' <ide> require 'active_support/deprecation' <add>require 'action_dispatch/http/request' <add>require 'action_dispatch/http/response' <ide> <ide> module ActionController <ide> # Extend ActionDispatch middleware stack to make it aware of options <ide> def self.make_response!(request) <ide> end <ide> end <ide> <add> def self.build_with_env(env = {}) #:nodoc: <add> new.tap { |c| <add> c.set_request! ActionDispatch::Request.new(env) <add> c.set_response! make_response!(c.request) <add> } <add> end <add> <ide> # Delegates to the class' <tt>controller_name</tt> <ide> def controller_name <ide> self.class.controller_name <ide> end <ide> <del> # The details below can be overridden to support a specific <del> # Request and Response object. The default ActionController::Base <del> # implementation includes RackDelegation, which makes a request <del> # and response object available. You might wish to control the <del> # environment and response manually for performance reasons. <del> <ide> attr_internal :response, :request <ide> delegate :session, :to => "@_request" <del> delegate :headers, :to => "@_response" <add> delegate :headers, :status=, :location=, :content_type=, <add> :status, :location, :content_type, :to => "@_response" <ide> <ide> def initialize <ide> @_request = nil <ide> def params=(val) <ide> @_params = val <ide> end <ide> <del> # Basic implementations for content_type=, location=, and headers are <del> # provided to reduce the dependency on the RackDelegation module <del> # in Renderer and Redirector. <del> <del> def content_type=(type) <del> response.content_type = type <del> end <del> <del> def content_type <del> response.content_type <del> end <del> <del> def location <del> headers["Location"] <del> end <del> <del> def location=(url) <del> headers["Location"] = url <del> end <add> alias :response_code :status # :nodoc: <ide> <ide> # Basic url_for that can be overridden for more robust functionality <ide> def url_for(string) <ide> string <ide> end <ide> <del> def status <del> response.status <del> end <del> alias :response_code :status # :nodoc: <del> <del> def status=(status) <del> response.status = Rack::Utils.status_code(status) <del> end <del> <ide> def response_body=(body) <ide> body = [body] unless body.nil? || body.respond_to?(:each) <ide> response.body = body <ide> def to_a #:nodoc: <ide> response.to_a <ide> end <ide> <add> def reset_session <add> @_request.reset_session <add> end <add> <ide> class_attribute :middleware_stack <ide> self.middleware_stack = ActionController::MiddlewareStack.new <ide> <ide><path>actionpack/lib/action_controller/metal/conditional_get.rb <ide> module ActionController <ide> module ConditionalGet <ide> extend ActiveSupport::Concern <ide> <del> include RackDelegation <ide> include Head <ide> <ide> included do <ide><path>actionpack/lib/action_controller/metal/cookies.rb <ide> module ActionController #:nodoc: <ide> module Cookies <ide> extend ActiveSupport::Concern <ide> <del> include RackDelegation <del> <ide> included do <ide> helper_method :cookies <ide> end <ide><path>actionpack/lib/action_controller/metal/instrumentation.rb <ide> module Instrumentation <ide> extend ActiveSupport::Concern <ide> <ide> include AbstractController::Logger <del> include ActionController::RackDelegation <ide> <ide> attr_internal :view_runtime <ide> <ide><path>actionpack/lib/action_controller/metal/rack_delegation.rb <del>require 'action_dispatch/http/request' <del>require 'action_dispatch/http/response' <del> <del>module ActionController <del> module RackDelegation <del> extend ActiveSupport::Concern <del> <del> delegate :headers, :status=, :location=, :content_type=, <del> :status, :location, :content_type, :response_code, :to => "@_response" <del> <del> module ClassMethods <del> def build_with_env(env = {}) #:nodoc: <del> new.tap { |c| c.set_request! ActionDispatch::Request.new(env) } <del> end <del> end <del> <del> def reset_session <del> @_request.reset_session <del> end <del> end <del>end <ide><path>actionpack/lib/action_controller/metal/redirecting.rb <ide> module Redirecting <ide> extend ActiveSupport::Concern <ide> <ide> include AbstractController::Logger <del> include ActionController::RackDelegation <ide> include ActionController::UrlFor <ide> <ide> # Redirects the browser to the target specified in +options+. This parameter can be any one of: <ide><path>actionpack/lib/action_controller/metal/testing.rb <ide> module ActionController <ide> module Testing <ide> extend ActiveSupport::Concern <ide> <del> include RackDelegation <del> <ide> # TODO : Rewrite tests using controller.headers= to use Rack env <ide> def headers=(new_headers) <ide> @_response ||= ActionDispatch::Response.new <ide><path>actionpack/test/controller/new_base/bare_metal_test.rb <ide> <ide> module BareMetalTest <ide> class BareController < ActionController::Metal <del> include ActionController::RackDelegation <del> <ide> def index <ide> self.response_body = "Hello world" <ide> end <ide><path>actionpack/test/controller/render_test.rb <ide> class MetalTestController < ActionController::Metal <ide> include AbstractController::Rendering <ide> include ActionView::Rendering <ide> include ActionController::Rendering <del> include ActionController::RackDelegation <del> <ide> <ide> def accessing_logger_in_template <ide> render :inline => "<%= logger.class %>" <ide><path>guides/source/api_app.md <ide> controller modules by default: <ide> - `ActionController::Renderers::All`: Support for `render :json` and friends. <ide> - `ActionController::ConditionalGet`: Support for `stale?`. <ide> - `ActionController::ForceSSL`: Support for `force_ssl`. <del>- `ActionController::RackDelegation`: Support for the `request` and `response` <del> methods returning `ActionDispatch::Request` and `ActionDispatch::Response` <del> objects. <ide> - `ActionController::DataStreaming`: Support for `send_file` and `send_data`. <ide> - `AbstractController::Callbacks`: Support for `before_action` and friends. <ide> - `ActionController::Instrumentation`: Support for the instrumentation
14
Text
Text
change 1.10.14 to 1.10.15 in readme.md
d54655686da157c7c661d8e7b964dce93f52e97b
<ide><path>README.md <ide> Airflow is not a streaming solution, but it is often used to process real-time d <ide> <ide> Apache Airflow is tested with: <ide> <del>| | Master version (dev) | Stable version (2.0.1) | Previous version (1.10.14) | <add>| | Master version (dev) | Stable version (2.0.1) | Previous version (1.10.15) | <ide> | ------------ | ------------------------- | ------------------------ | ------------------------- | <ide> | Python | 3.6, 3.7, 3.8 | 3.6, 3.7, 3.8 | 2.7, 3.5, 3.6, 3.7, 3.8 | <ide> | PostgreSQL | 9.6, 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 |
1
Javascript
Javascript
fix geometry.mergemesh determine mesh bug
e0f84b07ac779bfb70227270532306d4296e9625
<ide><path>src/core/Geometry.js <ide> Object.assign( Geometry.prototype, EventDispatcher.prototype, { <ide> <ide> mergeMesh: function ( mesh ) { <ide> <del> if ( ( mesh && mesh.isMesh ) === false ) { <add> if ( !mesh || !mesh.isMesh ) { <ide> <ide> console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh ); <ide> return;
1
Python
Python
fix coding style
7140eede200e06d9f55e0a788d16a7fbea11686b
<ide><path>research/object_detection/models/faster_rcnn_resnet_v1_fpn_keras_feature_extractor_tf2_test.py <ide> def _build_conv_hyperparams(self): <ide> text_format.Merge(conv_hyperparams_text_proto, conv_hyperparams) <ide> return hyperparams_builder.KerasLayerHyperparams(conv_hyperparams) <ide> <del> def _build_feature_extractor(self, architecture='resnet_v1_50'): <add> def _build_feature_extractor(self): <ide> return frcnn_res_fpn.FasterRCNNResnet50FPNKerasFeatureExtractor( <ide> is_training=False, <ide> conv_hyperparams=self._build_conv_hyperparams(), <ide> first_stage_features_stride=16, <ide> batch_norm_trainable=False, <ide> weight_decay=0.0) <del> <add> <ide> def test_extract_proposal_features_returns_expected_size(self): <ide> feature_extractor = self._build_feature_extractor() <ide> preprocessed_inputs = tf.random_uniform( <ide> [2, 448, 448, 3], maxval=255, dtype=tf.float32) <ide> rpn_feature_maps = feature_extractor.get_proposal_feature_extractor_model( <ide> name='TestScope')(preprocessed_inputs) <del> features_shapes = [tf.shape(rpn_feature_map) <del> for rpn_feature_map in rpn_feature_maps] <add> features_shapes = [tf.shape(rpn_feature_map) <add> for rpn_feature_map in rpn_feature_maps] <ide> <ide> self.assertAllEqual(features_shapes[0].numpy(), [2, 112, 112, 256]) <ide> self.assertAllEqual(features_shapes[1].numpy(), [2, 56, 56, 256]) <ide> def test_extract_proposal_features_half_size_input(self): <ide> [2, 224, 224, 3], maxval=255, dtype=tf.float32) <ide> rpn_feature_maps = feature_extractor.get_proposal_feature_extractor_model( <ide> name='TestScope')(preprocessed_inputs) <del> features_shapes = [tf.shape(rpn_feature_map) <del> for rpn_feature_map in rpn_feature_maps] <del> <add> features_shapes = [tf.shape(rpn_feature_map) <add> for rpn_feature_map in rpn_feature_maps] <add> <ide> self.assertAllEqual(features_shapes[0].numpy(), [2, 56, 56, 256]) <ide> self.assertAllEqual(features_shapes[1].numpy(), [2, 28, 28, 256]) <ide> self.assertAllEqual(features_shapes[2].numpy(), [2, 14, 14, 256]) <ide> def test_extract_box_classifier_features_returns_expected_size(self): <ide> <ide> if __name__ == '__main__': <ide> tf.enable_v2_behavior() <del> tf.test.main() <ide>\ No newline at end of file <add> tf.test.main()
1
Python
Python
change error message when plugin init failed
5a12dffb58edb74748b02f6b2cc06e49d28e54ad
<ide><path>glances/stats.py <ide> def _load_plugin(self, plugin_script, args=None, config=None): <ide> except Exception as e: <ide> # If a plugin can not be log, display a critical message <ide> # on the console but do not crash <del> logger.critical("Error while initializing the {} plugin (see complete traceback in the log file)".format(name)) <add> logger.critical("Error while initializing the {} plugin ({}})".format(name, e)) <ide> logger.error(traceback.format_exc()) <ide> <ide> def load_plugins(self, args=None):
1
Text
Text
update readme and build instructions
9fe507d675ac80decbe714c4fc62ce7d2380ba2f
<ide><path>README.md <del># Atom — Futuristic Text Editing <add># Atom — The hackable, ~~collaborative~~ editor of tomorrow! <ide> <del>![atom](https://s3.amazonaws.com/speakeasy/apps/icons/27/medium/7db16e44-ba57-11e2-8c6f-981faf658e00.png) <add>![Atom](https://www.atom.io/assets/logo-e793a022e41eff6879fd6205bc06ef92.png) <ide> <del>Check out our [guides](https://www.atom.io/docs/latest/) and [API documentation](https://www.atom.io/docs/api/v34.0.0/api/) <add>Check out our [guides and API documentation](https://www.atom.io/docs/latest/) <ide> <ide> ## Installing <ide> <del>Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27). <add>Download the latest [Atom release](https://github.com/atom/atom/releases/latest). <ide> <del>It will automatically update when a new release is available. <add>Atom will automatically update when a new release is available. <ide> <ide> ## Building <ide> <del>### Requirements <del> <del> * Mountain Lion <del> * Looking for Windows support? Read [here][building]. <del> * Boxen (Obviously Atom won't release with this requirement) <del> <del>### Installation <del> <del> 1. `gh-setup atom` <del> <del> 2. `cd ~/github/atom` <del> <del> 3. `script/build` <del> <add> Follow the instructions in the [build docs][building] <ide> <ide> [building]: https://github.com/atom/atom/blob/master/docs/building-atom.md <ide><path>docs/building-atom.md <ide> atom][download]. <ide> <ide> ## OSX <ide> <del>* Use Mountain Lion <add>* Use OS X 10.8 or later <ide> * Install the latest node 0.10.x release (32bit preferable) <add>* Install cmake <ide> * Clone [atom][atom-git] to `~/github/atom` <del>* Run `~/github/atom/script/bootstrap` <add>* Run `~/github/atom/script/build` <ide> <ide> ## Windows <ide> <ide> atom][download]. <ide> * Use the Windows GitHub shell and cd into `C:\Users\<user>\github\atom` <ide> * Run `script\bootstrap` <ide> <del>[download]: http://www.atom.io <add>[download]: https://github.com/atom/atom/releases/latest <ide> [win-node]: http://nodejs.org/download/ <ide> [win-python]: http://www.python.org/download/ <ide> [win-github]: http://windows.github.com/
2
PHP
PHP
remove dead code
de2be59dce0e8ff935dd51bc45cb829e85ad4328
<ide><path>src/View/Helper/SessionHelper.php <ide> namespace Cake\View\Helper; <ide> <ide> use Cake\View\Helper; <del>use Cake\View\StringTemplateTrait; <ide> use Cake\View\View; <ide> <ide> /** <ide> class SessionHelper extends Helper <ide> { <ide> <del> use StringTemplateTrait; <del> <del> /** <del> * Default config for this class <del> * <del> * @var array <del> */ <del> protected $_defaultConfig = [ <del> 'templates' => [ <del> 'flash' => '<div id="{{key}}-message" class="message-{{class}}">{{message}}</div>' <del> ] <del> ]; <del> <ide> /** <ide> * Constructor <ide> *
1
Java
Java
create handler lazily in devserverhelper
8b487d4d5a3e12484c648ecc7d695b5b6a3f11d2
<ide><path>ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java <ide> import android.content.Context; <ide> import android.os.AsyncTask; <ide> import android.os.Handler; <add>import android.os.Looper; <ide> import android.widget.Toast; <ide> import com.facebook.common.logging.FLog; <ide> import com.facebook.infer.annotation.Assertions; <ide> public DevServerHelper( <ide> .build(); <ide> mBundleDownloader = new BundleDownloader(mClient); <ide> <del> mRestartOnChangePollingHandler = new Handler(); <add> mRestartOnChangePollingHandler = new Handler(Looper.getMainLooper()); <ide> mPackageName = packageName; <ide> } <ide>
1
PHP
PHP
add complex optgroup type
8e71c0ad9b4e8a6e3aa9c2dc4fc31e82f5512308
<ide><path>Cake/View/Input/SelectBox.php <ide> public function __construct($templates) { <ide> * empty option. <ide> * - `escape` - Set to false to disable HTML escaping. <ide> * <add> * ### Options format <add> * <add> * The options option can take a variety of data format depending on <add> * the complexity of HTML you want generated. <add> * <add> * You can generate simple options using a basic associative array: <add> * <add> * {{{ <add> * 'options' => ['elk' => 'Elk', 'beaver' => 'Beaver'] <add> * }}} <add> * <add> * If you need to define additional attributes on your option elements <add> * you can use the complex form for options: <add> * <add> * {{{ <add> * 'options' => [ <add> * ['name' => 'elk', 'value' => 'Elk', 'data-foo' => 'bar'], <add> * ] <add> * }}} <add> * <add> * This form **requires** that both the `name` and `value` keys be defined. <add> * If either is not set options will not be generated correctly. <add> * <add> * If you need to define option groups you can do those using nested arrays: <add> * <add> * {{{ <add> * 'options' => [ <add> * 'Mammals' => [ <add> * 'elk' => 'Elk', <add> * 'beaver' => 'Beaver' <add> * ] <add> * ] <add> * }}} <add> * <add> * And finally, if you need to put attributes on your optgroup elements you <add> * can do that with a more complex nested array form: <add> * <add> * {{{ <add> * 'options' => [ <add> * [ <add> * 'name' => 'Mammals', <add> * 'data-id' => 1, <add> * 'options' => [ <add> * 'elk' => 'Elk', <add> * 'beaver' => 'Beaver' <add> * ] <add> * ], <add> * ] <add> * }}} <add> * <add> * You are free to mix each of the forms in the same option set, and <add> * nest complex types as required. <add> * <ide> * @param array $data Data to render with. <ide> * @return string A generated select box. <ide> * @throws \RuntimeException when the name attribute is empty. <ide> public function render($data) { <ide> * @return array <ide> */ <ide> protected function _renderContent($data) { <del> $out = []; <ide> $options = $data['options']; <ide> <ide> if ($options instanceof Traversable) { <ide> protected function _renderContent($data) { <ide> $options = ['' => $value] + $options; <ide> } <ide> if (empty($options)) { <del> return $out; <add> return []; <ide> } <ide> <ide> $selected = isset($data['value']) ? $data['value'] : null; <ide> protected function _renderContent($data) { <ide> return $this->_renderOptions($options, $disabled, $selected, $data['escape']); <ide> } <ide> <add>/** <add> * Render the contents of an optgroup element. <add> * <add> * @param array $optgroup The opt group data. <add> */ <add> protected function _renderOptgroup($label, $optgroup, $disabled, $selected, $escape) { <add> $opts = $optgroup; <add> $attrs = []; <add> if (isset($optgroup['options'], $optgroup['name'])) { <add> $opts = $optgroup['options']; <add> $label = $optgroup['name']; <add> $attrs = $optgroup; <add> } <add> $groupOptions = $this->_renderOptions($opts, $disabled, $selected, $escape); <add> <add> return $this->_templates->format('optgroup', [ <add> 'label' => $escape ? h($label) : $label, <add> 'content' => implode('', $groupOptions), <add> 'attrs' => $this->_templates->formatAttributes($attrs, ['name', 'options']), <add> ]); <add> } <add> <ide> /** <ide> * Render a set of options. <ide> * <ide> protected function _renderOptions($options, $disabled, $selected, $escape) { <ide> $out = []; <ide> foreach ($options as $key => $val) { <ide> // Option groups <del> if (!is_int($key) && is_array($val) || $val instanceof Traversable) { <del> $groupOptions = $this->_renderOptions($val, $disabled, $selected, $escape); <del> $out[] = $this->_templates->format('optgroup', [ <del> 'label' => $escape ? h($key) : $key, <del> 'content' => implode('', $groupOptions) <del> ]); <add> $arrayVal = (is_array($val) || $val instanceof Traversable); <add> if ( <add> (!is_int($key) && $arrayVal) || <add> (is_int($key) && $arrayVal && isset($val['options'])) <add> ) { <add> $out[] = $this->_renderOptgroup($key, $val, $disabled, $selected, $escape); <ide> continue; <ide> } <ide> <ide><path>Test/TestCase/View/Input/SelectBoxTest.php <ide> public function setUp() { <ide> $templates = [ <ide> 'select' => '<select name="{{name}}"{{attrs}}>{{content}}</select>', <ide> 'option' => '<option value="{{name}}"{{attrs}}>{{value}}</option>', <del> 'optgroup' => '<optgroup label="{{label}}">{{content}}</optgroup>', <add> 'optgroup' => '<optgroup label="{{label}}"{{attrs}}>{{content}}</optgroup>', <ide> ]; <ide> $this->templates = new StringTemplate(); <ide> $this->templates->add($templates); <ide> public function testRenderOptionGroups() { <ide> $this->assertTags($result, $expected); <ide> } <ide> <add>/** <add> * test rendering with option groups <add> * <add> * @return void <add> */ <add> public function testRenderOptionGroupsWithAttributes() { <add> $select = new SelectBox($this->templates); <add> $data = [ <add> 'name' => 'Birds[name]', <add> 'options' => [ <add> [ <add> 'name' => 'Mammal', <add> 'data-foo' => 'bar', <add> 'options' => [ <add> 'beaver' => 'Beaver', <add> 'elk' => 'Elk', <add> ] <add> ] <add> ] <add> ]; <add> $result = $select->render($data); <add> $expected = [ <add> 'select' => [ <add> 'name' => 'Birds[name]', <add> ], <add> ['optgroup' => ['data-foo' => 'bar', 'label' => 'Mammal']], <add> ['option' => ['value' => 'beaver']], <add> 'Beaver', <add> '/option', <add> ['option' => ['value' => 'elk']], <add> 'Elk', <add> '/option', <add> '/optgroup', <add> '/select' <add> ]; <add> $this->assertTags($result, $expected); <add> } <add> <add> <ide> /** <ide> * test rendering with option groups with traversable nodes <ide> *
2
Ruby
Ruby
add assert_not_match compat
1d003e5d8a292443d4489acd2ec80e1f4d2b3476
<ide><path>Library/Homebrew/formula_assertions.rb <ide> def assertions <ide> assert_not_includes: :refute_includes, <ide> assert_not_instance_of: :refute_instance_of, <ide> assert_not_kind_of: :refute_kind_of, <add> assert_not_match: :refute_match, <ide> assert_no_match: :refute_match, <ide> assert_not_nil: :refute_nil, <ide> assert_not_operator: :refute_operator,
1
PHP
PHP
fix shell help for incorrect user input
57e4751a826b14345b16d802fdb0b60bef61f1b1
<ide><path>lib/Cake/Console/Shell.php <ide> public function in($prompt, $options = null, $default = null) { <ide> if (!$this->interactive) { <ide> return $default; <ide> } <del> $in = $this->_getInput($prompt, $options, $default); <add> $original_options = $options; <add> $in = $this->_getInput($prompt, $original_options, $default); <ide> <ide> if ($options && is_string($options)) { <ide> if (strpos($options, ',')) { <ide> public function in($prompt, $options = null, $default = null) { <ide> $options <ide> ); <ide> while ($in === '' || !in_array($in, $options)) { <del> $in = $this->_getInput($prompt, $options, $default); <add> $in = $this->_getInput($prompt, $original_options, $default); <ide> } <ide> } <ide> return $in;
1
PHP
PHP
expose the cookiecollection in a response
666c31222eedae4ae04ff75af85744464c7f677b
<ide><path>src/Http/Client/Response.php <ide> public function getCookies() <ide> return $this->_getCookies(); <ide> } <ide> <add> /** <add> * Get the cookie collection from this response. <add> * <add> * This method exposes the response's CookieCollection <add> * instance allowing you to interact with cookie objects directly. <add> * <add> * @return \Cake\Http\Cookie\CookieCollection <add> */ <add> public function getCookieCollection() <add> { <add> $this->buildCookieCollection(); <add> <add> return $this->cookies; <add> } <add> <ide> /** <ide> * Get the value of a single cookie. <ide> * <ide><path>tests/TestCase/Http/Client/ResponseTest.php <ide> namespace Cake\Test\TestCase\Http\Client; <ide> <ide> use Cake\Http\Client\Response; <add>use Cake\Http\Cookie\CookieCollection; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide> public function testGetCookies() <ide> $this->assertArrayHasKey('expiring', $result); <ide> } <ide> <add> /** <add> * Test accessing cookie collection <add> * <add> * @return void <add> */ <add> public function testGetCookieCollection() <add> { <add> $headers = [ <add> 'HTTP/1.0 200 Ok', <add> 'Set-Cookie: test=value', <add> 'Set-Cookie: session=123abc', <add> 'Set-Cookie: expiring=soon; Expires=Wed, 09-Jun-2021 10:18:14 GMT; Path=/; HttpOnly; Secure;', <add> ]; <add> $response = new Response($headers, ''); <add> <add> $cookies = $response->getCookieCollection(); <add> $this->assertInstanceOf(CookieCollection::class, $cookies); <add> $this->assertTrue($cookies->has('test')); <add> $this->assertTrue($cookies->has('session')); <add> $this->assertTrue($cookies->has('expiring')); <add> $this->assertSame('123abc', $cookies->get('session')->getValue()); <add> } <add> <ide> /** <ide> * Test statusCode() <ide> *
2
Javascript
Javascript
filter experimental warnings
8fc0d28e3de603bf4f5dcf4059f584aed886f194
<ide><path>test/helpers/captureStdio.js <ide> module.exports = (stdio, tty) => { <ide> <ide> toString: () => { <ide> return stripAnsi(logs.join("")).replace( <del> /\([^)]+\) (\[[^\]]+\]\s*)?DeprecationWarning.+(\n\(Use .node.+\))?(\n(\s|BREAKING CHANGE).*)*(\n\s+at .*)*\n?/g, <add> /\([^)]+\) (\[[^\]]+\]\s*)?(Deprecation|Experimental)Warning.+(\n\(Use .node.+\))?(\n(\s|BREAKING CHANGE).*)*(\n\s+at .*)*\n?/g, <ide> "" <ide> ); <ide> },
1
Ruby
Ruby
fix style error
f4501787635a8732909ee811b1b850d52802e928
<ide><path>Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb <ide> def report_failures <ide> odie "audit failed for #{Formatter.pluralize(num_failed, "cask")}: " \ <ide> "#{failed_casks.join(" ")}" <ide> end <del> <ide> end <ide> end <ide> end
1
Javascript
Javascript
clean the errors that flow v0.10.0 finds
70c9f5140d6e82f58e26b9e529de49c2cd5a0e2b
<ide><path>Examples/UIExplorer/ActivityIndicatorIOSExample.js <ide> var ToggleAnimatingActivityIndicator = React.createClass({ <ide> } <ide> }); <ide> <add>exports.displayName = (undefined: ?string); <ide> exports.framework = 'React'; <ide> exports.title = '<ActivityIndicatorIOS>'; <ide> exports.description = 'Animated loading indicators.'; <ide><path>Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js <ide> var TabBarItemIOS = React.createClass({ <ide> } <ide> }, <ide> <del> componentWillReceiveProps: function(nextProps: { selected: boolean }) { <add> componentWillReceiveProps: function(nextProps: { selected?: boolean }) { <ide> if (this.state.hasBeenSelected || nextProps.selected) { <ide> this.setState({hasBeenSelected: true}); <ide> } <ide><path>Libraries/ReactIOS/ReactIOSMount.js <ide> var ReactIOSMount = { <ide> unmountComponentAtNode: function(containerTag: number): bool { <ide> if (!ReactIOSTagHandles.reactTagIsNativeTopRootID(containerTag)) { <ide> console.error('You cannot render into anything but a top root'); <del> return; <add> return false; <ide> } <ide> <ide> var containerID = ReactIOSTagHandles.tagToRootNodeID[containerTag];
3
Javascript
Javascript
fix setsid in tty.open
391f0879815fe0395484587dca485e15e75684b2
<ide><path>lib/tty_posix.js <ide> exports.open = function(path, args) { <ide> child = spawn(path, args, { <ide> env: env, <ide> customFds: [masterFD, masterFD, masterFD], <del> setuid: true <add> setsid: true <ide> }); <ide> <ide> return [stream, child];
1
Python
Python
add created_at attribute to kubernetespod
ed1924633323281f582b62df7296a2ad0c2d3c05
<ide><path>libcloud/container/drivers/kubernetes.py <ide> from libcloud.compute.base import NodeImage <ide> from libcloud.compute.base import NodeLocation <ide> <del>__all__ = [ <del> 'KubernetesContainerDriver' <del>] <add>__all__ = ["KubernetesContainerDriver"] <ide> <ide> <ide> ROOT_URL = "/api/" <ide> <ide> <ide> class KubernetesPod(object): <del> def __init__(self, id, name, containers, namespace, state, ip_addresses): <add> def __init__( <add> self, id, name, containers, namespace, state, ip_addresses, created_at <add> ): <ide> """ <ide> A Kubernetes pod <ide> """ <ide> def __init__(self, id, name, containers, namespace, state, ip_addresses): <ide> self.namespace = namespace <ide> self.state = state <ide> self.ip_addresses = ip_addresses <add> self.created_at = created_at <ide> <ide> <ide> class KubernetesContainerDriver(KubernetesDriverMixin, ContainerDriver): <ide> def ex_list_nodes(self): <ide> :rtype: ``list`` of :class:`.Node` <ide> """ <ide> result = self.connection.request(ROOT_URL + "v1/nodes").object <del> return [self._to_node(node) for node in result['items']] <add> return [self._to_node(node) for node in result["items"]] <ide> <ide> def _to_node(self, node): <ide> """ <ide> Convert an API node to a `Node` object <ide> """ <del> ID = node['metadata']['uid'] <del> name = node['metadata']['name'] <add> ID = node["metadata"]["uid"] <add> name = node["metadata"]["name"] <ide> driver = self.connection.driver <del> namespace = 'undefined' <del> memory = node['status'].get('capacity', {}).get('memory', 0) <add> namespace = "undefined" <add> memory = node["status"].get("capacity", {}).get("memory", 0) <ide> if not isinstance(memory, int): <del> if 'Ki' in memory: <del> memory = memory.rstrip('Ki') <add> if "Ki" in memory: <add> memory = memory.rstrip("Ki") <ide> memory = int(memory) * 1024 <del> elif 'K' in memory: <del> memory = memory.rstrip('K') <add> elif "K" in memory: <add> memory = memory.rstrip("K") <ide> memory = int(memory) * 1000 <del> elif 'M' in memory or 'Mi' in memory: <del> memory = memory.rstrip('M') <del> memory = memory.rstrip('Mi') <add> elif "M" in memory or "Mi" in memory: <add> memory = memory.rstrip("M") <add> memory = memory.rstrip("Mi") <ide> memory = int(memory) <del> elif 'Gi' in memory: <del> memory = memory.rstrip('Gi') <add> elif "Gi" in memory: <add> memory = memory.rstrip("Gi") <ide> memory = int(memory) // 1024 <del> elif 'G' in memory: <del> memory = memory.rstrip('G') <add> elif "G" in memory: <add> memory = memory.rstrip("G") <ide> memory = int(memory) // 1000 <del> cpu = node['status'].get('capacity', {}).get('cpu', 1) <add> cpu = node["status"].get("capacity", {}).get("cpu", 1) <ide> if not isinstance(cpu, int): <del> cpu = int(cpu.rstrip('m')) <del> extra_size = {'cpus': cpu} <del> size_name = f'{cpu} vCPUs, {memory}MB Ram' <add> cpu = int(cpu.rstrip("m")) <add> extra_size = {"cpus": cpu} <add> size_name = f"{cpu} vCPUs, {memory}MB Ram" <ide> size_id = hashlib.md5(size_name.encode("utf-8")).hexdigest() <del> size = NodeSize(id=size_id, name=size_name, ram=memory, <del> disk=0, bandwidth=0, price=0, <del> driver=driver, extra=extra_size) <del> extra = {'memory': memory, 'cpu': cpu} <add> size = NodeSize( <add> id=size_id, <add> name=size_name, <add> ram=memory, <add> disk=0, <add> bandwidth=0, <add> price=0, <add> driver=driver, <add> extra=extra_size, <add> ) <add> extra = {"memory": memory, "cpu": cpu} <ide> # TODO: Find state <ide> state = NodeState.UNKNOWN <ide> public_ips, private_ips = [], [] <del> for address in node['status']['addresses']: <del> if address['type'] == 'InternalIP': <del> private_ips.append(address['address']) <del> elif address['type'] == 'ExternalIP': <del> public_ips.append(address['address']) <add> for address in node["status"]["addresses"]: <add> if address["type"] == "InternalIP": <add> private_ips.append(address["address"]) <add> elif address["type"] == "ExternalIP": <add> public_ips.append(address["address"]) <ide> created_at = datetime.datetime.strptime( <del> node['metadata']['creationTimestamp'], <del> '%Y-%m-%dT%H:%M:%SZ') <del> return Node(id=ID, name=name, state=state, <del> public_ips=public_ips, <del> private_ips=private_ips, <del> driver=driver, size=size, <del> extra=extra, created_at=created_at) <add> node["metadata"]["creationTimestamp"], "%Y-%m-%dT%H:%M:%SZ" <add> ) <add> return Node( <add> id=ID, <add> name=name, <add> state=state, <add> public_ips=public_ips, <add> private_ips=private_ips, <add> driver=driver, <add> size=size, <add> extra=extra, <add> created_at=created_at, <add> ) <ide> <ide> def ex_list_pods(self): <ide> """ <ide> def _to_pod(self, data): <ide> spec = container_statuses <ide> containers.append(self._to_container(container, spec, data)) <ide> ip_addresses = [ip_dict["ip"] for ip_dict in data["status"].get("podIPs", [])] <add> created_at = datetime.datetime.strptime( <add> data["metadata"]["creationTimestamp"], "%Y-%m-%dT%H:%M:%SZ" <add> ) <ide> return KubernetesPod( <ide> id=data["metadata"]["uid"], <ide> name=data["metadata"]["name"], <ide> namespace=data["metadata"]["namespace"], <ide> state=data["status"]["phase"].lower(), <ide> ip_addresses=ip_addresses, <ide> containers=containers, <add> created_at=created_at, <ide> ) <ide> <ide> def _to_container(self, data, container_status, pod_data):
1
Python
Python
ensure correct weight tie-ing
b4e2dd8d9e3222b55706ac14459d0d24ed430f5f
<ide><path>keras/layers/core.py <ide> def _get_hidden(self, train): <ide> return self.encoders[-1].get_output(train) <ide> <ide> def _tranpose_weights(self, src, dest): <del> if len(dest.shape) > 1: <add> if len(dest.shape) > 1 and len(src.shape) > 1: <ide> dest = src.T <ide> <ide> def get_output(self, train): <ide> if not train and not self.output_reconstruction: <ide> return self._get_hidden(train) <ide> <del> decode = self.decoders[-1].get_output(train) <del> <ide> if self.tie_weights: <ide> for e,d in zip(self.encoders, self.decoders): <ide> map(self._tranpose_weights, e.get_weights(), d.get_weights()) <ide> <del> return decode <add> return self.decoders[-1].get_output(train) <ide> <ide> def get_config(self): <ide> return {"name":self.__class__.__name__,
1
Mixed
Ruby
change behaviour with empty array in where clause
16f6f2592e4e6c22f06d75eb8a6ec0cb68c9404b
<ide><path>activerecord/CHANGELOG.md <ide> ## Rails 4.0.0 (unreleased) ## <ide> <add>* Change behaviour with empty array in where clause, <add> the SQL generated when when were passed an empty array was insecure in some cases <add> <add> Roberto Miranda <add> <ide> * Raise ArgumentError instead of generate invalid SQL when empty hash is used in where clause value <ide> <ide> Roberto Miranda <ide><path>activerecord/lib/active_record/associations/has_many_through_association.rb <ide> def delete_records(records, method) <ide> records = load_target if records == :all <ide> <ide> scope = through_association.scope <del> scope.where! construct_join_attributes(*records) <add> scope.where! construct_join_attributes(*records) unless records.empty? <ide> <ide> case method <ide> when :destroy <ide><path>activerecord/lib/active_record/relation/predicate_builder.rb <ide> def self.build_from_hash(klass, attributes, default_table) <ide> queries.concat expand(association && association.klass, table, k, v) <ide> end <ide> end <add> elsif value.is_a?(Array) && value.empty? <add> raise ArgumentError, "Condition value in SQL clause can't be an empty array" <ide> else <ide> column = column.to_s <ide> <ide><path>activerecord/test/cases/finder_test.rb <ide> def test_find_with_nil_inside_set_passed_for_one_attribute <ide> assert_equal [2, 1].sort, client_of.compact.sort <ide> end <ide> <del> def test_find_with_nil_inside_set_passed_for_attribute <del> client_of = Company.all.merge!( <del> :where => { :client_of => [nil] }, <del> :order => 'client_of DESC' <del> ).map { |x| x.client_of } <del> <del> assert_equal [], client_of.compact <del> end <del> <ide> def test_with_limiting_with_custom_select <ide> posts = Post.references(:authors).merge( <ide> :includes => :author, :select => ' posts.*, authors.id as "author_id"', <ide><path>activerecord/test/cases/relation/where_test.rb <ide> def test_where_with_table_name_and_empty_hash <ide> end <ide> <ide> def test_where_with_table_name_and_empty_array <del> assert_equal 0, Post.where(:id => []).count <add> assert_raises(ArgumentError) do <add> Post.where(:id => []) <add> end <ide> end <ide> <ide> def test_where_with_empty_hash_and_no_foreign_key <ide><path>activerecord/test/cases/relations_test.rb <ide> def test_find_ids <ide> end <ide> <ide> def test_find_in_empty_array <del> authors = Author.all.where(:id => []) <del> assert authors.to_a.blank? <add> assert_raises(ArgumentError) do <add> Author.all.where(:id => []) <add> end <ide> end <ide> <ide> def test_where_with_ar_object
6
Go
Go
remove the last references to overlayfs
2352f00e4ff2cd102a4d591d67aba8e1c7eaa7b6
<ide><path>daemon/daemon_overlay.go <add>// +build !exclude_graphdriver_overlay <add> <add>package daemon <add> <add>import ( <add> _ "github.com/docker/docker/daemon/graphdriver/overlay" <add>) <ide><path>daemon/daemon_overlayfs.go <del>// +build !exclude_graphdriver_overlayfs <del> <del>package daemon <del> <del>import ( <del> _ "github.com/docker/docker/daemon/graphdriver/overlayfs" <del>) <add><path>daemon/graphdriver/overlay/copy.go <del><path>daemon/graphdriver/overlayfs/copy.go <ide> // +build linux <ide> <del>package overlayfs <add>package overlay <ide> <ide> import ( <ide> "fmt" <ide> func copyDir(srcDir, dstDir string, flags CopyFlags) error { <ide> return err <ide> } <ide> <del> // We need to copy this attribute if it appears in an overlayfs upper layer, as <del> // this function is used to copy those. It is set by overlayfs if a directory <add> // We need to copy this attribute if it appears in an overlay upper layer, as <add> // this function is used to copy those. It is set by overlay if a directory <ide> // is removed and then re-created and should not inherit anything from the <ide> // same dir in the lower dir. <ide> if err := copyXattr(srcPath, dstPath, "trusted.overlay.opaque"); err != nil { <add><path>daemon/graphdriver/overlay/overlay.go <del><path>daemon/graphdriver/overlayfs/overlayfs.go <ide> // +build linux <ide> <del>package overlayfs <add>package overlay <ide> <ide> import ( <ide> "bufio" <ide> func init() { <ide> } <ide> <ide> func Init(home string, options []string) (graphdriver.Driver, error) { <del> if err := supportsOverlayfs(); err != nil { <add> if err := supportsOverlay(); err != nil { <ide> return nil, graphdriver.ErrNotSupported <ide> } <ide> <ide> func Init(home string, options []string) (graphdriver.Driver, error) { <ide> return NaiveDiffDriverWithApply(d), nil <ide> } <ide> <del>func supportsOverlayfs() error { <add>func supportsOverlay() error { <ide> // We can try to modprobe overlay first before looking at <ide> // proc/filesystems for when overlay is supported <ide> exec.Command("modprobe", "overlay").Run() <ide><path>daemon/graphdriver/overlay/overlay_test.go <add>package overlay <add> <add>import ( <add> "github.com/docker/docker/daemon/graphdriver/graphtest" <add> "testing" <add>) <add> <add>// This avoids creating a new driver for each test if all tests are run <add>// Make sure to put new tests between TestOverlaySetup and TestOverlayTeardown <add>func TestOverlaySetup(t *testing.T) { <add> graphtest.GetDriver(t, "overlay") <add>} <add> <add>func TestOverlayCreateEmpty(t *testing.T) { <add> graphtest.DriverTestCreateEmpty(t, "overlay") <add>} <add> <add>func TestOverlayCreateBase(t *testing.T) { <add> graphtest.DriverTestCreateBase(t, "overlay") <add>} <add> <add>func TestOverlayCreateSnap(t *testing.T) { <add> graphtest.DriverTestCreateSnap(t, "overlay") <add>} <add> <add>func TestOverlayTeardown(t *testing.T) { <add> graphtest.PutDriver(t) <add>} <ide><path>daemon/graphdriver/overlayfs/overlayfs_test.go <del>package overlayfs <del> <del>import ( <del> "github.com/docker/docker/daemon/graphdriver/graphtest" <del> "testing" <del>) <del> <del>// This avoids creating a new driver for each test if all tests are run <del>// Make sure to put new tests between TestOverlayfsSetup and TestOverlayfsTeardown <del>func TestOverlayfsSetup(t *testing.T) { <del> graphtest.GetDriver(t, "overlayfs") <del>} <del> <del>func TestOverlayfsCreateEmpty(t *testing.T) { <del> graphtest.DriverTestCreateEmpty(t, "overlayfs") <del>} <del> <del>func TestOverlayfsCreateBase(t *testing.T) { <del> graphtest.DriverTestCreateBase(t, "overlayfs") <del>} <del> <del>func TestOverlayfsCreateSnap(t *testing.T) { <del> graphtest.DriverTestCreateSnap(t, "overlayfs") <del>} <del> <del>func TestOverlayfsTeardown(t *testing.T) { <del> graphtest.PutDriver(t) <del>}
6
PHP
PHP
update doc block
e1e764ee8800203720ff6a5c6601cc821e3073a8
<ide><path>src/Illuminate/Http/RedirectResponse.php <ide> public function exceptInput() <ide> * Flash a container of errors to the session. <ide> * <ide> * @param \Illuminate\Support\Contracts\MessageProviderInterface|array $provider <add> * @param string $key <ide> * @return \Illuminate\Http\RedirectResponse <ide> */ <ide> public function withErrors($provider, $key = 'default')
1
Javascript
Javascript
fix couple of small issues
1228981e4f62d9a9d3f8cf3b90ef9138ebba7983
<ide><path>rollup.config.js <ide> <ide> const babel = require('rollup-plugin-babel'); <ide> const cleanup = require('rollup-plugin-cleanup'); <del>const polyfill = require('rollup-plugin-polyfill') <add>const polyfill = require('rollup-plugin-polyfill'); <ide> const json = require('@rollup/plugin-json'); <ide> const resolve = require('@rollup/plugin-node-resolve'); <ide> const terser = require('rollup-plugin-terser').terser; <ide><path>src/elements/element.rectangle.js <ide> export default class Rectangle extends Element { <ide> } <ide> <ide> getCenterPoint(useFinalPosition) { <del> const {x, y, base, horizontal} = this.getProps(['x', 'y', 'base', 'horizontal', useFinalPosition]); <add> const {x, y, base, horizontal} = this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition); <ide> return { <ide> x: horizontal ? (x + base) / 2 : x, <ide> y: horizontal ? y : (y + base) / 2 <ide><path>src/plugins/plugin.tooltip.js <ide> defaults.set('tooltips', { <ide> easing: 'easeOutQuart', <ide> numbers: { <ide> type: 'number', <del> properties: ['x', 'y', 'width', 'height'], <add> properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'], <ide> }, <ide> opacity: { <ide> easing: 'linear',
3
Text
Text
add documentation on tooltip xalign and yalign
55dd426a412c89cc0457a3ec925cb2df11ccfa28
<ide><path>docs/configuration/tooltip.md <ide> Namespace: `options.plugins.tooltip`, the global options for the chart tooltips <ide> | `backgroundColor` | [`Color`](../general/colors.md) | `'rgba(0, 0, 0, 0.8)'` | Background color of the tooltip. <ide> | `titleColor` | [`Color`](../general/colors.md) | `'#fff'` | Color of title text. <ide> | `titleFont` | `Font` | `{weight: 'bold'}` | See [Fonts](../general/fonts.md). <del>| `titleAlign` | `string` | `'left'` | Horizontal alignment of the title text lines. [more...](#alignment) <add>| `titleAlign` | `string` | `'left'` | Horizontal alignment of the title text lines. [more...](#text-alignment) <ide> | `titleSpacing` | `number` | `2` | Spacing to add to top and bottom of each title line. <ide> | `titleMarginBottom` | `number` | `6` | Margin to add on bottom of title section. <ide> | `bodyColor` | [`Color`](../general/colors.md) | `'#fff'` | Color of body text. <ide> | `bodyFont` | `Font` | `{}` | See [Fonts](../general/fonts.md). <del>| `bodyAlign` | `string` | `'left'` | Horizontal alignment of the body text lines. [more...](#alignment) <add>| `bodyAlign` | `string` | `'left'` | Horizontal alignment of the body text lines. [more...](#text-alignment) <ide> | `bodySpacing` | `number` | `2` | Spacing to add to top and bottom of each tooltip item. <ide> | `footerColor` | [`Color`](../general/colors.md) | `'#fff'` | Color of footer text. <ide> | `footerFont` | `Font` | `{weight: 'bold'}` | See [Fonts](../general/fonts.md). <del>| `footerAlign` | `string` | `'left'` | Horizontal alignment of the footer text lines. [more...](#alignment) <add>| `footerAlign` | `string` | `'left'` | Horizontal alignment of the footer text lines. [more...](#text-alignment) <ide> | `footerSpacing` | `number` | `2` | Spacing to add to top and bottom of each footer line. <ide> | `footerMarginTop` | `number` | `6` | Margin to add before drawing the footer. <ide> | `padding` | [`Padding`](../general/padding.md) | `6` | Padding inside the tooltip. <ide> Namespace: `options.plugins.tooltip`, the global options for the chart tooltips <ide> | `borderWidth` | `number` | `0` | Size of the border. <ide> | `rtl` | `boolean` | | `true` for rendering the tooltip from right to left. <ide> | `textDirection` | `string` | canvas' default | This will force the text direction `'rtl' or 'ltr` on the canvas for rendering the tooltips, regardless of the css specified on the canvas <add>| `xAlign` | `string` | `undefined` | Position of the tooltip caret in the X direction. [more](#tooltip-alignment) <add>| `yAlign` | `string` | `undefined` | Position of the tooltip caret in the Y direction. [more](#tooltip-alignment) <ide> <ide> ### Position Modes <ide> <ide> tooltipPlugin.positioners.myCustomPositioner = function(elements, eventPosition) <ide> }; <ide> ``` <ide> <del>### Alignment <add>### Tooltip Alignment <add> <add>The `xAlign` and `yAlign` options define the position of the tooltip caret. If these parameters are unset, the optimal caret position is determined. <add> <add>The following values for the `xAlign` setting are supported. <add> <add>* `'left'` <add>* `'center'` <add>* `'right'` <add> <add>The following values for the `yAlign` setting are supported. <add> <add>* `'top'` <add>* `'center'` <add>* `'bottom'` <add> <add>### Text Alignment <ide> <ide> The `titleAlign`, `bodyAlign` and `footerAlign` options define the horizontal position of the text lines with respect to the tooltip box. The following values are supported. <ide>
1
Text
Text
use code markup/markdown in headers
b407503b177ca8849c63b2cfe00ff11515bdabff
<ide><path>doc/api/fs.md <ide> synchronous use libuv's threadpool, which can have surprising and negative <ide> performance implications for some applications. See the <ide> [`UV_THREADPOOL_SIZE`][] documentation for more information. <ide> <del>## Class fs.Dir <add>## Class `fs.Dir` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> async function print(path) { <ide> print('./').catch(console.error); <ide> ``` <ide> <del>### dir.close() <add>### `dir.close()` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> Subsequent reads will result in errors. <ide> A `Promise` is returned that will be resolved after the resource has been <ide> closed. <ide> <del>### dir.close(callback) <add>### `dir.close(callback)` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> Subsequent reads will result in errors. <ide> <ide> The `callback` will be called after the resource handle has been closed. <ide> <del>### dir.closeSync() <add>### `dir.closeSync()` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> <ide> Synchronously close the directory's underlying resource handle. <ide> Subsequent reads will result in errors. <ide> <del>### dir.path <add>### `dir.path` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> added: v12.12.0 <ide> The read-only path of this directory as was provided to [`fs.opendir()`][], <ide> [`fs.opendirSync()`][], or [`fsPromises.opendir()`][]. <ide> <del>### dir.read() <add>### `dir.read()` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> provided by the operating system's underlying directory mechanisms. <ide> Entries added or removed while iterating over the directory may or may not be <ide> included in the iteration results. <ide> <del>### dir.read(callback) <add>### `dir.read(callback)` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> provided by the operating system's underlying directory mechanisms. <ide> Entries added or removed while iterating over the directory may or may not be <ide> included in the iteration results. <ide> <del>### dir.readSync() <add>### `dir.readSync()` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> provided by the operating system's underlying directory mechanisms. <ide> Entries added or removed while iterating over the directory may or may not be <ide> included in the iteration results. <ide> <del>### dir\[Symbol.asyncIterator\]() <add>### `dir[Symbol.asyncIterator]()` <ide> <!-- YAML <ide> added: v12.12.0 <ide> --> <ide> provided by the operating system's underlying directory mechanisms. <ide> Entries added or removed while iterating over the directory may or may not be <ide> included in the iteration results. <ide> <del>## Class: fs.Dirent <add>## Class: `fs.Dirent` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> Additionally, when [`fs.readdir()`][] or [`fs.readdirSync()`][] is called with <ide> the `withFileTypes` option set to `true`, the resulting array is filled with <ide> `fs.Dirent` objects, rather than strings or `Buffers`. <ide> <del>### dirent.isBlockDevice() <add>### `dirent.isBlockDevice()` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> added: v10.10.0 <ide> <ide> Returns `true` if the `fs.Dirent` object describes a block device. <ide> <del>### dirent.isCharacterDevice() <add>### `dirent.isCharacterDevice()` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> added: v10.10.0 <ide> <ide> Returns `true` if the `fs.Dirent` object describes a character device. <ide> <del>### dirent.isDirectory() <add>### `dirent.isDirectory()` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> added: v10.10.0 <ide> Returns `true` if the `fs.Dirent` object describes a file system <ide> directory. <ide> <del>### dirent.isFIFO() <add>### `dirent.isFIFO()` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> added: v10.10.0 <ide> Returns `true` if the `fs.Dirent` object describes a first-in-first-out <ide> (FIFO) pipe. <ide> <del>### dirent.isFile() <add>### `dirent.isFile()` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> added: v10.10.0 <ide> <ide> Returns `true` if the `fs.Dirent` object describes a regular file. <ide> <del>### dirent.isSocket() <add>### `dirent.isSocket()` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> added: v10.10.0 <ide> <ide> Returns `true` if the `fs.Dirent` object describes a socket. <ide> <del>### dirent.isSymbolicLink() <add>### `dirent.isSymbolicLink()` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> added: v10.10.0 <ide> <ide> Returns `true` if the `fs.Dirent` object describes a symbolic link. <ide> <del>### dirent.name <add>### `dirent.name` <ide> <!-- YAML <ide> added: v10.10.0 <ide> --> <ide> The file name that this `fs.Dirent` object refers to. The type of this <ide> value is determined by the `options.encoding` passed to [`fs.readdir()`][] or <ide> [`fs.readdirSync()`][]. <ide> <del>## Class: fs.FSWatcher <add>## Class: `fs.FSWatcher` <ide> <!-- YAML <ide> added: v0.5.8 <ide> --> <ide> object. <ide> All `fs.FSWatcher` objects emit a `'change'` event whenever a specific watched <ide> file is modified. <ide> <del>### Event: 'change' <add>### Event: `'change'` <ide> <!-- YAML <ide> added: v0.5.8 <ide> --> <ide> fs.watch('./tmp', { encoding: 'buffer' }, (eventType, filename) => { <ide> }); <ide> ``` <ide> <del>### Event: 'close' <add>### Event: `'close'` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> <ide> Emitted when the watcher stops watching for changes. The closed <ide> `fs.FSWatcher` object is no longer usable in the event handler. <ide> <del>### Event: 'error' <add>### Event: `'error'` <ide> <!-- YAML <ide> added: v0.5.8 <ide> --> <ide> added: v0.5.8 <ide> Emitted when an error occurs while watching the file. The errored <ide> `fs.FSWatcher` object is no longer usable in the event handler. <ide> <del>### watcher.close() <add>### `watcher.close()` <ide> <!-- YAML <ide> added: v0.5.8 <ide> --> <ide> <ide> Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the <ide> `fs.FSWatcher` object is no longer usable. <ide> <del>## Class: fs.ReadStream <add>## Class: `fs.ReadStream` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> added: v0.1.93 <ide> A successful call to `fs.createReadStream()` will return a new `fs.ReadStream` <ide> object. <ide> <del>### Event: 'close' <add>### Event: `'close'` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> <ide> Emitted when the `fs.ReadStream`'s underlying file descriptor has been closed. <ide> <del>### Event: 'open' <add>### Event: `'open'` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> added: v0.1.93 <ide> <ide> Emitted when the `fs.ReadStream`'s file descriptor has been opened. <ide> <del>### Event: 'ready' <add>### Event: `'ready'` <ide> <!-- YAML <ide> added: v9.11.0 <ide> --> <ide> Emitted when the `fs.ReadStream` is ready to be used. <ide> <ide> Fires immediately after `'open'`. <ide> <del>### readStream.bytesRead <add>### `readStream.bytesRead` <ide> <!-- YAML <ide> added: v6.4.0 <ide> --> <ide> added: v6.4.0 <ide> <ide> The number of bytes that have been read so far. <ide> <del>### readStream.path <add>### `readStream.path` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> argument to `fs.createReadStream()`. If `path` is passed as a string, then <ide> `readStream.path` will be a string. If `path` is passed as a `Buffer`, then <ide> `readStream.path` will be a `Buffer`. <ide> <del>### readStream.pending <add>### `readStream.pending` <ide> <!-- YAML <ide> added: v11.2.0 <ide> --> <ide> added: v11.2.0 <ide> This property is `true` if the underlying file has not been opened yet, <ide> i.e. before the `'ready'` event is emitted. <ide> <del>## Class: fs.Stats <add>## Class: `fs.Stats` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> BigIntStats { <ide> birthtime: Mon, 10 Oct 2011 23:24:11 GMT } <ide> ``` <ide> <del>### stats.isBlockDevice() <add>### `stats.isBlockDevice()` <ide> <!-- YAML <ide> added: v0.1.10 <ide> --> <ide> added: v0.1.10 <ide> <ide> Returns `true` if the `fs.Stats` object describes a block device. <ide> <del>### stats.isCharacterDevice() <add>### `stats.isCharacterDevice()` <ide> <!-- YAML <ide> added: v0.1.10 <ide> --> <ide> added: v0.1.10 <ide> <ide> Returns `true` if the `fs.Stats` object describes a character device. <ide> <del>### stats.isDirectory() <add>### `stats.isDirectory()` <ide> <!-- YAML <ide> added: v0.1.10 <ide> --> <ide> added: v0.1.10 <ide> <ide> Returns `true` if the `fs.Stats` object describes a file system directory. <ide> <del>### stats.isFIFO() <add>### `stats.isFIFO()` <ide> <!-- YAML <ide> added: v0.1.10 <ide> --> <ide> added: v0.1.10 <ide> Returns `true` if the `fs.Stats` object describes a first-in-first-out (FIFO) <ide> pipe. <ide> <del>### stats.isFile() <add>### `stats.isFile()` <ide> <!-- YAML <ide> added: v0.1.10 <ide> --> <ide> added: v0.1.10 <ide> <ide> Returns `true` if the `fs.Stats` object describes a regular file. <ide> <del>### stats.isSocket() <add>### `stats.isSocket()` <ide> <!-- YAML <ide> added: v0.1.10 <ide> --> <ide> added: v0.1.10 <ide> <ide> Returns `true` if the `fs.Stats` object describes a socket. <ide> <del>### stats.isSymbolicLink() <add>### `stats.isSymbolicLink()` <ide> <!-- YAML <ide> added: v0.1.10 <ide> --> <ide> Returns `true` if the `fs.Stats` object describes a symbolic link. <ide> <ide> This method is only valid when using [`fs.lstat()`][]. <ide> <del>### stats.dev <add>### `stats.dev` <ide> <ide> * {number|bigint} <ide> <ide> The numeric identifier of the device containing the file. <ide> <del>### stats.ino <add>### `stats.ino` <ide> <ide> * {number|bigint} <ide> <ide> The file system specific "Inode" number for the file. <ide> <del>### stats.mode <add>### `stats.mode` <ide> <ide> * {number|bigint} <ide> <ide> A bit-field describing the file type and mode. <ide> <del>### stats.nlink <add>### `stats.nlink` <ide> <ide> * {number|bigint} <ide> <ide> The number of hard-links that exist for the file. <ide> <del>### stats.uid <add>### `stats.uid` <ide> <ide> * {number|bigint} <ide> <ide> The numeric user identifier of the user that owns the file (POSIX). <ide> <del>### stats.gid <add>### `stats.gid` <ide> <ide> * {number|bigint} <ide> <ide> The numeric group identifier of the group that owns the file (POSIX). <ide> <del>### stats.rdev <add>### `stats.rdev` <ide> <ide> * {number|bigint} <ide> <ide> A numeric device identifier if the file is considered "special". <ide> <del>### stats.size <add>### `stats.size` <ide> <ide> * {number|bigint} <ide> <ide> The size of the file in bytes. <ide> <del>### stats.blksize <add>### `stats.blksize` <ide> <ide> * {number|bigint} <ide> <ide> The file system block size for i/o operations. <ide> <del>### stats.blocks <add>### `stats.blocks` <ide> <ide> * {number|bigint} <ide> <ide> The number of blocks allocated for this file. <ide> <del>### stats.atimeMs <add>### `stats.atimeMs` <ide> <!-- YAML <ide> added: v8.1.0 <ide> --> <ide> added: v8.1.0 <ide> The timestamp indicating the last time this file was accessed expressed in <ide> milliseconds since the POSIX Epoch. <ide> <del>### stats.mtimeMs <add>### `stats.mtimeMs` <ide> <!-- YAML <ide> added: v8.1.0 <ide> --> <ide> added: v8.1.0 <ide> The timestamp indicating the last time this file was modified expressed in <ide> milliseconds since the POSIX Epoch. <ide> <del>### stats.ctimeMs <add>### `stats.ctimeMs` <ide> <!-- YAML <ide> added: v8.1.0 <ide> --> <ide> added: v8.1.0 <ide> The timestamp indicating the last time the file status was changed expressed <ide> in milliseconds since the POSIX Epoch. <ide> <del>### stats.birthtimeMs <add>### `stats.birthtimeMs` <ide> <!-- YAML <ide> added: v8.1.0 <ide> --> <ide> added: v8.1.0 <ide> The timestamp indicating the creation time of this file expressed in <ide> milliseconds since the POSIX Epoch. <ide> <del>### stats.atimeNs <add>### `stats.atimeNs` <ide> <!-- YAML <ide> added: v12.10.0 <ide> --> <ide> the object. <ide> The timestamp indicating the last time this file was accessed expressed in <ide> nanoseconds since the POSIX Epoch. <ide> <del>### stats.mtimeNs <add>### `stats.mtimeNs` <ide> <!-- YAML <ide> added: v12.10.0 <ide> --> <ide> the object. <ide> The timestamp indicating the last time this file was modified expressed in <ide> nanoseconds since the POSIX Epoch. <ide> <del>### stats.ctimeNs <add>### `stats.ctimeNs` <ide> <!-- YAML <ide> added: v12.10.0 <ide> --> <ide> the object. <ide> The timestamp indicating the last time the file status was changed expressed <ide> in nanoseconds since the POSIX Epoch. <ide> <del>### stats.birthtimeNs <add>### `stats.birthtimeNs` <ide> <!-- YAML <ide> added: v12.10.0 <ide> --> <ide> the object. <ide> The timestamp indicating the creation time of this file expressed in <ide> nanoseconds since the POSIX Epoch. <ide> <del>### stats.atime <add>### `stats.atime` <ide> <!-- YAML <ide> added: v0.11.13 <ide> --> <ide> added: v0.11.13 <ide> <ide> The timestamp indicating the last time this file was accessed. <ide> <del>### stats.mtime <add>### `stats.mtime` <ide> <!-- YAML <ide> added: v0.11.13 <ide> --> <ide> added: v0.11.13 <ide> <ide> The timestamp indicating the last time this file was modified. <ide> <del>### stats.ctime <add>### `stats.ctime` <ide> <!-- YAML <ide> added: v0.11.13 <ide> --> <ide> added: v0.11.13 <ide> <ide> The timestamp indicating the last time the file status was changed. <ide> <del>### stats.birthtime <add>### `stats.birthtime` <ide> <!-- YAML <ide> added: v0.11.13 <ide> --> <ide> The times in the stat object have the following semantics: <ide> Prior to Node.js 0.12, the `ctime` held the `birthtime` on Windows systems. As <ide> of 0.12, `ctime` is not "creation time", and on Unix systems, it never was. <ide> <del>## Class: fs.WriteStream <add>## Class: `fs.WriteStream` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> <ide> * Extends {stream.Writable} <ide> <del>### Event: 'close' <add>### Event: `'close'` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> <ide> Emitted when the `WriteStream`'s underlying file descriptor has been closed. <ide> <del>### Event: 'open' <add>### Event: `'open'` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> added: v0.1.93 <ide> <ide> Emitted when the `WriteStream`'s file is opened. <ide> <del>### Event: 'ready' <add>### Event: `'ready'` <ide> <!-- YAML <ide> added: v9.11.0 <ide> --> <ide> Emitted when the `fs.WriteStream` is ready to be used. <ide> <ide> Fires immediately after `'open'`. <ide> <del>### writeStream.bytesWritten <add>### `writeStream.bytesWritten` <ide> <!-- YAML <ide> added: v0.4.7 <ide> --> <ide> <ide> The number of bytes written so far. Does not include data that is still queued <ide> for writing. <ide> <del>### writeStream.path <add>### `writeStream.path` <ide> <!-- YAML <ide> added: v0.1.93 <ide> --> <ide> argument to [`fs.createWriteStream()`][]. If `path` is passed as a string, then <ide> `writeStream.path` will be a string. If `path` is passed as a `Buffer`, then <ide> `writeStream.path` will be a `Buffer`. <ide> <del>### writeStream.pending <add>### `writeStream.pending` <ide> <!-- YAML <ide> added: v11.2.0 <ide> --> <ide> added: v11.2.0 <ide> This property is `true` if the underlying file has not been opened yet, <ide> i.e. before the `'ready'` event is emitted. <ide> <del>## fs.access(path\[, mode\], callback) <add>## `fs.access(path[, mode], callback)` <ide> <!-- YAML <ide> added: v0.11.15 <ide> changes: <ide> a file or directory. The `fs.access()` function, however, does not check the <ide> ACL and therefore may report that a path is accessible even if the ACL restricts <ide> the user from reading or writing to it. <ide> <del>## fs.accessSync(path\[, mode\]) <add>## `fs.accessSync(path[, mode])` <ide> <!-- YAML <ide> added: v0.11.15 <ide> changes: <ide> try { <ide> } <ide> ``` <ide> <del>## fs.appendFile(path, data\[, options\], callback) <add>## `fs.appendFile(path, data[, options], callback)` <ide> <!-- YAML <ide> added: v0.6.7 <ide> changes: <ide> fs.open('message.txt', 'a', (err, fd) => { <ide> }); <ide> ``` <ide> <del>## fs.appendFileSync(path, data\[, options\]) <add>## `fs.appendFileSync(path, data[, options])` <ide> <!-- YAML <ide> added: v0.6.7 <ide> changes: <ide> try { <ide> } <ide> ``` <ide> <del>## fs.chmod(path, mode, callback) <add>## `fs.chmod(path, mode, callback)` <ide> <!-- YAML <ide> added: v0.1.30 <ide> changes: <ide> Caveats: on Windows only the write permission can be changed, and the <ide> distinction among the permissions of group, owner or others is not <ide> implemented. <ide> <del>## fs.chmodSync(path, mode) <add>## `fs.chmodSync(path, mode)` <ide> <!-- YAML <ide> added: v0.6.7 <ide> changes: <ide> this API: [`fs.chmod()`][]. <ide> <ide> See also: chmod(2). <ide> <del>## fs.chown(path, uid, gid, callback) <add>## `fs.chown(path, uid, gid, callback)` <ide> <!-- YAML <ide> added: v0.1.97 <ide> changes: <ide> possible exception are given to the completion callback. <ide> <ide> See also: chown(2). <ide> <del>## fs.chownSync(path, uid, gid) <add>## `fs.chownSync(path, uid, gid)` <ide> <!-- YAML <ide> added: v0.1.97 <ide> changes: <ide> This is the synchronous version of [`fs.chown()`][]. <ide> <ide> See also: chown(2). <ide> <del>## fs.close(fd, callback) <add>## `fs.close(fd, callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> to the completion callback. <ide> Calling `fs.close()` on any file descriptor (`fd`) that is currently in use <ide> through any other `fs` operation may lead to undefined behavior. <ide> <del>## fs.closeSync(fd) <add>## `fs.closeSync(fd)` <ide> <!-- YAML <ide> added: v0.1.21 <ide> --> <ide> Synchronous close(2). Returns `undefined`. <ide> Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use <ide> through any other `fs` operation may lead to undefined behavior. <ide> <del>## fs.constants <add>## `fs.constants` <ide> <ide> * {Object} <ide> <ide> Returns an object containing commonly used constants for file system <ide> operations. The specific constants currently defined are described in <ide> [FS Constants][]. <ide> <del>## fs.copyFile(src, dest\[, flags\], callback) <add>## `fs.copyFile(src, dest[, flags], callback)` <ide> <!-- YAML <ide> added: v8.5.0 <ide> --> <ide> const { COPYFILE_EXCL } = fs.constants; <ide> fs.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL, callback); <ide> ``` <ide> <del>## fs.copyFileSync(src, dest\[, flags\]) <add>## `fs.copyFileSync(src, dest[, flags])` <ide> <!-- YAML <ide> added: v8.5.0 <ide> --> <ide> const { COPYFILE_EXCL } = fs.constants; <ide> fs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL); <ide> ``` <ide> <del>## fs.createReadStream(path\[, options\]) <add>## `fs.createReadStream(path[, options])` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> fs.createReadStream('sample.txt', { start: 90, end: 99 }); <ide> <ide> If `options` is a string, then it specifies the encoding. <ide> <del>## fs.createWriteStream(path\[, options\]) <add>## `fs.createWriteStream(path[, options])` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> should be passed to [`net.Socket`][]. <ide> <ide> If `options` is a string, then it specifies the encoding. <ide> <del>## fs.exists(path, callback) <add>## `fs.exists(path, callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> In general, check for the existence of a file only if the file won’t be <ide> used directly, for example when its existence is a signal from another <ide> process. <ide> <del>## fs.existsSync(path) <add>## `fs.existsSync(path)` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> if (fs.existsSync('/etc/passwd')) { <ide> } <ide> ``` <ide> <del>## fs.fchmod(fd, mode, callback) <add>## `fs.fchmod(fd, mode, callback)` <ide> <!-- YAML <ide> added: v0.4.7 <ide> changes: <ide> changes: <ide> Asynchronous fchmod(2). No arguments other than a possible exception <ide> are given to the completion callback. <ide> <del>## fs.fchmodSync(fd, mode) <add>## `fs.fchmodSync(fd, mode)` <ide> <!-- YAML <ide> added: v0.4.7 <ide> --> <ide> added: v0.4.7 <ide> <ide> Synchronous fchmod(2). Returns `undefined`. <ide> <del>## fs.fchown(fd, uid, gid, callback) <add>## `fs.fchown(fd, uid, gid, callback)` <ide> <!-- YAML <ide> added: v0.4.7 <ide> changes: <ide> changes: <ide> Asynchronous fchown(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> <del>## fs.fchownSync(fd, uid, gid) <add>## `fs.fchownSync(fd, uid, gid)` <ide> <!-- YAML <ide> added: v0.4.7 <ide> --> <ide> added: v0.4.7 <ide> <ide> Synchronous fchown(2). Returns `undefined`. <ide> <del>## fs.fdatasync(fd, callback) <add>## `fs.fdatasync(fd, callback)` <ide> <!-- YAML <ide> added: v0.1.96 <ide> changes: <ide> changes: <ide> Asynchronous fdatasync(2). No arguments other than a possible exception are <ide> given to the completion callback. <ide> <del>## fs.fdatasyncSync(fd) <add>## `fs.fdatasyncSync(fd)` <ide> <!-- YAML <ide> added: v0.1.96 <ide> --> <ide> added: v0.1.96 <ide> <ide> Synchronous fdatasync(2). Returns `undefined`. <ide> <del>## fs.fstat(fd\[, options\], callback) <add>## `fs.fstat(fd[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.95 <ide> changes: <ide> Asynchronous fstat(2). The callback gets two arguments `(err, stats)` where <ide> `stats` is an [`fs.Stats`][] object. `fstat()` is identical to [`stat()`][], <ide> except that the file to be stat-ed is specified by the file descriptor `fd`. <ide> <del>## fs.fstatSync(fd\[, options\]) <add>## `fs.fstatSync(fd[, options])` <ide> <!-- YAML <ide> added: v0.1.95 <ide> changes: <ide> changes: <ide> <ide> Synchronous fstat(2). <ide> <del>## fs.fsync(fd, callback) <add>## `fs.fsync(fd, callback)` <ide> <!-- YAML <ide> added: v0.1.96 <ide> changes: <ide> changes: <ide> Asynchronous fsync(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> <del>## fs.fsyncSync(fd) <add>## `fs.fsyncSync(fd)` <ide> <!-- YAML <ide> added: v0.1.96 <ide> --> <ide> added: v0.1.96 <ide> <ide> Synchronous fsync(2). Returns `undefined`. <ide> <del>## fs.ftruncate(fd\[, len\], callback) <add>## `fs.ftruncate(fd[, len], callback)` <ide> <!-- YAML <ide> added: v0.8.6 <ide> changes: <ide> fs.ftruncate(fd, 10, (err) => { <ide> <ide> The last three bytes are null bytes (`'\0'`), to compensate the over-truncation. <ide> <del>## fs.ftruncateSync(fd\[, len\]) <add>## `fs.ftruncateSync(fd[, len])` <ide> <!-- YAML <ide> added: v0.8.6 <ide> --> <ide> Returns `undefined`. <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.ftruncate()`][]. <ide> <del>## fs.futimes(fd, atime, mtime, callback) <add>## `fs.futimes(fd, atime, mtime, callback)` <ide> <!-- YAML <ide> added: v0.4.2 <ide> changes: <ide> descriptor. See [`fs.utimes()`][]. <ide> This function does not work on AIX versions before 7.1, it will return the <ide> error `UV_ENOSYS`. <ide> <del>## fs.futimesSync(fd, atime, mtime) <add>## `fs.futimesSync(fd, atime, mtime)` <ide> <!-- YAML <ide> added: v0.4.2 <ide> changes: <ide> changes: <ide> <ide> Synchronous version of [`fs.futimes()`][]. Returns `undefined`. <ide> <del>## fs.lchmod(path, mode, callback) <add>## `fs.lchmod(path, mode, callback)` <ide> <!-- YAML <ide> deprecated: v0.4.7 <ide> changes: <ide> are given to the completion callback. <ide> <ide> Only available on macOS. <ide> <del>## fs.lchmodSync(path, mode) <add>## `fs.lchmodSync(path, mode)` <ide> <!-- YAML <ide> deprecated: v0.4.7 <ide> --> <ide> deprecated: v0.4.7 <ide> <ide> Synchronous lchmod(2). Returns `undefined`. <ide> <del>## fs.lchown(path, uid, gid, callback) <add>## `fs.lchown(path, uid, gid, callback)` <ide> <!-- YAML <ide> changes: <ide> - version: v10.6.0 <ide> changes: <ide> Asynchronous lchown(2). No arguments other than a possible exception are given <ide> to the completion callback. <ide> <del>## fs.lchownSync(path, uid, gid) <add>## `fs.lchownSync(path, uid, gid)` <ide> <!-- YAML <ide> changes: <ide> - version: v10.6.0 <ide> changes: <ide> <ide> Synchronous lchown(2). Returns `undefined`. <ide> <del>## fs.link(existingPath, newPath, callback) <add>## `fs.link(existingPath, newPath, callback)` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> changes: <ide> Asynchronous link(2). No arguments other than a possible exception are given to <ide> the completion callback. <ide> <del>## fs.linkSync(existingPath, newPath) <add>## `fs.linkSync(existingPath, newPath)` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> changes: <ide> <ide> Synchronous link(2). Returns `undefined`. <ide> <del>## fs.lstat(path\[, options\], callback) <add>## `fs.lstat(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.30 <ide> changes: <ide> Asynchronous lstat(2). The callback gets two arguments `(err, stats)` where <ide> except that if `path` is a symbolic link, then the link itself is stat-ed, <ide> not the file that it refers to. <ide> <del>## fs.lstatSync(path\[, options\]) <add>## `fs.lstatSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.30 <ide> changes: <ide> changes: <ide> <ide> Synchronous lstat(2). <ide> <del>## fs.mkdir(path\[, options\], callback) <add>## `fs.mkdir(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.8 <ide> changes: <ide> fs.mkdir('/', { recursive: true }, (err) => { <ide> <ide> See also: mkdir(2). <ide> <del>## fs.mkdirSync(path\[, options\]) <add>## `fs.mkdirSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> This is the synchronous version of [`fs.mkdir()`][]. <ide> <ide> See also: mkdir(2). <ide> <del>## fs.mkdtemp(prefix\[, options\], callback) <add>## `fs.mkdtemp(prefix[, options], callback)` <ide> <!-- YAML <ide> added: v5.10.0 <ide> changes: <ide> fs.mkdtemp(`${tmpDir}${sep}`, (err, folder) => { <ide> }); <ide> ``` <ide> <del>## fs.mkdtempSync(prefix\[, options\]) <add>## `fs.mkdtempSync(prefix[, options])` <ide> <!-- YAML <ide> added: v5.10.0 <ide> --> <ide> this API: [`fs.mkdtemp()`][]. <ide> The optional `options` argument can be a string specifying an encoding, or an <ide> object with an `encoding` property specifying the character encoding to use. <ide> <del>## fs.open(path\[, flags\[, mode\]\], callback) <add>## `fs.open(path[, flags[, mode]], callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> a colon, Node.js will open a file system stream, as described by <ide> Functions based on `fs.open()` exhibit this behavior as well: <ide> `fs.writeFile()`, `fs.readFile()`, etc. <ide> <del>## fs.opendir(path\[, options\], callback) <add>## `fs.opendir(path[, options], callback)` <ide> <!-- YAML <ide> added: v12.12.0 <ide> changes: <ide> and cleaning up the directory. <ide> The `encoding` option sets the encoding for the `path` while opening the <ide> directory and subsequent read operations. <ide> <del>## fs.opendirSync(path\[, options\]) <add>## `fs.opendirSync(path[, options])` <ide> <!-- YAML <ide> added: v12.12.0 <ide> changes: <ide> and cleaning up the directory. <ide> The `encoding` option sets the encoding for the `path` while opening the <ide> directory and subsequent read operations. <ide> <del>## fs.openSync(path\[, flags, mode\]) <add>## `fs.openSync(path[, flags, mode])` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> Returns an integer representing the file descriptor. <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.open()`][]. <ide> <del>## fs.read(fd, buffer, offset, length, position, callback) <add>## `fs.read(fd, buffer, offset, length, position, callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> The callback is given the three arguments, `(err, bytesRead, buffer)`. <ide> If this method is invoked as its [`util.promisify()`][]ed version, it returns <ide> a `Promise` for an `Object` with `bytesRead` and `buffer` properties. <ide> <del>## fs.readdir(path\[, options\], callback) <add>## `fs.readdir(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.8 <ide> changes: <ide> the filenames returned will be passed as `Buffer` objects. <ide> If `options.withFileTypes` is set to `true`, the `files` array will contain <ide> [`fs.Dirent`][] objects. <ide> <del>## fs.readdirSync(path\[, options\]) <add>## `fs.readdirSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> the filenames returned will be passed as `Buffer` objects. <ide> If `options.withFileTypes` is set to `true`, the result will contain <ide> [`fs.Dirent`][] objects. <ide> <del>## fs.readFile(path\[, options\], callback) <add>## `fs.readFile(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.29 <ide> changes: <ide> already had `'Hello World`' and six bytes are read with the file descriptor, <ide> the call to `fs.readFile()` with the same file descriptor, would give <ide> `'World'`, rather than `'Hello World'`. <ide> <del>## fs.readFileSync(path\[, options\]) <add>## `fs.readFileSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.8 <ide> changes: <ide> fs.readFileSync('<directory>'); <ide> fs.readFileSync('<directory>'); // => <data> <ide> ``` <ide> <del>## fs.readlink(path\[, options\], callback) <add>## `fs.readlink(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> object with an `encoding` property specifying the character encoding to use for <ide> the link path passed to the callback. If the `encoding` is set to `'buffer'`, <ide> the link path returned will be passed as a `Buffer` object. <ide> <del>## fs.readlinkSync(path\[, options\]) <add>## `fs.readlinkSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> object with an `encoding` property specifying the character encoding to use for <ide> the link path returned. If the `encoding` is set to `'buffer'`, <ide> the link path returned will be passed as a `Buffer` object. <ide> <del>## fs.readSync(fd, buffer, offset, length, position) <add>## `fs.readSync(fd, buffer, offset, length, position)` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> Returns the number of `bytesRead`. <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.read()`][]. <ide> <del>## fs.realpath(path\[, options\], callback) <add>## `fs.realpath(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> the path returned will be passed as a `Buffer` object. <ide> If `path` resolves to a socket or a pipe, the function will return a system <ide> dependent name for that object. <ide> <del>## fs.realpath.native(path\[, options\], callback) <add>## `fs.realpath.native(path[, options], callback)` <ide> <!-- YAML <ide> added: v9.2.0 <ide> --> <ide> On Linux, when Node.js is linked against musl libc, the procfs file system must <ide> be mounted on `/proc` in order for this function to work. Glibc does not have <ide> this restriction. <ide> <del>## fs.realpathSync(path\[, options\]) <add>## `fs.realpathSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> Returns the resolved pathname. <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.realpath()`][]. <ide> <del>## fs.realpathSync.native(path\[, options\]) <add>## `fs.realpathSync.native(path[, options])` <ide> <!-- YAML <ide> added: v9.2.0 <ide> --> <ide> On Linux, when Node.js is linked against musl libc, the procfs file system must <ide> be mounted on `/proc` in order for this function to work. Glibc does not have <ide> this restriction. <ide> <del>## fs.rename(oldPath, newPath, callback) <add>## `fs.rename(oldPath, newPath, callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> fs.rename('oldFile.txt', 'newFile.txt', (err) => { <ide> }); <ide> ``` <ide> <del>## fs.renameSync(oldPath, newPath) <add>## `fs.renameSync(oldPath, newPath)` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> changes: <ide> <ide> Synchronous rename(2). Returns `undefined`. <ide> <del>## fs.rmdir(path\[, options\], callback) <add>## `fs.rmdir(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> to the completion callback. <ide> Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on <ide> Windows and an `ENOTDIR` error on POSIX. <ide> <del>## fs.rmdirSync(path\[, options\]) <add>## `fs.rmdirSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> Synchronous rmdir(2). Returns `undefined`. <ide> Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error <ide> on Windows and an `ENOTDIR` error on POSIX. <ide> <del>## fs.stat(path\[, options\], callback) <add>## `fs.stat(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> Stats { <ide> } <ide> ``` <ide> <del>## fs.statSync(path\[, options\]) <add>## `fs.statSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> changes: <ide> <ide> Synchronous stat(2). <ide> <del>## fs.symlink(target, path\[, type\], callback) <add>## `fs.symlink(target, path[, type], callback)` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> example/ <ide> └── mewtwo -> ./mew <ide> ``` <ide> <del>## fs.symlinkSync(target, path\[, type\]) <add>## `fs.symlinkSync(target, path[, type])` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> Returns `undefined`. <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.symlink()`][]. <ide> <del>## fs.truncate(path\[, len\], callback) <add>## `fs.truncate(path[, len], callback)` <ide> <!-- YAML <ide> added: v0.8.6 <ide> changes: <ide> first argument. In this case, `fs.ftruncate()` is called. <ide> Passing a file descriptor is deprecated and may result in an error being thrown <ide> in the future. <ide> <del>## fs.truncateSync(path\[, len\]) <add>## `fs.truncateSync(path[, len])` <ide> <!-- YAML <ide> added: v0.8.6 <ide> --> <ide> passed as the first argument. In this case, `fs.ftruncateSync()` is called. <ide> Passing a file descriptor is deprecated and may result in an error being thrown <ide> in the future. <ide> <del>## fs.unlink(path, callback) <add>## `fs.unlink(path, callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> directory, use [`fs.rmdir()`][]. <ide> <ide> See also: unlink(2). <ide> <del>## fs.unlinkSync(path) <add>## `fs.unlinkSync(path)` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> changes: <ide> <ide> Synchronous unlink(2). Returns `undefined`. <ide> <del>## fs.unwatchFile(filename\[, listener\]) <add>## `fs.unwatchFile(filename[, listener])` <ide> <!-- YAML <ide> added: v0.1.31 <ide> --> <ide> Using [`fs.watch()`][] is more efficient than `fs.watchFile()` and <ide> `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` <ide> and `fs.unwatchFile()` when possible. <ide> <del>## fs.utimes(path, atime, mtime, callback) <add>## `fs.utimes(path, atime, mtime, callback)` <ide> <!-- YAML <ide> added: v0.4.2 <ide> changes: <ide> The `atime` and `mtime` arguments follow these rules: <ide> * If the value can not be converted to a number, or is `NaN`, `Infinity` or <ide> `-Infinity`, an `Error` will be thrown. <ide> <del>## fs.utimesSync(path, atime, mtime) <add>## `fs.utimesSync(path, atime, mtime)` <ide> <!-- YAML <ide> added: v0.4.2 <ide> changes: <ide> Returns `undefined`. <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.utimes()`][]. <ide> <del>## fs.watch(filename\[, options\]\[, listener\]) <add>## `fs.watch(filename[, options][, listener])` <ide> <!-- YAML <ide> added: v0.5.10 <ide> changes: <ide> fs.watch('somedir', (eventType, filename) => { <ide> }); <ide> ``` <ide> <del>## fs.watchFile(filename\[, options\], listener) <add>## `fs.watchFile(filename[, options], listener)` <ide> <!-- YAML <ide> added: v0.1.31 <ide> changes: <ide> This happens when: <ide> * the file is deleted, followed by a restore <ide> * the file is renamed and then renamed a second time back to its original name <ide> <del>## fs.write(fd, buffer\[, offset\[, length\[, position\]\]\], callback) <add>## `fs.write(fd, buffer[, offset[, length[, position]]], callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> changes: <ide> On Linux, positional writes don't work when the file is opened in append mode. <ide> The kernel ignores the position argument and always appends the data to <ide> the end of the file. <ide> <del>## fs.write(fd, string\[, position\[, encoding\]\], callback) <add>## `fs.write(fd, string[, position[, encoding]], callback)` <ide> <!-- YAML <ide> added: v0.11.5 <ide> changes: <ide> It is possible to configure the console to render UTF-8 properly by changing the <ide> active codepage with the `chcp 65001` command. See the [chcp][] docs for more <ide> details. <ide> <del>## fs.writeFile(file, data\[, options\], callback) <add>## `fs.writeFile(file, data[, options], callback)` <ide> <!-- YAML <ide> added: v0.1.29 <ide> changes: <ide> on the size of the original file, and the position of the file descriptor). If <ide> a file name had been used instead of a descriptor, the file would be guaranteed <ide> to contain only `', World'`. <ide> <del>## fs.writeFileSync(file, data\[, options\]) <add>## `fs.writeFileSync(file, data[, options])` <ide> <!-- YAML <ide> added: v0.1.29 <ide> changes: <ide> Returns `undefined`. <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.writeFile()`][]. <ide> <del>## fs.writeSync(fd, buffer\[, offset\[, length\[, position\]\]\]) <add>## `fs.writeSync(fd, buffer[, offset[, length[, position]]])` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> changes: <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.write(fd, buffer...)`][]. <ide> <del>## fs.writeSync(fd, string\[, position\[, encoding\]\]) <add>## `fs.writeSync(fd, string[, position[, encoding]])` <ide> <!-- YAML <ide> added: v0.11.5 <ide> changes: <ide> changes: <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.write(fd, string...)`][]. <ide> <del>## fs.writev(fd, buffers\[, position\], callback) <add>## `fs.writev(fd, buffers[, position], callback)` <ide> <!-- YAML <ide> added: v12.9.0 <ide> --> <ide> On Linux, positional writes don't work when the file is opened in append mode. <ide> The kernel ignores the position argument and always appends the data to <ide> the end of the file. <ide> <del>## fs.writevSync(fd, buffers\[, position\]) <add>## `fs.writevSync(fd, buffers[, position])` <ide> <!-- YAML <ide> added: v12.9.0 <ide> --> <ide> added: v12.9.0 <ide> For detailed information, see the documentation of the asynchronous version of <ide> this API: [`fs.writev()`][]. <ide> <del>## fs Promises API <add>## `fs` Promises API <ide> <ide> The `fs.promises` API provides an alternative set of asynchronous file system <ide> methods that return `Promise` objects rather than using callbacks. The <ide> API is accessible via `require('fs').promises`. <ide> <del>### class: FileHandle <add>### class: `FileHandle` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> the promise-based API uses the `FileHandle` class in order to help avoid <ide> accidental leaking of unclosed file descriptors after a `Promise` is resolved or <ide> rejected. <ide> <del>#### filehandle.appendFile(data, options) <add>#### `filehandle.appendFile(data, options)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> If `options` is a string, then it specifies the encoding. <ide> <ide> The `FileHandle` must have been opened for appending. <ide> <del>#### filehandle.chmod(mode) <add>#### `filehandle.chmod(mode)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Modifies the permissions on the file. The `Promise` is resolved with no <ide> arguments upon success. <ide> <del>#### filehandle.chown(uid, gid) <add>#### `filehandle.chown(uid, gid)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Changes the ownership of the file then resolves the `Promise` with no arguments <ide> upon success. <ide> <del>#### filehandle.close() <add>#### `filehandle.close()` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> async function openAndClose() { <ide> } <ide> ``` <ide> <del>#### filehandle.datasync() <add>#### `filehandle.datasync()` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Asynchronous fdatasync(2). The `Promise` is resolved with no arguments upon <ide> success. <ide> <del>#### filehandle.fd <add>#### `filehandle.fd` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> <ide> * {number} The numeric file descriptor managed by the `FileHandle` object. <ide> <del>#### filehandle.read(buffer, offset, length, position) <add>#### `filehandle.read(buffer, offset, length, position)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> Following successful read, the `Promise` is resolved with an object with a <ide> `bytesRead` property specifying the number of bytes read, and a `buffer` <ide> property that is a reference to the passed in `buffer` argument. <ide> <del>#### filehandle.readFile(options) <add>#### `filehandle.readFile(options)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> If one or more `filehandle.read()` calls are made on a file handle and then a <ide> position till the end of the file. It doesn't always read from the beginning <ide> of the file. <ide> <del>#### filehandle.stat(\[options\]) <add>#### `filehandle.stat([options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> changes: <ide> changes: <ide> <ide> Retrieves the [`fs.Stats`][] for the file. <ide> <del>#### filehandle.sync() <add>#### `filehandle.sync()` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Asynchronous fsync(2). The `Promise` is resolved with no arguments upon <ide> success. <ide> <del>#### filehandle.truncate(len) <add>#### `filehandle.truncate(len)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> doTruncate().catch(console.error); <ide> <ide> The last three bytes are null bytes (`'\0'`), to compensate the over-truncation. <ide> <del>#### filehandle.utimes(atime, mtime) <add>#### `filehandle.utimes(atime, mtime)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> then resolves the `Promise` with no arguments upon success. <ide> This function does not work on AIX versions before 7.1, it will resolve the <ide> `Promise` with an error using code `UV_ENOSYS`. <ide> <del>#### filehandle.write(buffer\[, offset\[, length\[, position\]\]\]) <add>#### `filehandle.write(buffer[, offset[, length[, position]]])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> On Linux, positional writes do not work when the file is opened in append mode. <ide> The kernel ignores the position argument and always appends the data to <ide> the end of the file. <ide> <del>#### filehandle.write(string\[, position\[, encoding\]\]) <add>#### `filehandle.write(string[, position[, encoding]])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> On Linux, positional writes do not work when the file is opened in append mode. <ide> The kernel ignores the position argument and always appends the data to <ide> the end of the file. <ide> <del>#### filehandle.writeFile(data, options) <add>#### `filehandle.writeFile(data, options)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> If one or more `filehandle.write()` calls are made on a file handle and then a <ide> current position till the end of the file. It doesn't always write from the <ide> beginning of the file. <ide> <del>#### filehandle.writev(buffers\[, position\]) <add>#### `filehandle.writev(buffers[, position])` <ide> <!-- YAML <ide> added: v12.9.0 <ide> --> <ide> On Linux, positional writes don't work when the file is opened in append mode. <ide> The kernel ignores the position argument and always appends the data to <ide> the end of the file. <ide> <del>### fsPromises.access(path\[, mode\]) <add>### `fsPromises.access(path[, mode])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> condition, since other processes may change the file's state between the two <ide> calls. Instead, user code should open/read/write the file directly and handle <ide> the error raised if the file is not accessible. <ide> <del>### fsPromises.appendFile(path, data\[, options\]) <add>### `fsPromises.appendFile(path, data[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> If `options` is a string, then it specifies the encoding. <ide> The `path` may be specified as a `FileHandle` that has been opened <ide> for appending (using `fsPromises.open()`). <ide> <del>### fsPromises.chmod(path, mode) <add>### `fsPromises.chmod(path, mode)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Changes the permissions of a file then resolves the `Promise` with no <ide> arguments upon succces. <ide> <del>### fsPromises.chown(path, uid, gid) <add>### `fsPromises.chown(path, uid, gid)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Changes the ownership of a file then resolves the `Promise` with no arguments <ide> upon success. <ide> <del>### fsPromises.copyFile(src, dest\[, flags\]) <add>### `fsPromises.copyFile(src, dest[, flags])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> fsPromises.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL) <ide> .catch(() => console.log('The file could not be copied')); <ide> ``` <ide> <del>### fsPromises.lchmod(path, mode) <add>### `fsPromises.lchmod(path, mode)` <ide> <!-- YAML <ide> deprecated: v10.0.0 <ide> --> <ide> deprecated: v10.0.0 <ide> Changes the permissions on a symbolic link then resolves the `Promise` with <ide> no arguments upon success. This method is only implemented on macOS. <ide> <del>### fsPromises.lchown(path, uid, gid) <add>### `fsPromises.lchown(path, uid, gid)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> changes: <ide> changes: <ide> Changes the ownership on a symbolic link then resolves the `Promise` with <ide> no arguments upon success. <ide> <del>### fsPromises.link(existingPath, newPath) <add>### `fsPromises.link(existingPath, newPath)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> <ide> Asynchronous link(2). The `Promise` is resolved with no arguments upon success. <ide> <del>### fsPromises.lstat(path\[, options\]) <add>### `fsPromises.lstat(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> changes: <ide> changes: <ide> Asynchronous lstat(2). The `Promise` is resolved with the [`fs.Stats`][] object <ide> for the given symbolic link `path`. <ide> <del>### fsPromises.mkdir(path\[, options\]) <add>### `fsPromises.mkdir(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> property indicating whether parent folders should be created. Calling <ide> `fsPromises.mkdir()` when `path` is a directory that exists results in a <ide> rejection only when `recursive` is false. <ide> <del>### fsPromises.mkdtemp(prefix\[, options\]) <add>### `fsPromises.mkdtemp(prefix[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> characters directly to the `prefix` string. For instance, given a directory <ide> `prefix` must end with a trailing platform-specific path separator <ide> (`require('path').sep`). <ide> <del>### fsPromises.open(path, flags\[, mode\]) <add>### `fsPromises.open(path, flags[, mode])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> changes: <ide> by [Naming Files, Paths, and Namespaces][]. Under NTFS, if the filename contains <ide> a colon, Node.js will open a file system stream, as described by <ide> [this MSDN page][MSDN-Using-Streams]. <ide> <del>### fsPromises.opendir(path\[, options\]) <add>### `fsPromises.opendir(path[, options])` <ide> <!-- YAML <ide> added: v12.12.0 <ide> changes: <ide> async function print(path) { <ide> print('./').catch(console.error); <ide> ``` <ide> <del>### fsPromises.readdir(path\[, options\]) <add>### `fsPromises.readdir(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> changes: <ide> will be passed as `Buffer` objects. <ide> If `options.withFileTypes` is set to `true`, the resolved array will contain <ide> [`fs.Dirent`][] objects. <ide> <del>### fsPromises.readFile(path\[, options\]) <add>### `fsPromises.readFile(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> returned. <ide> <ide> Any specified `FileHandle` has to support reading. <ide> <del>### fsPromises.readlink(path\[, options\]) <add>### `fsPromises.readlink(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> object with an `encoding` property specifying the character encoding to use for <ide> the link path returned. If the `encoding` is set to `'buffer'`, the link path <ide> returned will be passed as a `Buffer` object. <ide> <del>### fsPromises.realpath(path\[, options\]) <add>### `fsPromises.realpath(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> On Linux, when Node.js is linked against musl libc, the procfs file system must <ide> be mounted on `/proc` in order for this function to work. Glibc does not have <ide> this restriction. <ide> <del>### fsPromises.rename(oldPath, newPath) <add>### `fsPromises.rename(oldPath, newPath)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Renames `oldPath` to `newPath` and resolves the `Promise` with no arguments <ide> upon success. <ide> <del>### fsPromises.rmdir(path\[, options\]) <add>### `fsPromises.rmdir(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> changes: <ide> Using `fsPromises.rmdir()` on a file (not a directory) results in the <ide> `Promise` being rejected with an `ENOENT` error on Windows and an `ENOTDIR` <ide> error on POSIX. <ide> <del>### fsPromises.stat(path\[, options\]) <add>### `fsPromises.stat(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> changes: <ide> changes: <ide> <ide> The `Promise` is resolved with the [`fs.Stats`][] object for the given `path`. <ide> <del>### fsPromises.symlink(target, path\[, type\]) <add>### `fsPromises.symlink(target, path\[, type\])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> The `type` argument is only used on Windows platforms and can be one of `'dir'`, <ide> to be absolute. When using `'junction'`, the `target` argument will <ide> automatically be normalized to absolute path. <ide> <del>### fsPromises.truncate(path\[, len\]) <add>### `fsPromises.truncate(path[, len])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Truncates the `path` then resolves the `Promise` with no arguments upon <ide> success. The `path` *must* be a string or `Buffer`. <ide> <del>### fsPromises.unlink(path) <add>### `fsPromises.unlink(path)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> added: v10.0.0 <ide> Asynchronous unlink(2). The `Promise` is resolved with no arguments upon <ide> success. <ide> <del>### fsPromises.utimes(path, atime, mtime) <add>### `fsPromises.utimes(path, atime, mtime)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> The `atime` and `mtime` arguments follow these rules: <ide> * If the value can not be converted to a number, or is `NaN`, `Infinity` or <ide> `-Infinity`, an `Error` will be thrown. <ide> <del>### fsPromises.writeFile(file, data\[, options\]) <add>### `fsPromises.writeFile(file, data[, options])` <ide> <!-- YAML <ide> added: v10.0.0 <ide> -->
1
Javascript
Javascript
remove redundant rule overrides
3c16a90fcad985b5229300eab25e3f0f4fecb314
<ide><path>.eslintrc.js <ide> module.exports = { <ide> rules: { <ide> 'ember-internal/require-yuidoc-access': 'error', <ide> 'ember-internal/no-const-outside-module-scope': 'error', <del> <del> 'no-unused-vars': 'error', <del> 'no-throw-literal': 'error', <del> 'comma-dangle': 'off', <ide> }, <ide> }, <ide> {
1
PHP
PHP
remove social interfaces
ebcdae3af3afb5d39e9fe57764a97da275e8cda6
<ide><path>src/Illuminate/Contracts/Auth/Social/Factory.php <del><?php namespace Illuminate\Contracts\Auth\Social; <del> <del>interface Factory { <del> <del> /** <del> * Get an OAuth provider implementation. <del> * <del> * @param string $driver <del> * @return \Illuminate\Contracts\Auth\Social\Provider <del> */ <del> public function driver($driver = null); <del> <del>} <ide><path>src/Illuminate/Contracts/Auth/Social/Provider.php <del><?php namespace Illuminate\Contracts\Auth\Social; <del> <del>interface Provider { <del> <del> /** <del> * Redirect the user to the authentication page for the provider. <del> * <del> * @return \Symfony\Component\HttpFoundation\RedirectResponse <del> */ <del> public function redirect(); <del> <del> /** <del> * Get the User instance for the authenticated user. <del> * <del> * @return \Illuminate\Contracts\Auth\Social\User <del> */ <del> public function user(); <del> <del>} <ide><path>src/Illuminate/Contracts/Auth/Social/User.php <del><?php namespace Illuminate\Contracts\Auth\Social; <del> <del>interface User { <del> <del> /** <del> * Get the unique identifier for the user. <del> * <del> * @return string <del> */ <del> public function getId(); <del> <del> /** <del> * Get the nickname / username for the user. <del> * <del> * @return string <del> */ <del> public function getNickname(); <del> <del> /** <del> * Get the full name of the user. <del> * <del> * @return string <del> */ <del> public function getName(); <del> <del> /** <del> * Get the e-mail address of the user. <del> * <del> * @return string <del> */ <del> public function getEmail(); <del> <del> /** <del> * Get the avatar / image URL for the user. <del> * <del> * @return string <del> */ <del> public function getAvatar(); <del> <del>} <ide>\ No newline at end of file
3
Go
Go
fix error paring null json - issue7941
a7cd25b8b69fe23c6458f5242dcd9f9039c99f48
<ide><path>engine/env.go <ide> func (env *Env) Decode(src io.Reader) error { <ide> } <ide> <ide> func (env *Env) SetAuto(k string, v interface{}) { <add> // Issue 7941 - if the value in the incoming JSON is null then treat it <add> // as if they never specified the property at all. <add> if v == nil { <add> return <add> } <add> <ide> // FIXME: we fix-convert float values to int, because <ide> // encoding/json decodes integers to float64, but cannot encode them back. <ide> // (See http://golang.org/src/pkg/encoding/json/decode.go#L46) <ide><path>integration/api_test.go <ide> import ( <ide> "bufio" <ide> "bytes" <ide> "encoding/json" <add> "fmt" <ide> "io" <ide> "io/ioutil" <ide> "net" <ide> func TestPostJsonVerify(t *testing.T) { <ide> } <ide> } <ide> <add>// Issue 7941 - test to make sure a "null" in JSON is just ignored. <add>// W/o this fix a null in JSON would be parsed into a string var as "null" <add>func TestPostCreateNull(t *testing.T) { <add> eng := NewTestEngine(t) <add> daemon := mkDaemonFromEngine(eng, t) <add> defer daemon.Nuke() <add> <add> configStr := fmt.Sprintf(`{ <add> "Hostname":"", <add> "Domainname":"", <add> "Memory":0, <add> "MemorySwap":0, <add> "CpuShares":0, <add> "Cpuset":null, <add> "AttachStdin":true, <add> "AttachStdout":true, <add> "AttachStderr":true, <add> "PortSpecs":null, <add> "ExposedPorts":{}, <add> "Tty":true, <add> "OpenStdin":true, <add> "StdinOnce":true, <add> "Env":[], <add> "Cmd":"ls", <add> "Image":"%s", <add> "Volumes":{}, <add> "WorkingDir":"", <add> "Entrypoint":null, <add> "NetworkDisabled":false, <add> "OnBuild":null}`, unitTestImageID) <add> <add> req, err := http.NewRequest("POST", "/containers/create", strings.NewReader(configStr)) <add> if err != nil { <add> t.Fatal(err) <add> } <add> <add> req.Header.Set("Content-Type", "application/json") <add> <add> r := httptest.NewRecorder() <add> if err := server.ServeRequest(eng, api.APIVERSION, r, req); err != nil { <add> t.Fatal(err) <add> } <add> assertHttpNotError(r, t) <add> if r.Code != http.StatusCreated { <add> t.Fatalf("%d Created expected, received %d\n", http.StatusCreated, r.Code) <add> } <add> <add> var apiRun engine.Env <add> if err := apiRun.Decode(r.Body); err != nil { <add> t.Fatal(err) <add> } <add> containerID := apiRun.Get("Id") <add> <add> containerAssertExists(eng, containerID, t) <add> <add> c := daemon.Get(containerID) <add> if c.Config.Cpuset != "" { <add> t.Fatalf("Cpuset should have been empty - instead its:" + c.Config.Cpuset) <add> } <add>} <add> <ide> func TestPostContainersKill(t *testing.T) { <ide> eng := NewTestEngine(t) <ide> defer mkDaemonFromEngine(eng, t).Nuke()
2
Python
Python
create directory if it doesn't exist
32404e613c85151d059e596fd5457bafcf67fdc2
<ide><path>spacy/lookups.py <ide> def to_disk(self, path, **kwargs): <ide> """ <ide> if len(self._tables): <ide> path = ensure_path(path) <add> if not path.exists(): <add> path.mkdir() <ide> filepath = path / "lookups.bin" <ide> with filepath.open("wb") as file_: <ide> file_.write(self.to_bytes())
1
PHP
PHP
remove redundant check from bootstrap/autoload.php
1078776e953d35bd67af0971fe78efa037d8fb83
<ide><path>bootstrap/autoload.php <ide> */ <ide> <ide> require __DIR__.'/../vendor/autoload.php'; <del> <del>/* <del>|-------------------------------------------------------------------------- <del>| Include The Compiled Class File <del>|-------------------------------------------------------------------------- <del>| <del>| To dramatically increase your application's performance, you may use a <del>| compiled class file which contains all of the classes commonly used <del>| by a request. The Artisan "optimize" is used to create this file. <del>| <del>*/ <del> <del>$compiledPath = __DIR__.'/cache/compiled.php'; <del> <del>if (file_exists($compiledPath)) { <del> require $compiledPath; <del>}
1
Python
Python
update textcat exampe
79a94bc166bfdd73a11b4e10a4717df22d171025
<ide><path>examples/training/train_textcat.py <add>'''Train a multi-label convolutional neural network text classifier, <add>using the spacy.pipeline.TextCategorizer component. The model is then added <add>to spacy.pipeline, and predictions are available at `doc.cats`. <add>''' <ide> from __future__ import unicode_literals <ide> import plac <ide> import random <ide> def train_textcat(tokenizer, textcat, <ide> train_data = tqdm.tqdm(train_data, leave=False) # Progress bar <ide> for batch in minibatch(train_data, size=batch_sizes): <ide> docs, golds = zip(*batch) <del> textcat.update((docs, None), golds, sgd=optimizer, drop=0.2, <add> textcat.update(docs, golds, sgd=optimizer, drop=0.2, <ide> losses=losses) <ide> with textcat.model.use_params(optimizer.averages): <ide> scores = evaluate(tokenizer, textcat, dev_texts, dev_cats)
1
PHP
PHP
use local var
900ca7f60f7711e7fc5e45406bbf3f3183e1f2f8
<ide><path>src/Controller/Component/RequestHandlerComponent.php <ide> public function renderAs(Controller $controller, $type, array $options = []) <ide> if ($viewClass) { <ide> $controller->viewClass = $viewClass; <ide> } else { <add> $view = $controller->getView(); <add> <ide> if (empty($this->_renderType)) { <del> $controller->getView()->viewPath($controller->getView()->viewPath() . DS . $type); <add> $view->viewPath($view->viewPath() . DS . $type); <ide> } else { <del> $controller->getView()->viewPath(preg_replace( <add> $view->viewPath(preg_replace( <ide> "/([\/\\\\]{$this->_renderType})$/", <ide> DS . $type, <del> $controller->getView()->viewPath() <add> $view->viewPath() <ide> )); <ide> } <ide> <ide> $this->_renderType = $type; <del> $controller->getView()->layoutPath($type); <add> $view->layoutPath($type); <ide> } <ide> <ide> $response = $this->response;
1
Javascript
Javascript
update ordinal format in korean locale
fc8c6248cc7306039a468627ed55298a600ae907
<ide><path>locale/ko.js <ide> var ko = moment.defineLocale('ko', { <ide> y : '일 년', <ide> yy : '%d년' <ide> }, <del> dayOfMonthOrdinalParse : /\d{1,2}일/, <del> ordinal : '%d일', <add> dayOfMonthOrdinalParse : /\d{1,2}(일|월|주)/, <add> ordinal : function (number, period) { <add> switch (period) { <add> case 'd': <add> case 'D': <add> case 'DDD': <add> return number + '일'; <add> case 'M': <add> return number + '월'; <add> case 'w': <add> case 'W': <add> return number + '주'; <add> default: <add> return number; <add> } <add> }, <ide> meridiemParse : /오전|오후/, <ide> isPM : function (token) { <ide> return token === '오후';
1
Python
Python
add test file for compute driver outscale sdk
d3810a433069fb6302cda944e1715a8623688cd6
<ide><path>libcloud/test/test_outscale_sdk.py <add># Licensed to the Apache Software Foundation (ASF) under one or more <add># contributor license agreements. See the NOTICE file distributed with <add># this work for additional information regarding copyright ownership. <add># The ASF licenses this file to You under the Apache License, Version 2.0 <add># (the "License"); you may not use this file except in compliance with <add># the License. You may obtain a copy of the License at <add># <add># http://www.apache.org/licenses/LICENSE-2.0 <add># <add># Unless required by applicable law or agreed to in writing, software <add># distributed under the License is distributed on an "AS IS" BASIS, <add># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add># See the License for the specific language governing permissions and <add># limitations under the License. <add>""" <add>Outscale SDK <add>""" <add>try: <add> from osc_python_sdk import Gateway <add>except ImportError as ie: <add> has_gateway = False <add>else: <add> has_gateway = True <add> <add>from libcloud.common.base import ConnectionUserAndKey <add>from libcloud.compute.base import NodeDriver <add>from libcloud.compute.types import Provider <add>from libcloud.compute.drivers.ec2 import OUTSCALE_INC_REGION_DETAILS <add> <add>SERVICE_TYPE = 'compute' <add> <add> <add>class OutscaleSDKConnection(ConnectionUserAndKey): <add> """ <add> Outscale SDK connection <add> """ <add> <add> @staticmethod <add> def gtw_connection(self, access_key, secret_key, region='eu-west-2'): <add> """ <add> Set the gateway connection. <add> <add> :param access_key: personnal access key (required) <add> :type access_key: ``str`` <add> <add> :param secret_key: personnal secret key (required) <add> :type secret_key: ``str`` <add> <add> :param region: region <add> :type region: ``str`` <add> <add> :return: request <add> :rtype: ``dict`` <add> """ <add> return Gateway(**{ <add> 'access_key': access_key, <add> 'secret_key': secret_key, <add> 'region': region <add> }) <add> <add> <add>class OutscaleSDKNodeDriver(NodeDriver): <add> """ <add> Outscale SDK node driver <add> """ <add> <add> type = Provider.OUTSCALE_SDK <add> connectionCls = OutscaleSDKConnection <add> name = 'Outscale SDK' <add> website = 'http://www.outscale.com' <add> <add> def __init__(self, key, secret, region='eu-west-2'): <add> global gtw <add> if has_gateway: <add> gtw = OutscaleSDKConnection.gtw_connection(key, secret, region) <add> <add> def list_locations(self): <add> """ <add> Lists available regions details. <add> <add> :return: regions details <add> :rtype: ``dict`` <add> """ <add> return OUTSCALE_INC_REGION_DETAILS <add> <add> def create_public_ip(self): <add> """ <add> Create a new public ip. <add> <add> :return: the created public ip <add> :rtype: ``dict`` <add> """ <add> return gtw.CreatePublicIp() <add> <add> def create_node(self, image_id): <add> """ <add> Create a new instance. <add> <add> :param image_id: the ID of the OMI <add> used to create the VM (required) <add> :type image_id: ``str`` <add> <add> :return: the created instance <add> :rtype: ``dict`` <add> """ <add> return gtw.CreateVms(ImageId=image_id) <add> <add> def reboot_node(self, node_ids): <add> """ <add> Reboot instances. <add> <add> :param node_ids: the ID(s) of the VM(s) <add> you want to reboot (required) <add> :type node_ids: ``list`` <add> <add> :return: the rebooted instances <add> :rtype: ``dict`` <add> """ <add> return gtw.RebootVms(VmIds=node_ids) <add> <add> def list_nodes(self): <add> """ <add> List all nodes. <add> <add> :return: nodes <add> :rtype: ``dict`` <add> """ <add> return gtw.ReadVms() <add> <add> def delete_node(self, node_ids): <add> """ <add> Delete instances. <add> <add> :param node_ids: one or more IDs of VMs (required) <add> :type node_ids: ``list`` <add> <add> :return: request <add> :rtype: ``dict`` <add> """ <add> return gtw.DeleteVms(VmIds=node_ids) <add> <add> def create_image(self, node_id, name, description=''): <add> """ <add> Create a new image. <add> <add> :param node_id: the ID of the VM from which <add> you want to create the OMI (required) <add> :type node_id: ``str`` <add> <add> :param name: a unique name for the new OMI (required) <add> :type name: ``str`` <add> <add> :param description: a description for the new OMI <add> :type description: ``str`` <add> <add> :return: the created image <add> :rtype: ``dict`` <add> """ <add> return gtw.CreateImage( <add> VmId=node_id, <add> ImageName=name, <add> Description=description <add> ) <add> <add> def list_images(self): <add> """ <add> List all images. <add> <add> :return: images <add> :rtype: ``dict`` <add> """ <add> return gtw.ReadImages() <add> <add> def get_image(self, image_id): <add> """ <add> Get a specific image. <add> <add> :param image_id: the ID of the image you want to select (required) <add> :type image_id: ``str`` <add> <add> :return: the selected image <add> :rtype: ``dict`` <add> """ <add> img = None <add> images = gtw.ReadImages() <add> for image in images.get('Images'): <add> if image.get('ImageId') == image_id: <add> img = image <add> return img <add> <add> def delete_image(self, image_id): <add> """ <add> Delete an image. <add> <add> :param image_id: the ID of the OMI you want to delete (required) <add> :type image_id: ``str`` <add> <add> :return: request <add> :rtype: ``dict`` <add> """ <add> return gtw.DeleteImage(ImageId=image_id) <add> <add> def create_key_pair(self, name): <add> """ <add> Create a new key pair. <add> <add> :param node_id: a unique name for the keypair, with a maximum <add> length of 255 ASCII printable characters (required) <add> :type node_id: ``str`` <add> <add> :return: the created key pair <add> :rtype: ``dict`` <add> """ <add> return gtw.CreateKeypair(KeypairName=name) <add> <add> def list_key_pairs(self): <add> """ <add> List all key pairs. <add> <add> :return: key pairs <add> :rtype: ``dict`` <add> """ <add> return gtw.ReadKeypairs() <add> <add> def get_key_pair(self, name): <add> """ <add> Get a specific key pair. <add> <add> :param name: the name of the key pair <add> you want to select (required) <add> :type name: ``str`` <add> <add> :return: the selected key pair <add> :rtype: ``dict`` <add> """ <add> kp = None <add> key_pairs = gtw.ReadKeypairs() <add> for key_pair in key_pairs.get('Keypairs'): <add> if key_pair.get('KeypairName') == name: <add> kp = key_pair <add> return kp <add> <add> def delete_key_pair(self, name): <add> """ <add> Delete an image. <add> <add> :param name: the name of the keypair you want to delete (required) <add> :type name: ``str`` <add> <add> :return: request <add> :rtype: ``dict`` <add> """ <add> return gtw.DeleteKeypair(KeypairName=name) <add> <add> def create_snapshot(self): <add> """ <add> Create a new snapshot. <add> <add> :return: the created snapshot <add> :rtype: ``dict`` <add> """ <add> return gtw.CreateSnapshot() <add> <add> def list_snapshots(self): <add> """ <add> List all snapshots. <add> <add> :return: snapshots <add> :rtype: ``dict`` <add> """ <add> return gtw.ReadSnapshots() <add> <add> def delete_snapshot(self, snapshot_id): <add> """ <add> Delete a snapshot. <add> <add> :param snapshot_id: the ID of the snapshot <add> you want to delete (required) <add> :type snapshot_id: ``str`` <add> <add> :return: request <add> :rtype: ``dict`` <add> """ <add> return gtw.DeleteSnapshot(SnapshotId=snapshot_id) <add> <add> def create_volume( <add> self, snapshot_id, <add> size=1, <add> location='eu-west-2a', <add> volume_type='standard' <add> ): <add> """ <add> Create a new volume. <add> <add> :param snapshot_id: the ID of the snapshot from which <add> you want to create the volume (required) <add> :type snapshot_id: ``str`` <add> <add> :param size: the size of the volume, in gibibytes (GiB), <add> the maximum allowed size for a volume is 14,901 GiB <add> :type size: ``int`` <add> <add> :param location: the Subregion in which <add> you want to create the volume <add> :type location: ``str`` <add> <add> :param volume_type: the type of volume <add> you want to create (io1 | gp2 | standard) <add> :type volume_type: ``str`` <add> <add> :return: the created volume <add> :rtype: ``dict`` <add> """ <add> return gtw.CreateVolume( <add> SnapshotId=snapshot_id, <add> Size=size, <add> SubregionName=location, <add> VolumeType=volume_type <add> ) <add> <add> def list_volumes(self): <add> """ <add> List all volumes. <add> <add> :return: volumes <add> :rtype: ``dict`` <add> """ <add> return gtw.ReadVolumes() <add> <add> def delete_volume(self, volume_id): <add> """ <add> Delete a volume. <add> <add> :param volume_id: the ID of the volume <add> you want to delete (required) <add> :type volume_id: ``str`` <add> <add> :return: request <add> :rtype: ``dict`` <add> """ <add> return gtw.DeleteVolume(VolumeId=volume_id) <add> <add> def attach_volume(self, node_id, volume_id, device): <add> """ <add> Attach a volume. <add> <add> :param node_id: the ID of the VM you want <add> to attach the volume to (required) <add> :type node_id: ``str`` <add> <add> :param volume_id: the ID of the volume <add> you want to attach (required) <add> :type volume_id: ``str`` <add> <add> :param device: the name of the device (required) <add> :type device: ``str`` <add> <add> :return: the attached volume <add> :rtype: ``dict`` <add> """ <add> return gtw.LinkVolume( <add> VmId=node_id, <add> VolumeId=volume_id, <add> DeviceName=device <add> ) <add> <add> def detach_volume(self, volume_id, force=False): <add> """ <add> Detach a volume. <add> <add> :param volume_id: the ID of the volume <add> you want to detach (required) <add> :type volume_id: ``str`` <add> <add> :param force: forces the detachment of <add> the volume in case of previous failure <add> :type force: ``str`` <add> <add> :return: the attached volume <add> :rtype: ``dict`` <add> """ <add> return gtw.UnlinkVolume(VolumeId=volume_id, ForceUnlink=force)
1
Text
Text
fix typo in shard pattern
d3496d5392d744b4909813f9a86f4d73eafba928
<ide><path>inception/README.md <ide> look like: <ide> ``` <ide> <ide> When the script finishes you will find 2 shards for the training and validation <del>files in the `DATA_DIR`. The files will match the patterns `train-????-of-00001` <del>and `validation-?????-of-00001`, respectively. <add>files in the `DATA_DIR`. The files will match the patterns `train-?????-of-00002` <add>and `validation-?????-of-00002`, respectively. <ide> <ide> **NOTE** If you wish to prepare a custom image data set for transfer learning, <ide> you will need to invoke [`build_image_data.py`](inception/data/build_image_data.py) on
1
Javascript
Javascript
fix example that navigates away from the page
7c7477ce4561c8664a2270c19fd85b7bf9b04f29
<ide><path>src/ng/directive/booleanAttrs.js <ide> expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/); <ide> <ide> element(by.id('link-6')).click(); <del> expect(browser.getCurrentUrl()).toMatch(/\/6$/); <add> <add> // At this point, we navigate away from an Angular page, so we need <add> // to use browser.driver to get the base webdriver. <add> browser.wait(function() { <add> return browser.driver.getCurrentUrl().then(function(url) { <add> return url.match(/\/6$/); <add> }); <add> }, 1000, 'page should navigate to /6'); <ide> }); <ide> </file> <ide> </example>
1
Mixed
Javascript
add maxtotalsockets to agent class
7a5d3a2fc1915166b1da2c161f020358a8c36bfd
<ide><path>doc/api/http.md <ide> added: v0.3.6 <ide> By default set to `Infinity`. Determines how many concurrent sockets the agent <ide> can have open per origin. Origin is the returned value of [`agent.getName()`][]. <ide> <add>### `agent.maxTotalSockets` <add><!-- YAML <add>added: REPLACEME <add>--> <add> <add>* {number} <add> <add>By default set to `Infinity`. Determines how many concurrent sockets the agent <add>can have open. Unlike `maxSockets`, this parameter applies across all origins. <add> <ide> ### `agent.requests` <ide> <!-- YAML <ide> added: v0.5.9 <ide><path>lib/_http_agent.js <ide> 'use strict'; <ide> <ide> const { <add> NumberIsNaN, <ide> ObjectKeys, <ide> ObjectSetPrototypeOf, <ide> ObjectValues, <ide> const { <ide> codes: { <ide> ERR_INVALID_ARG_TYPE, <ide> ERR_INVALID_OPT_VALUE, <add> ERR_OUT_OF_RANGE, <ide> }, <ide> } = require('internal/errors'); <ide> const { once } = require('internal/util'); <add>const { validateNumber } = require('internal/validators'); <ide> <ide> const kOnKeylog = Symbol('onkeylog'); <add>const kRequestOptions = Symbol('requestOptions'); <ide> // New Agent code. <ide> <ide> // The largest departure from the previous implementation is that <ide> function Agent(options) { <ide> this.maxSockets = this.options.maxSockets || Agent.defaultMaxSockets; <ide> this.maxFreeSockets = this.options.maxFreeSockets || 256; <ide> this.scheduling = this.options.scheduling || 'fifo'; <add> this.maxTotalSockets = this.options.maxTotalSockets; <add> this.totalSocketCount = 0; <ide> <ide> if (this.scheduling !== 'fifo' && this.scheduling !== 'lifo') { <ide> throw new ERR_INVALID_OPT_VALUE('scheduling', this.scheduling); <ide> } <ide> <add> if (this.maxTotalSockets !== undefined) { <add> validateNumber(this.maxTotalSockets, 'maxTotalSockets'); <add> if (this.maxTotalSockets <= 0 || NumberIsNaN(this.maxTotalSockets)) <add> throw new ERR_OUT_OF_RANGE('maxTotalSockets', '> 0', <add> this.maxTotalSockets); <add> } else { <add> this.maxTotalSockets = Infinity; <add> } <add> <ide> this.on('free', (socket, options) => { <ide> const name = this.getName(options); <ide> debug('agent.on(free)', name); <ide> function Agent(options) { <ide> if (this.sockets[name]) <ide> count += this.sockets[name].length; <ide> <del> if (count > this.maxSockets || <add> if (this.totalSocketCount > this.maxTotalSockets || <add> count > this.maxSockets || <ide> freeLen >= this.maxFreeSockets || <ide> !this.keepSocketAlive(socket)) { <ide> socket.destroy(); <ide> Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */, <ide> this.reuseSocket(socket, req); <ide> setRequestSocket(this, req, socket); <ide> this.sockets[name].push(socket); <del> } else if (sockLen < this.maxSockets) { <add> this.totalSocketCount++; <add> } else if (sockLen < this.maxSockets && <add> this.totalSocketCount < this.maxTotalSockets) { <ide> debug('call onSocket', sockLen, freeLen); <ide> // If we are under maxSockets create a new one. <ide> this.createSocket(req, options, (err, socket) => { <ide> Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */, <ide> if (!this.requests[name]) { <ide> this.requests[name] = []; <ide> } <add> <add> // Used to create sockets for pending requests from different origin <add> req[kRequestOptions] = options; <add> <ide> this.requests[name].push(req); <ide> } <ide> }; <ide> Agent.prototype.createSocket = function createSocket(req, options, cb) { <ide> this.sockets[name] = []; <ide> } <ide> this.sockets[name].push(s); <del> debug('sockets', name, this.sockets[name].length); <add> this.totalSocketCount++; <add> debug('sockets', name, this.sockets[name].length, this.totalSocketCount); <ide> installListeners(this, s, options); <ide> cb(null, s); <ide> }); <ide> Agent.prototype.removeSocket = function removeSocket(s, options) { <ide> // Don't leak <ide> if (sockets[name].length === 0) <ide> delete sockets[name]; <add> this.totalSocketCount--; <ide> } <ide> } <ide> } <ide> <add> let req; <ide> if (this.requests[name] && this.requests[name].length) { <ide> debug('removeSocket, have a request, make a socket'); <del> const req = this.requests[name][0]; <add> req = this.requests[name][0]; <add> } else { <add> // TODO(rickyes): this logic will not be FIFO across origins. <add> // There might be older requests in a different origin, but <add> // if the origin which releases the socket has pending requests <add> // that will be prioritized. <add> for (const prop in this.requests) { <add> // Check whether this specific origin is already at maxSockets <add> if (this.sockets[prop] && this.sockets[prop].length) break; <add> debug('removeSocket, have a request with different origin,' + <add> ' make a socket'); <add> req = this.requests[prop][0]; <add> options = req[kRequestOptions]; <add> break; <add> } <add> } <add> <add> if (req && options) { <add> req[kRequestOptions] = undefined; <ide> // If we have pending requests and a socket gets closed make a new one <ide> this.createSocket(req, options, (err, socket) => { <ide> if (err) <ide> Agent.prototype.removeSocket = function removeSocket(s, options) { <ide> socket.emit('free'); <ide> }); <ide> } <add> <ide> }; <ide> <ide> Agent.prototype.keepSocketAlive = function keepSocketAlive(socket) { <ide><path>test/parallel/test-http-agent-maxtotalsockets.js <add>'use strict'; <add> <add>const common = require('../common'); <add>const assert = require('assert'); <add>const http = require('http'); <add>const Countdown = require('../common/countdown'); <add> <add>assert.throws(() => new http.Agent({ <add> maxTotalSockets: 'test', <add>}), { <add> code: 'ERR_INVALID_ARG_TYPE', <add> name: 'TypeError', <add> message: 'The "maxTotalSockets" argument must be of type number. ' + <add> "Received type string ('test')", <add>}); <add> <add>[-1, 0, NaN].forEach((item) => { <add> assert.throws(() => new http.Agent({ <add> maxTotalSockets: item, <add> }), { <add> code: 'ERR_OUT_OF_RANGE', <add> name: 'RangeError', <add> message: 'The value of "maxTotalSockets" is out of range. ' + <add> `It must be > 0. Received ${item}`, <add> }); <add>}); <add> <add>assert.ok(new http.Agent({ <add> maxTotalSockets: Infinity, <add>})); <add> <add>function start(param = {}) { <add> const { maxTotalSockets, maxSockets } = param; <add> <add> const agent = new http.Agent({ <add> keepAlive: true, <add> keepAliveMsecs: 1000, <add> maxTotalSockets, <add> maxSockets, <add> maxFreeSockets: 3 <add> }); <add> <add> const server = http.createServer(common.mustCall((req, res) => { <add> res.end('hello world'); <add> }, 6)); <add> const server2 = http.createServer(common.mustCall((req, res) => { <add> res.end('hello world'); <add> }, 6)); <add> <add> server.keepAliveTimeout = 0; <add> server2.keepAliveTimeout = 0; <add> <add> const countdown = new Countdown(12, () => { <add> assert.strictEqual(getRequestCount(), 0); <add> agent.destroy(); <add> server.close(); <add> server2.close(); <add> }); <add> <add> function handler(s) { <add> for (let i = 0; i < 6; i++) { <add> http.get({ <add> host: 'localhost', <add> port: s.address().port, <add> agent, <add> path: `/${i}`, <add> }, common.mustCall((res) => { <add> assert.strictEqual(res.statusCode, 200); <add> res.resume(); <add> res.on('end', common.mustCall(() => { <add> for (const key of Object.keys(agent.sockets)) { <add> assert(agent.sockets[key].length <= maxSockets); <add> } <add> assert(getTotalSocketsCount() <= maxTotalSockets); <add> countdown.dec(); <add> })); <add> })); <add> } <add> } <add> <add> function getTotalSocketsCount() { <add> let num = 0; <add> for (const key of Object.keys(agent.sockets)) { <add> num += agent.sockets[key].length; <add> } <add> return num; <add> } <add> <add> function getRequestCount() { <add> let num = 0; <add> for (const key of Object.keys(agent.requests)) { <add> num += agent.requests[key].length; <add> } <add> return num; <add> } <add> <add> server.listen(0, common.mustCall(() => handler(server))); <add> server2.listen(0, common.mustCall(() => handler(server2))); <add>} <add> <add>// If maxTotalSockets is larger than maxSockets, <add>// then the origin check will be skipped <add>// when the socket is removed. <add>[{ <add> maxTotalSockets: 2, <add> maxSockets: 3, <add>}, { <add> maxTotalSockets: 3, <add> maxSockets: 2, <add>}, { <add> maxTotalSockets: 2, <add> maxSockets: 2, <add>}].forEach(start);
3
Python
Python
add test for qr on empty array
eab959b407e39ef7b35b1f0a90609e462d8527e7
<ide><path>numpy/linalg/tests/test_linalg.py <ide> def test_matrix_rank(): <ide> # works on scalar <ide> yield assert_equal, matrix_rank(1), 1 <ide> <add>@raises(linalg.LinAlgError) <add>def test_qr_empty(): <add> a = np.zeros((0,2)) <add> linalg.qr(a) <add> <ide> <ide> if __name__ == "__main__": <ide> run_module_suite()
1
Ruby
Ruby
add expat.framework check to doctor
9ede899d5d71a1e415f9e6c17632812593875065
<ide><path>Library/Homebrew/cmd/doctor.rb <ide> def check_for_other_vars <ide> end <ide> end <ide> <add>def check_for_other_frameworks <add> # Other frameworks that are known to cause problems when present <add> if File.exist? "/Library/Frameworks/expat.framework" <add> puts <<-EOS.undent <add> /Library/Frameworks/expat.framework detected <add> <add> This will be picked up by Cmake's build system and likey cause the <add> build to fail, trying to link to a 32-bit version of expat. <add> You may need to move this file out of the way to compile Cmake. <add> <add> EOS <add> end <add>end <add> <ide> module Homebrew extend self <ide> def doctor <ide> read, write = IO.pipe <ide> def doctor <ide> check_for_git <ide> check_for_autoconf <ide> check_for_linked_kegonly_brews <add> check_for_other_frameworks <ide> <ide> exit! 0 <ide> else
1
Java
Java
fix streams to stream in test
70b8848492429399b76b7bb1f7ace64ac35c1d54
<ide><path>spring-web-reactive/src/test/java/org/springframework/web/reactive/method/annotation/RequestMappingIntegrationTests.java <ide> import reactor.io.buffer.Buffer; <ide> import reactor.rx.Promise; <ide> import reactor.rx.Stream; <del>import reactor.rx.Streams; <ide> import rx.Observable; <ide> import rx.Single; <ide> <ide> private static class TestController { <ide> @RequestMapping("/param") <ide> @ResponseBody <ide> public Publisher<String> handleWithParam(@RequestParam String name) { <del> return Streams.just("Hello ", name, "!"); <add> return Stream.just("Hello ", name, "!"); <ide> } <ide> <ide> @RequestMapping("/person") <ide> public CompletableFuture<Person> completableFutureResponseBody() { <ide> @ResponseBody <ide> public Publisher<ByteBuffer> rawResponseBody() { <ide> JacksonJsonEncoder encoder = new JacksonJsonEncoder(); <del> return encoder.encode(Streams.just(new Person("Robert")), <add> return encoder.encode(Stream.just(new Person("Robert")), <ide> ResolvableType.forClass(Person.class), MediaType.APPLICATION_JSON); <ide> } <ide> <ide> public List<Person> listResponseBody() { <ide> @RequestMapping("/publisher") <ide> @ResponseBody <ide> public Publisher<Person> publisherResponseBody() { <del> return Streams.just(new Person("Robert"), new Person("Marie")); <add> return Stream.just(new Person("Robert"), new Person("Marie")); <ide> } <ide> <ide> @RequestMapping("/observable") <ide> public Observable<Person> observableResponseBody() { <ide> @RequestMapping("/stream") <ide> @ResponseBody <ide> public Stream<Person> reactorStreamResponseBody() { <del> return Streams.just(new Person("Robert"), new Person("Marie")); <add> return Stream.just(new Person("Robert"), new Person("Marie")); <ide> } <ide> <ide> @RequestMapping("/publisher-capitalize") <ide> @ResponseBody <ide> public Publisher<Person> publisherCapitalize(@RequestBody Publisher<Person> persons) { <del> return Streams.from(persons).map(person -> { <add> return Stream.from(persons).map(person -> { <ide> person.setName(person.getName().toUpperCase()); <ide> return person; <ide> }); <ide> public Single<Person> singleCapitalize(@RequestBody Single<Person> personFuture) <ide> @RequestMapping("/promise-capitalize") <ide> @ResponseBody <ide> public Promise<Person> promiseCapitalize(@RequestBody Promise<Person> personFuture) { <del> return Streams.from(personFuture.map(person -> { <add> return Stream.from(personFuture.map(person -> { <ide> person.setName(person.getName().toUpperCase()); <ide> return person; <ide> })).promise(); <ide> } <ide> <ide> @RequestMapping("/publisher-create") <ide> public Publisher<Void> publisherCreate(@RequestBody Publisher<Person> personStream) { <del> return Streams.from(personStream).toList().doOnSuccess(persons::addAll).after(); <add> return Stream.from(personStream).toList().doOnSuccess(persons::addAll).after(); <ide> } <ide> <ide> @RequestMapping("/stream-create") <ide> public Publisher<Void> streamCreate(@RequestBody Stream<Person> personStream) { <del> return Streams.from(personStream.toList().doOnSuccess(persons::addAll).after()).promise(); <add> return Stream.from(personStream.toList().doOnSuccess(persons::addAll).after()).promise(); <ide> } <ide> <ide> @RequestMapping("/observable-create") <ide> public Publisher<String> handleWithError() { <ide> @ExceptionHandler <ide> @ResponseBody <ide> public Publisher<String> handleException(IllegalStateException ex) { <del> return Streams.just("Recovered from error: " + ex.getMessage()); <add> return Stream.just("Recovered from error: " + ex.getMessage()); <ide> } <ide> <ide> //TODO add mixed and T request mappings tests
1
Javascript
Javascript
replace magic number 1 with element_node
d400d6d5ef056622ed4de4da00f97bde144c6f55
<ide><path>packages/react-dom/src/client/ReactDOM.js <ide> const ReactDOM: Object = { <ide> <ide> // Check if the container itself is a React root node. <ide> const isContainerReactRoot = <del> container.nodeType === 1 && <add> container.nodeType === ELEMENT_NODE && <ide> isValidContainer(container.parentNode) && <ide> !!container.parentNode._reactRootContainer; <ide> <ide><path>packages/react-dom/src/client/ReactDOMHostConfig.js <ide> export function didNotHydrateContainerInstance( <ide> instance: Instance | TextInstance, <ide> ) { <ide> if (__DEV__) { <del> if (instance.nodeType === 1) { <add> if (instance.nodeType === ELEMENT_NODE) { <ide> warnForDeletedHydratableElement(parentContainer, (instance: any)); <ide> } else { <ide> warnForDeletedHydratableText(parentContainer, (instance: any)); <ide> export function didNotHydrateInstance( <ide> instance: Instance | TextInstance, <ide> ) { <ide> if (__DEV__ && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) { <del> if (instance.nodeType === 1) { <add> if (instance.nodeType === ELEMENT_NODE) { <ide> warnForDeletedHydratableElement(parentInstance, (instance: any)); <ide> } else { <ide> warnForDeletedHydratableText(parentInstance, (instance: any)); <ide><path>packages/react-dom/src/shared/HTMLNodeType.js <ide> * <ide> * This source code is licensed under the MIT license found in the <ide> * LICENSE file in the root directory of this source tree. <add> * <add> * @flow <ide> */ <ide> <ide> /** <ide><path>packages/react-dom/src/test-utils/ReactTestUtils.js <ide> import { <ide> import SyntheticEvent from 'events/SyntheticEvent'; <ide> import invariant from 'shared/invariant'; <ide> import lowPriorityWarning from 'shared/lowPriorityWarning'; <del> <add>import {ELEMENT_NODE} from '../shared/HTMLNodeType'; <ide> import * as DOMTopLevelEventTypes from '../events/DOMTopLevelEventTypes'; <ide> <ide> const {findDOMNode} = ReactDOM; <ide> function validateClassInstance(inst, methodName) { <ide> const stringified = '' + inst; <ide> if (Array.isArray(inst)) { <ide> received = 'an array'; <del> } else if (inst && inst.nodeType === 1 && inst.tagName) { <add> } else if (inst && inst.nodeType === ELEMENT_NODE && inst.tagName) { <ide> received = 'a DOM node'; <ide> } else if (stringified === '[object Object]') { <ide> received = 'object with keys {' + Object.keys(inst).join(', ') + '}'; <ide> const ReactTestUtils = { <ide> }, <ide> <ide> isDOMComponent: function(inst) { <del> return !!(inst && inst.nodeType === 1 && inst.tagName); <add> return !!(inst && inst.nodeType === ELEMENT_NODE && inst.tagName); <ide> }, <ide> <ide> isDOMComponentElement: function(inst) {
4
Text
Text
fix typo on code comment for pages docs
e72d8996b2055604a53c5799d8145e8fb598aa6e
<ide><path>docs/basic-features/pages.md <ide> Data is always up-to-date but it comes at the cost of a slightly higher [Time to <ide> // Next.js will execute `getInitialProps` <ide> // It will wait for the result of `getInitialProps` <ide> // When the results comes back Next.js will render the page. <del>// Next.js wil do this for every request that comes in. <add>// Next.js will do this for every request that comes in. <ide> import fetch from 'isomorphic-unfetch' <ide> <ide> function HomePage({ stars }) {
1
Ruby
Ruby
remove unnecessary official command tapping
a1b0ef1300ff8ac07ef904479b0321a2a5fc0368
<ide><path>Library/Homebrew/cmd/tests.rb <ide> <ide> module Homebrew <ide> def tests <del> ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" <del> <del> if ARGV.include? "--official-cmd-taps" <del> ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"] = "1" <del> OFFICIAL_CMD_TAPS.each do |tap, _| <del> tap = Tap.fetch tap <del> tap.install unless tap.installed? <del> end <del> end <del> <ide> (HOMEBREW_LIBRARY/"Homebrew/test").cd do <add> ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" <ide> ENV["TESTOPTS"] = "-v" if ARGV.verbose? <ide> ENV["HOMEBREW_NO_COMPAT"] = "1" if ARGV.include? "--no-compat" <ide> ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if ARGV.include? "--generic" <ide> ENV["HOMEBREW_NO_GITHUB_API"] = "1" unless ARGV.include? "--online" <add> if ARGV.include? "--official-cmd-taps" <add> ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"] = "1" <add> end <add> <ide> if ARGV.include? "--coverage" <ide> ENV["HOMEBREW_TESTS_COVERAGE"] = "1" <ide> FileUtils.rm_f "coverage/.resultset.json" <ide><path>Library/Homebrew/dev-cmd/test-bot.rb <ide> def homebrew <ide> if @tap.nil? <ide> tests_args = [] <ide> if ruby_two <del> test "brew", "tap", "caskroom/cask" <del> test "brew", "tap", "homebrew/bundle" <del> test "brew", "tap", "homebrew/services" <ide> tests_args << "--official-cmd-taps" <ide> tests_args << "--coverage" if ENV["TRAVIS"] <ide> end <ide><path>Library/Homebrew/test/test_integration_cmds.rb <ide> class #{Formulary.class_s(name)} < Formula <ide> formula_path <ide> end <ide> <add> def setup_remote_tap(name) <add> tap = Tap.fetch name <add> tap.install(:full_clone => false, :quiet => true) unless tap.installed? <add> tap <add> end <add> <ide> def testball <ide> "#{File.expand_path("..", __FILE__)}/testball.rb" <ide> end <ide> def test_search <ide> <ide> def test_bundle <ide> needs_test_cmd_taps <add> setup_remote_tap("homebrew/bundle") <ide> HOMEBREW_REPOSITORY.cd do <ide> shutup do <ide> system "git", "init" <ide> def test_bundle <ide> end <ide> ensure <ide> FileUtils.rm_rf HOMEBREW_REPOSITORY/".git" <add> FileUtils.rm_rf HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-bundle" <ide> end <ide> <ide> def test_cask <ide> needs_test_cmd_taps <add> setup_remote_tap("caskroom/cask") <ide> cmd("cask", "list") <add> ensure <add> FileUtils.rm_rf HOMEBREW_LIBRARY/"Taps/caskroom" <add> FileUtils.rm_rf HOMEBREW_PREFIX/"share" <ide> end <ide> <ide> def test_services <ide> needs_test_cmd_taps <add> setup_remote_tap("homebrew/services") <ide> assert_equal "Warning: No services available to control with `brew services`", <ide> cmd("services", "list") <add> ensure <add> FileUtils.rm_rf HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-services" <ide> end <ide> end
3
PHP
PHP
add default to array_pull to match array_get
7e5514db12e390bc8acf12f8ddee9da8f480c931
<ide><path>src/Illuminate/Support/helpers.php <ide> function array_pluck($array, $value, $key = null) <ide> * <ide> * @param array $array <ide> * @param string $key <add> * @param mixed $default <ide> * @return mixed <ide> */ <del> function array_pull(&$array, $key) <add> function array_pull(&$array, $key, $default = null) <ide> { <del> $value = array_get($array, $key); <add> $value = array_get($array, $key, $default); <ide> <ide> array_forget($array, $key); <ide>
1
Javascript
Javascript
fix code comment
c19dcf8009961977c7c6d0305b84542e9ae65393
<ide><path>packages/ember-metal/lib/accessors.js <ide> Ember.setPath = Ember.deprecateFunc('setPath is deprecated since set now support <ide> @method trySet <ide> @for Ember <ide> @param {Object} obj The object to modify. <del> @param {String} keyName The property key to set <add> @param {String} path The property path to set <ide> @param {Object} value The value to set <ide> */ <ide> Ember.trySet = function(root, path, value) { <ide><path>packages/ember-metal/lib/binding.js <ide> Binding.prototype = { <ide> `get()` - see that method for more information. <ide> <ide> @method from <del> @param {String} propertyPath the property path to connect to <add> @param {String} path the property path to connect to <ide> @return {Ember.Binding} `this` <ide> */ <ide> from: function(path) { <ide> Binding.prototype = { <ide> `get()` - see that method for more information. <ide> <ide> @method to <del> @param {String|Tuple} propertyPath A property path or tuple <add> @param {String|Tuple} path A property path or tuple <ide> @return {Ember.Binding} `this` <ide> */ <ide> to: function(path) { <ide><path>packages/ember-metal/lib/map.js <ide> OrderedSet.prototype = { <ide> <ide> /** <ide> @method forEach <del> @param {Function} function <del> @param target <add> @param {Function} fn <add> @param self <ide> */ <ide> forEach: function(fn, self) { <ide> // allow mutation during iteration <ide><path>packages/ember-metal/lib/utils.js <ide> Ember.generateGuid = function generateGuid(obj, prefix) { <ide> <ide> @method guidFor <ide> @for Ember <del> @param obj {Object} any object, string, number, Element, or primitive <add> @param {Object} obj any object, string, number, Element, or primitive <ide> @return {String} the unique guid for this instance. <ide> */ <ide> Ember.guidFor = function guidFor(obj) { <ide> var needsFinallyFix = (function() { <ide> <ide> @method tryFinally <ide> @for Ember <del> @param {Function} function The function to run the try callback <del> @param {Function} function The function to run the finally callback <add> @param {Function} tryable The function to run the try callback <add> @param {Function} finalizer The function to run the finally callback <ide> @param [binding] <ide> @return {anything} The return value is the that of the finalizer, <ide> unless that valueis undefined, in which case it is the return value <ide> if (needsFinallyFix) { <ide> <ide> @method tryCatchFinally <ide> @for Ember <del> @param {Function} function The function to run the try callback <del> @param {Function} function The function to run the catchable callback <del> @param {Function} function The function to run the finally callback <add> @param {Function} tryable The function to run the try callback <add> @param {Function} catchable The function to run the catchable callback <add> @param {Function} finalizer The function to run the finally callback <ide> @param [binding] <ide> @return {anything} The return value is the that of the finalizer, <ide> unless that value is undefined, in which case it is the return value <ide><path>packages/ember-runtime/lib/core.js <ide> var toString = Object.prototype.toString; <ide> <ide> @method typeOf <ide> @for Ember <del> @param item {Object} the item to check <add> @param {Object} item the item to check <ide> @return {String} the type <ide> */ <ide> Ember.typeOf = function(item) { <ide> function _copy(obj, deep, seen, copies) { <ide> <ide> @method copy <ide> @for Ember <del> @param {Object} object The object to clone <add> @param {Object} obj The object to clone <ide> @param {Boolean} deep If true, a deep copy of the object is made <ide> @return {Object} The cloned object <ide> */ <ide><path>packages/ember-runtime/lib/mixins/array.js <ide> Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot <ide> @method addArrayObserver <ide> @param {Object} target The observer object. <ide> @param {Hash} opts Optional hash of configuration options including <del> `willChange`, `didChange`, and a `context` option. <add> `willChange` and `didChange` option. <ide> @return {Ember.Array} receiver <ide> */ <ide> addArrayObserver: function(target, opts) { <ide> Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot <ide> <ide> @method removeArrayObserver <ide> @param {Object} target The object observing the array. <add> @param {Hash} opts Optional hash of configuration options including <add> `willChange` and `didChange` option. <ide> @return {Ember.Array} receiver <ide> */ <ide> removeArrayObserver: function(target, opts) { <ide><path>packages/ember-runtime/lib/mixins/copyable.js <ide> Ember.Copyable = Ember.Mixin.create( <ide> an exception. <ide> <ide> @method copy <del> @param deep {Boolean} if `true`, a deep copy of the object should be made <add> @param {Boolean} deep if `true`, a deep copy of the object should be made <ide> @return {Object} copy of receiver <ide> */ <ide> copy: Ember.required(Function), <ide><path>packages/ember-runtime/lib/mixins/enumerable.js <ide> Ember.Enumerable = Ember.Mixin.create( <ide> mixin. <ide> <ide> @method addEnumerableObserver <del> @param target {Object} <del> @param opts {Hash} <add> @param {Object} target <add> @param {Hash} opts <ide> */ <ide> addEnumerableObserver: function(target, opts) { <ide> var willChange = (opts && opts.willChange) || 'enumerableWillChange', <ide> Ember.Enumerable = Ember.Mixin.create( <ide> Removes a registered enumerable observer. <ide> <ide> @method removeEnumerableObserver <del> @param target {Object} <del> @param [opts] {Hash} <add> @param {Object} target <add> @param {Hash} [opts] <ide> */ <ide> removeEnumerableObserver: function(target, opts) { <ide> var willChange = (opts && opts.willChange) || 'enumerableWillChange', <ide><path>packages/ember-runtime/lib/mixins/observable.js <ide> Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ { <ide> not defined upfront. <ide> <ide> @method get <del> @param {String} key The property to retrieve <add> @param {String} keyName The property to retrieve <ide> @return {Object} The property value or undefined. <ide> */ <ide> get: function(keyName) { <ide> Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ { <ide> ``` <ide> <ide> @method set <del> @param {String} key The property to set <add> @param {String} keyName The property to set <ide> @param {Object} value The value to set or `null`. <ide> @return {Ember.Observable} <ide> */ <ide> Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ { <ide> like. <ide> <ide> @method propertyWillChange <del> @param {String} key The property key that is about to change. <add> @param {String} keyName The property key that is about to change. <ide> @return {Ember.Observable} <ide> */ <ide> propertyWillChange: function(keyName){
9
Ruby
Ruby
convert `add_references` to use kwargs
68a6c8ecc41ca2e4bee7c7218e8a4be81bbf7e25
<ide><path>activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb <ide> def index_name_exists?(table_name, index_name, default) <ide> # <ide> # add_reference(:products, :supplier, polymorphic: true, index: true) <ide> # <del> def add_reference(table_name, ref_name, options = {}) <del> polymorphic = options.delete(:polymorphic) <del> index_options = options.delete(:index) <del> type = options.delete(:type) || :integer <add> def add_reference( <add> table_name, <add> ref_name, <add> polymorphic: false, <add> index: false, <add> type: :integer, <add> **options <add> ) <add> polymorphic_options = polymorphic.is_a?(Hash) ? polymorphic : options <add> index_options = index.is_a?(Hash) ? index : {} <ide> add_column(table_name, "#{ref_name}_id", type, options) <del> add_column(table_name, "#{ref_name}_type", :string, polymorphic.is_a?(Hash) ? polymorphic : options) if polymorphic <del> add_index(table_name, polymorphic ? %w[type id].map{ |t| "#{ref_name}_#{t}" } : "#{ref_name}_id", index_options.is_a?(Hash) ? index_options : {}) if index_options <add> <add> if polymorphic <add> add_column(table_name, "#{ref_name}_type", :string, polymorphic_options) <add> end <add> <add> if index <add> add_index(table_name, polymorphic ? %w[type id].map{ |t| "#{ref_name}_#{t}" } : "#{ref_name}_id", index_options) <add> end <ide> end <ide> alias :add_belongs_to :add_reference <ide>
1
Python
Python
return none for data path if it doesn't exist
d9a77ddf1422e3e58ca18a95cc9e4a1c8a85e789
<ide><path>spacy/util.py <ide> def get_lang_class(name): <ide> <ide> <ide> def get_data_path(): <del> return _data_path <add> return _data_path if _data_path.exists() else None <ide> <ide> <ide> def set_data_path(path): <ide> def or_(val1, val2): <ide> <ide> def match_best_version(target_name, target_version, path): <ide> path = path if not isinstance(path, basestring) else pathlib.Path(path) <del> if not path.exists(): <add> if path is None or not path.exists(): <ide> return None <ide> matches = [] <ide> for data_name in path.iterdir():
1
Java
Java
convert spel plus operands using reg'd converters
7cdfaf3e0d9e1add3a326db7527a37905edd5e6e
<ide><path>spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java <ide> /* <del> * Copyright 2002-2009 the original author or authors. <add> * Copyright 2002-2012 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> package org.springframework.expression.spel.ast; <ide> <add>import org.springframework.core.convert.TypeDescriptor; <ide> import org.springframework.expression.EvaluationException; <ide> import org.springframework.expression.Operation; <add>import org.springframework.expression.TypeConverter; <ide> import org.springframework.expression.TypedValue; <ide> import org.springframework.expression.spel.ExpressionState; <add>import org.springframework.util.Assert; <ide> <ide> /** <ide> * The plus operator will: <ide> * </ul> <ide> * It can be used as a unary operator for numbers (double/long/int). The standard promotions are performed <ide> * when the operand types vary (double+int=double). For other options it defers to the registered overloader. <del> * <add> * <ide> * @author Andy Clement <add> * @author Ivo Smid <ide> * @since 3.0 <ide> */ <ide> public class OpPlus extends Operator { <ide> <ide> public OpPlus(int pos, SpelNodeImpl... operands) { <ide> super("+", pos, operands); <add> Assert.notEmpty(operands); <ide> } <ide> <ide> @Override <ide> public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep <ide> if (rightOp == null) { // If only one operand, then this is unary plus <ide> Object operandOne = leftOp.getValueInternal(state).getValue(); <ide> if (operandOne instanceof Number) { <del> if (operandOne instanceof Double) { <del> return new TypedValue(((Double) operandOne).doubleValue()); <del> } else if (operandOne instanceof Long) { <del> return new TypedValue(((Long) operandOne).longValue()); <add> if (operandOne instanceof Double || operandOne instanceof Long) { <add> return new TypedValue(operandOne); <ide> } else { <del> return new TypedValue(((Integer) operandOne).intValue()); <add> return new TypedValue(((Number) operandOne).intValue()); <ide> } <ide> } <ide> return state.operate(Operation.ADD, operandOne, null); <ide> } <ide> else { <del> Object operandOne = leftOp.getValueInternal(state).getValue(); <del> Object operandTwo = rightOp.getValueInternal(state).getValue(); <add> final TypedValue operandOneValue = leftOp.getValueInternal(state); <add> final Object operandOne = operandOneValue.getValue(); <add> <add> final TypedValue operandTwoValue = rightOp.getValueInternal(state); <add> final Object operandTwo = operandTwoValue.getValue(); <add> <ide> if (operandOne instanceof Number && operandTwo instanceof Number) { <ide> Number op1 = (Number) operandOne; <ide> Number op2 = (Number) operandTwo; <ide> public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep <ide> } else if (operandOne instanceof String && operandTwo instanceof String) { <ide> return new TypedValue(new StringBuilder((String) operandOne).append((String) operandTwo).toString()); <ide> } else if (operandOne instanceof String) { <del> StringBuilder result = new StringBuilder((String)operandOne); <del> result.append((operandTwo==null?"null":operandTwo.toString())); <del> return new TypedValue(result.toString()); <add> StringBuilder result = new StringBuilder((String) operandOne); <add> result.append((operandTwo == null ? "null" : convertTypedValueToString(operandTwoValue, state))); <add> return new TypedValue(result.toString()); <ide> } else if (operandTwo instanceof String) { <del> StringBuilder result = new StringBuilder((operandOne==null?"null":operandOne.toString())); <del> result.append((String)operandTwo); <del> return new TypedValue(result.toString()); <add> StringBuilder result = new StringBuilder((operandOne == null ? "null" : convertTypedValueToString( <add> operandOneValue, state))); <add> result.append((String) operandTwo); <add> return new TypedValue(result.toString()); <ide> } <ide> return state.operate(Operation.ADD, operandOne, operandTwo); <ide> } <ide> public String toStringAST() { <ide> return super.toStringAST(); <ide> } <ide> <add> @Override <ide> public SpelNodeImpl getRightOperand() { <del> if (children.length<2) {return null;} <add> if (children.length < 2) { <add> return null; <add> } <ide> return children[1]; <ide> } <ide> <add> /** <add> * Convert operand value to string using registered converter or using <add> * {@code toString} method. <add> * <add> * @param value typed value to be converted <add> * @param state expression state <add> * @return {@code TypedValue} instance converted to {@code String} <add> */ <add> private static String convertTypedValueToString(TypedValue value, ExpressionState state) { <add> final TypeConverter typeConverter = state.getEvaluationContext().getTypeConverter(); <add> final TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(String.class); <add> <add> if (typeConverter.canConvert(value.getTypeDescriptor(), typeDescriptor)) { <add> final Object obj = typeConverter.convertValue(value.getValue(), value.getTypeDescriptor(), typeDescriptor); <add> return String.valueOf(obj); <add> } else { <add> return String.valueOf(value.getValue()); <add> } <add> } <ide> <ide> } <ide><path>spring-expression/src/test/java/org/springframework/expression/spel/ast/OpPlusTests.java <add>/* <add> * Copyright 2002-2012 the original author or authors. <add> * <add> * Licensed under the Apache License, Version 2.0 (the "License"); <add> * you may not use this file except in compliance with the License. <add> * You may obtain a copy of the License at <add> * <add> * http://www.apache.org/licenses/LICENSE-2.0 <add> * <add> * Unless required by applicable law or agreed to in writing, software <add> * distributed under the License is distributed on an "AS IS" BASIS, <add> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add> * See the License for the specific language governing permissions and <add> * limitations under the License. <add> */ <add> <add>package org.springframework.expression.spel.ast; <add> <add>import java.sql.Time; <add>import java.text.SimpleDateFormat; <add>import java.util.Date; <add>import java.util.Locale; <add> <add>import org.junit.Test; <add> <add>import org.springframework.core.convert.converter.Converter; <add>import org.springframework.core.convert.support.GenericConversionService; <add>import org.springframework.expression.TypedValue; <add>import org.springframework.expression.spel.ExpressionState; <add>import org.springframework.expression.spel.SpelEvaluationException; <add>import org.springframework.expression.spel.support.StandardEvaluationContext; <add>import org.springframework.expression.spel.support.StandardTypeConverter; <add> <add>import static org.junit.Assert.*; <add> <add>/** <add> * Unit tests for SpEL's plus operator. <add> * <add> * @author Ivo Smid <add> * @author Chris Beams <add> * @since 3.2 <add> * @see OpPlus <add> */ <add>public class OpPlusTests { <add> <add> @Test(expected = IllegalArgumentException.class) <add> public void test_emptyOperands() { <add> new OpPlus(-1); <add> } <add> <add> @Test(expected = SpelEvaluationException.class) <add> public void test_unaryPlusWithStringLiteral() { <add> ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext()); <add> <add> StringLiteral str = new StringLiteral("word", -1, "word"); <add> <add> OpPlus o = new OpPlus(-1, str); <add> o.getValueInternal(expressionState); <add> } <add> <add> @Test <add> public void test_unaryPlusWithNumberOperand() { <add> ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext()); <add> <add> { <add> RealLiteral realLiteral = new RealLiteral("123.00", -1, 123.0); <add> OpPlus o = new OpPlus(-1, realLiteral); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(Double.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(Double.class, value.getTypeDescriptor().getType()); <add> assertEquals(realLiteral.getLiteralValue().getValue(), value.getValue()); <add> } <add> <add> { <add> IntLiteral intLiteral = new IntLiteral("123", -1, 123); <add> OpPlus o = new OpPlus(-1, intLiteral); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(Integer.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(Integer.class, value.getTypeDescriptor().getType()); <add> assertEquals(intLiteral.getLiteralValue().getValue(), value.getValue()); <add> } <add> <add> { <add> LongLiteral longLiteral = new LongLiteral("123", -1, 123L); <add> OpPlus o = new OpPlus(-1, longLiteral); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(Long.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(Long.class, value.getTypeDescriptor().getType()); <add> assertEquals(longLiteral.getLiteralValue().getValue(), value.getValue()); <add> } <add> } <add> <add> @Test <add> public void test_binaryPlusWithNumberOperands() { <add> ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext()); <add> <add> { <add> RealLiteral n1 = new RealLiteral("123.00", -1, 123.0); <add> RealLiteral n2 = new RealLiteral("456.00", -1, 456.0); <add> OpPlus o = new OpPlus(-1, n1, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(Double.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(Double.class, value.getTypeDescriptor().getType()); <add> assertEquals(Double.valueOf(123.0 + 456.0), value.getValue()); <add> } <add> <add> { <add> LongLiteral n1 = new LongLiteral("123", -1, 123L); <add> LongLiteral n2 = new LongLiteral("456", -1, 456L); <add> OpPlus o = new OpPlus(-1, n1, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(Long.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(Long.class, value.getTypeDescriptor().getType()); <add> assertEquals(Long.valueOf(123L + 456L), value.getValue()); <add> } <add> <add> { <add> IntLiteral n1 = new IntLiteral("123", -1, 123); <add> IntLiteral n2 = new IntLiteral("456", -1, 456); <add> OpPlus o = new OpPlus(-1, n1, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(Integer.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(Integer.class, value.getTypeDescriptor().getType()); <add> assertEquals(Integer.valueOf(123 + 456), value.getValue()); <add> } <add> } <add> <add> @Test <add> public void test_binaryPlusWithStringOperands() { <add> ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext()); <add> <add> StringLiteral n1 = new StringLiteral("\"foo\"", -1, "\"foo\""); <add> StringLiteral n2 = new StringLiteral("\"bar\"", -1, "\"bar\""); <add> OpPlus o = new OpPlus(-1, n1, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(String.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(String.class, value.getTypeDescriptor().getType()); <add> assertEquals("foobar", value.getValue()); <add> } <add> <add> @Test <add> public void test_binaryPlusWithLeftStringOperand() { <add> ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext()); <add> <add> StringLiteral n1 = new StringLiteral("\"number is \"", -1, "\"number is \""); <add> LongLiteral n2 = new LongLiteral("123", -1, 123); <add> OpPlus o = new OpPlus(-1, n1, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(String.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(String.class, value.getTypeDescriptor().getType()); <add> assertEquals("number is 123", value.getValue()); <add> } <add> <add> @Test <add> public void test_binaryPlusWithRightStringOperand() { <add> ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext()); <add> <add> LongLiteral n1 = new LongLiteral("123", -1, 123); <add> StringLiteral n2 = new StringLiteral("\" is a number\"", -1, "\" is a number\""); <add> OpPlus o = new OpPlus(-1, n1, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(String.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(String.class, value.getTypeDescriptor().getType()); <add> assertEquals("123 is a number", value.getValue()); <add> } <add> <add> @Test <add> public void test_binaryPlusWithTime_ToString() { <add> <add> ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext()); <add> <add> Time time = new Time(new Date().getTime()); <add> <add> VariableReference var = new VariableReference("timeVar", -1); <add> var.setValue(expressionState, time); <add> <add> StringLiteral n2 = new StringLiteral("\" is now\"", -1, "\" is now\""); <add> OpPlus o = new OpPlus(-1, var, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(String.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(String.class, value.getTypeDescriptor().getType()); <add> assertEquals(time + " is now", value.getValue()); <add> } <add> <add> @Test <add> public void test_binaryPlusWithTimeConverted() { <add> <add> final SimpleDateFormat format = new SimpleDateFormat("hh :--: mm :--: ss", Locale.ENGLISH); <add> <add> GenericConversionService conversionService = new GenericConversionService(); <add> conversionService.addConverter(new Converter<Time, String>() { <add> public String convert(Time source) { <add> return format.format(source); <add> } <add> }); <add> <add> StandardEvaluationContext evaluationContextConverter = new StandardEvaluationContext(); <add> evaluationContextConverter.setTypeConverter(new StandardTypeConverter(conversionService)); <add> <add> ExpressionState expressionState = new ExpressionState(evaluationContextConverter); <add> <add> Time time = new Time(new Date().getTime()); <add> <add> VariableReference var = new VariableReference("timeVar", -1); <add> var.setValue(expressionState, time); <add> <add> StringLiteral n2 = new StringLiteral("\" is now\"", -1, "\" is now\""); <add> OpPlus o = new OpPlus(-1, var, n2); <add> TypedValue value = o.getValueInternal(expressionState); <add> <add> assertEquals(String.class, value.getTypeDescriptor().getObjectType()); <add> assertEquals(String.class, value.getTypeDescriptor().getType()); <add> assertEquals(format.format(time) + " is now", value.getValue()); <add> } <add> <add>}
2
Ruby
Ruby
convert tab test to spec
e03caebaedf579d5330c5c908b2d3ffa927ea5c3
<ide><path>Library/Homebrew/test/tab_spec.rb <add>require "tab" <add>require "formula" <add> <add>RSpec::Matchers.alias_matcher :have_option_with, :be_with <add> <add>describe Tab do <add> matcher :be_poured_from_bottle do <add> match do |actual| <add> actual.poured_from_bottle == true <add> end <add> end <add> <add> matcher :be_built_as_bottle do <add> match do |actual| <add> actual.built_as_bottle == true <add> end <add> end <add> <add> subject { <add> described_class.new( <add> "homebrew_version" => HOMEBREW_VERSION, <add> "used_options" => used_options.as_flags, <add> "unused_options" => unused_options.as_flags, <add> "built_as_bottle" => false, <add> "poured_from_bottle" => true, <add> "changed_files" => [], <add> "time" => time, <add> "source_modified_time" => 0, <add> "HEAD" => TEST_SHA1, <add> "compiler" => "clang", <add> "stdlib" => "libcxx", <add> "runtime_dependencies" => [], <add> "source" => { <add> "tap" => CoreTap.instance.to_s, <add> "path" => CoreTap.instance.path.to_s, <add> "spec" => "stable", <add> "versions" => { <add> "stable" => "0.10", <add> "devel" => "0.14", <add> "head" => "HEAD-1111111", <add> }, <add> }, <add> ) <add> } <add> let(:time) { Time.now.to_i } <add> let(:unused_options) { Options.create(%w[--with-baz --without-qux]) } <add> let(:used_options) { Options.create(%w[--with-foo --without-bar]) } <add> <add> let(:f) { formula { url "foo-1.0" } } <add> let(:f_tab_path) { f.prefix/"INSTALL_RECEIPT.json" } <add> let(:f_tab_content) { (TEST_FIXTURE_DIR/"receipt.json").read } <add> <add> specify "defaults" do <add> tab = described_class.empty <add> <add> expect(tab.homebrew_version).to eq(HOMEBREW_VERSION) <add> expect(tab.unused_options).to be_empty <add> expect(tab.used_options).to be_empty <add> expect(tab.changed_files).to be nil <add> expect(tab).not_to be_built_as_bottle <add> expect(tab).not_to be_poured_from_bottle <add> expect(tab).to be_stable <add> expect(tab).not_to be_devel <add> expect(tab).not_to be_head <add> expect(tab.tap).to be nil <add> expect(tab.time).to be nil <add> expect(tab.HEAD).to be nil <add> expect(tab.runtime_dependencies).to be_empty <add> expect(tab.stable_version).to be nil <add> expect(tab.devel_version).to be nil <add> expect(tab.head_version).to be nil <add> expect(tab.cxxstdlib.compiler).to eq(DevelopmentTools.default_compiler) <add> expect(tab.cxxstdlib.type).to be nil <add> expect(tab.source["path"]).to be nil <add> end <add> <add> specify "#include?" do <add> expect(subject).to include("with-foo") <add> expect(subject).to include("without-bar") <add> end <add> <add> specify "#with?" do <add> expect(subject).to have_option_with("foo") <add> expect(subject).to have_option_with("qux") <add> expect(subject).not_to have_option_with("bar") <add> expect(subject).not_to have_option_with("baz") <add> end <add> <add> specify "#universal?" do <add> tab = described_class.new(used_options: %w[--universal]) <add> expect(tab).to be_universal <add> end <add> <add> specify "#parsed_homebrew_version" do <add> tab = described_class.new <add> expect(tab.parsed_homebrew_version).to be Version::NULL <add> <add> tab = described_class.new(homebrew_version: "1.2.3") <add> expect(tab.parsed_homebrew_version).to eq("1.2.3") <add> expect(tab.parsed_homebrew_version).to be < "1.2.3-1-g12789abdf" <add> expect(tab.parsed_homebrew_version).to be_kind_of(Version) <add> <add> tab.homebrew_version = "1.2.4-567-g12789abdf" <add> expect(tab.parsed_homebrew_version).to be > "1.2.4" <add> expect(tab.parsed_homebrew_version).to be > "1.2.4-566-g21789abdf" <add> expect(tab.parsed_homebrew_version).to be < "1.2.4-568-g01789abdf" <add> <add> tab = described_class.new(homebrew_version: "2.0.0-134-gabcdefabc-dirty") <add> expect(tab.parsed_homebrew_version).to be > "2.0.0" <add> expect(tab.parsed_homebrew_version).to be > "2.0.0-133-g21789abdf" <add> expect(tab.parsed_homebrew_version).to be < "2.0.0-135-g01789abdf" <add> end <add> <add> specify "#runtime_dependencies" do <add> tab = described_class.new <add> expect(tab.runtime_dependencies).to be nil <add> <add> tab.homebrew_version = "1.1.6" <add> expect(tab.runtime_dependencies).to be nil <add> <add> tab.runtime_dependencies = [] <add> expect(tab.runtime_dependencies).not_to be nil <add> <add> tab.homebrew_version = "1.1.5" <add> expect(tab.runtime_dependencies).to be nil <add> <add> tab.homebrew_version = "1.1.7" <add> expect(tab.runtime_dependencies).not_to be nil <add> <add> tab.homebrew_version = "1.1.10" <add> expect(tab.runtime_dependencies).not_to be nil <add> <add> tab.runtime_dependencies = [{ "full_name" => "foo", "version" => "1.0" }] <add> expect(tab.runtime_dependencies).not_to be nil <add> end <add> <add> specify "#cxxstdlib" do <add> expect(subject.cxxstdlib.compiler).to eq(:clang) <add> expect(subject.cxxstdlib.type).to eq(:libcxx) <add> end <add> <add> specify "other attributes" do <add> expect(subject.HEAD).to eq(TEST_SHA1) <add> expect(subject.tap.name).to eq("homebrew/core") <add> expect(subject.time).to eq(time) <add> expect(subject).not_to be_built_as_bottle <add> expect(subject).to be_poured_from_bottle <add> end <add> <add> describe "::from_file" do <add> it "parses a Tab from a file" do <add> path = Pathname.new("#{TEST_FIXTURE_DIR}/receipt.json") <add> tab = described_class.from_file(path) <add> source_path = "/usr/local/Library/Taps/homebrew/homebrew-core/Formula/foo.rb" <add> runtime_dependencies = [{ "full_name" => "foo", "version" => "1.0" }] <add> changed_files = %w[INSTALL_RECEIPT.json bin/foo] <add> <add> expect(tab.used_options.sort).to eq(used_options.sort) <add> expect(tab.unused_options.sort).to eq(unused_options.sort) <add> expect(tab.changed_files).to eq(changed_files) <add> expect(tab).not_to be_built_as_bottle <add> expect(tab).to be_poured_from_bottle <add> expect(tab).to be_stable <add> expect(tab).not_to be_devel <add> expect(tab).not_to be_head <add> expect(tab.tap.name).to eq("homebrew/core") <add> expect(tab.spec).to eq(:stable) <add> expect(tab.time).to eq(Time.at(1_403_827_774).to_i) <add> expect(tab.HEAD).to eq(TEST_SHA1) <add> expect(tab.cxxstdlib.compiler).to eq(:clang) <add> expect(tab.cxxstdlib.type).to eq(:libcxx) <add> expect(tab.runtime_dependencies).to eq(runtime_dependencies) <add> expect(tab.stable_version.to_s).to eq("2.14") <add> expect(tab.devel_version.to_s).to eq("2.15") <add> expect(tab.head_version.to_s).to eq("HEAD-0000000") <add> expect(tab.source["path"]).to eq(source_path) <add> end <add> <add> it "can parse an old Tab file" do <add> path = Pathname.new("#{TEST_FIXTURE_DIR}/receipt_old.json") <add> tab = described_class.from_file(path) <add> <add> expect(tab.used_options.sort).to eq(used_options.sort) <add> expect(tab.unused_options.sort).to eq(unused_options.sort) <add> expect(tab).not_to be_built_as_bottle <add> expect(tab).to be_poured_from_bottle <add> expect(tab).to be_stable <add> expect(tab).not_to be_devel <add> expect(tab).not_to be_head <add> expect(tab.tap.name).to eq("homebrew/core") <add> expect(tab.spec).to eq(:stable) <add> expect(tab.time).to eq(Time.at(1_403_827_774).to_i) <add> expect(tab.HEAD).to eq(TEST_SHA1) <add> expect(tab.cxxstdlib.compiler).to eq(:clang) <add> expect(tab.cxxstdlib.type).to eq(:libcxx) <add> expect(tab.runtime_dependencies).to be nil <add> end <add> end <add> <add> describe "::create" do <add> it "creates a Tab" do <add> f = formula do <add> url "foo-1.0" <add> depends_on "bar" <add> depends_on "user/repo/from_tap" <add> depends_on "baz" => :build <add> end <add> <add> tap = Tap.new("user", "repo") <add> from_tap = formula("from_tap", path: tap.path/"Formula/from_tap.rb") do <add> url "from_tap-1.0" <add> end <add> stub_formula_loader from_tap <add> <add> stub_formula_loader formula("bar") { url "bar-2.0" } <add> stub_formula_loader formula("baz") { url "baz-3.0" } <add> <add> compiler = DevelopmentTools.default_compiler <add> stdlib = :libcxx <add> tab = described_class.create(f, compiler, stdlib) <add> <add> runtime_dependencies = [ <add> { "full_name" => "bar", "version" => "2.0" }, <add> { "full_name" => "user/repo/from_tap", "version" => "1.0" }, <add> ] <add> <add> expect(tab.runtime_dependencies).to eq(runtime_dependencies) <add> expect(tab.source["path"]).to eq(f.path.to_s) <add> end <add> <add> it "can create a Tab from an alias" do <add> alias_path = CoreTap.instance.alias_dir/"bar" <add> f = formula(alias_path: alias_path) { url "foo-1.0" } <add> compiler = DevelopmentTools.default_compiler <add> stdlib = :libcxx <add> tab = described_class.create(f, compiler, stdlib) <add> <add> expect(tab.source["path"]).to eq(f.alias_path.to_s) <add> end <add> end <add> <add> describe "::for_keg" do <add> subject { described_class.for_keg(f.prefix) } <add> <add> it "creates a Tab for a given Keg" do <add> f.prefix.mkpath <add> f_tab_path.write f_tab_content <add> <add> expect(subject.tabfile).to eq(f_tab_path) <add> end <add> <add> it "can create a Tab for a non-existant Keg" do <add> f.prefix.mkpath <add> <add> expect(subject.tabfile).to be nil <add> end <add> end <add> <add> describe "::for_formula" do <add> it "creates a Tab for a given Formula" do <add> tab = described_class.for_formula(f) <add> expect(tab.source["path"]).to eq(f.path.to_s) <add> end <add> <add> it "can create a Tab for for a Formula from an alias" do <add> alias_path = CoreTap.instance.alias_dir/"bar" <add> f = formula(alias_path: alias_path) { url "foo-1.0" } <add> <add> tab = described_class.for_formula(f) <add> expect(tab.source["path"]).to eq(alias_path.to_s) <add> end <add> <add> it "creates a Tab for a given Formula" do <add> f.prefix.mkpath <add> f_tab_path.write f_tab_content <add> <add> tab = described_class.for_formula(f) <add> expect(tab.tabfile).to eq(f_tab_path) <add> end <add> <add> it "can create a Tab for a non-existant Formula" do <add> f.prefix.mkpath <add> <add> tab = described_class.for_formula(f) <add> expect(tab.tabfile).to be nil <add> end <add> <add> it "can create a Tab for a Formula with multiple Kegs" do <add> f.prefix.mkpath <add> f_tab_path.write f_tab_content <add> <add> f2 = formula { url "foo-2.0" } <add> f2.prefix.mkpath <add> <add> expect(f2.rack).to eq(f.rack) <add> expect(f.installed_prefixes.length).to eq(2) <add> <add> tab = described_class.for_formula(f) <add> expect(tab.tabfile).to eq(f_tab_path) <add> end <add> <add> it "can create a Tab for a Formula with an outdated Kegs" do <add> f_tab_path.write f_tab_content <add> <add> f2 = formula { url "foo-2.0" } <add> <add> expect(f2.rack).to eq(f.rack) <add> expect(f.installed_prefixes.length).to eq(1) <add> <add> tab = described_class.for_formula(f) <add> expect(tab.tabfile).to eq(f_tab_path) <add> end <add> end <add> <add> specify "#to_json" do <add> tab = described_class.new(JSON.parse(subject.to_json)) <add> expect(tab.used_options.sort).to eq(subject.used_options.sort) <add> expect(tab.unused_options.sort).to eq(subject.unused_options.sort) <add> expect(tab.built_as_bottle).to eq(subject.built_as_bottle) <add> expect(tab.poured_from_bottle).to eq(subject.poured_from_bottle) <add> expect(tab.changed_files).to eq(subject.changed_files) <add> expect(tab.tap).to eq(subject.tap) <add> expect(tab.spec).to eq(subject.spec) <add> expect(tab.time).to eq(subject.time) <add> expect(tab.HEAD).to eq(subject.HEAD) <add> expect(tab.compiler).to eq(subject.compiler) <add> expect(tab.stdlib).to eq(subject.stdlib) <add> expect(tab.runtime_dependencies).to eq(subject.runtime_dependencies) <add> expect(tab.stable_version).to eq(subject.stable_version) <add> expect(tab.devel_version).to eq(subject.devel_version) <add> expect(tab.head_version).to eq(subject.head_version) <add> expect(tab.source["path"]).to eq(subject.source["path"]) <add> end <add> <add> specify "::remap_deprecated_options" do <add> deprecated_options = [DeprecatedOption.new("with-foo", "with-foo-new")] <add> remapped_options = described_class.remap_deprecated_options(deprecated_options, subject.used_options) <add> expect(remapped_options).to include(Option.new("without-bar")) <add> expect(remapped_options).to include(Option.new("with-foo-new")) <add> end <add>end <ide><path>Library/Homebrew/test/tab_test.rb <del>require "testing_env" <del>require "tab" <del>require "formula" <del> <del>class TabTests < Homebrew::TestCase <del> def setup <del> super <del> <del> @time = Time.now.to_i <del> @used = Options.create(%w[--with-foo --without-bar]) <del> @unused = Options.create(%w[--with-baz --without-qux]) <del> <del> @tab = Tab.new( <del> "homebrew_version" => HOMEBREW_VERSION, <del> "used_options" => @used.as_flags, <del> "unused_options" => @unused.as_flags, <del> "built_as_bottle" => false, <del> "poured_from_bottle" => true, <del> "changed_files" => [], <del> "time" => @time, <del> "source_modified_time" => 0, <del> "HEAD" => TEST_SHA1, <del> "compiler" => "clang", <del> "stdlib" => "libcxx", <del> "runtime_dependencies" => [], <del> "source" => { <del> "tap" => CoreTap.instance.to_s, <del> "path" => CoreTap.instance.path.to_s, <del> "spec" => "stable", <del> "versions" => { <del> "stable" => "0.10", <del> "devel" => "0.14", <del> "head" => "HEAD-1111111", <del> }, <del> }, <del> ) <del> end <del> <del> def test_defaults <del> tab = Tab.empty <del> <del> assert_equal HOMEBREW_VERSION, tab.homebrew_version <del> assert_empty tab.unused_options <del> assert_empty tab.used_options <del> assert_nil tab.changed_files <del> refute_predicate tab, :built_as_bottle <del> refute_predicate tab, :poured_from_bottle <del> assert_predicate tab, :stable? <del> refute_predicate tab, :devel? <del> refute_predicate tab, :head? <del> assert_nil tab.tap <del> assert_nil tab.time <del> assert_nil tab.HEAD <del> assert_empty tab.runtime_dependencies <del> assert_nil tab.stable_version <del> assert_nil tab.devel_version <del> assert_nil tab.head_version <del> assert_equal DevelopmentTools.default_compiler, tab.cxxstdlib.compiler <del> assert_nil tab.cxxstdlib.type <del> assert_nil tab.source["path"] <del> end <del> <del> def test_include? <del> assert_includes @tab, "with-foo" <del> assert_includes @tab, "without-bar" <del> end <del> <del> def test_with? <del> assert @tab.with?("foo") <del> assert @tab.with?("qux") <del> refute @tab.with?("bar") <del> refute @tab.with?("baz") <del> end <del> <del> def test_universal? <del> tab = Tab.new(used_options: %w[--universal]) <del> assert_predicate tab, :universal? <del> end <del> <del> def test_parsed_homebrew_version <del> tab = Tab.new <del> assert_same Version::NULL, tab.parsed_homebrew_version <del> <del> tab = Tab.new(homebrew_version: "1.2.3") <del> assert_equal "1.2.3", tab.parsed_homebrew_version <del> assert tab.parsed_homebrew_version < "1.2.3-1-g12789abdf" <del> assert_kind_of Version, tab.parsed_homebrew_version <del> <del> tab.homebrew_version = "1.2.4-567-g12789abdf" <del> assert tab.parsed_homebrew_version > "1.2.4" <del> assert tab.parsed_homebrew_version > "1.2.4-566-g21789abdf" <del> assert tab.parsed_homebrew_version < "1.2.4-568-g01789abdf" <del> <del> tab = Tab.new(homebrew_version: "2.0.0-134-gabcdefabc-dirty") <del> assert tab.parsed_homebrew_version > "2.0.0" <del> assert tab.parsed_homebrew_version > "2.0.0-133-g21789abdf" <del> assert tab.parsed_homebrew_version < "2.0.0-135-g01789abdf" <del> end <del> <del> def test_runtime_dependencies <del> tab = Tab.new <del> assert_nil tab.runtime_dependencies <del> <del> tab.homebrew_version = "1.1.6" <del> assert_nil tab.runtime_dependencies <del> <del> tab.runtime_dependencies = [] <del> refute_nil tab.runtime_dependencies <del> <del> tab.homebrew_version = "1.1.5" <del> assert_nil tab.runtime_dependencies <del> <del> tab.homebrew_version = "1.1.7" <del> refute_nil tab.runtime_dependencies <del> <del> tab.homebrew_version = "1.1.10" <del> refute_nil tab.runtime_dependencies <del> <del> tab.runtime_dependencies = [{ "full_name" => "foo", "version" => "1.0" }] <del> refute_nil tab.runtime_dependencies <del> end <del> <del> def test_cxxstdlib <del> assert_equal :clang, @tab.cxxstdlib.compiler <del> assert_equal :libcxx, @tab.cxxstdlib.type <del> end <del> <del> def test_other_attributes <del> assert_equal TEST_SHA1, @tab.HEAD <del> assert_equal "homebrew/core", @tab.tap.name <del> assert_equal @time, @tab.time <del> refute_predicate @tab, :built_as_bottle <del> assert_predicate @tab, :poured_from_bottle <del> end <del> <del> def test_from_old_version_file <del> path = Pathname.new("#{TEST_FIXTURE_DIR}/receipt_old.json") <del> tab = Tab.from_file(path) <del> <del> assert_equal @used.sort, tab.used_options.sort <del> assert_equal @unused.sort, tab.unused_options.sort <del> refute_predicate tab, :built_as_bottle <del> assert_predicate tab, :poured_from_bottle <del> assert_predicate tab, :stable? <del> refute_predicate tab, :devel? <del> refute_predicate tab, :head? <del> assert_equal "homebrew/core", tab.tap.name <del> assert_equal :stable, tab.spec <del> refute_nil tab.time <del> assert_equal TEST_SHA1, tab.HEAD <del> assert_equal :clang, tab.cxxstdlib.compiler <del> assert_equal :libcxx, tab.cxxstdlib.type <del> assert_nil tab.runtime_dependencies <del> end <del> <del> def test_from_file <del> path = Pathname.new("#{TEST_FIXTURE_DIR}/receipt.json") <del> tab = Tab.from_file(path) <del> source_path = "/usr/local/Library/Taps/homebrew/homebrew-core/Formula/foo.rb" <del> runtime_dependencies = [{ "full_name" => "foo", "version" => "1.0" }] <del> changed_files = %w[INSTALL_RECEIPT.json bin/foo] <del> <del> assert_equal @used.sort, tab.used_options.sort <del> assert_equal @unused.sort, tab.unused_options.sort <del> assert_equal changed_files, tab.changed_files <del> refute_predicate tab, :built_as_bottle <del> assert_predicate tab, :poured_from_bottle <del> assert_predicate tab, :stable? <del> refute_predicate tab, :devel? <del> refute_predicate tab, :head? <del> assert_equal "homebrew/core", tab.tap.name <del> assert_equal :stable, tab.spec <del> refute_nil tab.time <del> assert_equal TEST_SHA1, tab.HEAD <del> assert_equal :clang, tab.cxxstdlib.compiler <del> assert_equal :libcxx, tab.cxxstdlib.type <del> assert_equal runtime_dependencies, tab.runtime_dependencies <del> assert_equal "2.14", tab.stable_version.to_s <del> assert_equal "2.15", tab.devel_version.to_s <del> assert_equal "HEAD-0000000", tab.head_version.to_s <del> assert_equal source_path, tab.source["path"] <del> end <del> <del> def test_create <del> f = formula do <del> url "foo-1.0" <del> depends_on "bar" <del> depends_on "user/repo/from_tap" <del> depends_on "baz" => :build <del> end <del> <del> tap = Tap.new("user", "repo") <del> from_tap = formula("from_tap", tap.path/"Formula/from_tap.rb") do <del> url "from_tap-1.0" <del> end <del> stub_formula_loader from_tap <del> <del> stub_formula_loader formula("bar") { url "bar-2.0" } <del> stub_formula_loader formula("baz") { url "baz-3.0" } <del> <del> compiler = DevelopmentTools.default_compiler <del> stdlib = :libcxx <del> tab = Tab.create(f, compiler, stdlib) <del> <del> runtime_dependencies = [ <del> { "full_name" => "bar", "version" => "2.0" }, <del> { "full_name" => "user/repo/from_tap", "version" => "1.0" }, <del> ] <del> <del> assert_equal runtime_dependencies, tab.runtime_dependencies <del> assert_equal f.path.to_s, tab.source["path"] <del> end <del> <del> def test_create_from_alias <del> alias_path = CoreTap.instance.alias_dir/"bar" <del> f = formula(alias_path: alias_path) { url "foo-1.0" } <del> compiler = DevelopmentTools.default_compiler <del> stdlib = :libcxx <del> tab = Tab.create(f, compiler, stdlib) <del> <del> assert_equal f.alias_path.to_s, tab.source["path"] <del> end <del> <del> def test_for_formula <del> f = formula { url "foo-1.0" } <del> tab = Tab.for_formula(f) <del> <del> assert_equal f.path.to_s, tab.source["path"] <del> end <del> <del> def test_for_formula_from_alias <del> alias_path = CoreTap.instance.alias_dir/"bar" <del> f = formula(alias_path: alias_path) { url "foo-1.0" } <del> tab = Tab.for_formula(f) <del> <del> assert_equal alias_path.to_s, tab.source["path"] <del> end <del> <del> def test_to_json <del> tab = Tab.new(JSON.parse(@tab.to_json)) <del> assert_equal @tab.used_options.sort, tab.used_options.sort <del> assert_equal @tab.unused_options.sort, tab.unused_options.sort <del> assert_equal @tab.built_as_bottle, tab.built_as_bottle <del> assert_equal @tab.poured_from_bottle, tab.poured_from_bottle <del> assert_equal @tab.changed_files, tab.changed_files <del> assert_equal @tab.tap, tab.tap <del> assert_equal @tab.spec, tab.spec <del> assert_equal @tab.time, tab.time <del> assert_equal @tab.HEAD, tab.HEAD <del> assert_equal @tab.compiler, tab.compiler <del> assert_equal @tab.stdlib, tab.stdlib <del> assert_equal @tab.runtime_dependencies, tab.runtime_dependencies <del> assert_equal @tab.stable_version, tab.stable_version <del> assert_equal @tab.devel_version, tab.devel_version <del> assert_equal @tab.head_version, tab.head_version <del> assert_equal @tab.source["path"], tab.source["path"] <del> end <del> <del> def test_remap_deprecated_options <del> deprecated_options = [DeprecatedOption.new("with-foo", "with-foo-new")] <del> remapped_options = Tab.remap_deprecated_options(deprecated_options, @tab.used_options) <del> assert_includes remapped_options, Option.new("without-bar") <del> assert_includes remapped_options, Option.new("with-foo-new") <del> end <del>end <del> <del>class TabLoadingTests < Homebrew::TestCase <del> def setup <del> super <del> @f = formula { url "foo-1.0" } <del> @f.prefix.mkpath <del> @path = @f.prefix.join(Tab::FILENAME) <del> @path.write TEST_FIXTURE_DIR.join("receipt.json").read <del> end <del> <del> def test_for_keg <del> tab = Tab.for_keg(@f.prefix) <del> assert_equal @path, tab.tabfile <del> end <del> <del> def test_for_keg_nonexistent_path <del> @path.unlink <del> tab = Tab.for_keg(@f.prefix) <del> assert_nil tab.tabfile <del> end <del> <del> def test_for_formula <del> tab = Tab.for_formula(@f) <del> assert_equal @path, tab.tabfile <del> end <del> <del> def test_for_formula_nonexistent_path <del> @path.unlink <del> tab = Tab.for_formula(@f) <del> assert_nil tab.tabfile <del> end <del> <del> def test_for_formula_multiple_kegs <del> f2 = formula { url "foo-2.0" } <del> f2.prefix.mkpath <del> <del> assert_equal @f.rack, f2.rack <del> assert_equal 2, @f.installed_prefixes.length <del> <del> tab = Tab.for_formula(@f) <del> assert_equal @path, tab.tabfile <del> end <del> <del> def test_for_formula_outdated_keg <del> f2 = formula { url "foo-2.0" } <del> <del> assert_equal @f.rack, f2.rack <del> assert_equal 1, @f.installed_prefixes.length <del> <del> tab = Tab.for_formula(f2) <del> assert_equal @path, tab.tabfile <del> end <del>end
2
Ruby
Ruby
add env.o0 to stdenv
0b793e321ee3b2984185f93178103b38db21369e
<ide><path>Library/Homebrew/extend/ENV/std.rb <ide> def O1 <ide> remove_from_cflags(/-O./) <ide> append_to_cflags '-O1' <ide> end <add> def O0 <add> remove_from_cflags(/-O./) <add> append_to_cflags '-O0' <add> end <ide> <ide> def gcc_4_0_1 <ide> # we don't use locate because gcc 4.0 has not been provided since Xcode 4
1
Javascript
Javascript
handle optional chained methods as dependency
eb58c3909aa19fb6ffbed27b9c9dba4aada3cb8e
<ide><path>packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js <ide> const tests = { <ide> }, <ide> ], <ide> }, <add> { <add> code: normalizeIndent` <add> function MyComponent(props) { <add> useEffect(() => {}, [props?.attribute.method()]); <add> } <add> `, <add> errors: [ <add> { <add> message: <add> 'React Hook useEffect has a complex expression in the dependency array. ' + <add> 'Extract it to a separate variable so it can be statically checked.', <add> suggestions: undefined, <add> }, <add> ], <add> }, <add> { <add> code: normalizeIndent` <add> function MyComponent(props) { <add> useEffect(() => {}, [props.method()]); <add> } <add> `, <add> errors: [ <add> { <add> message: <add> 'React Hook useEffect has a complex expression in the dependency array. ' + <add> 'Extract it to a separate variable so it can be statically checked.', <add> suggestions: undefined, <add> }, <add> ], <add> }, <ide> { <ide> code: normalizeIndent` <ide> function MyComponent() { <ide><path>packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js <ide> function analyzePropertyChain(node, optionalChains) { <ide> return result; <ide> } else if (node.type === 'ChainExpression' && !node.computed) { <ide> const expression = node.expression; <add> <add> if (expression.type === 'CallExpression') { <add> throw new Error(`Unsupported node type: ${expression.type}`); <add> } <add> <ide> const object = analyzePropertyChain(expression.object, optionalChains); <ide> const property = analyzePropertyChain(expression.property, null); <ide> const result = `${object}.${property}`;
2
Text
Text
improve description on volume removal
00f2fd1dd5dee53919cda7ed9f5c70ba8558edb5
<ide><path>docs/sources/userguide/dockervolumes.md <ide> persistent or shared data: <ide> - Data volumes can be shared and reused between containers <ide> - Changes to a data volume are made directly <ide> - Changes to a data volume will not be included when you update an image <del>- Volumes persist until no containers use them <add>- Data volumes persist even if the container itself is deleted <add> <add>Data volumes are designed to persist data, independent of the container's life <add>cycle. Docker will therefore *never* automatically delete volumes when you remove <add>a container, nor will it "garbage collect" volumes that are no longer referenced <add>by a container. <ide> <ide> ### Adding a data volume <ide> <ide> be deleted. To delete the volume from disk, you must explicitly call <ide> `docker rm -v` against the last container with a reference to the volume. This <ide> allows you to upgrade, or effectively migrate data volumes between containers. <ide> <add>> **Note:** Docker will not warn you when removing a container *without* <add>> providing the `-v` option to delete its volumes. If you remove containers <add>> without using the `-v` option, you may end up with "dangling" volumes; <add>> volumes that are no longer referenced by a container. <add>> Dangling volumes are difficult to get rid of and can take up a large amount <add>> of disk space. We're working on improving volume management and you can check <add>> progress on this in [pull request #8484](https://github.com/docker/docker/pull/8484) <add> <ide> ## Backup, restore, or migrate data volumes <ide> <ide> Another useful function we can perform with volumes is use them for
1
Ruby
Ruby
fix superenv env[] hack
061f8cb35f8ac155e16943951ae39aa75cbd24d2
<ide><path>Library/Homebrew/superenv.rb <ide> def [] key <ide> if has_key? key <ide> fetch(key) <ide> elsif %w{CPPFLAGS CFLAGS LDFLAGS}.include? key <del> class << (a = "") <del> attr_accessor :key <del> def + value <del> ENV[key] = value <del> end <del> alias_method '<<', '+' <del> end <del> a.key = key <del> a <add> self[key] = "" <ide> end <ide> end <ide> end
1
Javascript
Javascript
fix controller usage in {{action}} and sendaction
8732970e6bee9deea2fb17e68f658c1bb5387efd
<ide><path>packages/ember-routing-htmlbars/lib/keywords/action.js <ide> export default { <ide> target = read(hash.target); <ide> } <ide> } else { <del> target = get(env.view, 'controller') || read(scope.self); <add> target = read(scope.locals.controller) || read(scope.self); <ide> } <ide> <ide> return { actionName, actionArgs, target }; <ide><path>packages/ember-views/lib/views/component.js <ide> var Component = View.extend(TargetActionSupport, ComponentTemplateDeprecation, { <ide> <ide> init() { <ide> this._super.apply(this, arguments); <add> set(this, 'controller', this); <ide> set(this, 'context', this); <ide> }, <ide> <ide><path>packages/ember-views/tests/views/component_test.js <ide> QUnit.test("The context of an Ember.Component is itself", function() { <ide> strictEqual(component, component.get('context'), "A component's context is itself"); <ide> }); <ide> <del>QUnit.skip("The controller (target of `action`) of an Ember.Component is itself", function() { <add>QUnit.test("The controller (target of `action`) of an Ember.Component is itself", function() { <ide> strictEqual(component, component.get('controller'), "A component's controller is itself"); <ide> }); <ide> <ide> QUnit.module("Ember.Component - Actions", { <ide> }); <ide> <ide> component = Component.create({ <del> _parentView: EmberView.create({ <add> parentView: EmberView.create({ <ide> controller: controller <ide> }) <ide> }); <ide> QUnit.test("Calling sendAction on a component without an action defined does not <ide> equal(sendCount, 0, "addItem action was not invoked"); <ide> }); <ide> <del>QUnit.skip("Calling sendAction on a component with an action defined calls send on the controller", function() { <add>QUnit.test("Calling sendAction on a component with an action defined calls send on the controller", function() { <ide> set(component, 'action', "addItem"); <ide> <ide> component.sendAction(); <ide> QUnit.skip("Calling sendAction on a component with an action defined calls send <ide> equal(actionCounts['addItem'], 1, "addItem event was sent once"); <ide> }); <ide> <del>QUnit.skip("Calling sendAction with a named action uses the component's property as the action name", function() { <add>QUnit.test("Calling sendAction with a named action uses the component's property as the action name", function() { <ide> set(component, 'playing', "didStartPlaying"); <ide> set(component, 'action', "didDoSomeBusiness"); <ide> <ide> QUnit.test("Calling sendAction when the action name is not a string raises an ex <ide> }); <ide> }); <ide> <del>QUnit.skip("Calling sendAction on a component with a context", function() { <add>QUnit.test("Calling sendAction on a component with a context", function() { <ide> set(component, 'playing', "didStartPlaying"); <ide> <ide> var testContext = { song: 'She Broke My Ember' }; <ide> QUnit.skip("Calling sendAction on a component with a context", function() { <ide> deepEqual(actionArguments, [testContext], "context was sent with the action"); <ide> }); <ide> <del>QUnit.skip("Calling sendAction on a component with multiple parameters", function() { <add>QUnit.test("Calling sendAction on a component with multiple parameters", function() { <ide> set(component, 'playing', "didStartPlaying"); <ide> <ide> var firstContext = { song: 'She Broke My Ember' };
3
Javascript
Javascript
add shouldverifypeer param to securepairs
855210ce0b949aa5e8b810d57ab1700b39837f3f
<ide><path>lib/securepair.js <ide> var SecureStream = null; <ide> * Provides a pair of streams to do encrypted communication. <ide> */ <ide> <del>function SecurePair(credentials, isServer) { <add>function SecurePair(credentials, isServer, shouldVerifyPeer) { <ide> if (!(this instanceof SecurePair)) { <del> return new SecurePair(credentials, isServer); <add> return new SecurePair(credentials, isServer, shouldVerifyPeer); <ide> } <ide> <ide> var self = this; <ide> function SecurePair(credentials, isServer) { <ide> <ide> if (!this._isServer) { <ide> /* For clients, we will always have either a given ca list or be using default one */ <del> this.credentials.shouldVerify = true; <add> shouldVerifyPeer = true; <ide> } <ide> <ide> this._secureEstablished = false; <ide> function SecurePair(credentials, isServer) { <ide> <ide> this._ssl = new SecureStream(this.credentials.context, <ide> this._isServer ? true : false, <del> this.credentials.shouldVerify); <add> shouldVerifyPeer ? true : false); <ide> <ide> <ide> /* Acts as a r/w stream to the cleartext side of the stream. */ <ide> function SecurePair(credentials, isServer) { <ide> util.inherits(SecurePair, events.EventEmitter); <ide> <ide> <del>exports.createSecurePair = function (credentials, isServer) { <del> var pair = new SecurePair(credentials, isServer); <add>exports.createSecurePair = function (credentials, isServer, shouldVerifyPeer) { <add> var pair = new SecurePair(credentials, isServer, shouldVerifyPeer); <ide> return pair; <ide> }; <ide>
1
Mixed
Ruby
fix backtracecleaner#noise for multiple silencers
a3678e45ecf8e17527722889d5347325083ad560
<ide><path>activesupport/CHANGELOG.md <add>* Fix return value from `BacktraceCleaner#noise` when the cleaner is configured <add> with multiple silencers. <add> <add> Fixes #11030 <add> <add> *Mark J. Titorenko* <add> <ide> * `HashWithIndifferentAccess#select` now returns a `HashWithIndifferentAccess` <ide> instance instead of a `Hash` instance. <ide> <ide><path>activesupport/lib/active_support/backtrace_cleaner.rb <ide> def silence(backtrace) <ide> end <ide> <ide> def noise(backtrace) <del> @silencers.each do |s| <del> backtrace = backtrace.select { |line| s.call(line) } <del> end <del> <del> backtrace <add> backtrace - silence(backtrace) <ide> end <ide> end <ide> end <ide><path>activesupport/test/clean_backtrace_test.rb <ide> def setup <ide> end <ide> end <ide> <add>class BacktraceCleanerMultipleSilencersTest < ActiveSupport::TestCase <add> def setup <add> @bc = ActiveSupport::BacktraceCleaner.new <add> @bc.add_silencer { |line| line =~ /mongrel/ } <add> @bc.add_silencer { |line| line =~ /yolo/ } <add> end <add> <add> test "backtrace should not contain lines that match the silencers" do <add> assert_equal \ <add> [ "/other/class.rb" ], <add> @bc.clean([ "/mongrel/class.rb", "/other/class.rb", "/mongrel/stuff.rb", "/other/yolo.rb" ]) <add> end <add> <add> test "backtrace should only contain lines that match the silencers" do <add> assert_equal \ <add> [ "/mongrel/class.rb", "/mongrel/stuff.rb", "/other/yolo.rb" ], <add> @bc.clean([ "/mongrel/class.rb", "/other/class.rb", "/mongrel/stuff.rb", "/other/yolo.rb" ], <add> :noise) <add> end <add>end <add> <ide> class BacktraceCleanerFilterAndSilencerTest < ActiveSupport::TestCase <ide> def setup <ide> @bc = ActiveSupport::BacktraceCleaner.new
3
Ruby
Ruby
introduce predicate {does_not_}matches_regexp
d2e6be1677b124b3eef5b3ebe0fd4a0d31d8a2bf
<ide><path>lib/arel/predications.rb <ide> def matches other, escape = nil, case_sensitive = false <ide> Nodes::Matches.new self, quoted_node(other), escape, case_sensitive <ide> end <ide> <add> def matches_regexp other, case_sensitive = true <add> Nodes::Regexp.new self, quoted_node(other), case_sensitive <add> end <add> <ide> def matches_any others, escape = nil, case_sensitive = false <ide> grouping_any :matches, others, escape, case_sensitive <ide> end <ide> def does_not_match other, escape = nil, case_sensitive = false <ide> Nodes::DoesNotMatch.new self, quoted_node(other), escape, case_sensitive <ide> end <ide> <add> def does_not_match_regexp other, case_sensitive = true <add> Nodes::NotRegexp.new self, quoted_node(other), case_sensitive <add> end <add> <ide> def does_not_match_any others, escape = nil <ide> grouping_any :does_not_match, others, escape <ide> end <ide><path>test/visitors/test_postgres.rb <ide> def compile node <ide> <ide> describe "Nodes::Regexp" do <ide> it "should know how to visit" do <del> node = Arel::Nodes::Regexp.new(@table[:name], Nodes.build_quoted('foo.*')) <add> node = @table[:name].matches_regexp('foo.*') <add> node.must_be_kind_of Nodes::Regexp <add> node.case_sensitive.must_equal(true) <ide> compile(node).must_be_like %{ <ide> "users"."name" ~ 'foo.*' <ide> } <ide> end <ide> <ide> it "can handle case insensitive" do <del> node = Arel::Nodes::Regexp.new(@table[:name], Nodes.build_quoted('foo.*'), false) <add> node = @table[:name].matches_regexp('foo.*', false) <add> node.must_be_kind_of Nodes::Regexp <add> node.case_sensitive.must_equal(false) <ide> compile(node).must_be_like %{ <ide> "users"."name" ~* 'foo.*' <ide> } <ide> end <ide> <ide> it 'can handle subqueries' do <del> subquery = @table.project(:id).where(Arel::Nodes::Regexp.new(@table[:name], Nodes.build_quoted('foo.*'))) <add> subquery = @table.project(:id).where(@table[:name].matches_regexp('foo.*')) <ide> node = @attr.in subquery <ide> compile(node).must_be_like %{ <ide> "users"."id" IN (SELECT id FROM "users" WHERE "users"."name" ~ 'foo.*') <ide> def compile node <ide> <ide> describe "Nodes::NotRegexp" do <ide> it "should know how to visit" do <del> node = Arel::Nodes::NotRegexp.new(@table[:name], Nodes.build_quoted('foo.*')) <add> node = @table[:name].does_not_match_regexp('foo.*') <add> node.must_be_kind_of Nodes::NotRegexp <add> node.case_sensitive.must_equal(true) <ide> compile(node).must_be_like %{ <ide> "users"."name" !~ 'foo.*' <ide> } <ide> end <ide> <ide> it "can handle case insensitive" do <del> node = Arel::Nodes::NotRegexp.new(@table[:name], Nodes.build_quoted('foo.*'), false) <add> node = @table[:name].does_not_match_regexp('foo.*', false) <add> node.case_sensitive.must_equal(false) <ide> compile(node).must_be_like %{ <ide> "users"."name" !~* 'foo.*' <ide> } <ide> end <ide> <ide> it 'can handle subqueries' do <del> subquery = @table.project(:id).where(Arel::Nodes::NotRegexp.new(@table[:name], Nodes.build_quoted('foo.*'))) <add> subquery = @table.project(:id).where(@table[:name].does_not_match_regexp('foo.*')) <ide> node = @attr.in subquery <ide> compile(node).must_be_like %{ <ide> "users"."id" IN (SELECT id FROM "users" WHERE "users"."name" !~ 'foo.*')
2
Javascript
Javascript
add comments to empty catch statements
78a2cd862426fbc137f9286b7bcedf415f960ef0
<ide><path>lib/events.js <ide> function enhanceStackTrace(err, own) { <ide> const { name } = this.constructor; <ide> if (name !== 'EventEmitter') <ide> ctorInfo = ` on ${name} instance`; <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> const sep = `\nEmitted 'error' event${ctorInfo} at:\n`; <ide> <ide> const errStack = ArrayPrototypeSlice( <ide> EventEmitter.prototype.emit = function emit(type, ...args) { <ide> value: FunctionPrototypeBind(enhanceStackTrace, this, er, capture), <ide> configurable: true <ide> }); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> <ide> // Note: The comments on the `throw` lines are intentional, they show <ide> // up in Node's output if this results in an unhandled exception. <ide><path>lib/fs.js <ide> function symlink(target, path, type_, callback_) { <ide> // errors consistent between platforms if invalid path is <ide> // provided. <ide> absoluteTarget = pathModule.resolve(path, '..', target); <del> } catch { } <add> } catch { <add> // Continue regardless of error. <add> } <ide> if (absoluteTarget !== undefined) { <ide> stat(absoluteTarget, (err, stat) => { <ide> const resolvedType = !err && stat.isDirectory() ? 'dir' : 'file'; <ide><path>lib/internal/bootstrap/pre_execution.js <ide> function patchProcessObject(expandArgv1) { <ide> const path = require('path'); <ide> try { <ide> process.argv[1] = path.resolve(process.argv[1]); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> } <ide> <ide> // TODO(joyeecheung): most of these should be deprecated and removed, <ide><path>lib/internal/error_serdes.js <ide> function TryGetAllProperties(object, target = object) { <ide> if (getter && key !== '__proto__') { <ide> try { <ide> descriptor.value = FunctionPrototypeCall(getter, target); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> } <ide> if ('value' in descriptor && typeof descriptor.value !== 'function') { <ide> delete descriptor.get; <ide> function serializeError(error) { <ide> } <ide> } <ide> } <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> try { <ide> const serialized = serialize(error); <ide> return Buffer.concat([Buffer.from([kSerializedObject]), serialized]); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> return Buffer.concat([Buffer.from([kInspectedError]), <ide> Buffer.from(inspect(error), 'utf8')]); <ide> } <ide><path>lib/internal/main/worker_thread.js <ide> function workerOnGlobalUncaughtException(error, fromPromise) { <ide> if (!handlerThrew) { <ide> process.emit('exit', process.exitCode); <ide> } <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> } <ide> <ide> let serialized; <ide> try { <ide> const { serializeError } = require('internal/error_serdes'); <ide> serialized = serializeError(error); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> debug(`[${threadId}] uncaught exception serialized = ${!!serialized}`); <ide> if (serialized) <ide> port.postMessage({ <ide><path>lib/internal/modules/cjs/loader.js <ide> Module._extensions['.js'] = function(module, filename) { <ide> let parentSource; <ide> try { <ide> parentSource = fs.readFileSync(parentPath, 'utf8'); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> if (parentSource) { <ide> const errLine = StringPrototypeSplit( <ide> StringPrototypeSlice(err.stack, StringPrototypeIndexOf( <ide><path>lib/internal/modules/esm/module_job.js <ide> class ModuleJob { <ide> // care about CommonJS for the purposes of this error message. <ide> ({ format } = <ide> await this.loader.load(childFileURL)); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> <ide> if (format === 'commonjs') { <ide> const importStatement = splitStack[1]; <ide><path>lib/internal/modules/esm/resolve.js <ide> function resolvePackageTargetString( <ide> try { <ide> new URL(target); <ide> isURL = true; <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> if (!isURL) { <ide> const exportTarget = pattern ? <ide> RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : <ide><path>lib/internal/modules/esm/translators.js <ide> translators.set('commonjs', async function commonjsStrategy(url, source, <ide> let value; <ide> try { <ide> value = exports[exportName]; <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> this.setExport(exportName, value); <ide> } <ide> this.setExport('default', exports); <ide> function cjsPreparseModuleExports(filename) { <ide> let source; <ide> try { <ide> source = readFileSync(filename, 'utf8'); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> <ide> let exports, reexports; <ide> try { <ide><path>lib/internal/policy/manifest.js <ide> function canonicalizeSpecifier(specifier, base) { <ide> return resolve(specifier, base).href; <ide> } <ide> return resolve(specifier).href; <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> return specifier; <ide> } <ide> <ide><path>lib/internal/process/execution.js <ide> function createOnGlobalUncaughtException() { <ide> null, <ide> er ?? {}); <ide> } <del> } catch {} // Ignore the exception. Diagnostic reporting is unavailable. <add> } catch { <add> // Ignore the exception. Diagnostic reporting is unavailable. <add> } <ide> } <ide> <ide> const type = fromPromise ? 'unhandledRejection' : 'uncaughtException'; <ide><path>lib/internal/process/warning.js <ide> function writeToFile(message) { <ide> process.on('exit', () => { <ide> try { <ide> fs.closeSync(fd); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> }); <ide> } <ide> fs.appendFile(fd, `${message}\n`, (err) => { <ide><path>lib/internal/util/inspect.js <ide> function getUserOptions(ctx, isCrossContext) { <ide> let stylized; <ide> try { <ide> stylized = `${ctx.stylize(value, flavour)}`; <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> <ide> if (typeof stylized !== 'string') return value; <ide> // `stylized` is a string as it should be, which is safe to pass along. <ide><path>lib/repl.js <ide> function REPLServer(prompt, <ide> // to the parent of `process.cwd()`. <ide> parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href; <ide> } catch { <add> // Continue regardless of error. <ide> } <ide> <ide> // Remove all "await"s and attempt running the script <ide> function REPLServer(prompt, <ide> // to the parent of `process.cwd()`. <ide> parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href; <ide> } catch { <add> // Continue regardless of error. <ide> } <ide> while (true) { <ide> try { <ide> REPLServer.prototype.complete = function() { <ide> function gracefulReaddir(...args) { <ide> try { <ide> return ReflectApply(fs.readdirSync, null, args); <del> } catch {} <add> } catch { <add> // Continue regardless of error. <add> } <ide> } <ide> <ide> function completeFSFunctions(line) {
14
Ruby
Ruby
remove unused parameter
70312d224a812c4e4b25fdb172284a82bedd0a64
<ide><path>actionpack/lib/action_dispatch/testing/integration.rb <ide> def reset! <ide> # By default, a single session is automatically created for you, but you <ide> # can use this method to open multiple sessions that ought to be tested <ide> # simultaneously. <del> def open_session(app = nil) <add> def open_session <ide> dup.tap do |session| <ide> yield session if block_given? <ide> end
1
Javascript
Javascript
add documentation for navigationstateutils
3a8c302ae815be0a9b1a6d14860ff8186d43fc07
<ide><path>Libraries/NavigationExperimental/NavigationStateUtils.js <ide> const invariant = require('fbjs/lib/invariant'); <ide> <ide> import type { <ide> NavigationRoute, <del> NavigationState, <add> NavigationState <ide> } from 'NavigationTypeDefinition'; <ide> <ide> /** <ide> * Utilities to perform atomic operation with navigate state and routes. <add> * <add> * ```javascript <add> * const state1 = {key: 'page 1'}; <add> * const state2 = NavigationStateUtils.push(state1, {key: 'page 2'}); <add> * ``` <ide> */ <add>const NavigationStateUtils = { <ide> <del>/** <del> * Gets a route by key <del> */ <del>function get(state: NavigationState, key: string): ?NavigationRoute { <del> return state.routes.find(route => route.key === key) || null; <del>} <del> <del>/** <del> * Returns the first index at which a given route's key can be found in the <del> * routes of the navigation state, or -1 if it is not present. <del> */ <del>function indexOf(state: NavigationState, key: string): number { <del> return state.routes.map(route => route.key).indexOf(key); <del>} <del> <del>/** <del> * Returns `true` at which a given route's key can be found in the <del> * routes of the navigation state. <del> */ <del>function has(state: NavigationState, key: string): boolean { <del> return !!state.routes.some(route => route.key === key); <del>} <del> <del>/** <del> * Pushes a new route into the navigation state. <del> * Note that this moves the index to the positon to where the last route in the <del> * stack is at. <del> */ <del>function push(state: NavigationState, route: NavigationRoute): NavigationState { <del> invariant( <del> indexOf(state, route.key) === -1, <del> 'should not push route with duplicated key %s', <del> route.key, <del> ); <del> <del> const routes = [ <del> ...state.routes, <del> route, <del> ]; <del> <del> return { <del> ...state, <del> index: routes.length - 1, <del> routes, <del> }; <del>} <del> <del>/** <del> * Pops out a route from the navigation state. <del> * Note that this moves the index to the positon to where the last route in the <del> * stack is at. <del> */ <del>function pop(state: NavigationState): NavigationState { <del> if (state.index <= 0) { <del> // [Note]: Over-popping does not throw error. Instead, it will be no-op. <del> return state; <del> } <del> const routes = state.routes.slice(0, -1); <del> return { <del> ...state, <del> index: routes.length - 1, <del> routes, <del> }; <del>} <del> <del>/** <del> * Sets the focused route of the navigation state by index. <del> */ <del>function jumpToIndex(state: NavigationState, index: number): NavigationState { <del> if (index === state.index) { <del> return state; <del> } <del> <del> invariant(!!state.routes[index], 'invalid index %s to jump to', index); <del> <del> return { <del> ...state, <del> index, <del> }; <del>} <del> <del>/** <del> * Sets the focused route of the navigation state by key. <del> */ <del>function jumpTo(state: NavigationState, key: string): NavigationState { <del> const index = indexOf(state, key); <del> return jumpToIndex(state, index); <del>} <del> <del>/** <del> * Sets the focused route to the previous route. <del> */ <del>function back(state: NavigationState): NavigationState { <del> const index = state.index - 1; <del> const route = state.routes[index]; <del> return route ? jumpToIndex(state, index) : state; <del>} <del> <del>/** <del> * Sets the focused route to the next route. <del> */ <del>function forward(state: NavigationState): NavigationState { <del> const index = state.index + 1; <del> const route = state.routes[index]; <del> return route ? jumpToIndex(state, index) : state; <del>} <del> <del>/** <del> * Replace a route by a key. <del> * Note that this moves the index to the positon to where the new route in the <del> * stack is at. <del> */ <del>function replaceAt( <del> state: NavigationState, <del> key: string, <del> route: NavigationRoute, <del>): NavigationState { <del> const index = indexOf(state, key); <del> return replaceAtIndex(state, index, route); <del>} <del> <del>/** <del> * Replace a route by a index. <del> * Note that this moves the index to the positon to where the new route in the <del> * stack is at. <del> */ <del>function replaceAtIndex( <del> state: NavigationState, <del> index: number, <del> route: NavigationRoute, <del>): NavigationState { <del> invariant( <del> !!state.routes[index], <del> 'invalid index %s for replacing route %s', <del> index, <del> route.key, <del> ); <del> <del> if (state.routes[index] === route) { <del> return state; <del> } <del> <del> const routes = state.routes.slice(); <del> routes[index] = route; <del> <del> return { <del> ...state, <del> index, <del> routes, <del> }; <del>} <add> /** <add> * Gets a route by key. If the route isn't found, returns `null`. <add> */ <add> get(state: NavigationState, key: string): ?NavigationRoute { <add> return state.routes.find(route => route.key === key) || null; <add> }, <add> <add> /** <add> * Returns the first index at which a given route's key can be found in the <add> * routes of the navigation state, or -1 if it is not present. <add> */ <add> indexOf(state: NavigationState, key: string): number { <add> return state.routes.map(route => route.key).indexOf(key); <add> }, <add> <add> /** <add> * Returns `true` at which a given route's key can be found in the <add> * routes of the navigation state. <add> */ <add> has(state: NavigationState, key: string): boolean { <add> return !!state.routes.some(route => route.key === key); <add> }, <add> <add> /** <add> * Pushes a new route into the navigation state. <add> * Note that this moves the index to the positon to where the last route in the <add> * stack is at. <add> */ <add> push(state: NavigationState, route: NavigationRoute): NavigationState { <add> invariant( <add> NavigationStateUtils.indexOf(state, route.key) === -1, <add> 'should not push route with duplicated key %s', <add> route.key, <add> ); <add> <add> const routes = state.routes.slice(); <add> routes.push(route); <add> <add> return { <add> ...state, <add> index: routes.length - 1, <add> routes, <add> }; <add> }, <add> <add> /** <add> * Pops out a route from the navigation state. <add> * Note that this moves the index to the positon to where the last route in the <add> * stack is at. <add> */ <add> pop(state: NavigationState): NavigationState { <add> if (state.index <= 0) { <add> // [Note]: Over-popping does not throw error. Instead, it will be no-op. <add> return state; <add> } <add> const routes = state.routes.slice(0, -1); <add> return { <add> ...state, <add> index: routes.length - 1, <add> routes, <add> }; <add> }, <add> <add> /** <add> * Sets the focused route of the navigation state by index. <add> */ <add> jumpToIndex(state: NavigationState, index: number): NavigationState { <add> if (index === state.index) { <add> return state; <add> } <ide> <del>/** <del> * Resets all routes. <del> * Note that this moves the index to the positon to where the last route in the <del> * stack is at if the param `index` isn't provided. <del> */ <del>function reset( <del> state: NavigationState, <del> routes: Array<NavigationRoute>, <del> index?: number, <del>): NavigationState { <del> invariant( <del> routes.length && Array.isArray(routes), <del> 'invalid routes to replace', <del> ); <del> <del> const nextIndex: number = index === undefined ? routes.length - 1 : index; <del> <del> if (state.routes.length === routes.length && state.index === nextIndex) { <del> const compare = (route, ii) => routes[ii] === route; <del> if (state.routes.every(compare)) { <add> invariant(!!state.routes[index], 'invalid index %s to jump to', index); <add> <add> return { <add> ...state, <add> index, <add> }; <add> }, <add> <add> /** <add> * Sets the focused route of the navigation state by key. <add> */ <add> jumpTo(state: NavigationState, key: string): NavigationState { <add> const index = NavigationStateUtils.indexOf(state, key); <add> return NavigationStateUtils.jumpToIndex(state, index); <add> }, <add> <add> /** <add> * Sets the focused route to the previous route. <add> */ <add> back(state: NavigationState): NavigationState { <add> const index = state.index - 1; <add> const route = state.routes[index]; <add> return route ? NavigationStateUtils.jumpToIndex(state, index) : state; <add> }, <add> <add> /** <add> * Sets the focused route to the next route. <add> */ <add> forward(state: NavigationState): NavigationState { <add> const index = state.index + 1; <add> const route = state.routes[index]; <add> return route ? NavigationStateUtils.jumpToIndex(state, index) : state; <add> }, <add> <add> /** <add> * Replace a route by a key. <add> * Note that this moves the index to the positon to where the new route in the <add> * stack is at. <add> */ <add> replaceAt( <add> state: NavigationState, <add> key: string, <add> route: NavigationRoute, <add> ): NavigationState { <add> const index = NavigationStateUtils.indexOf(state, key); <add> return NavigationStateUtils.replaceAtIndex(state, index, route); <add> }, <add> <add> /** <add> * Replace a route by a index. <add> * Note that this moves the index to the positon to where the new route in the <add> * stack is at. <add> */ <add> replaceAtIndex( <add> state: NavigationState, <add> index: number, <add> route: NavigationRoute, <add> ): NavigationState { <add> invariant( <add> !!state.routes[index], <add> 'invalid index %s for replacing route %s', <add> index, <add> route.key, <add> ); <add> <add> if (state.routes[index] === route) { <ide> return state; <ide> } <del> } <ide> <del> invariant(!!routes[nextIndex], 'invalid index %s to reset', nextIndex); <add> const routes = state.routes.slice(); <add> routes[index] = route; <add> <add> return { <add> ...state, <add> index, <add> routes, <add> }; <add> }, <add> <add> /** <add> * Resets all routes. <add> * Note that this moves the index to the positon to where the last route in the <add> * stack is at if the param `index` isn't provided. <add> */ <add> reset( <add> state: NavigationState, <add> routes: Array<NavigationRoute>, <add> index?: number, <add> ): NavigationState { <add> invariant( <add> routes.length && Array.isArray(routes), <add> 'invalid routes to replace', <add> ); <add> <add> const nextIndex: number = index === undefined ? routes.length - 1 : index; <add> <add> if (state.routes.length === routes.length && state.index === nextIndex) { <add> const compare = (route, ii) => routes[ii] === route; <add> if (state.routes.every(compare)) { <add> return state; <add> } <add> } <ide> <del> return { <del> ...state, <del> index: nextIndex, <del> routes, <del> }; <del>} <add> invariant(!!routes[nextIndex], 'invalid index %s to reset', nextIndex); <ide> <del>const NavigationStateUtils = { <del> back, <del> forward, <del> get: get, <del> has, <del> indexOf, <del> jumpTo, <del> jumpToIndex, <del> pop, <del> push, <del> replaceAt, <del> replaceAtIndex, <del> reset, <add> return { <add> ...state, <add> index: nextIndex, <add> routes, <add> }; <add> }, <ide> }; <ide> <ide> module.exports = NavigationStateUtils;
1
Go
Go
fix the daemon panic on consul server restart
4df4ba70caf2de3b68158d9e6cb9a6f4ea203e0f
<ide><path>libnetwork/datastore/datastore.go <ide> func (ds *datastore) Watch(kvObject KVObject, stopCh <-chan struct{}) (<-chan KV <ide> close(sCh) <ide> return <ide> case kvPair := <-kvpCh: <add> // If the backend KV store gets reset libkv's go routine <add> // for the watch can exit resulting in a nil value in <add> // channel. <add> if kvPair == nil { <add> close(sCh) <add> return <add> } <ide> dstO := ctor.New() <ide> <ide> if err := dstO.SetValue(kvPair.Value); err != nil {
1
Javascript
Javascript
add tests for view cleanup/destruction
9228bb85f7c2237b4699f1c9e810426d29ea5188
<ide><path>packages/ember-glimmer/lib/syntax/curly-component.js <ide> class CurlyComponentManager { <ide> <ide> aliasIdToElementId(args, props); <ide> <add> props.parentView = parentView; <ide> props.renderer = parentView.renderer; <ide> props[HAS_BLOCK] = hasBlock; <ide> <ide><path>packages/ember-glimmer/tests/integration/components/dynamic-components-test.js <ide> moduleFor('Components test: dynamic components', class extends RenderingTest { <ide> <ide> ['@test component helper destroys underlying component when it is swapped out'](assert) { <ide> let destroyed = { 'foo-bar': 0, 'foo-bar-baz': 0 }; <add> let testContext = this; <ide> <ide> this.registerComponent('foo-bar', { <ide> template: 'hello from foo-bar', <ide> ComponentClass: Component.extend({ <add> willDestroyElement() { <add> assert.equal(testContext.$(`#${this.elementId}`).length, 1, 'element is still attached to the document'); <add> }, <add> <ide> willDestroy() { <ide> this._super(); <ide> destroyed['foo-bar']++; <ide><path>packages/ember-glimmer/tests/integration/components/life-cycle-test.js <ide> class LifeCycleHooksTest extends RenderingTest { <ide> super(); <ide> this.hooks = []; <ide> this.components = {}; <add> this.teardownAssertions = []; <ide> } <ide> <ide> teardown() { <del> super(); <del> this.assertHooks( <del> 'destroy', <del> ['the-top', 'willDestroyElement'], <del> ['the-middle', 'willDestroyElement'], <del> ['the-bottom', 'willDestroyElement'] <del> ); <add> super.teardown(); <add> <add> for (let i = 0; i < this.teardownAssertions.length; i++) { <add> this.teardownAssertions[i](); <add> } <ide> } <ide> <ide> /* abstract */ <ide> class LifeCycleHooksTest extends RenderingTest { <ide> this.hooks.push(hook(name, hookName, args)); <ide> }; <ide> <add> let assertParentView = (hookName, instance) => { <add> if (!instance.parentView) { <add> this.assert.ok(false, `parentView should be present in ${hookName}`); <add> } <add> }; <add> <add> let assertElement = (hookName, instance) => { <add> if (instance.tagName === '') { return; } <add> <add> if (!instance.element) { <add> this.assert.ok(false, `element property should be present on ${instance} during ${hookName}`); <add> } <add> <add> let inDOM = this.$(`#${instance.elementId}`)[0]; <add> if (!inDOM) { <add> this.assert.ok(false, `element for ${instance} should be in the DOM during ${hookName}`); <add> } <add> }; <add> <add> let assertNoElement = (hookName, instance) => { <add> if (instance.element) { <add> this.assert.ok(false, `element should not be present in ${hookName}`); <add> } <add> }; <add> <ide> let ComponentClass = this.ComponentClass.extend({ <ide> init() { <ide> expectDeprecation(() => { this._super(...arguments); }, <ide> /didInitAttrs called/); <ide> <ide> pushHook('init'); <ide> pushComponent(this); <add> assertParentView('init', this); <add> assertNoElement('init', this); <ide> }, <ide> <ide> didInitAttrs(options) { <ide> pushHook('didInitAttrs', options); <add> assertParentView('didInitAttrs', this); <add> assertNoElement('didInitAttrs', this); <ide> }, <ide> <ide> didUpdateAttrs(options) { <ide> pushHook('didUpdateAttrs', options); <add> assertParentView('didUpdateAttrs', this); <ide> }, <ide> <ide> willUpdate(options) { <ide> pushHook('willUpdate', options); <add> assertParentView('willUpdate', this); <ide> }, <ide> <ide> didReceiveAttrs(options) { <ide> pushHook('didReceiveAttrs', options); <add> assertParentView('didReceiveAttrs', this); <ide> }, <ide> <ide> willRender() { <ide> pushHook('willRender'); <add> assertParentView('willRender', this); <ide> }, <ide> <ide> didRender() { <ide> pushHook('didRender'); <add> assertParentView('didRender', this); <add> assertElement('didRender', this); <ide> }, <ide> <ide> didInsertElement() { <ide> pushHook('didInsertElement'); <add> assertParentView('didInsertElement', this); <add> assertElement('didInsertElement', this); <ide> }, <ide> <ide> didUpdate(options) { <ide> pushHook('didUpdate', options); <add> assertParentView('didUpdate', this); <add> assertElement('didUpdate', this); <ide> }, <ide> <ide> willDestroyElement() { <ide> pushHook('willDestroyElement'); <add> assertParentView('willDestroyElement', this); <add> assertElement('willDestroyElement', this); <ide> } <ide> }); <ide> <ide> class LifeCycleHooksTest extends RenderingTest { <ide> ['the-top', 'didRender'] <ide> <ide> ); <add> <add> this.teardownAssertions.push(() => { <add> this.assertHooks( <add> 'destroy', <add> ['the-top', 'willDestroyElement'], <add> ['the-middle', 'willDestroyElement'], <add> ['the-bottom', 'willDestroyElement'] <add> ); <add> }); <ide> } <ide> <ide> ['@test passing values through attrs causes lifecycle hooks to fire if the attribute values have changed']() { <ide> class LifeCycleHooksTest extends RenderingTest { <ide> } else { <ide> this.assertHooks('after no-op rernder (root)'); <ide> } <add> <add> this.teardownAssertions.push(() => { <add> this.assertHooks( <add> 'destroy', <add> ['the-top', 'willDestroyElement'], <add> ['the-middle', 'willDestroyElement'], <add> ['the-bottom', 'willDestroyElement'] <add> ); <add> }); <ide> } <ide> <add> ['@test components rendered from `{{each}}` have correct life-cycle hooks to be called']() { <add> let { invoke } = this.boundHelpers; <add> <add> this.registerComponent('an-item', { template: strip` <add> <div>Item: {{count}}</div> <add> ` }); <add> <add> this.registerComponent('no-items', { template: strip` <add> <div>Nothing to see here</div> <add> ` }); <add> <add> this.render(strip` <add> {{#each items as |item|}} <add> ${invoke('an-item', { count: expr('item') })} <add> {{else}} <add> ${invoke('no-items')} <add> {{/each}} <add> `, { <add> items: [1, 2, 3, 4, 5] <add> }); <add> <add> this.assertText('Item: 1Item: 2Item: 3Item: 4Item: 5'); <add> <add> let initialHooks = (count) => { <add> return [ <add> ['an-item', 'init'], <add> ['an-item', 'didInitAttrs', { attrs: { count } }], <add> ['an-item', 'didReceiveAttrs', { newAttrs: { count } }], <add> ['an-item', 'willRender'] <add> ]; <add> }; <add> <add> let initialAfterRenderHooks = (count) => { <add> return [ <add> ['an-item', 'didInsertElement'], <add> ['an-item', 'didRender'] <add> ]; <add> }; <add> <add> this.assertHooks( <add> <add> 'after initial render', <add> <add> // Sync hooks <add> ...initialHooks(1), <add> ...initialHooks(2), <add> ...initialHooks(3), <add> ...initialHooks(4), <add> ...initialHooks(5), <add> <add> // Async hooks <add> ...initialAfterRenderHooks(5), <add> ...initialAfterRenderHooks(4), <add> ...initialAfterRenderHooks(3), <add> ...initialAfterRenderHooks(2), <add> ...initialAfterRenderHooks(1) <add> ); <add> <add> this.runTask(() => set(this.context, 'items', [])); <add> <add> this.assertText('Nothing to see here'); <add> <add> this.assertHooks( <add> 'reset to empty array', <add> <add> ['an-item', 'willDestroyElement'], <add> ['an-item', 'willDestroyElement'], <add> ['an-item', 'willDestroyElement'], <add> ['an-item', 'willDestroyElement'], <add> ['an-item', 'willDestroyElement'], <add> <add> ['no-items', 'init'], <add> ['no-items', 'didInitAttrs', { attrs: { } }], <add> ['no-items', 'didReceiveAttrs', { newAttrs: { } }], <add> ['no-items', 'willRender'], <add> <add> ['no-items', 'didInsertElement'], <add> ['no-items', 'didRender'] <add> ); <add> <add> this.teardownAssertions.push(() => { <add> this.assertHooks( <add> 'destroy', <add> <add> ['no-items', 'willDestroyElement'] <add> ); <add> }); <add> } <ide> } <ide> <ide> moduleFor('Components test: lifecycle hooks (curly components)', class extends LifeCycleHooksTest { <ide><path>packages/ember-htmlbars/lib/morphs/morph.js <ide> proto.addDestruction = function(toDestroy) { <ide> }; <ide> <ide> proto.cleanup = function() { <del> let view = this.emberView; <del> <del> if (view) { <del> let parentView = view.parentView; <del> if (parentView && view.ownerView._destroyingSubtreeForView === parentView) { <del> parentView.removeChild(view); <del> } <del> } <del> <ide> let toDestroy = this.emberToDestroy; <ide> <ide> if (toDestroy) {
4
PHP
PHP
add a clear of the tableregistry to teardown
61d5902d77afbd6491eced73840a4f09cef9d2dc
<ide><path>src/TestSuite/TestCase.php <ide> public function tearDown() <ide> Configure::clear(); <ide> Configure::write($this->_configure); <ide> } <add> TableRegistry::clear(); <ide> } <ide> <ide> /**
1
Go
Go
fix .ensure-emptyfs on non-x86_64 architectures
1f59bc8c03df18686b93a0cd619cf2c55cbcf421
<ide><path>distribution/pull_v2.go <ide> func (p *v2Puller) pullManifestList(ctx context.Context, ref reference.Named, mf <ide> // TODO(aaronl): The manifest list spec supports optional <ide> // "features" and "variant" fields. These are not yet used. <ide> // Once they are, their values should be interpreted here. <del> // TODO(jstarks): Once os.version and os.features are present, <del> // pass these, too. <del> if image.ValidateOSCompatibility(manifestDescriptor.Platform.OS, manifestDescriptor.Platform.Architecture, "", nil) == nil { <add> if manifestDescriptor.Platform.Architecture == runtime.GOARCH && manifestDescriptor.Platform.OS == runtime.GOOS { <ide> manifestDigest = manifestDescriptor.Digest <ide> break <ide> } <ide><path>image/compat.go <del>package image <del> <del>import ( <del> "fmt" <del> "runtime" <del> "strings" <del>) <del> <del>func archMatches(arch string) bool { <del> // Special case x86_64 as an alias for amd64 <del> return arch == runtime.GOARCH || (arch == "x86_64" && runtime.GOARCH == "amd64") <del>} <del> <del>// ValidateOSCompatibility validates that an image with the given properties can run on this machine. <del>func ValidateOSCompatibility(os string, arch string, osVersion string, osFeatures []string) error { <del> if os != "" && os != runtime.GOOS { <del> return fmt.Errorf("image is for OS %s, expected %s", os, runtime.GOOS) <del> } <del> if arch != "" && !archMatches(arch) { <del> return fmt.Errorf("image is for architecture %s, expected %s", arch, runtime.GOARCH) <del> } <del> if osVersion != "" { <del> thisOSVersion := getOSVersion() <del> if thisOSVersion != osVersion { <del> return fmt.Errorf("image is for OS version '%s', expected '%s'", osVersion, thisOSVersion) <del> } <del> } <del> var missing []string <del> for _, f := range osFeatures { <del> if !hasOSFeature(f) { <del> missing = append(missing, f) <del> } <del> } <del> if len(missing) > 0 { <del> return fmt.Errorf("image requires missing OS features: %s", strings.Join(missing, ", ")) <del> } <del> return nil <del>} <ide><path>image/compat_test.go <del>package image <del> <del>import ( <del> "runtime" <del> "testing" <del>) <del> <del>func TestValidateOSCompatibility(t *testing.T) { <del> err := ValidateOSCompatibility(runtime.GOOS, runtime.GOARCH, getOSVersion(), nil) <del> if err != nil { <del> t.Error(err) <del> } <del> <del> err = ValidateOSCompatibility("DOS", runtime.GOARCH, getOSVersion(), nil) <del> if err == nil { <del> t.Error("expected OS compat error") <del> } <del> <del> err = ValidateOSCompatibility(runtime.GOOS, "pdp-11", getOSVersion(), nil) <del> if err == nil { <del> t.Error("expected architecture compat error") <del> } <del> <del> err = ValidateOSCompatibility(runtime.GOOS, runtime.GOARCH, "98 SE", nil) <del> if err == nil { <del> t.Error("expected OS version compat error") <del> } <del>} <ide><path>image/store.go <ide> func (is *store) Create(config []byte) (ID, error) { <ide> return "", errors.New("too many non-empty layers in History section") <ide> } <ide> <del> err = ValidateOSCompatibility(img.OS, img.Architecture, img.OSVersion, img.OSFeatures) <del> if err != nil { <del> return "", err <del> } <del> <ide> dgst, err := is.fs.Set(config) <ide> if err != nil { <ide> return "", err
4
Javascript
Javascript
remove unnecessary comparison;
4b7c562bbaf5a6d10ed9b970a13c1c5f9daefa59
<ide><path>src/renderers/dom/shared/CSSPropertyOperations.js <ide> var CSSPropertyOperations = { <ide> } <ide> if (isCustomProperty) { <ide> style.setProperty(styleName, styleValue); <del> } else if (styleValue) { <del> style[styleName] = styleValue; <ide> } else { <del> style[styleName] = ''; <add> style[styleName] = styleValue; <ide> } <ide> } <ide> },
1
Javascript
Javascript
add "code" property to event object
899c56f6ada26821e8af12d9f35fa039100e838e
<ide><path>src/event.js <ide> jQuery.each( { <ide> shiftKey: true, <ide> view: true, <ide> "char": true, <add> code: true, <ide> charCode: true, <ide> key: true, <ide> keyCode: true,
1
Text
Text
add a link to hot reloading with time travel talk
7f0eb594a43966e7e054dc3941f171613f493b82
<ide><path>README.md <ide> Atomic Flux with hot reloading. <ide> <ide> - [Why another Flux framework?](#why-another-flux-framework) <ide> - [Philosophy & Design Goals](#philosophy--design-goals) <add>- [The Talk](#the-talk) <ide> - [Demo](#demo) <ide> - [Examples](#examples) <ide> - [Simple Examples](#simple-examples) <ide> Read **[The Evolution of Flux Frameworks](https://medium.com/@dan_abramov/the-ev <ide> * The API surface area is minimal. <ide> * Have I mentioned hot reloading yet? <ide> <add>## The Talk <add> <add>Redux was demoed together with **[React Hot Loader](https://github.com/gaearon/react-hot-loader)** at React Europe. <add>Watch **[Dan Abramov's talk on Hot Reloading with Time Travel](https://www.youtube.com/watch?v=xsSnOQynTHs).** <add> <ide> ## Demo <ide> <ide> <img src='https://s3.amazonaws.com/f.cl.ly/items/2Z2D3U260d2A311k2B0z/Screen%20Recording%202015-06-03%20at%2003.22%20pm.gif' width='500'>
1
Python
Python
set version to 2.2.0.dev0
08e8267a595aea045a2c8bd0eaa9ab16ffb03e12
<ide><path>spacy/about.py <ide> # fmt: off <ide> <ide> __title__ = "spacy" <del>__version__ = "2.1.8" <add>__version__ = "2.2.0.dev0" <ide> __summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython" <ide> __uri__ = "https://spacy.io" <ide> __author__ = "Explosion AI" <ide> __email__ = "contact@explosion.ai" <ide> __license__ = "MIT" <del>__release__ = True <add>__release__ = False <ide> <ide> __download_url__ = "https://github.com/explosion/spacy-models/releases/download" <ide> __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
1
Text
Text
add comments to markdown templates
dc27efccdd4424c4af15b0d4338c3428bd77bb10
<ide><path>.github/issue_template.md <ide> ### Steps to reproduce <del> <del>(Guidelines for creating a bug report are [available <del>here](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#creating-a-bug-report)) <add><!-- (Guidelines for creating a bug report are [available <add>here](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#creating-a-bug-report)) --> <ide> <ide> ### Expected behavior <del>Tell us what should happen <add><!-- Tell us what should happen --> <ide> <ide> ### Actual behavior <del>Tell us what happens instead <add><!-- Tell us what happens instead --> <ide> <ide> ### System configuration <ide> **Rails version**: <ide><path>.github/pull_request_template.md <ide> ### Summary <ide> <del>Provide a general description of the code changes in your pull <add><!-- Provide a general description of the code changes in your pull <ide> request... were there any bugs you had fixed? If so, mention them. If <ide> these bugs have open GitHub issues, be sure to tag them here as well, <del>to keep the conversation linked together. <add>to keep the conversation linked together. --> <ide> <ide> ### Other Information <ide> <del>If there's anything else that's important and relevant to your pull <add><!-- If there's anything else that's important and relevant to your pull <ide> request, mention that information here. This could include <ide> benchmarks, or other information. <ide> <ide> Finally, if your pull request affects documentation or any non-code <ide> changes, guidelines for those changes are [available <ide> here](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#contributing-to-the-rails-documentation) <ide> <del>Thanks for contributing to Rails! <add>Thanks for contributing to Rails! -->
2
PHP
PHP
remove unnecessary in foreach
e5255cd7b57c5e5d3fb04d5512bcc9ce2c4401cf
<ide><path>src/Illuminate/Support/Collection.php <ide> public function every($step, $offset = 0) <ide> <ide> $position = 0; <ide> <del> foreach ($this->items as $key => $item) { <add> foreach ($this->items as $item) { <ide> if ($position % $step === $offset) { <ide> $new[] = $item; <ide> }
1
Mixed
Go
add isolation to info
c4e169727474f24cb0eddea15b94aaa2bfbb3281
<ide><path>api/types/types.go <ide> type Info struct { <ide> // running when the daemon is shutdown or upon daemon start if <ide> // running containers are detected <ide> LiveRestoreEnabled bool <add> Isolation container.Isolation <ide> } <ide> <ide> // PluginsInfo is a temp struct holding Plugins name <ide><path>cli/command/system/info.go <ide> func prettyPrintInfo(dockerCli *command.DockerCli, info types.Info) error { <ide> fmt.Fprintf(dockerCli.Out(), "\n") <ide> } <ide> <add> // Isolation only has meaning on a Windows daemon. <add> if info.OSType == "windows" { <add> fmt.Fprintf(dockerCli.Out(), "Default Isolation: %v\n", info.Isolation) <add> } <add> <ide> ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Kernel Version: %s\n", info.KernelVersion) <ide> ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Operating System: %s\n", info.OperatingSystem) <ide> ioutils.FprintfIfNotEmpty(dockerCli.Out(), "OSType: %s\n", info.OSType) <ide><path>daemon/info.go <ide> func (daemon *Daemon) SystemInfo() (*types.Info, error) { <ide> NoProxy: sockets.GetProxyEnv("no_proxy"), <ide> SecurityOptions: securityOptions, <ide> LiveRestoreEnabled: daemon.configStore.LiveRestoreEnabled, <add> Isolation: daemon.defaultIsolation, <ide> } <ide> <ide> // TODO Windows. Refactor this more once sysinfo is refactored into <ide><path>docs/reference/api/docker_remote_api.md <ide> This section lists each version from latest to oldest. Each listing includes a <ide> <ide> [Docker Remote API v1.25](docker_remote_api_v1.25.md) documentation <ide> <add>* `GET /info` now returns `Isolation`. <ide> * `POST /containers/create` now takes `AutoRemove` in HostConfig, to enable auto-removal of the container on daemon side when the container's process exits. <ide> * `GET /containers/json` and `GET /containers/(id or name)/json` now return `"removing"` as a value for the `State.Status` field if the container is being removed. Previously, "exited" was returned as status. <ide> * `GET /containers/json` now accepts `removing` as a valid value for the `status` filter. <ide><path>docs/reference/api/docker_remote_api_v1.25.md <ide> Display system-wide information <ide> <ide> GET /info HTTP/1.1 <ide> <del>**Example response**: <add>**Example response (Linux)**: <ide> <ide> HTTP/1.1 200 OK <ide> Content-Type: application/json <ide> Display system-wide information <ide> "SystemTime": "2015-03-10T11:11:23.730591467-07:00" <ide> } <ide> <add> <add>**Example response (Windows)**: <add> <add> HTTP/1.1 200 OK <add> Content-Type: application/json <add> <add> { <add> "ID": "NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62", <add> "Containers": 1, <add> "ContainersRunning": 0, <add> "ContainersPaused": 0, <add> "ContainersStopped": 1, <add> "Images": 17, <add> "Driver": "windowsfilter", <add> "DriverStatus": [ <add> ["Windows", ""] <add> ], <add> "SystemStatus": null, <add> "Plugins": { <add> "Volume": ["local"], <add> "Network": ["nat", "null", "overlay"], <add> "Authorization": null <add> }, <add> "MemoryLimit": false, <add> "SwapLimit": false, <add> "KernelMemory": false, <add> "CpuCfsPeriod": false, <add> "CpuCfsQuota": false, <add> "CPUShares": false, <add> "CPUSet": false, <add> "IPv4Forwarding": true, <add> "BridgeNfIptables": true, <add> "BridgeNfIp6tables": true, <add> "Debug": false, <add> "NFd": -1, <add> "OomKillDisable": false, <add> "NGoroutines": 11, <add> "SystemTime": "2016-09-23T11:59:58.9843533-07:00", <add> "LoggingDriver": "json-file", <add> "CgroupDriver": "", <add> "NEventsListener": 0, <add> "KernelVersion": "10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)", <add> "OperatingSystem": "Windows Server 2016 Datacenter", <add> "OSType": "windows", <add> "Architecture": "x86_64", <add> "IndexServerAddress": "https://index.docker.io/v1/", <add> "RegistryConfig": { <add> "InsecureRegistryCIDRs": ["127.0.0.0/8"], <add> "IndexConfigs": { <add> "docker.io": { <add> "Name": "docker.io", <add> "Mirrors": null, <add> "Secure": true, <add> "Official": true <add> } <add> }, <add> "Mirrors": null <add> }, <add> "NCPU": 8, <add> "MemTotal": 4293828608, <add> "DockerRootDir": "C:\\control", <add> "HttpProxy": "", <add> "HttpsProxy": "", <add> "NoProxy": "", <add> "Name": "WIN-V0V70C0LU5P", <add> "Labels": null, <add> "ExperimentalBuild": false, <add> "ServerVersion": "1.13.0-dev", <add> "ClusterStore": "", <add> "ClusterAdvertise": "", <add> "SecurityOptions": null, <add> "Runtimes": null, <add> "DefaultRuntime": "", <add> "Swarm": { <add> "NodeID": "", <add> "NodeAddr": "", <add> "LocalNodeState": "inactive", <add> "ControlAvailable": false, <add> "Error": "", <add> "RemoteManagers": null, <add> "Nodes": 0, <add> "Managers": 0, <add> "Cluster": { <add> "ID": "", <add> "Version": {}, <add> "CreatedAt": "0001-01-01T00:00:00Z", <add> "UpdatedAt": "0001-01-01T00:00:00Z", <add> "Spec": { <add> "Orchestration": {}, <add> "Raft": { <add> "ElectionTick": 0, <add> "HeartbeatTick": 0 <add> }, <add> "Dispatcher": {}, <add> "CAConfig": {}, <add> "TaskDefaults": {} <add> } <add> } <add> }, <add> "LiveRestoreEnabled": false, <add> "Isolation": "process" <add> } <add> <ide> **Status codes**: <ide> <ide> - **200** – no error <ide><path>docs/reference/commandline/info.md <ide> You can also specify the output format: <ide> <ide> $ docker info --format '{{json .}}' <ide> {"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...} <add> <add>Here is a sample output for a daemon running on Windows Server 2016: <add> <add> E:\docker>docker info <add> Containers: 1 <add> Running: 0 <add> Paused: 0 <add> Stopped: 1 <add> Images: 17 <add> Server Version: 1.13.0-dev <add> Storage Driver: windowsfilter <add> Windows: <add> Logging Driver: json-file <add> Plugins: <add> Volume: local <add> Network: nat null overlay <add> Swarm: inactive <add> Default Isolation: process <add> Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937) <add> Operating System: Windows Server 2016 Datacenter <add> OSType: windows <add> Architecture: x86_64 <add> CPUs: 8 <add> Total Memory: 3.999 GiB <add> Name: WIN-V0V70C0LU5P <add> ID: NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62 <add> Docker Root Dir: C:\control <add> Debug Mode (client): false <add> Debug Mode (server): false <add> Registry: https://index.docker.io/v1/ <add> Insecure Registries: <add> 127.0.0.0/8 <add> Live Restore Enabled: false <ide>\ No newline at end of file <ide><path>integration-cli/docker_test_vars.go <ide> import ( <ide> "path/filepath" <ide> "strconv" <ide> <add> "github.com/docker/docker/api/types/container" <ide> "github.com/docker/docker/pkg/reexec" <ide> ) <ide> <ide> var ( <ide> // Environment variable WINDOWS_BASE_IMAGE can override this <ide> WindowsBaseImage = "windowsservercore" <ide> <add> // isolation is the isolation mode of the daemon under test <add> isolation container.Isolation <add> <ide> // daemonPid is the pid of the main test daemon <ide> daemonPid int <ide> ) <ide><path>integration-cli/docker_utils.go <ide> func init() { <ide> volumesConfigPath = strings.Replace(volumesConfigPath, `\`, `/`, -1) <ide> containerStoragePath = strings.Replace(containerStoragePath, `\`, `/`, -1) <ide> } <add> isolation = info.Isolation <ide> } <ide> <ide> func convertBasesize(basesizeBytes int64) (int64, error) {
8
Javascript
Javascript
add crypto check to test-tls-wrap-econnreset
7bdb5ca6207dbfc2ef9b253dd68588c3cf8b1cff
<ide><path>test/parallel/test-tls-wrap-econnreset-localaddress.js <ide> 'use strict'; <ide> <ide> const common = require('../common'); <add>if (!common.hasCrypto) { <add> common.skip('missing crypto'); <add> return; <add>} <ide> const assert = require('assert'); <ide> const net = require('net'); <ide> const tls = require('tls'); <ide><path>test/parallel/test-tls-wrap-econnreset-pipe.js <ide> 'use strict'; <ide> <ide> const common = require('../common'); <add>if (!common.hasCrypto) { <add> common.skip('missing crypto'); <add> return; <add>} <ide> const assert = require('assert'); <ide> const tls = require('tls'); <ide> const net = require('net'); <ide><path>test/parallel/test-tls-wrap-econnreset-socket.js <ide> 'use strict'; <ide> <ide> const common = require('../common'); <add>if (!common.hasCrypto) { <add> common.skip('missing crypto'); <add> return; <add>} <ide> const assert = require('assert'); <ide> const net = require('net'); <ide> const tls = require('tls'); <ide><path>test/parallel/test-tls-wrap-econnreset.js <ide> 'use strict'; <ide> <ide> const common = require('../common'); <add>if (!common.hasCrypto) { <add> common.skip('missing crypto'); <add> return; <add>} <ide> const assert = require('assert'); <ide> const net = require('net'); <ide> const tls = require('tls');
4
Java
Java
remove unused imports
73604160a227166ba0d107438c6a321c5ecfc718
<ide><path>src/main/java/io/reactivex/rxjava3/core/Completable.java <ide> import org.reactivestreams.*; <ide> <ide> import io.reactivex.rxjava3.annotations.*; <del>import io.reactivex.rxjava3.core.Observable; <ide> import io.reactivex.rxjava3.disposables.Disposable; <ide> import io.reactivex.rxjava3.exceptions.*; <ide> import io.reactivex.rxjava3.functions.*; <ide><path>src/main/java/io/reactivex/rxjava3/core/Maybe.java <ide> import org.reactivestreams.*; <ide> <ide> import io.reactivex.rxjava3.annotations.*; <del>import io.reactivex.rxjava3.core.Observable; <ide> import io.reactivex.rxjava3.disposables.Disposable; <ide> import io.reactivex.rxjava3.exceptions.*; <ide> import io.reactivex.rxjava3.functions.*;
2
Javascript
Javascript
add missing methods on texteditorelement
b54dbb58abcb41ec11c00c3fae2bc1db9db646fa
<ide><path>src/text-editor-element.js <ide> class TextEditorElement extends HTMLElement { <ide> getBaseCharacterWidth () { <ide> return this.getComponent().getBaseCharacterWidth() <ide> } <add> <ide> getMaxScrollTop () { <ide> return this.getComponent().getMaxScrollTop() <ide> } <ide> <add> getScrollHeight () { <add> return this.getComponent().getScrollHeight() <add> } <add> <add> getScrollWidth () { <add> return this.getComponent().getScrollWidth() <add> } <add> <add> getVerticalScrollbarWidth () { <add> return this.getComponent().getVerticalScrollbarWidth() <add> } <add> <add> getHorizontalScrollbarHeight () { <add> return this.getComponent().getHorizontalScrollbarHeight() <add> } <add> <ide> getScrollTop () { <ide> return this.getComponent().getScrollTop() <ide> } <ide> class TextEditorElement extends HTMLElement { <ide> component.scheduleUpdate() <ide> } <ide> <add> getScrollBottom () { <add> return this.getComponent().getScrollBottom() <add> } <add> <add> setScrollBottom (scrollBottom) { <add> return this.getComponent().setScrollBottom(scrollBottom) <add> } <add> <ide> getScrollLeft () { <ide> return this.getComponent().getScrollLeft() <ide> } <ide> class TextEditorElement extends HTMLElement { <ide> component.scheduleUpdate() <ide> } <ide> <add> getScrollRight () { <add> return this.getComponent().getScrollRight() <add> } <add> <add> setScrollRight (scrollRight) { <add> return this.getComponent().setScrollRight(scrollRight) <add> } <add> <add> // Essential: Scrolls the editor to the top. <add> scrollToTop () { <add> this.setScrollTop(0) <add> } <add> <add> // Essential: Scrolls the editor to the bottom. <add> scrollToBottom () { <add> this.setScrollTop(Infinity) <add> } <add> <ide> hasFocus () { <ide> return this.getComponent().focused <ide> }
1
Ruby
Ruby
allow configuration of actionmailer queue name
f5a131aaeaf0533e5f81461c2ad63474a865c19c
<ide><path>actionmailer/lib/action_mailer/base.rb <ide> module ActionMailer <ide> # <ide> # * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with <ide> # <tt>delivery_method :test</tt>. Most useful for unit and functional testing. <add> # <add> # * <tt>deliver_later_queue_name</tt> - The name of the queue used with <tt>deliver_later</tt> <ide> class Base < AbstractController::Base <ide> include DeliveryMethods <ide> include Previews <ide><path>actionmailer/lib/action_mailer/delivery_job.rb <ide> module ActionMailer <ide> # The <tt>ActionMailer::DeliveryJob</tt> class is used when you <ide> # want to send emails outside of the request-response cycle. <ide> class DeliveryJob < ActiveJob::Base # :nodoc: <del> queue_as :mailers <add> queue_as { ActionMailer::Base.deliver_later_queue_name } <ide> <ide> def perform(mailer, mail_method, delivery_method, *args) #:nodoc: <ide> mailer.constantize.public_send(mail_method, *args).send(delivery_method) <ide><path>actionmailer/lib/action_mailer/delivery_methods.rb <ide> module DeliveryMethods <ide> cattr_accessor :perform_deliveries <ide> self.perform_deliveries = true <ide> <add> cattr_accessor :deliver_later_queue_name <add> self.deliver_later_queue_name = :mailers <add> <ide> self.delivery_methods = {}.freeze <ide> self.delivery_method = :smtp <ide> <ide><path>actionmailer/test/message_delivery_test.rb <ide> class MessageDeliveryTest < ActiveSupport::TestCase <ide> setup do <ide> @previous_logger = ActiveJob::Base.logger <ide> @previous_delivery_method = ActionMailer::Base.delivery_method <add> @previous_deliver_later_queue_name = ActionMailer::Base.deliver_later_queue_name <add> ActionMailer::Base.deliver_later_queue_name = :test_queue <ide> ActionMailer::Base.delivery_method = :test <ide> ActiveJob::Base.logger = Logger.new(nil) <ide> @mail = DelayedMailer.test_message(1, 2, 3) <ide> class MessageDeliveryTest < ActiveSupport::TestCase <ide> teardown do <ide> ActiveJob::Base.logger = @previous_logger <ide> ActionMailer::Base.delivery_method = @previous_delivery_method <add> ActionMailer::Base.deliver_later_queue_name = @previous_deliver_later_queue_name <ide> end <ide> <ide> test 'should have a message' do <ide> def test_should_enqueue_and_run_correctly_in_activejob <ide> end <ide> end <ide> <add> test 'should enqueue the job on the correct queue' do <add> assert_performed_with(job: ActionMailer::DeliveryJob, args: ['DelayedMailer', 'test_message', 'deliver_now', 1, 2, 3], queue: "test_queue") do <add> @mail.deliver_later <add> end <add> end <add> <add> test 'can override the queue when enqueuing mail' do <add> assert_performed_with(job: ActionMailer::DeliveryJob, args: ['DelayedMailer', 'test_message', 'deliver_now', 1, 2, 3], queue: "another_queue") do <add> @mail.deliver_later(queue: :another_queue) <add> end <add> end <ide> end <ide><path>railties/test/application/configuration_test.rb <ide> def index <ide> assert_equal [::MyMailObserver, ::MyOtherMailObserver], ::Mail.send(:class_variable_get, "@@delivery_notification_observers") <ide> end <ide> <add> test "allows setting the queue name for the ActionMailer::DeliveryJob" do <add> add_to_config <<-RUBY <add> config.action_mailer.deliver_later_queue_name = 'test_default' <add> RUBY <add> <add> require "#{app_path}/config/environment" <add> require "mail" <add> <add> _ = ActionMailer::Base <add> <add> assert_equal 'test_default', ActionMailer::Base.send(:class_variable_get, "@@deliver_later_queue_name") <add> end <add> <ide> test "valid timezone is setup correctly" do <ide> add_to_config <<-RUBY <ide> config.root = "#{app_path}"
5
Python
Python
clarify documentation for json parsing
daf85d3725516a17e474b143d6d67b95140db285
<ide><path>flask/wrappers.py <ide> def blueprint(self): <ide> <ide> @property <ide> def json(self): <del> """If the mimetype is :mimetype:`application/json` this will contain the <add> """If self.is_json would return true, this will contain the <ide> parsed JSON data. Otherwise this will be ``None``. <ide> <ide> The :meth:`get_json` method should be used instead. <ide> def is_json(self): <ide> <ide> def get_json(self, force=False, silent=False, cache=True): <ide> """Parses the incoming JSON request data and returns it. By default <del> this function will return ``None`` if the mimetype is not <del> :mimetype:`application/json` but this can be overridden by the <del> ``force`` parameter. If parsing fails the <del> :meth:`on_json_loading_failed` method on the request object will be <del> invoked. <add> this function will return ``None`` if self.is_json would return false, <add> but this can be overridden by the ``force`` parameter. If parsing <add> fails, the :meth:`on_json_loading_failed` method on the request object <add> will be invoked. <ide> <ide> :param force: if set to ``True`` the mimetype is ignored. <ide> :param silent: if set to ``True`` this method will fail silently
1
Javascript
Javascript
remove vulgar language
069dd10ca2258a27f3cba2db688ce4b97b624241
<ide><path>test/parallel/test-zerolengthbufferbug.js <ide> const http = require('http'); <ide> <ide> const server = http.createServer((req, res) => { <ide> const buffer = Buffer.alloc(0); <del> // FIXME: WTF gjslint want this? <ide> res.writeHead(200, { 'Content-Type': 'text/html', <ide> 'Content-Length': buffer.length }); <ide> res.end(buffer);
1
Text
Text
update faqs on contributing guide
6103991d8b41fc735c79b7b2ceb89e2352e038f1
<ide><path>CONTRIBUTING.md <ide> Essentially, we expect basic familiarity with some of the aforementioned technol <ide> <ide> ## Frequently Asked Questions <ide> <del>**How can I report a bug that is not on board?** <add>### How can I report a bug that is not on board? <ide> <ide> If you think you've found a bug, first read the ["Help I've Found a Bug"](https://forum.freecodecamp.org/t/how-to-report-a-bug/19543) article and follow its instructions. <ide> <ide> If you're confident it's a new bug, go ahead and create a new GitHub issue. Be sure to include as much information as possible so that we can reproduce the bug. We have a pre-defined issue template to help you through this. <ide> <ide> Please note that any issues that seek coding help on a challenge will be closed. The issue tracker is strictly for codebase related issues and discussions. Whenever in doubt, you should [seek assistance on the forum](https://www.freecodecamp.org/forum) before making a report. <ide> <del>**How can I report a security issue?** <add>### How can I report a security issue? <ide> <ide> Please don't create GitHub issues for security issues. Instead, please send an email to `security@freecodecamp.org` and we'll look into it immediately. <ide> <del>**What do these different labels that are tagged on issues mean?** <add>### What do these different labels that are tagged on issues mean? <ide> <ide> Our community moderators [triage](https://en.wikipedia.org/wiki/Software_bug#Bug_management) issues and pull requests based on their priority, severity, and other factors. You can [find a complete glossary of their meanings here](https://github.com/freecodecamp/freecodecamp/labels). <ide> <del>You should go through [**`help wanted`**](https://github.com/freeCodeCamp/freeCodeCamp/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) or [**`first-timers welcome`**](https://github.com/freeCodeCamp/freeCodeCamp/issues?q=is%3Aopen+is%3Aissue+label%3A%22first+timers+welcome%22) issues for a quick overview of what is available for you to work on. These are up for grabs, and you do not need to seek permission before working on them. <add>You should go through [**`help wanted`**](https://github.com/freeCodeCamp/freeCodeCamp/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) or [**`first timers welcome`**](https://github.com/freeCodeCamp/freeCodeCamp/issues?q=is%3Aopen+is%3Aissue+label%3A%22first+timers+welcome%22) issues for a quick overview of what is available for you to work on. <ide> <del>If these issues lack clarity on what needs to be done, feel free to ask questions in the comments. <add>These are up for grabs, and you do not need to seek permission before working on them. If these issues lack clarity on what needs to be done, feel free to ask questions in the comments. <ide> <del>**I found a typo, should I report an issue before I can make a pull request?** <add>### I found a typo, should I report an issue before I can make a pull request? <ide> <ide> For typos and other wording changes, you can directly open pull requests without first creating an issue. Issues are more for discussing larger problems associated with code or structural aspects of the curriculum. <ide> <del>**I am new to GitHub and Open Source in general:** <add>### How do I get an issue assigned to me? <add> <add>We typically do not assign issues to anyone other than long time contributors to avoid ambigious no-shows. Instead we follow the below policy to be fair to everyone: <add> <add>1. The first pull-request for any issue is preffered to be merged. <add>2. In case of multiple pull-requests for the same issue, we give priorty to quality of the code in the pull-requests. <add> - Did you include tests? <add> - Did you catch all usecases? <add> - Did you ensure all tests pass, and you confirmed everything works locally? <add>3. Finally we favor pull-requests which follow our recomended guidelines. <add> - Did you follow the pull-request checklist? <add> - Did you name your pull-request title meaningfully? <add> <add>You do not need any permission for issues that are marked `help wanted` or `first timers welcome` as explained earlier. Follow the guidelines carefully and open a pull-request. <add> <add>### I am new to GitHub and Open Source, where should I start? <ide> <ide> Read our [How to Contribute to Open Source Guide](https://github.com/freeCodeCamp/how-to-contribute-to-open-source). <ide> <del>**I am stuck on something that is not included in this documentation. How can I get help?** <add>### I am stuck on something that is not included in this documentation. How can I get help? <ide> <ide> Feel free to ask for help in: <ide>
1
Text
Text
improve grammar for 1st paragraph
5dcea016a6e18a31148ab32351a1caf7f8331c20
<ide><path>curriculum/challenges/spanish/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.spanish.md <ide> localeTitle: Disminuir un número con JavaScript <ide> --- <ide> <ide> ## Description <del><section id="description"> Puede <dfn>disminuir</dfn> o disminuir fácilmente una variable por una con el operador <code>--</code> . <code>i--;</code> es el equivalente de <code>i = i - 1;</code> <strong>Nota</strong> <br> La línea entera se convierte en <code>i--;</code> , eliminando la necesidad del signo igual. </section> <add><section id="description"> Usted puede <dfn>disminuir</dfn> o reducir fácilmente una variable por uno (1) con el operador <code>--</code> . <code>i--;</code> es el equivalente de <code>i = i - 1;</code><strong>Nota</strong> <br> La línea entera se convierte en <code>i--;</code> , eliminando la necesidad del signo igual. </section> <ide> <ide> ## Instructions <ide> <section id="instructions"> Cambie el código para usar el operador <code>--</code> en <code>myVar</code> . </section>
1
Go
Go
add logdone logs where it's missing
3c984a6d1578947c5adfe13993cb28d88a674bbf
<ide><path>integration-cli/docker_cli_commit_test.go <ide> func TestCommitTTY(t *testing.T) { <ide> if _, err := runCommand(cmd); err != nil { <ide> t.Fatal(err) <ide> } <add> <add> logDone("commit - commit tty") <ide> } <ide> <ide> func TestCommitWithHostBindMount(t *testing.T) { <ide><path>integration-cli/docker_cli_diff_test.go <ide> func TestDiffEnsureOnlyKmsgAndPtmx(t *testing.T) { <ide> t.Errorf("'%s' is shown in the diff but shouldn't", line) <ide> } <ide> } <add> <add> logDone("diff - ensure that only kmsg and ptmx in diff") <ide> } <ide><path>integration-cli/docker_cli_history_test.go <ide> func TestBuildHistory(t *testing.T) { <ide> } <ide> <ide> deleteImages("testbuildhistory") <add> <add> logDone("history - build history") <ide> } <ide> <ide> func TestHistoryExistentImage(t *testing.T) { <ide><path>integration-cli/docker_cli_links_test.go <ide> func TestPingUnlinkedContainers(t *testing.T) { <ide> } else if exitCode != 1 { <ide> errorOut(err, t, fmt.Sprintf("run ping failed with errors: %v", err)) <ide> } <add> <add> logDone("links - ping unlinked container") <ide> } <ide> <ide> func TestPingLinkedContainers(t *testing.T) { <ide> func TestPingLinkedContainers(t *testing.T) { <ide> cmd(t, "kill", idA) <ide> cmd(t, "kill", idB) <ide> deleteAllContainers() <add> <add> logDone("links - ping linked container") <ide> } <ide> <ide> func TestIpTablesRulesWhenLinkAndUnlink(t *testing.T) { <ide><path>integration-cli/docker_cli_run_test.go <ide> func TestBindMounts(t *testing.T) { <ide> if content != expected { <ide> t.Fatalf("Output should be %q, actual out: %q", expected, content) <ide> } <add> <add> logDone("run - bind mounts") <ide> } <ide> <ide> func TestHostsLinkedContainerUpdate(t *testing.T) {
5
Python
Python
remove debug message
aa17412856a67803664224bc52a8f1d8a2356e2c
<ide><path>glances/plugins/glances_processlist.py <ide> def msg_curse(self, args=None, max_width=None): <ide> self.__msg_curse_header(ret, process_sort_key, args) <ide> <ide> # Process list <del> logger.info(self.max_values) <del> logger.info([(i['cpu_percent'], i['name']) for i in self.stats]) <ide> if glances_processes.is_tree_enabled(): <ide> ret.extend(self.get_process_tree_curses_data( <ide> self.__sort_stats(process_sort_key), args, first_level=True,
1
Python
Python
raise e983 early on in docbin init
a361df00cd65dd829a07d1256476dfd9639be4a9
<ide><path>spacy/errors.py <ide> class Errors: <ide> "{nO} - cannot add any more labels.") <ide> E923 = ("It looks like there is no proper sample data to initialize the " <ide> "Model of component '{name}'. To check your input data paths and " <del> "annotation, run: python -m spacy debug data config.cfg") <add> "annotation, run: python -m spacy debug data config.cfg " <add> "and include the same config override values you would specify " <add> "for the 'spacy train' command.") <ide> E924 = ("The '{name}' component does not seem to be initialized properly. " <ide> "This is likely a bug in spaCy, so feel free to open an issue: " <ide> "https://github.com/explosion/spaCy/issues") <ide> class Errors: <ide> "to token boundaries.") <ide> E982 = ("The `Token.ent_iob` attribute should be an integer indexing " <ide> "into {values}, but found {value}.") <del> E983 = ("Invalid key for '{dict}': {key}. Available keys: " <add> E983 = ("Invalid key(s) for '{dict}': {key}. Available keys: " <ide> "{keys}") <ide> E984 = ("Invalid component config for '{name}': component block needs either " <ide> "a key `factory` specifying the registered function used to " <ide><path>spacy/tokens/_serialize.py <ide> from .doc import Doc <ide> from ..vocab import Vocab <ide> from ..compat import copy_reg <del>from ..attrs import SPACY, ORTH, intify_attr <add>from ..attrs import SPACY, ORTH, intify_attr, IDS <ide> from ..errors import Errors <ide> from ..util import ensure_path, SimpleFrozenList <ide> <ide> def __init__( <ide> <ide> DOCS: https://spacy.io/api/docbin#init <ide> """ <del> attrs = sorted([intify_attr(attr) for attr in attrs]) <add> int_attrs = [intify_attr(attr) for attr in attrs] <add> if None in int_attrs: <add> non_valid = [attr for attr in attrs if intify_attr(attr) is None] <add> raise KeyError(Errors.E983.format(dict="attrs", key=non_valid, keys=IDS.keys())) from None <add> attrs = sorted(int_attrs) <ide> self.version = "0.1" <ide> self.attrs = [attr for attr in attrs if attr != ORTH and attr != SPACY] <ide> self.attrs.insert(0, ORTH) # Ensure ORTH is always attrs[0]
2
Javascript
Javascript
reuse name variable in share scope
4ed2ecfcfffc1402c60e0156b6252f2b5a9b7f2f
<ide><path>lib/container/ContainerEntryModule.js <ide> class ContainerEntryModule extends Module { <ide> ])};`, <ide> `var init = ${runtimeTemplate.basicFunction("shareScope, initScope", [ <ide> `if (!${RuntimeGlobals.shareScopeMap}) return;`, <del> `var oldScope = ${RuntimeGlobals.shareScopeMap}[${JSON.stringify( <del> this._shareScope <del> )}];`, <ide> `var name = ${JSON.stringify(this._shareScope)}`, <add> `var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`, <ide> `if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");`, <ide> `${RuntimeGlobals.shareScopeMap}[name] = shareScope;`, <ide> `return ${RuntimeGlobals.initializeSharing}(name, initScope);`
1
Python
Python
save the wav2vec2 processor before training starts
653076ca307520ee85fd5f5de6918019f8521bb5
<ide><path>examples/research_projects/wav2vec2/run_common_voice.py <ide> def compute_metrics(pred): <ide> checkpoint = model_args.model_name_or_path <ide> else: <ide> checkpoint = None <del> train_result = trainer.train(resume_from_checkpoint=checkpoint) <del> trainer.save_model() <ide> <del> # save the feature_extractor and the tokenizer <add> # Save the feature_extractor and the tokenizer <ide> if is_main_process(training_args.local_rank): <ide> processor.save_pretrained(training_args.output_dir) <ide> <add> train_result = trainer.train(resume_from_checkpoint=checkpoint) <add> trainer.save_model() <add> <ide> metrics = train_result.metrics <ide> max_train_samples = ( <ide> data_args.max_train_samples if data_args.max_train_samples is not None else len(train_dataset)
1
Javascript
Javascript
add flow to syntheticevent
87b3e2d257e49b6d2c8e662830fc8f3c7d62f85f
<ide><path>packages/react-dom/src/events/DOMPluginEventSystem.js <ide> import { <ide> SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS, <ide> } from './EventSystemFlags'; <ide> import type {AnyNativeEvent} from './PluginModuleType'; <del>import type {ReactSyntheticEvent} from './ReactSyntheticEventType'; <add>import type { <add> KnownReactSyntheticEvent, <add> ReactSyntheticEvent, <add>} from './ReactSyntheticEventType'; <ide> import type {ElementListenerMapEntry} from '../client/ReactDOMComponentTree'; <ide> import type {EventPriority} from 'shared/ReactTypes'; <ide> import type {Fiber} from 'react-reconciler/src/ReactInternalTypes'; <ide> function getLowestCommonAncestor(instA: Fiber, instB: Fiber): Fiber | null { <ide> <ide> function accumulateEnterLeaveListenersForEvent( <ide> dispatchQueue: DispatchQueue, <del> event: ReactSyntheticEvent, <add> event: KnownReactSyntheticEvent, <ide> target: Fiber, <ide> common: Fiber | null, <ide> inCapturePhase: boolean, <ide> ): void { <ide> const registrationName = event._reactName; <del> if (registrationName === undefined) { <del> return; <del> } <ide> const listeners: Array<DispatchListener> = []; <ide> <ide> let instance = target; <ide> function accumulateEnterLeaveListenersForEvent( <ide> // phase event listeners. <ide> export function accumulateEnterLeaveTwoPhaseListeners( <ide> dispatchQueue: DispatchQueue, <del> leaveEvent: ReactSyntheticEvent, <del> enterEvent: null | ReactSyntheticEvent, <add> leaveEvent: KnownReactSyntheticEvent, <add> enterEvent: null | KnownReactSyntheticEvent, <ide> from: Fiber | null, <ide> to: Fiber | null, <ide> ): void { <ide><path>packages/react-dom/src/events/ReactSyntheticEventType.js <ide> export type DispatchConfig = {| <ide> eventPriority?: EventPriority, <ide> |}; <ide> <del>export type ReactSyntheticEvent = {| <add>type BaseSyntheticEvent = { <ide> isPersistent: () => boolean, <ide> isPropagationStopped: () => boolean, <ide> _dispatchInstances?: null | Array<Fiber | null> | Fiber, <ide> _dispatchListeners?: null | Array<Function> | Function, <del> _reactName: string, <ide> _targetInst: Fiber, <ide> nativeEvent: Event, <add> target?: mixed, <add> relatedTarget?: mixed, <ide> type: string, <ide> currentTarget: null | EventTarget, <del>|}; <add>}; <add> <add>export type KnownReactSyntheticEvent = BaseSyntheticEvent & { <add> _reactName: string, <add>}; <add>export type UnknownReactSyntheticEvent = BaseSyntheticEvent & { <add> _reactName: null, <add>}; <add> <add>export type ReactSyntheticEvent = <add> | KnownReactSyntheticEvent <add> | UnknownReactSyntheticEvent; <ide><path>packages/react-dom/src/events/SyntheticEvent.js <ide> * <ide> * This source code is licensed under the MIT license found in the <ide> * LICENSE file in the root directory of this source tree. <add> * <add> * @flow <ide> */ <ide> <ide> /* eslint valid-typeof: 0 */ <ide> <ide> import getEventCharCode from './getEventCharCode'; <ide> <add>type EventInterfaceType = { <add> [propName: string]: 0 | ((event: {[propName: string]: mixed}) => mixed), <add>}; <add> <ide> /** <ide> * @interface Event <ide> * @see http://www.w3.org/TR/DOM-Level-3-Events/ <ide> */ <del>const EventInterface = { <add>const EventInterface: EventInterfaceType = { <ide> eventPhase: 0, <ide> bubbles: 0, <ide> cancelable: 0, <ide> function functionThatReturnsFalse() { <ide> * DOM interface; custom application-specific events can also subclass this. <ide> */ <ide> export function SyntheticEvent( <del> reactName, <del> reactEventType, <del> targetInst, <del> nativeEvent, <del> nativeEventTarget, <del> Interface = EventInterface, <add> reactName: string | null, <add> reactEventType: string, <add> targetInst: Fiber, <add> nativeEvent: {[propName: string]: mixed}, <add> nativeEventTarget: null | EventTarget, <add> Interface: EventInterfaceType = EventInterface, <ide> ) { <ide> this._reactName = reactName; <ide> this._targetInst = targetInst; <ide> Object.assign(SyntheticEvent.prototype, { <ide> <ide> if (event.preventDefault) { <ide> event.preventDefault(); <add> // $FlowFixMe - flow is not aware of `unknown` in IE <ide> } else if (typeof event.returnValue !== 'unknown') { <ide> event.returnValue = false; <ide> } <ide> Object.assign(SyntheticEvent.prototype, { <ide> <ide> if (event.stopPropagation) { <ide> event.stopPropagation(); <add> // $FlowFixMe - flow is not aware of `unknown` in IE <ide> } else if (typeof event.cancelBubble !== 'unknown') { <ide> // The ChangeEventPlugin registers a "propertychange" event for <ide> // IE. This event does not support bubbling or cancelling, and <ide> Object.assign(SyntheticEvent.prototype, { <ide> isPersistent: functionThatReturnsTrue, <ide> }); <ide> <del>export const UIEventInterface = { <add>export const UIEventInterface: EventInterfaceType = { <ide> ...EventInterface, <ide> view: 0, <ide> detail: 0, <ide> let isMovementYSet = false; <ide> * @interface MouseEvent <ide> * @see http://www.w3.org/TR/DOM-Level-3-Events/ <ide> */ <del>export const MouseEventInterface = { <add>export const MouseEventInterface: EventInterfaceType = { <ide> ...UIEventInterface, <ide> screenX: 0, <ide> screenY: 0, <ide> export const MouseEventInterface = { <ide> * @interface DragEvent <ide> * @see http://www.w3.org/TR/DOM-Level-3-Events/ <ide> */ <del>export const DragEventInterface = { <add>export const DragEventInterface: EventInterfaceType = { <ide> ...MouseEventInterface, <ide> dataTransfer: 0, <ide> }; <ide> export const DragEventInterface = { <ide> * @interface FocusEvent <ide> * @see http://www.w3.org/TR/DOM-Level-3-Events/ <ide> */ <del>export const FocusEventInterface = { <add>export const FocusEventInterface: EventInterfaceType = { <ide> ...UIEventInterface, <ide> relatedTarget: 0, <ide> }; <ide> export const FocusEventInterface = { <ide> * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface <ide> * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent <ide> */ <del>export const AnimationEventInterface = { <add>export const AnimationEventInterface: EventInterfaceType = { <ide> ...EventInterface, <ide> animationName: 0, <ide> elapsedTime: 0, <ide> export const AnimationEventInterface = { <ide> * @interface Event <ide> * @see http://www.w3.org/TR/clipboard-apis/ <ide> */ <del>export const ClipboardEventInterface = { <add>export const ClipboardEventInterface: EventInterfaceType = { <ide> ...EventInterface, <ide> clipboardData: function(event) { <ide> return 'clipboardData' in event <ide> export const ClipboardEventInterface = { <ide> * @interface Event <ide> * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents <ide> */ <del>export const CompositionEventInterface = { <add>export const CompositionEventInterface: EventInterfaceType = { <ide> ...EventInterface, <ide> data: 0, <ide> }; <ide> export const CompositionEventInterface = { <ide> * /#events-inputevents <ide> */ <ide> // Happens to share the same list for now. <del>export const InputEventInterface = CompositionEventInterface; <add>export const InputEventInterface: EventInterfaceType = CompositionEventInterface; <ide> <ide> /** <ide> * Normalization of deprecated HTML5 `key` values <ide><path>packages/react-dom/src/events/plugins/EnterLeaveEventPlugin.js <ide> import { <ide> isContainerMarkedAsRoot, <ide> } from '../../client/ReactDOMComponentTree'; <ide> import {accumulateEnterLeaveTwoPhaseListeners} from '../DOMPluginEventSystem'; <add>import type {KnownReactSyntheticEvent} from '../ReactSyntheticEventType'; <ide> <ide> import {HostComponent, HostText} from 'react-reconciler/src/ReactWorkTags'; <ide> import {getNearestMountedFiber} from 'react-reconciler/src/ReactFiberTreeReflection'; <ide> function extractEvents( <ide> leave.target = fromNode; <ide> leave.relatedTarget = toNode; <ide> <del> let enter = new SyntheticEvent( <del> enterEventType, <del> eventTypePrefix + 'enter', <del> to, <del> nativeEvent, <del> nativeEventTarget, <del> eventInterface, <del> ); <del> enter.target = toNode; <del> enter.relatedTarget = fromNode; <add> let enter: KnownReactSyntheticEvent | null = null; <ide> <del> // If we are not processing the first ancestor, then we <del> // should not process the same nativeEvent again, as we <del> // will have already processed it in the first ancestor. <add> // We should only process this nativeEvent if we are processing <add> // the first ancestor. Next time, we will ignore the event. <ide> const nativeTargetInst = getClosestInstanceFromNode((nativeEventTarget: any)); <del> if (nativeTargetInst !== targetInst) { <del> enter = null; <add> if (nativeTargetInst === targetInst) { <add> const enterEvent: KnownReactSyntheticEvent = new SyntheticEvent( <add> enterEventType, <add> eventTypePrefix + 'enter', <add> to, <add> nativeEvent, <add> nativeEventTarget, <add> eventInterface, <add> ); <add> enterEvent.target = toNode; <add> enterEvent.relatedTarget = fromNode; <add> enter = enterEvent; <ide> } <ide> <ide> accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
4
Javascript
Javascript
fix error handling in packager
95972cfd08dd95e1df13c8a15aba8b5655b83a8e
<ide><path>local-cli/server/server.js <ide> function _server(argv, config, resolve, reject) { <ide> } <ide> console.log('\nSee', chalk.underline('http://facebook.github.io/react-native/docs/troubleshooting.html')); <ide> console.log('for common problems and solutions.'); <del> reject(); <add> process.exit(1); <ide> }); <ide> <ide> // TODO: remove once we deprecate this arg
1
Text
Text
use canary for all example downloads
24c1ac6ca94c9e81bcd6c19d832e9df1a5235b8e
<ide><path>examples/active-class-name/README.md <ide> create-next-app --example active-class-name active-class-name-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/active-class-name <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/active-class-name <ide> cd active-class-name <ide> ``` <ide> <ide><path>examples/basic-css/README.md <ide> create-next-app --example basic-css basic-css-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/basic-css <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/basic-css <ide> cd basic-css <ide> ``` <ide> <ide><path>examples/custom-server-express/README.md <ide> create-next-app --example custom-server-express custom-server-express-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server-express <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-express <ide> cd custom-server-express <ide> ``` <ide> <ide><path>examples/custom-server-fastify/README.md <ide> create-next-app --example custom-server-fastify custom-server-fastify-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server-fastify <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-fastify <ide> cd custom-server-fastify <ide> ``` <ide> <ide><path>examples/custom-server-hapi/README.md <ide> create-next-app --example custom-server-hapi custom-server-hapi-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server-hapi <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-hapi <ide> cd custom-server-hapi <ide> ``` <ide> <ide><path>examples/custom-server-koa/README.md <ide> create-next-app --example custom-server-koa custom-server-koa-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server-koa <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-koa <ide> cd custom-server-koa <ide> ``` <ide> <ide><path>examples/custom-server-micro/README.md <ide> create-next-app --example custom-server-micro custom-server-micro-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server-micro <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-micro <ide> cd custom-server-micro <ide> ``` <ide> <ide><path>examples/custom-server-nodemon/README.md <ide> create-next-app --example custom-server-nodemon custom-server-nodemon-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server-nodemon <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-nodemon <ide> cd custom-server-nodemon <ide> ``` <ide> <ide><path>examples/custom-server/README.md <ide> create-next-app --example custom-server custom-server-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server <ide> cd custom-server <ide> ``` <ide> <ide><path>examples/data-fetch/README.md <ide> create-next-app --example data-fetch data-fetch-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/data-fetch <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/data-fetch <ide> cd data-fetch <ide> ``` <ide> <ide><path>examples/form-handler/README.md <ide> create-next-app --example form-handler form-handler-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/form-handler <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/form-handler <ide> cd form-handler <ide> ``` <ide> <ide><path>examples/head-elements/README.md <ide> create-next-app --example head-elements head-elements-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/head-elements <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/head-elements <ide> cd head-elements <ide> ``` <ide> <ide><path>examples/hello-world/README.md <ide> create-next-app --example hello-world hello-world-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/hello-world <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/hello-world <ide> cd hello-world <ide> ``` <ide> <ide><path>examples/layout-component/README.md <ide> create-next-app --example layout-component layout-component-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/layout-component <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/layout-component <ide> cd layout-component <ide> ``` <ide> <ide><path>examples/nested-components/README.md <ide> create-next-app --example nested-components nested-components-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/nested-components <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/nested-components <ide> cd nested-components <ide> ``` <ide> <ide><path>examples/only-client-render-external-dependencies/README.md <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/only-client-render-external-dependencies <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/only-client-render-external-dependencies <ide> cd only-client-render-external-dependencies <ide> ``` <ide> <ide><path>examples/page-transitions/README.md <ide> create-next-app --example page-transitions page-transitions-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/page-transitions <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/page-transitions <ide> cd page-transitions <ide> ``` <ide> <ide><path>examples/parameterized-routing/README.md <ide> create-next-app --example parameterized-routing parameterized-routing-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/parameterized-routing <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/parameterized-routing <ide> cd parameterized-routing <ide> ``` <ide> <ide><path>examples/progressive-render/README.md <ide> create-next-app --example progressive-render progressive-render-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/progressive-render <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/progressive-render <ide> cd progressive-render <ide> ``` <ide> <ide><path>examples/root-static-files/README.md <ide> create-next-app --example root-static-files root-static-files-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server <ide> cd custom-server <ide> ``` <ide> <ide><path>examples/shared-modules/README.md <ide> create-next-app --example shared-modules shared-modules-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/shared-modules <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/shared-modules <ide> cd shared-modules <ide> ``` <ide> <ide><path>examples/ssr-caching/README.md <ide> create-next-app --example ssr-caching ssr-caching-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/ssr-caching <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/ssr-caching <ide> cd ssr-caching <ide> ``` <ide> <ide><path>examples/svg-components/README.md <ide> create-next-app --example svg-components svg-components-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/svg-components <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/svg-components <ide> cd svg-components <ide> ``` <ide> <ide><path>examples/using-inferno/README.md <ide> create-next-app --example using-inferno using-inferno-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/using-inferno <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/using-inferno <ide> cd using-inferno <ide> ``` <ide> <ide><path>examples/using-preact/README.md <ide> create-next-app --example using-preact using-preact-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/using-preact <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/using-preact <ide> cd using-preact <ide> ``` <ide> <ide><path>examples/using-router/README.md <ide> create-next-app --example using-router using-router-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/using-router <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/using-router <ide> cd using-router <ide> ``` <ide> <ide><path>examples/using-with-router/README.md <ide> create-next-app --example using-with-router using-with-router-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/using-with-router <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/using-with-router <ide> cd using-with-router <ide> ``` <ide> <ide><path>examples/with-absolute-imports/README.md <ide> create-next-app --example with-absolute-imports with-absolute-imports-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-absolute-import <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-absolute-import <ide> cd with-absolute-import <ide> ``` <ide> <ide><path>examples/with-algolia-react-instantsearch/README.md <ide> create-next-app --example with-algolia-react-instantsearch with-algolia-react-in <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-algolia-react-instantsearch <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-algolia-react-instantsearch <ide> cd with-algolia-react-instantsearch <ide> ``` <ide> <ide><path>examples/with-amp/README.md <ide> create-next-app --example with-amp with-amp-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js.git): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-amp <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-amp <ide> cd with-amp <ide> ``` <ide> <ide><path>examples/with-ant-design/README.md <ide> create-next-app --example with-ant-design with-ant-design-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-ant-design <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-ant-design <ide> cd with-ant-design <ide> ``` <ide> <ide><path>examples/with-antd-mobile/README.md <ide> create-next-app --example with-antd-mobile with-antd-mobile-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-antd-mobile <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-antd-mobile <ide> cd with-antd-mobile <ide> ``` <ide> <ide><path>examples/with-aphrodite/README.md <ide> create-next-app --example with-aphrodite with-aphrodite-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-aphrodite <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-aphrodite <ide> cd with-aphrodite <ide> ``` <ide> <ide><path>examples/with-apollo-and-redux/README.md <ide> create-next-app --example with-apollo-and-redux with-apollo-and-redux-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-apollo-and-redux <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-apollo-and-redux <ide> cd with-apollo-and-redux <ide> ``` <ide> <ide><path>examples/with-apollo-auth/README.md <ide> create-next-app --example with-apollo-auth with-apollo-auth-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-apollo-auth <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-apollo-auth <ide> cd with-apollo-auth <ide> ``` <ide> <ide><path>examples/with-apollo/README.md <ide> create-next-app --example with-apollo with-apollo-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-apollo <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-apollo <ide> cd with-apollo <ide> ``` <ide> <ide><path>examples/with-asset-imports/README.md <ide> create-next-app --example with-asset-imports with-asset-imports-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-asset-imports <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-asset-imports <ide> cd with-asset-imports <ide> ``` <ide> <ide><path>examples/with-babel-macros/README.md <ide> create-next-app --example with-babel-macros with-babel-macros-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-babel-macros <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-babel-macros <ide> cd with-babel-macros <ide> ``` <ide> <ide><path>examples/with-custom-babel-config/README.md <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-custom-babel-config <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-custom-babel-config <ide> cd with-custom-babel-config <ide> ``` <ide> <ide><path>examples/with-cxs/README.md <ide> create-next-app --example with-cxs with-cxs-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-cxs <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-cxs <ide> cd with-cxs <ide> ``` <ide> <ide><path>examples/with-dotenv/README.md <ide> create-next-app --example with-dotenv with-dotenv-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-dotenv <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-dotenv <ide> cd with-dotenv <ide> ``` <ide> <ide><path>examples/with-dynamic-import/README.md <ide> create-next-app --example with-dynamic-import with-dynamic-import-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-dynamic-import <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-dynamic-import <ide> cd with-dynamic-import <ide> ``` <ide> <ide><path>examples/with-electron/readme.md <ide> create-next-app --example with-electron with-electron-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-electron <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-electron <ide> cd with-electron <ide> ``` <ide> <ide><path>examples/with-emotion/README.md <ide> create-next-app --example with-emotion with-emotion-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-emotion <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-emotion <ide> cd with-emotion <ide> ``` <ide> <ide><path>examples/with-fela/README.md <ide> create-next-app --example with-fela with-fela-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-fela <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-fela <ide> cd with-fela <ide> ``` <ide> <ide><path>examples/with-firebase-authentication/README.md <ide> create-next-app --example with-firebase-authentication with-firebase-authenticat <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-firebase-authentication <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-firebase-authentication <ide> cd with-firebase <ide> ``` <ide> <ide><path>examples/with-firebase-hosting/README.md <ide> create-next-app --example with-firebase-hosting with-firebase-hosting-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-firebase-hosting <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-firebase-hosting <ide> cd with-firebase-hosting <ide> ``` <ide> <ide><path>examples/with-flow/README.md <ide> create-next-app --example with-flow with-flow-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-flow <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-flow <ide> cd with-flow <ide> ``` <ide> <ide><path>examples/with-freactal/README.md <ide> create-next-app --example with-freactal with-freactal-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-freactal <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-freactal <ide> cd with-freactal <ide> ``` <ide> <ide><path>examples/with-glamor/README.md <ide> create-next-app --example with-glamor with-glamor-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-glamor <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-glamor <ide> cd with-glamor <ide> ``` <ide> <ide><path>examples/with-glamorous/README.md <ide> create-next-app --example with-glamorous with-glamorous-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-glamorous <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-glamorous <ide> cd with-glamorous <ide> ``` <ide> <ide><path>examples/with-global-stylesheet/README.md <ide> create-next-app --example with-global-stylesheet with-global-stylesheet-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-global-stylesheet <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-global-stylesheet <ide> cd with-global-stylesheet <ide> ``` <ide> <ide><path>examples/with-hashed-statics/README.md <ide> create-next-app --example with-hashed-statics with-hashed-statics-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-hashed-statics <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-hashed-statics <ide> cd with-hashed-statics <ide> ``` <ide> <ide><path>examples/with-i18next/README.md <ide> create-next-app --example with-i18next with-i18next-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-i18next <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-i18next <ide> cd with-i18next <ide> ``` <ide> <ide><path>examples/with-jest/README.md <ide> create-next-app --example with-jest with-jest-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-jest <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-jest <ide> cd with-jest <ide> ``` <ide> <ide><path>examples/with-kea/README.md <ide> create-next-app --example with-kea with-kea-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-kea <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-kea <ide> cd with-kea <ide> ``` <ide> <ide><path>examples/with-loading/README.md <ide> create-next-app --example with-loading with-loading-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-loading <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-loading <ide> cd with-loading <ide> ``` <ide> <ide><path>examples/with-markdown/readme.md <ide> create-next-app --example with-markdown with-markdown <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-markdown <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-markdown <ide> cd with-markdown <ide> ``` <ide> <ide><path>examples/with-material-ui/README.md <ide> create-next-app --example with-material-ui with-material-ui-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-material-ui <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-material-ui <ide> cd with-material-ui <ide> ``` <ide> <ide><path>examples/with-mobx-state-tree/README.md <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-mobx <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mobx <ide> cd with-mobx <ide> ``` <ide> <ide><path>examples/with-mobx/README.md <ide> create-next-app --example with-mobx with-mobx-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-mobx <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mobx <ide> cd with-mobx <ide> ``` <ide> <ide><path>examples/with-next-routes/README.md <ide> create-next-app --example with-next-routes with-next-routes-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-next-routes <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-routes <ide> cd with-next-routes <ide> ``` <ide> <ide><path>examples/with-pkg/README.md <ide> create-next-app --example with-pkg with-pkg-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-pkg <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-pkg <ide> cd with-pkg <ide> ``` <ide> <ide><path>examples/with-portals/README.md <ide> create-next-app --example with-portals with-portals-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-portals <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-portals <ide> cd with-portals <ide> ``` <ide> <ide><path>examples/with-prefetching/README.md <ide> create-next-app --example with-prefetching with-prefetching-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-prefetching <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-prefetching <ide> cd with-prefetching <ide> ``` <ide> <ide><path>examples/with-pretty-url-routing/README.md <ide> create-next-app --example with-pretty-url-routing with-pretty-url-routing-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-pretty-url-routing <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-pretty-url-routing <ide> cd with-pretty-url-routing <ide> ``` <ide> <ide><path>examples/with-react-ga/README.md <ide> create-next-app --example with-react-ga with-react-ga-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-ga <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-ga <ide> cd with-react-ga <ide> ``` <ide> <ide><path>examples/with-react-helmet/README.md <ide> create-next-app --example with-react-helmet with-react-helmet-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-helmet <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-helmet <ide> cd with-react-helmet <ide> ``` <ide> <ide><path>examples/with-react-intl/README.md <ide> create-next-app --example with-react-intl with-react-intl-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js.git): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-intl <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-intl <ide> cd with-react-intl <ide> ``` <ide> <ide><path>examples/with-react-md/README.md <ide> create-next-app --example with-react-md with-react-md-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-md <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-md <ide> cd with-react-md <ide> ``` <ide> <ide><path>examples/with-react-toolbox/README.md <ide> create-next-app --example with-react-toolbox with-react-toolbox-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-toolbox <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-toolbox <ide> cd with-react-toolbox <ide> ``` <ide> <ide><path>examples/with-react-uwp/README.md <ide> create-next-app --example with-react-uwp with-react-uwp-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-uwp <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-uwp <ide> cd with-react-uwp <ide> ``` <ide> <ide><path>examples/with-react-with-styles/README.md <ide> create-next-app --example with-react-with-styles with-react-with-styles-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-with-styles <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-with-styles <ide> cd with-react-with-styles <ide> ``` <ide> <ide><path>examples/with-reasonml/README.md <ide> create-next-app --example with-reasonml with-reasonml-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-reasonml <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-reasonml <ide> cd with-reasonml <ide> ``` <ide> <ide><path>examples/with-rebass/README.md <ide> create-next-app --example with-rebass with-rebass-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-rebass <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-rebass <ide> cd with-rebass <ide> ``` <ide> <ide><path>examples/with-recompose/README.md <ide> create-next-app --example with-recompose with-recompose-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-recompose <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-recompose <ide> cd with-recompose <ide> ``` <ide> <ide><path>examples/with-redux-code-splitting/README.md <ide> create-next-app --example with-redux-code-splitting with-redux-code-splitting-ap <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-redux-code-splitting <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-code-splitting <ide> cd with-redux-code-splitting <ide> ``` <ide> <ide><path>examples/with-redux-observable/README.md <ide> create-next-app --example with-redux-observable with-redux-observable-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-redux-observable <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-observable <ide> cd with-redux-observable <ide> ``` <ide> <ide><path>examples/with-redux-reselect-recompose/README.md <ide> create-next-app --example with-redux-reselect-recompose with-redux-reselect-reco <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-redux-reselect-recompose <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-reselect-recompose <ide> cd with-redux-reselect-recompose <ide> ``` <ide> <ide><path>examples/with-redux-saga/README.md <ide> create-next-app --example with-redux-saga with-redux-saga-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-redux-saga <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-saga <ide> cd with-redux-saga <ide> ``` <ide> <ide><path>examples/with-redux/README.md <ide> create-next-app --example with-redux with-redux-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-redux <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux <ide> cd with-redux <ide> ``` <ide> <ide><path>examples/with-refnux/README.md <ide> create-next-app --example with-refnux with-refnux-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-refnux <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-refnux <ide> cd with-refnux <ide> ``` <ide> <ide><path>examples/with-relay-modern/README.md <ide> create-next-app --example with-relay-modern with-relay-modern-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-relay-modern <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-relay-modern <ide> cd with-relay-modern <ide> ``` <ide> <ide><path>examples/with-scoped-stylesheets-and-postcss/README.md <ide> create-next-app --example with-scoped-stylesheets-and-postcss with-scoped-styles <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-scoped-stylesheets-and-postcss <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-scoped-stylesheets-and-postcss <ide> cd with-scoped-stylesheets-and-postcss <ide> ``` <ide> <ide><path>examples/with-semantic-ui/README.md <ide> create-next-app --example with-semantic-ui with-semantic-ui-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-semantic-ui <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-semantic-ui <ide> cd with-semantic-ui <ide> ``` <ide> <ide><path>examples/with-shallow-routing/README.md <ide> create-next-app --example with-shallow-routing with-shallow-routing-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-shallow-routing <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-shallow-routing <ide> cd with-shallow-routing <ide> ``` <ide> <ide><path>examples/with-socket.io/README.md <ide> create-next-app --example with-socket.io with-socket.io-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-socket.io <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-socket.io <ide> cd with-socket.io <ide> ``` <ide> <ide><path>examples/with-static-export/README.md <ide> create-next-app --example with-static-export with-static-export-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-static-export <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-static-export <ide> cd with-static-export <ide> ``` <ide> <ide><path>examples/with-styled-components/README.md <ide> create-next-app --example with-styled-components with-styled-components-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-styled-components <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styled-components <ide> cd with-styled-components <ide> ``` <ide> <ide><path>examples/with-styled-jsx-plugins/README.md <ide> create-next-app --example with-styled-jsx-plugins with-styled-jsx-plugins-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-styled-jsx-plugins <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styled-jsx-plugins <ide> cd with-styled-jsx-plugins <ide> ``` <ide> <ide><path>examples/with-styled-jsx-scss/README.md <ide> create-next-app --example with-styled-jsx-scss with-styled-jsx-scss-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-styled-jsx-scss <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styled-jsx-scss <ide> cd with-styled-jsx-scss <ide> ``` <ide> <ide><path>examples/with-styletron/README.md <ide> create-next-app --example with-styletron with-styletron-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-styletron <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styletron <ide> cd with-styletron <ide> ``` <ide> <ide><path>examples/with-sw-precache/README.md <ide> create-next-app --example with-sw-precache with-sw-precache-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-sw-precache <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-sw-precache <ide> cd with-sw-precache <ide> ``` <ide> <ide><path>examples/with-tailwindcss/README.md <ide> cd my-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-tailwindcss <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-tailwindcss <ide> cd with-tailwindcss <ide> ``` <ide> <ide><path>examples/with-typescript/README.md <ide> create-next-app --example with-typescript with-typescript-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-typescript <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-typescript <ide> cd with-typescript <ide> ``` <ide> <ide><path>examples/with-universal-configuration-runtime/readme.md <ide> create-next-app --example with-universal-configuration-runtime with-universal-co <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-universal-configuration-runtime <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-universal-configuration-runtime <ide> cd with-universal-configuration-runtime <ide> ``` <ide> <ide><path>examples/with-universal-configuration/README.md <ide> create-next-app --example with-universal-configuration with-universal-configurat <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-universal-configuration <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-universal-configuration <ide> cd with-universal-configuration <ide> ``` <ide> <ide><path>examples/with-url-object-routing/README.md <ide> create-next-app --example with-url-object-routing with-url-object-routing-app <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-url-object-routing <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-url-object-routing <ide> cd with-url-object-routing <ide> ``` <ide> <ide><path>examples/with-webpack-bundle-analyzer/README.md <ide> create-next-app --example with-webpack-bundle-analyzer with-webpack-bundle-analy <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-webpack-bundle-analyzer <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-webpack-bundle-analyzer <ide> cd with-webpack-bundle-analyzer <ide> ``` <ide> <ide><path>examples/with-webpack-bundle-size-analyzer/README.md <ide> create-next-app --example with-webpack-bundle-size-analyzer with-webpack-bundle- <ide> Download the example [or clone the repo](https://github.com/zeit/next.js): <ide> <ide> ```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-webpack-bundle-size-analyzer <add>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-webpack-bundle-size-analyzer <ide> cd with-webpack-bundle-size-analyzer <ide> ``` <ide>
100
Javascript
Javascript
fix two memory leaks
9830cb935e28d7cf338652252449894d89a41bad
<ide><path>test/driver.js <ide> function load() { <ide> } <ide> <ide> function cleanup() { <del> var styleSheet = document.styleSheets[0]; <del> if (styleSheet) { <del> while (styleSheet.cssRules.length > 0) <del> styleSheet.deleteRule(0); <add> // Clear out all the stylesheets since a new one is created for each font. <add> while (document.styleSheets.length > 0) { <add> var styleSheet = document.styleSheets[0]; <add> if (styleSheet) { <add> while (styleSheet.cssRules.length > 0) <add> styleSheet.deleteRule(0); <add> } <add> var parent = styleSheet.ownerNode.parentNode; <add> parent.removeChild(styleSheet.ownerNode); <ide> } <ide> var guard = document.getElementById('content-end'); <ide> var body = document.body; <ide> while (body.lastChild !== guard) <ide> body.removeChild(body.lastChild); <add> <add> // Wipe out the link to the pdfdoc so it can be GC'ed. <add> for (var i = 0; i < manifest.length; i++) { <add> if (manifest[i].pdfDoc) { <add> manifest[i].pdfDoc.destroy(); <add> delete manifest[i].pdfDoc <add> } <add> } <ide> } <ide> <ide> function nextTask() { <del> // If there is a pdfDoc on the last task executed, destroy it to free memory. <del> if (task && task.pdfDoc) { <del> task.pdfDoc.destroy(); <del> delete task.pdfDoc; <del> } <ide> cleanup(); <ide> <ide> if (currentTaskIdx == manifest.length) {
1
Python
Python
remove a print message when using global pooling
929669bd1bfa682678393949d1765e3314eb2c49
<ide><path>keras/layers/pooling.py <ide> def __init__(self, dim_ordering='default', **kwargs): <ide> super(_GlobalPooling2D, self).__init__(**kwargs) <ide> if dim_ordering == 'default': <ide> dim_ordering = K.image_dim_ordering() <del> print(dim_ordering) <ide> self.dim_ordering = dim_ordering <ide> self.input_spec = [InputSpec(ndim=4)] <ide>
1
Javascript
Javascript
add test case for entry and container in one entry
2da5345dd0e03601b5f0879a5728260bdda43faa
<ide><path>test/ConfigTestCases.test.js <ide> describe("ConfigTestCases", () => { <ide> } <ide> }; <ide> <add> const requireCache = Object.create(null); <ide> function _require(currentDirectory, options, module) { <ide> if (Array.isArray(module) || /^\.\.?\//.test(module)) { <ide> let content; <ide> describe("ConfigTestCases", () => { <ide> p = path.join(currentDirectory, module); <ide> content = fs.readFileSync(p, "utf-8"); <ide> } <add> if (p in requireCache) { <add> return requireCache[p].exports; <add> } <ide> const m = { <ide> exports: {} <ide> }; <add> requireCache[p] = m; <ide> let runInNewContext = false; <ide> const moduleScope = { <ide> require: _require.bind(null, path.dirname(p), options), <ide><path>test/configCases/container/2-container-full/Self.js <add>export default { <add> in: __filename <add>}; <ide><path>test/configCases/container/2-container-full/index.js <ide> it("should load the component from container", () => { <ide> }); <ide> }); <ide> }); <add> <add>import Self from "./Self"; <add> <add>it("should load itself from its own container", () => { <add> return import("self/Self").then(({ default: RemoteSelf }) => { <add> expect(RemoteSelf).toBe(Self); <add> }); <add>}); <ide><path>test/configCases/container/2-container-full/webpack.config.js <ide> const { ModuleFederationPlugin } = require("../../../../").container; <ide> module.exports = { <ide> plugins: [ <ide> new ModuleFederationPlugin({ <del> name: "container", <add> name: "main", <ide> library: { type: "commonjs-module" }, <del> filename: "container.js", <ide> remotes: { <del> containerB: "../1-container-full/container.js" <add> containerB: "../1-container-full/container.js", <add> self: "./bundle0.js" <ide> }, <add> exposes: ["./Self"], <ide> shared: ["react"] <ide> }) <ide> ]
4
Javascript
Javascript
remove unused variable
5bc779240ba4bd05589d5359111a231cebbccbe6
<ide><path>test/sequential/test-timers-block-eventloop.js <ide> const t3 = <ide> setTimeout(common.mustNotCall('eventloop blocked!'), platformTimeout(200)); <ide> <ide> setTimeout(function() { <del> fs.stat('/dev/nonexistent', (err, stats) => { <add> fs.stat('/dev/nonexistent', () => { <ide> clearInterval(t1); <ide> clearInterval(t2); <ide> clearTimeout(t3);
1