hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
574f034e6646da5a77287d0eb5c89b14dd275608
diff --git a/nunaliit2-js/src/main/js/nunaliit2/n2.couchModule.js b/nunaliit2-js/src/main/js/nunaliit2/n2.couchModule.js index <HASH>..<HASH> 100644 --- a/nunaliit2-js/src/main/js/nunaliit2/n2.couchModule.js +++ b/nunaliit2-js/src/main/js/nunaliit2/n2.couchModule.js @@ -461,6 +461,9 @@ var ModuleDisplay = $n2.Class({ d.register(DH,'editClosed',function(m){ _this._hideSlidingSidePanel(); }); + d.register(DH,'searchInitiate',function(m){ + _this._showSlidingSidePanel(); + }); d.register(DH,'moduleGetCurrent',function(m){ m.moduleId = _this.getCurrentModuleId();
Open sliding panel when search initiated (#<I>)
GCRC_nunaliit
train
js
f19b37f0c467dd2cf4103f214c3ce8aa33bf162b
diff --git a/src/Parser/State.php b/src/Parser/State.php index <HASH>..<HASH> 100644 --- a/src/Parser/State.php +++ b/src/Parser/State.php @@ -69,6 +69,8 @@ class State */ protected $new_statement_character_found = false; + protected $valid_placeholder_characters = []; + /** * * Constructor @@ -90,6 +92,12 @@ class State if (array_key_exists(0, $this->values)) { array_unshift($this->values, null); } + $this->valid_placeholder_characters = array_merge( + range('a', 'z'), + range ('A', 'Z'), + range (0, 9), + ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_'] + ); } /** @@ -314,7 +322,20 @@ class State */ public function getIdentifier() { - return $this->capture('\\w+\\b'); + $identifier = ''; + $length = 0; + while (! $this->done()) + { + $character = mb_substr($this->statement, $this->current_index + $length, 1, $this->charset); + if (! in_array($character, $this->valid_placeholder_characters, true)) + { + return $identifier; + } + $identifier .= $character; + $length++; + + } + return $identifier; } /**
Removed the call to State->capture from State->getIdentifier
auraphp_Aura.Sql
train
php
1073eca2fac1b05c0e20b02aea78e8a2f550cfe5
diff --git a/model/connect/DBSchemaManager.php b/model/connect/DBSchemaManager.php index <HASH>..<HASH> 100644 --- a/model/connect/DBSchemaManager.php +++ b/model/connect/DBSchemaManager.php @@ -591,7 +591,7 @@ abstract class DBSchemaManager { if (!isset($this->tableList[strtolower($table)])) $newTable = true; if (is_array($spec)) { - $specValue = $this->$spec_orig['type']($spec_orig['parts']); + $specValue = $this->{$spec_orig['type']}($spec_orig['parts']); } else { $specValue = $spec; }
Bugfix: Complex (curly) syntax
silverstripe_silverstripe-framework
train
php
b91a4a35d447f91de12c2e0da1f11f22070c0647
diff --git a/pyoos/utils/asatime.py b/pyoos/utils/asatime.py index <HASH>..<HASH> 100644 --- a/pyoos/utils/asatime.py +++ b/pyoos/utils/asatime.py @@ -59,4 +59,4 @@ class AsaTime(object): date = dateparser.parse(date_string, tzinfos=cls.tzd) return date except: - raise + raise ValueError("Could not parse date string!")
Raise a short stack when we can't parse a date
ioos_pyoos
train
py
04e8c66c2c7dce8b53cd075c9a058548e0f3e305
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,11 @@ ? 'administration' : 'frontend'); + header('Expires: Mon, 12 Dec 1982 06:14:00 GMT'); + header('Last-Modified: ' . gmdate('r')); + header('Cache-Control: no-cache, must-revalidate, max-age=0'); + header('Pragma: no-cache'); + $output = renderer($renderer)->display(getCurrentPage()); header(sprintf('Content-Length: %d', strlen($output))); diff --git a/symphony/lib/boot/bundle.php b/symphony/lib/boot/bundle.php index <HASH>..<HASH> 100755 --- a/symphony/lib/boot/bundle.php +++ b/symphony/lib/boot/bundle.php @@ -13,11 +13,6 @@ } set_magic_quotes_runtime(0); - - header('Expires: Mon, 12 Dec 1982 06:14:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - header('Cache-Control: no-cache, must-revalidate, max-age=0'); - header('Pragma: no-cache'); require_once(DOCROOT . '/symphony/lib/boot/func.utilities.php'); require_once(DOCROOT . '/symphony/lib/boot/defines.php');
Moved cache preventing headers from bundle.php to index.php. Allows scripts to include the Symphony engine without getting unwanted headers set.
symphonycms_symphony-2
train
php,php
785cc320722cfc335dd7770ad31b471aa4e39d1f
diff --git a/app/models/specialist_document_edition.rb b/app/models/specialist_document_edition.rb index <HASH>..<HASH> 100644 --- a/app/models/specialist_document_edition.rb +++ b/app/models/specialist_document_edition.rb @@ -22,7 +22,7 @@ class SpecialistDocumentEdition field :state, type: String - embeds_many :attachments + embeds_many :attachments, cascade_callbacks: true state_machine initial: :draft do event :publish do
Ensure attachment callbacks fire on edition save
alphagov_govuk_content_models
train
rb
d0b067017352938984595baa7ee7524600b50442
diff --git a/app/services/never_logged_in_notifier.rb b/app/services/never_logged_in_notifier.rb index <HASH>..<HASH> 100644 --- a/app/services/never_logged_in_notifier.rb +++ b/app/services/never_logged_in_notifier.rb @@ -3,7 +3,7 @@ module NeverLoggedInNotifier def self.send_reminders return unless Rails.configuration.send_reminder_emails - Person.never_logged_in(25).each do |person| + Person.never_logged_in(25).find_each do |person| person.with_lock do # use db lock to allow cronjob to run on more than one instance send_reminder person end diff --git a/app/services/team_description_notifier.rb b/app/services/team_description_notifier.rb index <HASH>..<HASH> 100644 --- a/app/services/team_description_notifier.rb +++ b/app/services/team_description_notifier.rb @@ -3,7 +3,7 @@ module TeamDescriptionNotifier def self.send_reminders return unless Rails.configuration.send_reminder_emails - Group.without_description.each do |group| + Group.without_description.find_each do |group| group.with_lock do # use db lock to allow cronjob to run on more than one instance send_reminder group end
Replace each with find_each in existing notifiers
ministryofjustice_peoplefinder
train
rb,rb
3ecc795e950d016b75cfca748f772f9bdc20bd36
diff --git a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java index <HASH>..<HASH> 100644 --- a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java +++ b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java @@ -169,7 +169,9 @@ public class StandardSREPage extends AbstractSREInstallPage { SARLEclipsePlugin.logDebugMessage("Associated Eclipse Path (Path): " + path); //$NON-NLS-1$ IWorkspace workspace = ResourcesPlugin.getWorkspace(); IPath workspaceLocation = workspace.getRoot().getLocation(); + SARLEclipsePlugin.logDebugMessage("Workspace (Path): " + workspaceLocation); //$NON-NLS-1$ if (workspaceLocation.isPrefixOf(path)) { + SARLEclipsePlugin.logDebugMessage("Make relative path"); //$NON-NLS-1$ path = workspaceLocation.makeRelativeTo(workspaceLocation); } SARLEclipsePlugin.logDebugMessage("Resolved Path (Path): " + path); //$NON-NLS-1$
[eclipse] Add logging messages for debugging SRE file selection. see #<I>
sarl_sarl
train
java
adcea27d72685800ec0383f90491815b94c66b12
diff --git a/lib/airrecord/table.rb b/lib/airrecord/table.rb index <HASH>..<HASH> 100644 --- a/lib/airrecord/table.rb +++ b/lib/airrecord/table.rb @@ -180,7 +180,7 @@ module Airrecord end def save - raise Error, "Unable to save a new record" if new_record? + return create if new_record? return true if @updated_keys.empty? diff --git a/test/table_test.rb b/test/table_test.rb index <HASH>..<HASH> 100644 --- a/test/table_test.rb +++ b/test/table_test.rb @@ -181,12 +181,12 @@ class TableTest < Minitest::Test assert record.save end - def test_update_raises_if_new_record + def test_update_creates_if_new_record record = @table.new("Name" => "omg") - assert_raises Airrecord::Error do - record.save - end + stub_post_request(record) + + assert record.save end def test_existing_record_is_not_new
Create new records instead of raising in #save
sirupsen_airrecord
train
rb,rb
ca4e4893c38db4e5ab3d7040cbc0fa3b5cdaf6b9
diff --git a/src/runner.js b/src/runner.js index <HASH>..<HASH> 100644 --- a/src/runner.js +++ b/src/runner.js @@ -3,6 +3,7 @@ var Runner = require('screener-runner'); var cloneDeep = require('lodash/cloneDeep'); var omit = require('lodash/omit'); var url = require('url'); +var pkg = require('../package.json'); // transform storybook object into screener states var transformToStates = function(storybook, baseUrl) { @@ -34,6 +35,10 @@ exports.run = function(config, options) { config = cloneDeep(config); return validate.storybookConfig(config) .then(function() { + // add package version + config.meta = { + 'screener-storybook': pkg.version + }; var host = 'localhost:' + config.storybookPort; var localUrl = 'http://' + host; // add tunnel details
add screener-storybook version to meta
screener-io_screener-storybook
train
js
70de24e12ccb8e6bceadb035d2daaacf119a0316
diff --git a/lib/simple_form/components/labels.rb b/lib/simple_form/components/labels.rb index <HASH>..<HASH> 100644 --- a/lib/simple_form/components/labels.rb +++ b/lib/simple_form/components/labels.rb @@ -28,7 +28,7 @@ module SimpleForm end def label_text - SimpleForm.label_text.call(raw_label_text, required_label_text) + SimpleForm.label_text.call(raw_label_text, required_label_text).html_safe end def label_target diff --git a/lib/simple_form/inputs/base.rb b/lib/simple_form/inputs/base.rb index <HASH>..<HASH> 100644 --- a/lib/simple_form/inputs/base.rb +++ b/lib/simple_form/inputs/base.rb @@ -39,7 +39,7 @@ module SimpleForm send(component) end content.compact! - wrap(content.join).html_safe + wrap(content.join.html_safe) end protected
fix a couple of escaping issues in edge rails
plataformatec_simple_form
train
rb,rb
372cab2963094b43423742164dd9224acd0f1d4d
diff --git a/aioice/exceptions.py b/aioice/exceptions.py index <HASH>..<HASH> 100644 --- a/aioice/exceptions.py +++ b/aioice/exceptions.py @@ -1,7 +1,3 @@ -class ConnectionError(Exception): - pass - - class TransactionError(Exception): response = None
[exceptions] don't define custom ConnectionError, it's not used
aiortc_aioice
train
py
7ad0c0b9acd4aee7eb0b4787730b3e2058579d26
diff --git a/livestyle-client.js b/livestyle-client.js index <HASH>..<HASH> 100644 --- a/livestyle-client.js +++ b/livestyle-client.js @@ -191,7 +191,7 @@ toWatch = [], url, i; - cssIncludes.unshift({ href: location.pathname }); + //cssIncludes.unshift({ href: location.pathname }); // See https://github.com/One-com/livestyle/issues/11 for (i = 0; i < cssIncludes.length; i += 1) { url = removeCacheBuster(cssIncludes[i].href); @@ -277,7 +277,7 @@ setTimeout(startPolling, pollTimeout); } }; - cssIncludes.unshift({ href: location.pathname }); + //cssIncludes.unshift({ href: location.pathname }); // See https://github.com/One-com/livestyle/issues/11 proceed(); };
Disabled the client subscribing to the current page url, which introduced a lot of errors. See Issue #<I> to reimplement it.
One-com_livestyle
train
js
4c606477733323101b9efaf913da6cbfb260f8d0
diff --git a/lib/metadata/MIQExtract/MIQExtract.rb b/lib/metadata/MIQExtract/MIQExtract.rb index <HASH>..<HASH> 100644 --- a/lib/metadata/MIQExtract/MIQExtract.rb +++ b/lib/metadata/MIQExtract/MIQExtract.rb @@ -26,7 +26,7 @@ class MIQExtract def initialize(filename, ost = nil) # TODO: Always pass in MiqVm ost ||= OpenStruct.new @ost = ost - @dataDir = ost.config ? ost.config.dataDir : nil + @dataDir = ost.config.try(:dataDir) ost.scanData = {} if ost.scanData.nil? @xml_class = ost.xml_class.nil? ? XmlHash::Document : ost.xml_class
Refactor " : nil" used in ternary operators Add removed whitespace Revert refactor Revert refactor Revert refactor (transferred from ManageIQ/manageiq-gems-pending@7a<I>b<I>de<I>c7bc3e<I>cef<I>dbbea9ce<I>a<I>d)
ManageIQ_manageiq-smartstate
train
rb
bd3dff2bb464dd0e777f51d408ad5caf199c7bfc
diff --git a/src/SuffixExtractor.php b/src/SuffixExtractor.php index <HASH>..<HASH> 100644 --- a/src/SuffixExtractor.php +++ b/src/SuffixExtractor.php @@ -113,7 +113,7 @@ class SuffixExtractor } } - return [$host, '']; + return [$host, null]; }
Fix to result: null on incorrect TLD now
layershifter_TLDExtract
train
php
a61a8d78b13e2bb2eee7178552ab55168406b213
diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -705,8 +705,18 @@ EOT )); } + // Check for similar names/typos $similar = $this->findSimilar($name); if ($similar) { + // Check whether the minimum stability was the problem but the package exists + if ($requiredVersion === null && in_array($name, $similar, true)) { + throw new \InvalidArgumentException(sprintf( + 'Could not find a version of package %s matching your minimum-stability (%s). Require it with an explicit version constraint allowing its desired stability.', + $name, + $this->getMinimumStability($input) + )); + } + throw new \InvalidArgumentException(sprintf( "Could not find package %s.\n\nDid you mean " . (count($similar) > 1 ? 'one of these' : 'this') . "?\n %s", $name,
Fix warning for packages not existing while they exist but not at the required stability, fixes #<I>
composer_composer
train
php
6fbd88a43882bb4d60d0219964626503f154e217
diff --git a/lib/knapsack/adapters/minitest_adapter.rb b/lib/knapsack/adapters/minitest_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/knapsack/adapters/minitest_adapter.rb +++ b/lib/knapsack/adapters/minitest_adapter.rb @@ -52,7 +52,11 @@ module Knapsack def self.test_path(obj) # Pick the first public method in the class itself, that starts with "test_" test_method_name = obj.public_methods(false).select{|m| m =~ /^test_/ }.first - method_object = obj.method(test_method_name) + if test_method_name.nil? + method_object = obj.method(obj.location.sub(/.*?test_/, 'test_')) + else + method_object = obj.method(test_method_name) + end full_test_path = method_object.source_location.first parent_of_test_dir_regexp = Regexp.new("^#{@@parent_of_test_dir}") test_path = full_test_path.gsub(parent_of_test_dir_regexp, '.')
Add support got Minitest::SharedExamples
ArturT_knapsack
train
rb
5c2bb9412d40b5f5208240b8fa81ab15e98cf330
diff --git a/lib/vagrant/action/vm/nfs.rb b/lib/vagrant/action/vm/nfs.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/action/vm/nfs.rb +++ b/lib/vagrant/action/vm/nfs.rb @@ -110,7 +110,6 @@ module Vagrant # up to the host class to define the specific behavior. def export_folders @env[:ui].info I18n.t("vagrant.actions.vm.nfs.exporting") - @env[:host].nfs_export(@env[:vm].uuid, guest_ip, folders) end @@ -119,9 +118,14 @@ module Vagrant @env[:ui].info I18n.t("vagrant.actions.vm.nfs.mounting") # Only mount the folders which have a guest path specified - am_folders = folders.select { |name, folder| folder[:guestpath] } - am_folders = Hash[*am_folders.flatten] if am_folders.is_a?(Array) - @env[:vm].guest.mount_nfs(host_ip, Hash[am_folders]) + mount_folders = {} + folders.each do |name, opts| + if opts[:guestpath] + mount_folders[name] = opts.dup + end + end + + @env[:vm].guest.mount_nfs(host_ip, mount_folders) end # Returns the IP address of the first host only network adapter
A much cleaner way to find NFS folders to mount
hashicorp_vagrant
train
rb
e0c8ed569272a9082cb3bdb4d539ae09fe8c89ed
diff --git a/src/edeposit/amqp/ftp/__init__.py b/src/edeposit/amqp/ftp/__init__.py index <HASH>..<HASH> 100644 --- a/src/edeposit/amqp/ftp/__init__.py +++ b/src/edeposit/amqp/ftp/__init__.py @@ -5,9 +5,7 @@ # Interpreter version: python 2.7 # #= Imports ==================================================================== -import os -import sys - +from collections import namedtuple import sh @@ -19,3 +17,11 @@ from settings import * #= Functions & objects ======================================================== def reload_configuration(): sh.killall("-HUP", "proftpd") + + +class CreateUser(namedtuple("CreateUser", ["username"])): + pass + + +class RemoveUser(namedtuple("RemoveUser", ["username"])): + pass
Added CreateUser and RemoveUser messages.
edeposit_edeposit.amqp.ftp
train
py
d07ff0e463003dcd68a20470f56dfb4c39bab6d5
diff --git a/salt/modules/hipchat.py b/salt/modules/hipchat.py index <HASH>..<HASH> 100644 --- a/salt/modules/hipchat.py +++ b/salt/modules/hipchat.py @@ -20,7 +20,7 @@ import requests import logging from urlparse import urljoin as _urljoin from requests.exceptions import ConnectionError -from six.moves import range +from salt.utils.six.moves import range log = logging.getLogger(__name__) __virtualname__ = 'hipchat'
Replaced module six in file /salt/modules/hipchat.py
saltstack_salt
train
py
9acd41af304dc742fc3982f2dbd94c8edc0f4e12
diff --git a/salt/states/network.py b/salt/states/network.py index <HASH>..<HASH> 100644 --- a/salt/states/network.py +++ b/salt/states/network.py @@ -164,7 +164,7 @@ all interfaces are ignored unless specified. - max_bonds: 1 - updelay: 0 - use_carrier: on - - xmit_hash_policy: layer2 + - hashing-algorithm: layer2 - mtu: 9000 - autoneg: on - speed: 1000
Update network states doc Previously it was xmit_hash_policy, but that's not what the code is actually looking for.
saltstack_salt
train
py
f1167cc9f49ef09009c948a0b4ac9f399046904e
diff --git a/modules/__tests__/Router-test.js b/modules/__tests__/Router-test.js index <HASH>..<HASH> 100644 --- a/modules/__tests__/Router-test.js +++ b/modules/__tests__/Router-test.js @@ -158,6 +158,27 @@ describe('Router', function () { }); }); + it('does not double escape when nested', function(done) { + // https://github.com/rackt/react-router/issues/1574 + let MyWrapperComponent = React.createClass({ + render () { return this.props.children; } + }); + let MyComponent = React.createClass({ + render () { return <div>{this.props.params.some_token}</div> } + }); + + React.render(( + <Router history={createHistory('/point/aaa%2Bbbb')}> + <Route component={MyWrapperComponent}> + <Route path="point/:some_token" component={MyComponent} /> + </Route> + </Router> + ), node, function () { + expect(node.textContent.trim()).toEqual('aaa+bbb'); + done(); + }); + }); + it('is happy to have colons in parameter values', function(done) { // https://github.com/rackt/react-router/issues/1759 let MyComponent = React.createClass({
added a test for nested routes
taion_rrtr
train
js
dc33e09b241bdb824fe767a2f19be04e2b94d379
diff --git a/pkg/services/ngalert/schedule/schedule.go b/pkg/services/ngalert/schedule/schedule.go index <HASH>..<HASH> 100644 --- a/pkg/services/ngalert/schedule/schedule.go +++ b/pkg/services/ngalert/schedule/schedule.go @@ -700,26 +700,11 @@ func (r *alertRuleRegistry) del(key models.AlertRuleKey) (*alertRuleInfo, bool) return info, ok } -func (r *alertRuleRegistry) iter() <-chan models.AlertRuleKey { - c := make(chan models.AlertRuleKey) - - f := func() { - r.mu.Lock() - defer r.mu.Unlock() - - for k := range r.alertRuleInfo { - c <- k - } - close(c) - } - go f() - - return c -} - func (r *alertRuleRegistry) keyMap() map[models.AlertRuleKey]struct{} { - definitionsIDs := make(map[models.AlertRuleKey]struct{}) - for k := range r.iter() { + r.mu.Lock() + defer r.mu.Unlock() + definitionsIDs := make(map[models.AlertRuleKey]struct{}, len(r.alertRuleInfo)) + for k := range r.alertRuleInfo { definitionsIDs[k] = struct{}{} } return definitionsIDs
simplify getting a slice of keys (#<I>)
grafana_grafana
train
go
f298a105175ab5632c7ffeac84805cca6ffe5f72
diff --git a/lib/parameters/instance_param.rb b/lib/parameters/instance_param.rb index <HASH>..<HASH> 100644 --- a/lib/parameters/instance_param.rb +++ b/lib/parameters/instance_param.rb @@ -31,7 +31,7 @@ module Parameters # The value of the instance param. # def value - @object.instance_variable_get("@#{@name}".to_sym) + @object.instance_variable_get(:"@#{@name}") end # @@ -44,7 +44,7 @@ module Parameters # The new value of the instance param. # def value=(value) - @object.instance_variable_set("@#{@name}".to_sym,coerce(value)) + @object.instance_variable_set(:"@#{@name}",coerce(value)) end #
Reduce usage of to_sym.
postmodern_parameters
train
rb
0e11f7fbb8726f079f7a292bbaae51bb7aaff77d
diff --git a/test/test_commands.py b/test/test_commands.py index <HASH>..<HASH> 100644 --- a/test/test_commands.py +++ b/test/test_commands.py @@ -194,15 +194,8 @@ invocation. subprocess.check_output( ['git', 'remote', 'set-url', 'origin', 'http://foo.com/bar.git'], stderr=subprocess.STDOUT, cwd=cwd_without_version) - try: - run_command( - 'import', ['--skip-existing', '--input', REPOS_FILE, '.']) - # The run_command function should raise an exception when the - # process returns a non-zero return code, so the next line should - # never get executed. - assert False - except BaseException: - pass + run_command( + 'import', ['--skip-existing', '--input', REPOS_FILE, '.']) output = run_command( 'import', ['--force', '--input', REPOS_FILE, '.']) @@ -225,12 +218,6 @@ invocation. try: run_command( 'import', ['--skip-existing', '--input', REPOS_FILE, '.']) - # The run_command function should raise an exception when the - # process returns a non-zero return code, so the next line should - # never get executed. - assert False - except BaseException: - pass finally: subprocess.check_output( ['git', 'remote', 'rm', 'foo'],
fix logic in test since the commands are expected to have a return code of zero (#<I>)
dirk-thomas_vcstool
train
py
7f92efb5064b5f87ef0324f182c7f3bf5e1d556e
diff --git a/src/astral.py b/src/astral.py index <HASH>..<HASH> 100644 --- a/src/astral.py +++ b/src/astral.py @@ -668,6 +668,7 @@ class Location(object): return locals() tz = property(**tz()) + tzinfo = tz def solar_depression(): doc = """The number of degrees the sun must be below the horizon for the
Added `tzinfo` as an alias for `tz`
sffjunkie_astral
train
py
3e70c457cc201b7538156660d3cb22aabe2dd8aa
diff --git a/test/unit/utils-tests.js b/test/unit/utils-tests.js index <HASH>..<HASH> 100644 --- a/test/unit/utils-tests.js +++ b/test/unit/utils-tests.js @@ -143,4 +143,17 @@ test('libpq connection string building', function() { })) }) + test('password contains < and/or > characters', function () { + var sourceConfig = { + user:'brian', + password: 'hello<ther>e', + port: 5432, + host: 'localhost', + database: 'postgres' + } + var connectionString = 'pg://' + sourceConfig.user + ':' + sourceConfig.password + '@' + sourceConfig.host + ':' + sourceConfig.port + '/' + sourceConfig.database; + var config = utils.parseConnectionString(connectionString); + assert.same(config, sourceConfig); + }); + })
test case for password containing a < or > sign
brianc_node-postgres
train
js
5874d37bf0c7b24ae372b21cf263d09d3621e1c4
diff --git a/lib/request.js b/lib/request.js index <HASH>..<HASH> 100644 --- a/lib/request.js +++ b/lib/request.js @@ -205,10 +205,9 @@ class Request extends AsyncResource { } if ( - this.streaming && this.body && - !this.body.destroyed && - typeof this.body.destroy === 'function' + typeof this.body.destroy === 'function' && + !this.body.destroyed ) { this.body.destroy(err) }
refactor: simplify req body destroy
mcollina_undici
train
js
e39844f8b6b56ecbc887d38df79e7d755acb642c
diff --git a/Examples/Calculator/features/roles/calculating_individual.rb b/Examples/Calculator/features/roles/calculating_individual.rb index <HASH>..<HASH> 100644 --- a/Examples/Calculator/features/roles/calculating_individual.rb +++ b/Examples/Calculator/features/roles/calculating_individual.rb @@ -18,10 +18,6 @@ class CalculatingIndividual @calculator.get_ready_to @operate_with[next_operator] end - def equals - @calculator.equals - end - def can_see @calculator.display end
Refactoring: Apparently noone needs the Calculating Individual to respond to 'equals'
RiverGlide_CukeSalad
train
rb
7baf68d8a71c841ebc0545bdb37c2723d018c30e
diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index <HASH>..<HASH> 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -45,7 +45,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page $temp->add(new admin_setting_configtext('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,PARAM_INT)); $temp->add(new admin_setting_configtext('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,PARAM_INT)); $temp->add(new admin_setting_configcheckbox('enablecalendarexport', get_string('enablecalendarexport', 'admin'), get_string('configenablecalendarexport','admin'), 1)); - $temp->add(new admin_setting_configtext('calendar_exportsalt', get_string('calendarexportsalt','admin'), get_string('configcalendarexportsalt', 'admin'), random_string(40))); + $temp->add(new admin_setting_configtext('calendar_exportsalt', get_string('calendarexportsalt','admin'), get_string('configcalendarexportsalt', 'admin'), random_string(60))); $ADMIN->add('appearance', $temp); // "htmleditor" settingpage
MDL-<I> longer default salt; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
6f9a444bba13f134c2395dd52a3816ab7ec3031c
diff --git a/lib/puppet/rails/param_name.rb b/lib/puppet/rails/param_name.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/rails/param_name.rb +++ b/lib/puppet/rails/param_name.rb @@ -9,7 +9,7 @@ class Puppet::Rails::ParamName < ActiveRecord::Base hash = {} hash[:name] = self.name.to_sym hash[:source] = source - hash[:value] = resource.param_values.find(:all, :conditions => [ "param_name_id = ?", self]).collect { |v| v.value } + hash[:value] = resource.param_values.find(:all, :conditions => [ "param_name_id = ?", self.id]).collect { |v| v.value } if hash[:value].length == 1 hash[:value] = hash[:value].shift elsif hash[:value].empty?
Fixed #<I> by applying patch by vvidic.
puppetlabs_puppet
train
rb
e7cdd2f9f354e86dbee32597d376a5ace2dc1e4e
diff --git a/src/Schema/Extensions/GraphQLExtension.php b/src/Schema/Extensions/GraphQLExtension.php index <HASH>..<HASH> 100644 --- a/src/Schema/Extensions/GraphQLExtension.php +++ b/src/Schema/Extensions/GraphQLExtension.php @@ -14,7 +14,7 @@ abstract class GraphQLExtension implements \JsonSerializable * * @return DocumentAST */ - public function manipulateSchema(DocumentAST $current, DocumentAST $original): DocumentAST + public function manipulateSchema(DocumentAST $current, DocumentAST $original) { return $current; }
Remove return type to match Laravel style
nuwave_lighthouse
train
php
dd21df83a7b02dfca4b243dc0a96098cacf5123f
diff --git a/Branch-SDK/src/io/branch/referral/ServerRequestActionCompleted.java b/Branch-SDK/src/io/branch/referral/ServerRequestActionCompleted.java index <HASH>..<HASH> 100644 --- a/Branch-SDK/src/io/branch/referral/ServerRequestActionCompleted.java +++ b/Branch-SDK/src/io/branch/referral/ServerRequestActionCompleted.java @@ -48,6 +48,10 @@ class ServerRequestActionCompleted extends ServerRequest { ex.printStackTrace(); constructError_ = true; } + + if (action != null && action.equals("purchase")) { + Log.e("BranchSDK", "Warning: You are sending a purchase event with our non-dedicated purchase function. Please see function sendCommerceEvent"); + } } public ServerRequestActionCompleted(String requestPath, JSONObject post, Context context) {
log warning for non purchase event sent to usercompletedaction
BranchMetrics_android-branch-deep-linking
train
java
87007c50df503471bb4fa7d568677e49d872b618
diff --git a/src/main/java/com/flipkart/zjsonpatch/PathUtils.java b/src/main/java/com/flipkart/zjsonpatch/PathUtils.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/flipkart/zjsonpatch/PathUtils.java +++ b/src/main/java/com/flipkart/zjsonpatch/PathUtils.java @@ -21,8 +21,8 @@ class PathUtils { private static String decodePath(Object object) { String path = object.toString(); // see http://tools.ietf.org/html/rfc6901#section-4 - path = DECODED_TILDA_PATTERN.matcher(path).replaceAll("~"); - return DECODED_SLASH_PATTERN.matcher(path).replaceAll("/"); + path = DECODED_SLASH_PATTERN.matcher(path).replaceAll("/"); + return DECODED_TILDA_PATTERN.matcher(path).replaceAll("~"); } static <T> String getPathRepresentation(List<T> path) {
Switched `tilda (~)` and `slash(/)` decode order.
flipkart-incubator_zjsonpatch
train
java
8a4ab3164b97c1dfa42f0e2305dd2567853ecd0d
diff --git a/instana/__init__.py b/instana/__init__.py index <HASH>..<HASH> 100644 --- a/instana/__init__.py +++ b/instana/__init__.py @@ -24,7 +24,7 @@ __author__ = 'Instana Inc.' __copyright__ = 'Copyright 2017 Instana Inc.' __credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo'] __license__ = 'MIT' -__version__ = '0.7.10' +__version__ = '0.7.11' __maintainer__ = 'Peter Giacomo Lombardo' __email__ = 'peter.lombardo@instana.com' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='instana', - version='0.7.10', + version='0.7.11', download_url='https://github.com/instana/python-sensor', url='https://www.instana.com/', license='MIT',
Bump package version to <I>
instana_python-sensor
train
py,py
8f262d8e3e758bdcf499a3fb3d6575c85e1a91cf
diff --git a/cmsplugin_zinnia/__init__.py b/cmsplugin_zinnia/__init__.py index <HASH>..<HASH> 100644 --- a/cmsplugin_zinnia/__init__.py +++ b/cmsplugin_zinnia/__init__.py @@ -1,5 +1,5 @@ """cmsplugin_zinnia""" -__version__ = '0.4' +__version__ = '0.4.1' __license__ = 'BSD License' __author__ = 'Fantomas42'
Bump to version <I>
django-blog-zinnia_cmsplugin-zinnia
train
py
625a238bbec857fdb5ec72ea2db15943aaae2538
diff --git a/DependencyInjection/EasyAdminExtension.php b/DependencyInjection/EasyAdminExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/EasyAdminExtension.php +++ b/DependencyInjection/EasyAdminExtension.php @@ -62,6 +62,11 @@ class EasyAdminExtension extends Extension $parts = explode('\\', $entityClass); $entityName = array_pop($parts); + // to avoid entity name collision, make sure that its name is unique + while (array_key_exists($entityName, $entities)) { + $entityName .= '_'; + } + $entities[$entityName] = array( 'label' => !is_numeric($key) ? $key : $entityName, 'name' => $entityName, @@ -79,6 +84,11 @@ class EasyAdminExtension extends Extension $parts = explode('\\', $entityConfiguration['class']); $realEntityName = array_pop($parts); + // to avoid entity name collision, make sure that its name is unique + while (array_key_exists($realEntityName, $entities)) { + $realEntityName .= '_'; + } + // copy the original entity to not loose any of its configuration $entities[$realEntityName] = $config[$customEntityName];
Allow to have different entities with the same exact name This is very rare, except for entities like "Category" which can be defined in different bundles for different purposes. The proposed solution is very simple, but it should do the trick.
EasyCorp_EasyAdminBundle
train
php
b314741ed279167f2775a9bf6989ebeea97cb803
diff --git a/ui/app/mixins/searchable.js b/ui/app/mixins/searchable.js index <HASH>..<HASH> 100644 --- a/ui/app/mixins/searchable.js +++ b/ui/app/mixins/searchable.js @@ -48,7 +48,7 @@ export default Mixin.create({ }), listSearched: computed('searchTerm', 'listToSearch.[]', 'searchProps.[]', function() { - const searchTerm = this.get('searchTerm'); + const searchTerm = this.get('searchTerm').trim(); if (searchTerm && searchTerm.length) { const results = []; if (this.get('exactMatchEnabled')) {
Trim whitespace on the search term Trailing whitespace messes with tokenization
hashicorp_nomad
train
js
481be9da35248502211d22d8114de16026926311
diff --git a/communicator/winrm/communicator.go b/communicator/winrm/communicator.go index <HASH>..<HASH> 100644 --- a/communicator/winrm/communicator.go +++ b/communicator/winrm/communicator.go @@ -217,7 +217,7 @@ func (c *Communicator) newCopyClient() (*winrmcp.Winrmcp, error) { OperationTimeout: c.Timeout(), MaxOperationsPerShell: 15, // lowest common denominator } - + if c.connInfo.NTLM == true { config.TransportDecorator = func() winrm.Transporter { return &winrm.ClientNTLM{} } }
code reformatted with gofmt
hashicorp_terraform
train
go
b6e1f7b2af0639070d5ab191110c99f524a8f6ca
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,6 @@ const stylelint = require('stylelint'); const debug = require('debug')('prettier-stylelint:main'); // const explorer = cosmiconfig('stylelint'); -const linterAPI = stylelint.createLinter({ fix: true }); /** * Resolve Config for the given file @@ -19,6 +18,7 @@ const linterAPI = stylelint.createLinter({ fix: true }); */ function resolveConfig(file, options = {}) { const resolve = resolveConfig.resolve; + const linterAPI = stylelint.createLinter({ fix: true }); if (options.stylelintConfig) { return Promise.resolve(resolve(options.stylelintConfig)); @@ -68,6 +68,8 @@ resolveConfig.resolve = (stylelintConfig) => { }; function stylelinter(code, filePath) { + const linterAPI = stylelint.createLinter({ fix: true }); + return linterAPI ._lintSource({ code,
fix: dont re use the same linter instance because we can't invalidate the config cache
hugomrdias_prettier-stylelint
train
js
3981efff3757b8b48422beda74de0faebdbef3b0
diff --git a/pypiper/pypiper.py b/pypiper/pypiper.py index <HASH>..<HASH> 100755 --- a/pypiper/pypiper.py +++ b/pypiper/pypiper.py @@ -888,15 +888,24 @@ class PipelineManager(object): if not annotation: annotation = self.pipeline_name + annotation = str(annotation) + # In case the value is passed with trailing whitespace filename = str(filename).strip() - annotation = str(annotation) + + # better to use a relative path in this file + # convert any absoluate pathsinto relative paths + if os.path.isabs(filename): + relative_filename = os.path.relpath(filename, + self.pipeline_outfolder) + else: + relative_filename = filename message_raw = "{key}\t{filename}\t{annotation}".format( - key=key, filename=filename, annotation=annotation) + key=key, filename=relative_filename, annotation=annotation) - message_markdown = "> `{key}`\t{filename}\t{annotation}\t_RES_".format( - key=key, filename=filename, annotation=annotation) + message_markdown = "> `{key}`\t{filename}\t{annotation}\t_FIG_".format( + key=key, filename=relative_filename, annotation=annotation) print(message_markdown)
Finalize report_figure to relative paths
databio_pypiper
train
py
623b7dfd7b7fc686f69714e0e7864eac5bb08fd1
diff --git a/src/main/java/org/asteriskjava/manager/internal/ManagerReaderImpl.java b/src/main/java/org/asteriskjava/manager/internal/ManagerReaderImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/manager/internal/ManagerReaderImpl.java +++ b/src/main/java/org/asteriskjava/manager/internal/ManagerReaderImpl.java @@ -343,11 +343,7 @@ public class ManagerReaderImpl implements ManagerReader final String internalActionId = ManagerUtil.getInternalActionId(actionId); if (internalActionId != null) { - responseClass = expectedResponseClasses.get(internalActionId); - if (responseClass != null) - { - expectedResponseClasses.remove(internalActionId); - } + responseClass = expectedResponseClasses.remove(internalActionId); } final ManagerResponse response = responseBuilder.buildResponse(responseClass, buffer);
Remove a check-then-act in ManagerReaderImpl
asterisk-java_asterisk-java
train
java
2fc1d40acbb0ee69587a8b2e80fc3cddec722e75
diff --git a/src/Client/Middleware/MiddlewareClient.php b/src/Client/Middleware/MiddlewareClient.php index <HASH>..<HASH> 100644 --- a/src/Client/Middleware/MiddlewareClient.php +++ b/src/Client/Middleware/MiddlewareClient.php @@ -22,7 +22,7 @@ trait MiddlewareClient /** * @var IOAuthClient */ - private $client; + protected $client; /** * Set the OAuth Client.
fix(Middleware): Change middleware client accessibility
zerospam_sdk-framework
train
php
a7c3c9f0d504ad2f2a74fdd380ef3ac63fd7d8fe
diff --git a/staging/src/k8s.io/legacy-cloud-providers/gce/gce_zones.go b/staging/src/k8s.io/legacy-cloud-providers/gce/gce_zones.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/gce/gce_zones.go +++ b/staging/src/k8s.io/legacy-cloud-providers/gce/gce_zones.go @@ -20,6 +20,7 @@ package gce import ( "context" + "fmt" "strings" compute "google.golang.org/api/compute/v1" @@ -79,7 +80,9 @@ func (g *Cloud) ListZonesInRegion(region string) ([]*compute.Zone, error) { defer cancel() mc := newZonesMetricContext("list", region) - list, err := g.c.Zones().List(ctx, filter.Regexp("region", g.getRegionLink(region))) + // Use regex match instead of an exact regional link constructed from getRegionalLink below. + // See comments in issue kubernetes/kubernetes#87905 + list, err := g.c.Zones().List(ctx, filter.Regexp("region", fmt.Sprintf(".*/regions/%s", region))) if err != nil { return nil, mc.Observe(err) }
Fix ListZonesInRegion() after client BasePath change This path fixes region Regex for listing zones. Compute client BasePath changed to compute.googleapis.com, but resource URI were left as www.googleapis.com
kubernetes_kubernetes
train
go
58d6a588a1fdc1784becab28a1f4870902d9a203
diff --git a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSideNav.java b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSideNav.java index <HASH>..<HASH> 100644 --- a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSideNav.java +++ b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSideNav.java @@ -31,6 +31,7 @@ import com.google.gwt.user.client.ui.Widget; import com.google.web.bindery.event.shared.HandlerRegistration; import gwt.material.design.client.base.*; import gwt.material.design.client.base.helper.DOMHelper; +import gwt.material.design.client.base.mixin.ActiveMixin; import gwt.material.design.client.base.mixin.StyleMixin; import gwt.material.design.client.constants.*; import gwt.material.design.client.events.*; @@ -328,6 +329,11 @@ public class MaterialSideNav extends MaterialWidget implements HasSelectables, H ClearActiveEvent.fire(this); } + public void setActive(int index) { + clearActive(); + getWidget(index).addStyleName(CssName.ACTIVE); + } + @Override protected void build() { applyFixedType();
Added method setActive(int index) to automatically select sidenav items.
GwtMaterialDesign_gwt-material
train
java
f00ab76be2572951dcc50431fcbd74fa4e610265
diff --git a/client/extensions/woocommerce/app/dashboard/pre-setup-view.js b/client/extensions/woocommerce/app/dashboard/pre-setup-view.js index <HASH>..<HASH> 100644 --- a/client/extensions/woocommerce/app/dashboard/pre-setup-view.js +++ b/client/extensions/woocommerce/app/dashboard/pre-setup-view.js @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; -import { every, includes, isEmpty, keys, pick, trim } from 'lodash'; +import { every, find, includes, isEmpty, keys, pick, trim } from 'lodash'; import { localize } from 'i18n-calypso'; /**
Store: Fix store address setup for CA addresses by using the correct `find`
Automattic_wp-calypso
train
js
dd133fe034274ea6bdd2c738241191087a92a3c7
diff --git a/testsuite.py b/testsuite.py index <HASH>..<HASH> 100644 --- a/testsuite.py +++ b/testsuite.py @@ -40,6 +40,7 @@ from __future__ import print_function +import errno import kconfiglib import os import platform @@ -2433,8 +2434,16 @@ def equal_confs(): with open(".config") as menu_conf: l1 = menu_conf.readlines() - with open("._config") as my_conf: - l2 = my_conf.readlines() + try: + my_conf = open("._config") + except IOError as e: + if e.errno != errno.ENOENT: + raise + print("._config not found. Did you forget to apply the Makefile patch?") + return False + else: + with my_conf: + l2 = my_conf.readlines() # Skip the header generated by 'conf' unset_re = r"# CONFIG_(\w+) is not set"
Warn if the Makefile patch hasn't been applied The old error from the test suite was cryptic.
ulfalizer_Kconfiglib
train
py
213942149427cd443bf13e54c482afafb66a284c
diff --git a/session/bootstrap.go b/session/bootstrap.go index <HASH>..<HASH> 100644 --- a/session/bootstrap.go +++ b/session/bootstrap.go @@ -1421,7 +1421,7 @@ func doDMLWorks(s Session) { } func mustExecute(s Session, sql string) { - _, err := s.Execute(context.Background(), sql) + _, err := s.ExecuteInternal(context.Background(), sql) if err != nil { debug.PrintStack() logutil.BgLogger().Fatal("mustExecute error", zap.Error(err))
session: use ExecuteInternal to execute the bootstrap SQLs (#<I>)
pingcap_tidb
train
go
e2417c3b6a4ba6c0c860e3e472fd9b7e6bc3cb4b
diff --git a/test/suite/Integration/Counterpart/CounterpartMatcherDriverTest.php b/test/suite/Integration/Counterpart/CounterpartMatcherDriverTest.php index <HASH>..<HASH> 100644 --- a/test/suite/Integration/Counterpart/CounterpartMatcherDriverTest.php +++ b/test/suite/Integration/Counterpart/CounterpartMatcherDriverTest.php @@ -16,6 +16,9 @@ use Eloquent\Phony\Matcher\WrappedMatcher; use PHPUnit_Framework_TestCase; use ReflectionClass; +/** + * @requires PHP 5.4.0-dev + */ class CounterpartMatcherDriverTest extends PHPUnit_Framework_TestCase { protected function setUp()
Add Counterpart matcher driver test requirement for easy version switching.
eloquent_phony
train
php
7887eabbfa1a80bb4d46a99f28385f45c45309f5
diff --git a/hazelcast/src/main/java/com/hazelcast/instance/Node.java b/hazelcast/src/main/java/com/hazelcast/instance/Node.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/instance/Node.java +++ b/hazelcast/src/main/java/com/hazelcast/instance/Node.java @@ -166,7 +166,6 @@ public class Node { clusterService = new ClusterServiceImpl(this); textCommandService = new TextCommandServiceImpl(this); nodeExtension.printNodeInfo(this); - versionCheck.check(this, getBuildInfo().getVersion(), buildInfo.isEnterprise()); this.multicastService = createMulticastService(addressPicker); initializeListeners(config); joiner = nodeContext.createJoiner(this); @@ -358,6 +357,7 @@ public class Node { logger.warning("ManagementCenterService could not be constructed!", e); } nodeExtension.afterStart(this); + versionCheck.check(this, getBuildInfo().getVersion(), buildInfo.isEnterprise()); } public void shutdown(final boolean terminate) {
Moved version check after node starts.
hazelcast_hazelcast
train
java
cb2f7d499466acd2a8c9b917262914e46b5bf104
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -62,3 +62,7 @@ end require "active_storage/attached" ActiveRecord::Base.send :extend, ActiveStorage::Attached::Macros + +require "global_id" +GlobalID.app = "ActiveStorageExampleApp" +ActiveRecord::Base.send :include, GlobalID::Identification
Still need GlobalID for PurgeJob serialization
rails_rails
train
rb
923acb68201622af4f0be0ba4c4ec059e919b536
diff --git a/lib/unix_daemon.rb b/lib/unix_daemon.rb index <HASH>..<HASH> 100644 --- a/lib/unix_daemon.rb +++ b/lib/unix_daemon.rb @@ -76,7 +76,9 @@ module ActsAsFerret # checked on ubuntu and OSX only def process_exists(pid) ps = IO.popen("ps -fp #{pid}", "r") - ps.to_a[1] =~ /ferret_server/ + process = ps.to_a[1] + ps.close + process =~ /ferret_server/ end end
close pipe so defunct ps process is not left hanging around
jkraemer_acts_as_ferret
train
rb
c6c83aa9b96807692e68f71dca5c73e6878b3ed0
diff --git a/webapps/client/scripts/filter/modals/cam-tasklist-filter-modal.js b/webapps/client/scripts/filter/modals/cam-tasklist-filter-modal.js index <HASH>..<HASH> 100644 --- a/webapps/client/scripts/filter/modals/cam-tasklist-filter-modal.js +++ b/webapps/client/scripts/filter/modals/cam-tasklist-filter-modal.js @@ -31,12 +31,12 @@ define([ function unfixLike(key, value) { if (likeExp.test(key)) { - if (val[0] === '%') { - val = val.slice(1, val.length); + if (value[0] === '%') { + value = value.slice(1, value.length); } - if (val.slice(-1) === '%') { - val = val.slice(0, -1); + if (value.slice(-1) === '%') { + value = value.slice(0, -1); } } return value;
fix(filter): fix typo in filter dialog related to CAM-<I>
camunda_camunda-bpm-platform
train
js
dbefa2b55132aeb5cc1411faefef331d5418bb62
diff --git a/lib/findJsModulesFor.js b/lib/findJsModulesFor.js index <HASH>..<HASH> 100644 --- a/lib/findJsModulesFor.js +++ b/lib/findJsModulesFor.js @@ -116,6 +116,14 @@ function findJsModulesFor(config, pathToCurrentFile, variableName) { }); }); + config.environmentCoreModules().forEach((dep) => { + if (dep.toLowerCase() !== variableName.toLowerCase()) { + return; + } + + matchedModules.push(new JsModule({ importPath: dep })); + }); + // Find imports from package.json const ignorePrefixes = config.get('ignore_package_prefixes').map( (prefix) => escapeRegExp(prefix)); @@ -139,14 +147,6 @@ function findJsModulesFor(config, pathToCurrentFile, variableName) { } }); - config.environmentCoreModules().forEach((dep) => { - if (dep.toLowerCase() !== variableName.toLowerCase()) { - return; - } - - matchedModules.push(new JsModule({ importPath: dep })); - }); - // If you have overlapping lookup paths, you might end up seeing the same // module to import twice. In order to dedupe these, we remove the module // with the longest path
Move finding environmentCoreModules above dependencies Conceptually these should be considered first, since they are part of the environment. Furthermore, this is how we group things so it is nice to have the symmetry here.
Galooshi_import-js
train
js
5161b793c3a06d70daa685c5a9b35fa3a101df40
diff --git a/packages/hw-transport-webhid/src/TransportWebHID.js b/packages/hw-transport-webhid/src/TransportWebHID.js index <HASH>..<HASH> 100644 --- a/packages/hw-transport-webhid/src/TransportWebHID.js +++ b/packages/hw-transport-webhid/src/TransportWebHID.js @@ -115,10 +115,10 @@ export default class TransportWebHID extends Transport<HIDDevice> { getFirstLedgerDevice().then( (device) => { if (!device) { - throw new Error('Access denied to use Ledger device') - } - - if (!unsubscribed) { + observer.error( + new TransportOpenUserCancelled("Access denied to use Ledger device") + ); + } else if (!unsubscribed) { const deviceModel = identifyUSBProductId(device.productId); observer.next({ type: "add", descriptor: device, deviceModel }); observer.complete();
call observer.error instead of throwing an error
LedgerHQ_ledgerjs
train
js
1d0b6ad75e1f8ca2934a7fe8d00953a430806184
diff --git a/common/src/test/java/io/netty/util/concurrent/DefaultPromiseTest.java b/common/src/test/java/io/netty/util/concurrent/DefaultPromiseTest.java index <HASH>..<HASH> 100644 --- a/common/src/test/java/io/netty/util/concurrent/DefaultPromiseTest.java +++ b/common/src/test/java/io/netty/util/concurrent/DefaultPromiseTest.java @@ -179,22 +179,12 @@ public class DefaultPromiseTest { @Test(timeout = 2000) public void testLateListenerIsOrderedCorrectlySuccess() throws InterruptedException { - final EventExecutor executor = new TestEventExecutor(); - try { - testLateListenerIsOrderedCorrectly(null); - } finally { - executor.shutdownGracefully(0, 0, TimeUnit.SECONDS).sync(); - } + testLateListenerIsOrderedCorrectly(null); } @Test(timeout = 2000) public void testLateListenerIsOrderedCorrectlyFailure() throws InterruptedException { - final EventExecutor executor = new TestEventExecutor(); - try { - testLateListenerIsOrderedCorrectly(fakeException()); - } finally { - executor.shutdownGracefully(0, 0, TimeUnit.SECONDS).sync(); - } + testLateListenerIsOrderedCorrectly(fakeException()); } /**
DefaultPromiseTest dead code removal Motivation: DefaultPromiseTest has dead code which was left over from a code restructure. Shared code between 2 tests was moved into a common method, but some code which was not cleaned up in each of these methods after the code was moved. Modifications: - Delete dead code in DefaultPromiseTest Result: Less dead code
netty_netty
train
java
1a811f3e8e7a736a7feba4a3e8712034e74ab759
diff --git a/code/plugins/system/koowa.php b/code/plugins/system/koowa.php index <HASH>..<HASH> 100644 --- a/code/plugins/system/koowa.php +++ b/code/plugins/system/koowa.php @@ -37,9 +37,10 @@ class plgSystemKoowa extends JPlugin JLoader::import('libraries.koowa.koowa', JPATH_ROOT); JLoader::import('libraries.koowa.loader.loader', JPATH_ROOT); - //Initialise the factory + //Instanciate the singletons KLoader::instantiate(); KFactory::instantiate(); + KRequest::instantiate(); //Add loader adapters KLoader::addAdapter(new KLoaderAdapterJoomla());
re #<I> : KRequest is now a singleton. Added instanciate call.
joomlatools_joomlatools-framework
train
php
89455f850be2404a1edac1e1eb17fb5edda5305c
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -262,7 +262,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn $this->loadedProviders[$providerName] = true; $provider->register(); - $provider->boot(); + $this->call([$provider, 'boot']); } /**
Call providers boot method via IoC.
orchestral_lumen
train
php
1f1c5c18dc512fe81c22eee5a17b98e9b0a97e4c
diff --git a/api/backups/restore.go b/api/backups/restore.go index <HASH>..<HASH> 100644 --- a/api/backups/restore.go +++ b/api/backups/restore.go @@ -126,9 +126,6 @@ func (c *Client) restore(backupId string, newClient ClientConnection) error { return errors.Annotatef(err, "cannot perform restore: %v", remoteError) } } - if err == nil { - return errors.Errorf("An unreported error occured in the server.") - } if err != rpc.ErrShutdown { return errors.Annotatef(err, "cannot perform restore: %v", remoteError) }
Removed erroneous check
juju_juju
train
go
1ac0b5d169ce7a6a232631dfaf326747c84a4d20
diff --git a/src/Conductors/Concerns/ConductsAbilities.php b/src/Conductors/Concerns/ConductsAbilities.php index <HASH>..<HASH> 100644 --- a/src/Conductors/Concerns/ConductsAbilities.php +++ b/src/Conductors/Concerns/ConductsAbilities.php @@ -86,10 +86,8 @@ trait ConductsAbilities // In an ideal world, we'd be using $collection->every('is_string'). // Since we also support older versions of Laravel, we'll need to - // use "contains" with a double negative. Such is legacy life. - return ! (new Collection($abilities))->contains(function ($ability) { - return ! is_string($ability); - }); + // use "array_filter" with a double count. Such is legacy life. + return count(array_filter($abilities, 'is_string')) == count($abilities); } /**
Use "array_filter" instead of "contains" The order of the arguments passed to the "contains" callback has changed between versions of Laravel making it impossible to use in Bouncer.......
JosephSilber_bouncer
train
php
9ba31d15e0157e13ae610631dab4567d876baf04
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/BugInstance.java b/findbugs/src/java/edu/umd/cs/findbugs/BugInstance.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/BugInstance.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/BugInstance.java @@ -169,6 +169,9 @@ public class BugInstance implements Comparable<BugInstance>, XMLWriteable, Seria return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.ENGLISH); } + private boolean isFakeBugType(String type) { + return "MISSING".equals(type) || "FOUND".equals(type); + } /** * Constructor. * @@ -185,7 +188,7 @@ public class BugInstance implements Comparable<BugInstance>, XMLWriteable, Seria BugPattern p = DetectorFactoryCollection.instance().lookupBugPattern(type); if (p == null) { - if (!"MISSING".equals(type) && missingBugTypes.add(type)) { + if (!isFakeBugType(type) && missingBugTypes.add(type)) { String msg = "Can't find definition of bug type " + type; AnalysisContext.logError(msg, new IllegalArgumentException(msg)); }
OK, web cloud tests use both MISSING and FOUND as bug types... sigh.... Accomodate both git-svn-id: <URL>
spotbugs_spotbugs
train
java
ad706c9526c02477f9463123a0661ecc5dfd12ee
diff --git a/lib/instance/executable_sequence_proxy.rb b/lib/instance/executable_sequence_proxy.rb index <HASH>..<HASH> 100644 --- a/lib/instance/executable_sequence_proxy.rb +++ b/lib/instance/executable_sequence_proxy.rb @@ -68,7 +68,7 @@ module RightScale AuditCookStub.instance.setup_audit_forwarding(@thread_name, context.audit) AuditCookStub.instance.on_close(@thread_name) { @audit_closed = true; check_done } end - + # FIX: thread_name should never be nil from the core in future, but # temporarily we must supply the default thread_name before if nil. in # future we should fail execution when thread_name is reliably present and @@ -80,7 +80,7 @@ module RightScale # # === Return # result(String):: Thread name of this context - def get_thread_name_from_context(context) + def get_thread_name_from_context(context) thread_name = nil thread_name = context.thread_name if context.respond_to?(:thread_name) Log.warn("Encountered a nil thread name unexpectedly, defaulting to '#{RightScale::AgentConfig.default_thread_name}'") unless thread_name @@ -99,6 +99,10 @@ module RightScale # true:: Always return true def run @succeeded = true + if context.payload.executables.empty? + succeed + return + end @context.audit.create_new_section('Querying tags')
acu<I> do not run boot bundle if it is empty This prevent server without any RightScript or recipe from stranding when repose is down
rightscale_right_link
train
rb
adc0437cb7067946bdd4ca0303ef055f12e1594c
diff --git a/src/main/java/uk/ac/bolton/spaws/model/impl/Ratings.java b/src/main/java/uk/ac/bolton/spaws/model/impl/Ratings.java index <HASH>..<HASH> 100644 --- a/src/main/java/uk/ac/bolton/spaws/model/impl/Ratings.java +++ b/src/main/java/uk/ac/bolton/spaws/model/impl/Ratings.java @@ -24,7 +24,7 @@ public class Ratings implements IRatings { private double average = 0.0; private int min = 0; private int max = 5; - private int sample = 1; + private int sample = 0; public String getVerb() { return VERB;
Set initial sample size for a set of ratings to 0
scottbw_spaws
train
java
6393269fadcbe64b6e6534c849c3cb660d49376a
diff --git a/salt/modules/useradd.py b/salt/modules/useradd.py index <HASH>..<HASH> 100644 --- a/salt/modules/useradd.py +++ b/salt/modules/useradd.py @@ -391,9 +391,6 @@ def _format_info(data): ''' # Put GECOS info into a list gecos_field = data.pw_gecos.split(',', 3) - # Assign empty strings for any unspecified GECOS fields - while len(gecos_field) < 4: - gecos_field.append('') return {'gid': data.pw_gid, 'groups': list_groups(data.pw_name,), @@ -402,10 +399,10 @@ def _format_info(data): 'passwd': data.pw_passwd, 'shell': data.pw_shell, 'uid': data.pw_uid, - 'fullname': gecos_field[0], - 'roomnumber': gecos_field[1], - 'workphone': gecos_field[2], - 'homephone': gecos_field[3]} + 'fullname': gecos_field.get(0, ''), + 'roomnumber': gecos_field.get(1, ''), + 'workphone': gecos_field.get(2, ''), + 'homephone': gecos_field.get(3, '')} def list_groups(name):
Making the gecos stuff easier to read
saltstack_salt
train
py
206496f06c8aa60609aff4ffa20d55f83a1e8b16
diff --git a/indra/assemblers/pybel/assembler.py b/indra/assemblers/pybel/assembler.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/pybel/assembler.py +++ b/indra/assemblers/pybel/assembler.py @@ -400,7 +400,7 @@ def belgraph_to_signed_graph( rel = edge_data.get('relation') pos_edge = \ (u, v, ('sign', 0)) + \ - tuple((k, (tuple(v) if isinstance(v, list) else v)) + tuple((k, tuple(v)) for k, v in edge_data.get('annotations', {}).items()) \ if propagate_annotations else (u, v, ('sign', 0)) # Unpack tuple pairs at indices >1 or they'll be in nested tuples
Fix creation of annotation propogated pybeledge Since this v will always be an instance of a dictionary where the keys are the annotations, just directly tuple(v) to get the tuple of all values for that annotation
sorgerlab_indra
train
py
1cccb29a3b9008a40ebea695079f8f45d65c45e8
diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -879,6 +879,7 @@ OpenLayers.Util.createUniqueID = function(prefix) { /** * Constant: INCHES_PER_UNIT * {Object} Constant inches per unit -- borrowed from MapServer mapscale.c + * derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile */ OpenLayers.INCHES_PER_UNIT = { 'inches': 1.0, @@ -886,10 +887,12 @@ OpenLayers.INCHES_PER_UNIT = { 'mi': 63360.0, 'm': 39.3701, 'km': 39370.1, - 'dd': 4374754 + 'dd': 4374754, + 'yd': 36 }; OpenLayers.INCHES_PER_UNIT["in"]= OpenLayers.INCHES_PER_UNIT.inches; OpenLayers.INCHES_PER_UNIT["degrees"] = OpenLayers.INCHES_PER_UNIT.dd; +OpenLayers.INCHES_PER_UNIT["nmi"] = 1852 * OpenLayers.INCHES_PER_UNIT.m; /** * Constant: DOTS_PER_INCH
add yards and nautical miles to OpenLayers units. (Closes #<I>) git-svn-id: <URL>
openlayers_openlayers
train
js
faccc560ca9712affcb07fa1369b4c9b1096633b
diff --git a/src/modules/getAnimationPromises.js b/src/modules/getAnimationPromises.js index <HASH>..<HASH> 100644 --- a/src/modules/getAnimationPromises.js +++ b/src/modules/getAnimationPromises.js @@ -3,7 +3,7 @@ import { transitionEnd } from '../helpers'; const getAnimationPromises = function() { const promises = []; - let animatedElements = queryAll(this.options.animationSelector); + const animatedElements = queryAll(this.options.animationSelector, document.body); animatedElements.forEach((element) => { const promise = new Promise((resolve) => { element.addEventListener(transitionEnd(), (event) => {
Scope animated elements selector to body
gmrchk_swup
train
js
4d99f117853e3826de90793f927d9a2b57ded787
diff --git a/linebot/event.go b/linebot/event.go index <HASH>..<HASH> 100644 --- a/linebot/event.go +++ b/linebot/event.go @@ -230,9 +230,10 @@ func (e *Event) UnmarshalJSON(body []byte) (err error) { case EventTypePostback: e.Postback = rawEvent.Postback case EventTypeBeacon: - deviceMessage, err := hex.DecodeString(rawEvent.Beacon.DM) + var deviceMessage []byte + deviceMessage, err = hex.DecodeString(rawEvent.Beacon.DM) if err != nil { - return err + return } e.Beacon = &Beacon{ Hwid: rawEvent.Beacon.Hwid,
Update return statement of EventTypeBeacon
line_line-bot-sdk-go
train
go
d9a1cf5caead024e2348d147dc10f1cf2b2f48cd
diff --git a/lib/db/services.php b/lib/db/services.php index <HASH>..<HASH> 100644 --- a/lib/db/services.php +++ b/lib/db/services.php @@ -946,7 +946,6 @@ $services = array( 'core_webservice_get_site_info', 'core_notes_create_notes', 'core_user_get_course_user_profiles', - 'core_enrol_get_enrolled_users', 'core_message_send_instant_messages', 'mod_assign_get_grades', 'mod_assign_get_assignments',
MDL-<I> webservices: Deleted duplicated function in mobile service
moodle_moodle
train
php
6b3414f03bb80d8c56da30a983e615d0681f7a16
diff --git a/lib/specinfra/command/base/service.rb b/lib/specinfra/command/base/service.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/command/base/service.rb +++ b/lib/specinfra/command/base/service.rb @@ -12,6 +12,10 @@ class Specinfra::Command::Base::Service < Specinfra::Command::Base "initctl status #{escape(service)} | grep running" end + def check_is_running_under_daemontools(service) + "svstat /service/#{escape(service)} | grep -E 'up \\(pid [0-9]+\\)'" + end + def check_is_monitored_by_monit(service) "monit status" end
Support daemontools Support daemontools (djb-ware) for checking service.
mizzy_specinfra
train
rb
d9d5892f8353ef7a724f1bfe735d1aa249c14ffa
diff --git a/src/HasTags.php b/src/HasTags.php index <HASH>..<HASH> 100644 --- a/src/HasTags.php +++ b/src/HasTags.php @@ -100,11 +100,11 @@ trait HasTags $tags = $className::findOrCreate($tags); - collect($tags)->each(function (Tag $tag) { - if (! $this->tags()->get()->contains('id', $tag->id)) { - $this->tags()->attach($tag); - } - }); + if (! $tags instanceof \Illuminate\Support\Collection) { + $tags = collect($tags); + } + + $this->tags()->syncWithoutDetaching($tags->pluck('id')->toArray()); return $this; }
Use syncWithoutDetaching instead of conditionally attaching tags
spatie_laravel-tags
train
php
ac81e185081c32a1924ae8079fa762d730a18ee3
diff --git a/src/Nucleus/Binder/Bounding.php b/src/Nucleus/Binder/Bounding.php index <HASH>..<HASH> 100644 --- a/src/Nucleus/Binder/Bounding.php +++ b/src/Nucleus/Binder/Bounding.php @@ -1,17 +1,17 @@ <?php -namespace Nucleus\Binder\Bound; +namespace Nucleus\Binder; /** * @Annotation - * + * * @Target({"PROPERTY"}) */ class Bounding { public $scope = IBinder::DEFAULT_SCOPE; - public $namespace = IBinder::DEFAULT_NAMESPACE; + public $namespace = null; public $variableName = null; } \ No newline at end of file
[b] wrong namespace for the Bounding class
mpoiriert_binder
train
php
f8851f403ca71ba3b5f6f07a592f37e950c63fdd
diff --git a/src/org/zaproxy/zap/extension/bruteforce/BruteForcePanel.java b/src/org/zaproxy/zap/extension/bruteforce/BruteForcePanel.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/extension/bruteforce/BruteForcePanel.java +++ b/src/org/zaproxy/zap/extension/bruteforce/BruteForcePanel.java @@ -146,7 +146,7 @@ public class BruteForcePanel extends AbstractPanel implements BruteForceListenne // Wont need to do this if/when this class is changed to extend ScanPanel scanStatus = new ScanStatus( new ImageIcon( - BruteForcePanel.class.getResource("/resource/icon/16/086.png")), + BruteForcePanel.class.getResource(ExtensionBruteForce.HAMMER_ICON_RESOURCE)), Constant.messages.getString("bruteforce.panel.title")); if (View.isInitialised()) {
Issue <I> - Forced Browse footer status label still uses spanner icon Changed to use the hammer icon.
zaproxy_zaproxy
train
java
218dc20ffb9fa2c2ceec0fc9640b4b656e232702
diff --git a/www/src/Lib/_struct.py b/www/src/Lib/_struct.py index <HASH>..<HASH> 100644 --- a/www/src/Lib/_struct.py +++ b/www/src/Lib/_struct.py @@ -439,6 +439,23 @@ def _clearcache(): "Clear the internal cache." # No cache in this implementation +class Struct: + + def __init__(self, fmt): + self.format = fmt + + def pack(self, *args): + return pack(self.format, *args) + + def pack_into(self, *args): + return pack_into(self.format, *args) + + def unpack(self, *args): + return unpack(self.format, *args) + + def unpack_from(self, *args): + return unpack_from(self.format, *args) + if __name__=='__main__': t = pack('Bf',1,2) print(t, len(t))
Fixes issue #<I> : "struct" module is missing the "Struct" class
brython-dev_brython
train
py
7f43c25beaca0d8c23e886691f1bbfec9ac7a819
diff --git a/tests/unit/test_handler.py b/tests/unit/test_handler.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_handler.py +++ b/tests/unit/test_handler.py @@ -190,4 +190,4 @@ def test_invalid_client_certs(): incorrect arguments specifying client cert/key verification""" with pytest.raises(ValueError): # missing client cert - GELFTLSHandler("127.0.0.1", keyfile="badkey") + GELFTLSHandler("127.0.0.1", keyfile="/dev/null")
changing keyfile to valid file for test
severb_graypy
train
py
f6e3bc4e6637e257e1fa7390ea95c2d2b30ee343
diff --git a/app/xmpp/msg-processors/room-info.js b/app/xmpp/msg-processors/room-info.js index <HASH>..<HASH> 100644 --- a/app/xmpp/msg-processors/room-info.js +++ b/app/xmpp/msg-processors/room-info.js @@ -45,6 +45,10 @@ module.exports = MessageProcessor.extend({ }); query.c('feature', { + var: 'muc_persistent' + }); + + query.c('feature', { var: 'muc_open' }); @@ -56,6 +60,10 @@ module.exports = MessageProcessor.extend({ var: 'muc_nonanonymous' }); + query.c('feature', { + var: 'muc_unsecured' + }); + cb(null, stanza); },
Improved XMPP room info
sdelements_lets-chat
train
js
9ddc5d4001ac19ee99f4c21a539a0cb247be5564
diff --git a/framework/db/ar/CActiveRecord.php b/framework/db/ar/CActiveRecord.php index <HASH>..<HASH> 100644 --- a/framework/db/ar/CActiveRecord.php +++ b/framework/db/ar/CActiveRecord.php @@ -66,6 +66,8 @@ abstract class CActiveRecord extends CModel /** * Constructor. * @param string $scenario scenario name. See {@link CModel::scenario} for more details about this parameter. + * Note: in order to setup initial model parameters use {@link init()} or {@link afterConstruct()}. + * Do NOT override the constructor unless it is absolutely necessary! */ public function __construct($scenario='insert') {
Note about overriding "CActiveRecord::__construct()" has been added.
yiisoft_yii
train
php
5bcc08bfaff4e04ea686aeed1910b11999632e59
diff --git a/python/herald/transports/xmpp/utils.py b/python/herald/transports/xmpp/utils.py index <HASH>..<HASH> 100644 --- a/python/herald/transports/xmpp/utils.py +++ b/python/herald/transports/xmpp/utils.py @@ -137,7 +137,7 @@ class RoomCreator(object): self.__lock = threading.Lock() def create_room(self, room, service, nick, config=None, - callback=None, errback=None): + callback=None, errback=None, room_jid=None): """ Prepares the creation of a room. @@ -157,12 +157,16 @@ class RoomCreator(object): :param config: Configuration of the room :param callback: Method called back on success :param errback: Method called on error + :param room_jid: Forced room JID """ self.__logger.debug("Creating room: %s", room) with self.__lock: - # Format the room JID - room_jid = sleekxmpp.JID(local=room, domain=service).bare + if not room_jid: + # Generate/Format the room JID if not given + room_jid = sleekxmpp.JID(local=room, domain=service).bare + + self.__logger.debug("... Room JID: %s", room_jid) if not self.__rooms: # First room to create: register to events
Support for forced room JID in XMPP RoomCreator
cohorte_cohorte-herald
train
py
9e2eced5e8f5fd9037b6309985d6b19086b05555
diff --git a/vel/rl/commands/record_movie_command.py b/vel/rl/commands/record_movie_command.py index <HASH>..<HASH> 100644 --- a/vel/rl/commands/record_movie_command.py +++ b/vel/rl/commands/record_movie_command.py @@ -76,7 +76,7 @@ class RecordMovieCommand: video = cv2.VideoWriter(takename, fourcc, self.fps, (frames[0].shape[1], frames[0].shape[0])) for i in tqdm.trange(len(frames), file=sys.stdout): - video.write(frames[i]) + video.write(cv2.cvtColor(frames[i], cv2.COLOR_RGB2BGR)) video.release() print(f"Written {takename}")
Fixing colorspace in movie recording code.
MillionIntegrals_vel
train
py
56937e2224943cbab35f3cea88af2dad78ee0356
diff --git a/web/concrete/elements/custom_style.php b/web/concrete/elements/custom_style.php index <HASH>..<HASH> 100644 --- a/web/concrete/elements/custom_style.php +++ b/web/concrete/elements/custom_style.php @@ -82,9 +82,8 @@ $alignmentOptions = array( ); -$customClassesSelect = array( - '' => t('None') -); +$customClassesSelect = array(); + if (is_array($customClasses)) { foreach($customClasses as $class) { $customClassesSelect[$class] = $class; @@ -302,7 +301,7 @@ $form = Core::make('helper/form'); <div> <?=t('Custom Class')?> - <?=$form->select('customClass', $customClassesSelect, $customClass);?> + <?= $form->text('customClass', $customClass);?> </div> <hr/> @@ -337,4 +336,5 @@ $form = Core::make('helper/form'); <script type="text/javascript"> $('#ccm-inline-design-form').<?=$method?>(); + $("#customClass").select2({tags:<?= json_encode(array_values($customClassesSelect)); ?>, separator: " "}); </script> \ No newline at end of file
Convert custom block class selection into a select2 tag selection field to support custom and multiple classes. Former-commit-id: <I>d<I>e<I>debf<I>aad0fff8bc<I>e<I>
concrete5_concrete5
train
php
74c1e483d886cba481e965b43cd1d3a2b96c6e0e
diff --git a/lib/datagrid/drivers/array.rb b/lib/datagrid/drivers/array.rb index <HASH>..<HASH> 100644 --- a/lib/datagrid/drivers/array.rb +++ b/lib/datagrid/drivers/array.rb @@ -3,7 +3,7 @@ module Datagrid class Array < AbstractDriver #:nodoc: def self.match?(scope) - !Datagrid::Drivers::ActiveRecord.match?(scope) && scope.is_a?(::Array) + !Datagrid::Drivers::ActiveRecord.match?(scope) && (scope.is_a?(::Array) || scope.is_a?(Enumerator)) end def to_scope(scope) diff --git a/spec/datagrid/drivers/array_spec.rb b/spec/datagrid/drivers/array_spec.rb index <HASH>..<HASH> 100644 --- a/spec/datagrid/drivers/array_spec.rb +++ b/spec/datagrid/drivers/array_spec.rb @@ -89,5 +89,18 @@ describe Datagrid::Drivers::Array do it {should == [third, first, second]} end end + end + describe "when using enumerator scope" do + + it "should work fine" do + grid = test_report(to_enum: true) do + scope {[]} + filter(:to_enum, :boolean) do |_, scope| + scope.to_enum + end + end + grid.assets.should_not be_any + end + end end
Ability to use enumerator as array driver
bogdan_datagrid
train
rb,rb
aa6524424bdb6b1a3ed76c1fbc4c877efd742a73
diff --git a/addict/__init__.py b/addict/__init__.py index <HASH>..<HASH> 100644 --- a/addict/__init__.py +++ b/addict/__init__.py @@ -2,7 +2,7 @@ from .addict import Dict __title__ = 'addict' -__version__ = '1.0.0' +__version__ = '1.1.0' __author__ = 'Mats Julian Olsen' __license__ = 'MIT' __copyright__ = 'Copyright 2014, 2015, 2016 Mats Julian Olsen'
<I> Added __add__ and bugfix to __init__.
mewwts_addict
train
py
6eed28158ffacb5d79528e6d75a1c5ba929097d0
diff --git a/src/Assets/js/wasabi.js b/src/Assets/js/wasabi.js index <HASH>..<HASH> 100644 --- a/src/Assets/js/wasabi.js +++ b/src/Assets/js/wasabi.js @@ -67,6 +67,20 @@ var WS = (function() { return this.modules[name]; } console.debug('module "' + name + " is not registered."); + }, + + createView: function(viewClass, options) { + return this.viewFactory.create(viewClass, options || {}); + }, + + createViews: function($elements, ViewClass, options) { + var views = []; + if ($elements.length > 0) { + $elements.each(function(index, el) { + views.push(WS.createView(ViewClass, _.extend({el: el}, options || {}))); + }); + } + return views; } };
add createView and createViews helper methods to initialize a single or multiple backbone views for the given element(s)
wasabi-cms_core
train
js
20e2a7b26992cb41b395578f2ab8f5c2e5efdfc3
diff --git a/client/api/story.js b/client/api/story.js index <HASH>..<HASH> 100644 --- a/client/api/story.js +++ b/client/api/story.js @@ -39,14 +39,14 @@ Story.prototype.setHash = function(name, hash) { return this; }; -Story.prototype.getData = function(name) { +Story.prototype.getData = (name) => { const nameData = name + '-data'; const data = localStorage.getItem(nameData); return data || ''; }; -Story.prototype.getHash = function(name) { +Story.prototype.getHash = (name) => { const item = name + '-hash'; const data = localStorage.getItem(item);
chore(story) lint
cloudcmd_deepword
train
js
17da0a4f98ef70e4a3f52609a75c2486532c86d1
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,9 @@ function furkotTrip() { var form, stops; function plan(data) { + if (!form) { + form = createForm(); + } stops.value = JSON.stringify(data); return form.submit(); } @@ -16,13 +19,19 @@ function furkotTrip() { return hidden ? '_blank' : '_top'; } - form = document.createElement('form'); - form.action = 'https://trips.furkot.com/trip'; - form.method = 'post'; - form.target = target(); - stops = document.createElement('input'); - stops.name = 'stops'; - form.appendChild(stops); + function createForm() { + var form = document.createElement('form'); + form.style.display = 'none'; + form.action = 'https://trips.furkot.com/trip'; + form.method = 'post'; + form.target = target(); + stops = document.createElement('input'); + stops.name = 'stops'; + form.appendChild(stops); + // Firefox needs form in DOM + document.body.appendChild(form); + return form; + } return { plan: plan
fix form submission on Firefox Firefox does not submit forms unless they are added to document body
furkot_furkot-trip
train
js
6f8c12356b153f50b0821944fc1d147b14a7bfcb
diff --git a/lib/moped/node.rb b/lib/moped/node.rb index <HASH>..<HASH> 100644 --- a/lib/moped/node.rb +++ b/lib/moped/node.rb @@ -502,7 +502,7 @@ module Moped instrument_start = (logger = Moped.logger) && logger.debug? && Time.new yield ensure - log_operations(logger, operations, Time.new - instrument_start) if instrument_start && !$! + log_operations(logger, operations, Time.new - instrument_start) if instrument_start end def log_operations(logger, ops, duration)
Log even if end of file reached.
mongoid_moped
train
rb
d583fbf4541df0a034aaba4f81938a51f89b3962
diff --git a/config/webpack/build.webpack.config.js b/config/webpack/build.webpack.config.js index <HASH>..<HASH> 100644 --- a/config/webpack/build.webpack.config.js +++ b/config/webpack/build.webpack.config.js @@ -37,10 +37,11 @@ const SaveStats = function () { * @name SaveMetadata */ const SaveMetadata = function () { + const metadata = []; + this.plugin('emit', (compilation, done) => { const formatName = 'SKY_PAGES_READY_%s'; const formatDeclare = '%s\nvar %s = true;\n'; - const metadata = []; // Only care about JS files Object.keys(compilation.assets).forEach((key) => { @@ -61,9 +62,11 @@ const SaveMetadata = function () { fallback: fallback }); }); + done(); + }); + this.plugin('done', () => { writeJson('metadata.json', metadata); - done(); }); };
Waiting until done to write metadata file
blackbaud_skyux-builder
train
js
fddb9b4144509be0ac84ff4ec67fd3a59c0b0f1c
diff --git a/client/state/login/reducer.js b/client/state/login/reducer.js index <HASH>..<HASH> 100644 --- a/client/state/login/reducer.js +++ b/client/state/login/reducer.js @@ -253,17 +253,17 @@ export const socialAccountLink = createReducer( ); export default combineReducers( { + isFormDisabled, isRequesting, isRequestingTwoFactorAuth, magicLogin, redirectTo, - isFormDisabled, requestError, requestNotice, requestSuccess, - twoFactorAuth, - twoFactorAuthRequestError, - twoFactorAuthPushPoll, socialAccount, socialAccountLink, + twoFactorAuth, + twoFactorAuthPushPoll, + twoFactorAuthRequestError, } );
Login: Order exports in reducer alphabetically
Automattic_wp-calypso
train
js
e841c7c3f375246a1e8778005e972db30ad51e2f
diff --git a/src/main/java/org/asteriskjava/manager/action/OriginateAction.java b/src/main/java/org/asteriskjava/manager/action/OriginateAction.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/manager/action/OriginateAction.java +++ b/src/main/java/org/asteriskjava/manager/action/OriginateAction.java @@ -131,7 +131,8 @@ public class OriginateAction extends AbstractManagerAction * presentation indicator.<br> * In essence, it says, 'Is the person who has been called allowed to see the callers number?' * (presentation) and 'What authority was used to verify that this is a genuine number?' - * (screening).<br> + * (screening).<br> + * <br> * Presentation indicator (Bits 6 and 7): * <pre> * Bits Meaning @@ -141,7 +142,6 @@ public class OriginateAction extends AbstractManagerAction * 1 0 Number not available due to interworking * 1 1 Reserved * </pre> - * * Screening indicator (Bits 1 and 2): * <pre> * Bits Meaning @@ -151,7 +151,6 @@ public class OriginateAction extends AbstractManagerAction * 1 0 User-provided, verified and failed * 1 1 Network provided * </pre> - * * Examples for some general settings: * <pre> * Presentation Allowed, Network Provided: 3 (00000011)
Fixed callingPres property (Boolean -> Integer) and its documentation
asterisk-java_asterisk-java
train
java
892126c4bc2f6dee16fb9d525baa1b43a361ad85
diff --git a/bin/whistle.js b/bin/whistle.js index <HASH>..<HASH> 100755 --- a/bin/whistle.js +++ b/bin/whistle.js @@ -1,6 +1,6 @@ #! /usr/bin/env node -var program = require('../../starting'); +var program = require('starting'); var path = require('path'); var os = require('os'); var config = require('../lib/config');
refactor: show plugins debug info
avwo_whistle
train
js
c013371a43d30b5b54407f3fea2f2fd76bbe5934
diff --git a/hvac/api/secrets_engines/aws.py b/hvac/api/secrets_engines/aws.py index <HASH>..<HASH> 100644 --- a/hvac/api/secrets_engines/aws.py +++ b/hvac/api/secrets_engines/aws.py @@ -326,8 +326,8 @@ class Aws(VaultApiBase): name=name, ) - response = self._adapter.post( + response = self._adapter.get( url=api_path, - json=params, + params=params, ) return response.json() diff --git a/tests/unit_tests/api/secrets_engines/test_aws.py b/tests/unit_tests/api/secrets_engines/test_aws.py index <HASH>..<HASH> 100644 --- a/tests/unit_tests/api/secrets_engines/test_aws.py +++ b/tests/unit_tests/api/secrets_engines/test_aws.py @@ -75,7 +75,7 @@ class TestAws(TestCase): aws = Aws(adapter=Request()) with requests_mock.mock() as requests_mocker: requests_mocker.register_uri( - method='POST', + method='GET', url=mock_url, status_code=expected_status_code, json=mock_response,
Change AWS `generate_credentials` request method to GET (#<I>) * Change AWS `generate_credentials` request method to GET * Update aws.py
hvac_hvac
train
py,py
57974ea2b5b757d0145ceb8f7f2c39962278988c
diff --git a/lib/docker-json-client.js b/lib/docker-json-client.js index <HASH>..<HASH> 100644 --- a/lib/docker-json-client.js +++ b/lib/docker-json-client.js @@ -199,7 +199,7 @@ DockerJsonClient.prototype.parse = function parse(req, callback) { res.on('data', function onData(chunk) { if (contentMd5Hash) { - contentMd5Hash.update(chunk); + contentMd5Hash.update(chunk.toString('utf8')); } if (gz) {
encode content as utf-8 for content-md5 checking Somewhat inferred from <URL>
joyent_node-docker-registry-client
train
js
ef7bc3bd1830690fbcb29fac2d67f8eb149586d1
diff --git a/Form/Type/DateRangeType.php b/Form/Type/DateRangeType.php index <HASH>..<HASH> 100644 --- a/Form/Type/DateRangeType.php +++ b/Form/Type/DateRangeType.php @@ -20,6 +20,9 @@ class DateRangeType extends AbstractType { unset($options['years']); + $options['from']['required'] = $options['required']; + $options['to']['required'] = $options['required']; + $builder ->add('from', new DateType(), $options['from']) ->add('to', new DateType(), $options['to']);
Pass the required to from & to
symfony2admingenerator_AdmingeneratorGeneratorBundle
train
php
260b177fe3f0ec897a4a4d71f2c2247e50b9fbd3
diff --git a/common/compiler/solidity.go b/common/compiler/solidity.go index <HASH>..<HASH> 100644 --- a/common/compiler/solidity.go +++ b/common/compiler/solidity.go @@ -48,6 +48,7 @@ func (s *Solidity) makeArgs() []string { p := []string{ "--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc", "--optimize", // code optimizer switched on + "--allow-paths", "., ./, ../", //default to support relative path: ./ ../ . } if s.Major > 0 || s.Minor > 4 || s.Patch > 6 { p[1] += ",metadata,hashes"
common/compiler: support relative import paths (#<I>)
ethereum_go-ethereum
train
go
3763ea8907ddb43aa89c65eb9e77c2b74918fadc
diff --git a/test/fog/xml/connection_test.rb b/test/fog/xml/connection_test.rb index <HASH>..<HASH> 100644 --- a/test/fog/xml/connection_test.rb +++ b/test/fog/xml/connection_test.rb @@ -2,7 +2,7 @@ require "minitest/autorun" require "fog" # Note this is going to be part of fog-xml eventually -class TestFogXMLConnection < Minitest::Test +class Fog::XML::ConnectionTest < Minitest::Test def setup @connection = Fog::XML::Connection.new("http://localhost") end
Rename testing class to fit filename `TestFogXMLConnection` didn't really match with the file name of `test/fog/xml/connection_test.rb` due to the namespacing and placement of "Test"
fog_fog
train
rb
0fb9f4d221529fbc4b0515cbf4b8179c7c9ce679
diff --git a/test/load_brocfile_test.js b/test/load_brocfile_test.js index <HASH>..<HASH> 100644 --- a/test/load_brocfile_test.js +++ b/test/load_brocfile_test.js @@ -51,7 +51,7 @@ describe('loadBrocfile', function() { }); context('with invalid Brocfile.ts', function() { - this.slow(2000); + this.slow(8000); it('throws an error for invalid syntax', function() { chai @@ -61,7 +61,7 @@ describe('loadBrocfile', function() { }); context('with Brocfile.ts', function() { - this.slow(2000); + this.slow(8000); it('compiles and return tree definition', function() { process.chdir(projectPathTs);
Increase TS load timeout to avoid appveyor timeout (#<I>)
broccolijs_broccoli
train
js
39558a3d69f4d297258e8035e0f9c17801c726d7
diff --git a/library/src/com/nostra13/universalimageloader/core/DisplayImageOptions.java b/library/src/com/nostra13/universalimageloader/core/DisplayImageOptions.java index <HASH>..<HASH> 100644 --- a/library/src/com/nostra13/universalimageloader/core/DisplayImageOptions.java +++ b/library/src/com/nostra13/universalimageloader/core/DisplayImageOptions.java @@ -291,12 +291,16 @@ public final class DisplayImageOptions { public Builder cloneFrom(DisplayImageOptions options) { stubImage = options.stubImage; imageForEmptyUri = options.imageForEmptyUri; + imageOnFail = options.imageOnFail; resetViewBeforeLoading = options.resetViewBeforeLoading; cacheInMemory = options.cacheInMemory; cacheOnDisc = options.cacheOnDisc; imageScaleType = options.imageScaleType; bitmapConfig = options.bitmapConfig; delayBeforeLoading = options.delayBeforeLoading; + extraForDownloader = options.extraForDownloader; + preProcessor = options.preProcessor; + postProcessor = options.postProcessor; displayer = options.displayer; return this; }
Issue #<I> - cloneFrom does not clone pre/postprocessor
nostra13_Android-Universal-Image-Loader
train
java
522f9aff1cdf8308bbdf9add62671ad63309943a
diff --git a/addon/components/ui-dropdown.js b/addon/components/ui-dropdown.js index <HASH>..<HASH> 100644 --- a/addon/components/ui-dropdown.js +++ b/addon/components/ui-dropdown.js @@ -44,7 +44,7 @@ export default Ember.Select.extend(Base, DataAttributes, { // Without this, Dropdown Items will not be clickable if the content // is set after the initial render. Ember.run.scheduleOnce('afterRender', this, function() { - if (this.isDestroyed || this.isDestroying) return; + if (this.get('isDestroyed') || this.get('isDestroying')) return; this.didInsertElement(); this.set_value(); });
Switch to using get rather than accessing properties directly
Semantic-Org_Semantic-UI-Ember
train
js
65165c6f60282f1433e7ac9d2ab7c8f3d9541896
diff --git a/actor-apps/app-web/src/app/index.js b/actor-apps/app-web/src/app/index.js index <HASH>..<HASH> 100644 --- a/actor-apps/app-web/src/app/index.js +++ b/actor-apps/app-web/src/app/index.js @@ -35,7 +35,11 @@ const initReact = () => { crosstab.broadcast(ActorInitEvent, {}); } - window.messenger = new window.actor.ActorApp(); + if (location.pathname === '/app') { + window.messenger = new window.actor.ActorApp('wss://' + location.hostname + ':9080/'); + } else { + window.messenger = new window.actor.ActorApp(); + } } const App = React.createClass({
feat(web): detect local version and set proper endpoint
actorapp_actor-platform
train
js
14aa9aa6919e4b70c59cd20722ac113c0ffeb45b
diff --git a/src/Unirest/Request.php b/src/Unirest/Request.php index <HASH>..<HASH> 100755 --- a/src/Unirest/Request.php +++ b/src/Unirest/Request.php @@ -399,6 +399,9 @@ class Request if ($method === Method::POST) { curl_setopt(self::$handle, CURLOPT_POST, true); } else { + if ($method === Method::HEAD) { + curl_setopt(self::$handle, CURLOPT_NOBODY, true); + } curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method); } diff --git a/tests/Unirest/RequestTest.php b/tests/Unirest/RequestTest.php index <HASH>..<HASH> 100644 --- a/tests/Unirest/RequestTest.php +++ b/tests/Unirest/RequestTest.php @@ -251,6 +251,16 @@ class UnirestRequestTest extends \PHPUnit_Framework_TestCase $this->assertEquals('John', $response->body->queryString->name[1]); } + // HEAD + public function testHead() + { + $response = Request::head('http://mockbin.com/request?name=Mark', array( + 'Accept' => 'application/json' + )); + + $this->assertEquals(200, $response->code); + } + // POST public function testPost() {
feat(HEAD): CURLOPT_NOBODY option for HEAD requests * When using HEAD requests set the appropriate curl header to not wait for a response body. See <URL>
Kong_unirest-php
train
php,php