diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/Bundle/BlogBundle/Manager/ArticleManager.php b/Bundle/BlogBundle/Manager/ArticleManager.php
index <HASH>..<HASH> 100644
--- a/Bundle/BlogBundle/Manager/ArticleManager.php
+++ b/Bundle/BlogBundle/Manager/ArticleManager.php
@@ -77,6 +77,7 @@ class ArticleManager
//Transform VBP into BP
$this->virtualToBusinessPageTransformer->transform($page);
$page->setParent($article->getBlog());
+ $page->setStatus($article->getStatus());
$this->entityManager->persist($page);
$this->entityManager->flush();
|
give an Article BusinessPage the draft article's status
|
diff --git a/src/Factory.php b/src/Factory.php
index <HASH>..<HASH> 100644
--- a/src/Factory.php
+++ b/src/Factory.php
@@ -3,7 +3,6 @@
namespace Phlib\Logger;
use Psr\Log\LoggerInterface;
-use Psr\Log\LogLevel;
/**
* Class Factory
@@ -11,6 +10,9 @@ use Psr\Log\LogLevel;
*/
class Factory
{
+ /**
+ * @var array
+ */
private $decorators = [
'level' => '\Phlib\Logger\Decorator\LevelFilter'
];
|
Tidy up imports and docblocks
|
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/json/encoding.rb
+++ b/activesupport/lib/active_support/json/encoding.rb
@@ -2,6 +2,7 @@ require 'active_support/core_ext/object/to_json'
require 'active_support/core_ext/module/delegation'
require 'active_support/deprecation'
require 'active_support/json/variable'
+require 'active_support/ordered_hash'
require 'bigdecimal'
require 'active_support/core_ext/big_decimal/conversions' # for #to_s
|
add missing require for ordered_hash dependency
|
diff --git a/tests/Console/Command/IndexCreateOrUpdateMappingCommandTest.php b/tests/Console/Command/IndexCreateOrUpdateMappingCommandTest.php
index <HASH>..<HASH> 100644
--- a/tests/Console/Command/IndexCreateOrUpdateMappingCommandTest.php
+++ b/tests/Console/Command/IndexCreateOrUpdateMappingCommandTest.php
@@ -20,6 +20,10 @@ final class IndexCreateOrUpdateMappingCommandTest extends TestCase
$mock->shouldReceive('exists')
->once()
->andReturn(true);
+
+ $mock->shouldReceive('get')
+ ->once()
+ ->andReturn('{}');
});
$this->mock(Client::class, function (MockInterface $mock) {
@@ -108,6 +112,10 @@ final class IndexCreateOrUpdateMappingCommandTest extends TestCase
$mock->shouldReceive('exists')
->once()
->andReturn(true);
+
+ $mock->shouldReceive('get')
+ ->once()
+ ->andReturn('{}');
});
$this->mock(Client::class, function (MockInterface $mock) {
|
fixes tests for load json mapping file
|
diff --git a/tests/MetarDecoderTest.php b/tests/MetarDecoderTest.php
index <HASH>..<HASH> 100644
--- a/tests/MetarDecoderTest.php
+++ b/tests/MetarDecoderTest.php
@@ -182,7 +182,8 @@ class MetarDecoderTest extends \PHPUnit_Framework_TestCase
$d = $this->decoder->parseNotStrict($metar);
$this->assertFalse($d->isValid());
$this->assertEquals(1, count($d->getDecodingExceptions()));
- $error = $d->getDecodingExceptions()[0];
+ $errors = $d->getDecodingExceptions();
+ $error = $errors[0];
$this->assertEquals('CloudChunkDecoder', $error->getChunkDecoder());
$this->assertNull($d->getClouds());
}
|
Ensure compatibility for PHP<I>
|
diff --git a/vent/core/rq_worker/watch.py b/vent/core/rq_worker/watch.py
index <HASH>..<HASH> 100644
--- a/vent/core/rq_worker/watch.py
+++ b/vent/core/rq_worker/watch.py
@@ -83,11 +83,11 @@ def gpu_queue(options):
# check for vent usage/processes running
if (dedicated and
dev not in usage['vent_usage']['mem_mb'] and
- mem_needed <= usage[dev]['global_memory'] and
- not usage[dev]['processes']):
+ mem_needed <= usage[int(dev)]['global_memory'] and
+ not usage[int(dev)]['processes']):
device = dev
# check for ram constraints
- elif mem_needed <= (usage[dev]['global_memory'] - ram_used):
+ elif mem_needed <= (usage[int(dev)]['global_memory'] - ram_used):
device = dev
# TODO make this sleep incremental up to a point, potentially kill
|
dict key is an int not a string :(
|
diff --git a/chorus/src/main/java/org/chorusbdd/chorus/handlers/processes/ProcessesHandler.java b/chorus/src/main/java/org/chorusbdd/chorus/handlers/processes/ProcessesHandler.java
index <HASH>..<HASH> 100755
--- a/chorus/src/main/java/org/chorusbdd/chorus/handlers/processes/ProcessesHandler.java
+++ b/chorus/src/main/java/org/chorusbdd/chorus/handlers/processes/ProcessesHandler.java
@@ -65,7 +65,7 @@ public class ProcessesHandler {
private ProcessManager processManager = ProcessManager.getInstance();
- @Initialize
+ @Initialize(scope= Scope.FEATURE)
public void setup() {
processManager.setFeatureDetails(featureDir, featureFile, featureToken);
processConfigTemplates = loadProcessConfig();
|
Change scoping of initialize / load configs to feature initialization, to match past behaviour
|
diff --git a/test/rdoc_test.rb b/test/rdoc_test.rb
index <HASH>..<HASH> 100644
--- a/test/rdoc_test.rb
+++ b/test/rdoc_test.rb
@@ -16,13 +16,13 @@ class RdocTest < Test::Unit::TestCase
it 'renders inline rdoc strings' do
rdoc_app { rdoc '= Hiya' }
assert ok?
- assert_body /<h1[^>]*>Hiya<\/h1>/
+ assert_body /<h1[^>]*>Hiya(<span><a href=\"#label-Hiya\">¶<\/a> <a href=\"#documentation\">↑<\/a><\/span>)?<\/h1>/
end
it 'renders .rdoc files in views path' do
rdoc_app { rdoc :hello }
assert ok?
- assert_body /<h1[^>]*>Hello From RDoc<\/h1>/
+ assert_body /<h1[^>]*>Hello From RDoc(<span><a href=\"#label-Hello\+From\+RDoc\">¶<\/a> <a href=\"#documentation\">↑<\/a><\/span>)?<\/h1>/
end
it "raises error if template not found" do
|
Fix test failures with RDoc 4 broken by commit rdoc/rdoc@7f<I>d
|
diff --git a/test/modules/mock.js b/test/modules/mock.js
index <HASH>..<HASH> 100644
--- a/test/modules/mock.js
+++ b/test/modules/mock.js
@@ -1,7 +1,8 @@
/**
* Defines phantomas global API mock
*/
-var noop = function() {};
+var assert = require('assert'),
+ noop = function() {};
var phantomas = function() {
this.emitter = new (require('events').EventEmitter)();
@@ -133,7 +134,7 @@ function assertMetric(name, value) {
value = value || 1;
return function(phantomas) {
- phantomas.hasValue(name, value);
+ assert.strictEqual(value, phantomas.getMetric(name));
};
}
@@ -149,12 +150,10 @@ module.exports = {
getContext: function(moduleName, topic, metricsCheck) {
var phantomas = initModule(moduleName),
- context;
+ context = {};
- context = {
- topic: function() {
- return topic(phantomas);
- }
+ context.topic = function() {
+ return topic(phantomas);
};
Object.keys(metricsCheck || {}).forEach(function(name) {
|
Unit tests: fix assertMetric()
|
diff --git a/base/src/main/java/uk/ac/ebi/atlas/controllers/ResourceNotFoundException.java b/base/src/main/java/uk/ac/ebi/atlas/controllers/ResourceNotFoundException.java
index <HASH>..<HASH> 100644
--- a/base/src/main/java/uk/ac/ebi/atlas/controllers/ResourceNotFoundException.java
+++ b/base/src/main/java/uk/ac/ebi/atlas/controllers/ResourceNotFoundException.java
@@ -3,9 +3,9 @@ package uk.ac.ebi.atlas.controllers;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
+//TODO Make this a subclass of MissingResourceException to include fields about the resource class and key
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public final class ResourceNotFoundException extends RuntimeException {
-
public ResourceNotFoundException(Exception exception){
super(exception);
}
|
Add a TODO note for an enhancement of ResourceNotFoundException
(cherry picked from commit a<I>f0)
|
diff --git a/static/scripts/partialNavigation.js b/static/scripts/partialNavigation.js
index <HASH>..<HASH> 100644
--- a/static/scripts/partialNavigation.js
+++ b/static/scripts/partialNavigation.js
@@ -39,7 +39,8 @@
if (res) res = (href.indexOf('.js.html') === -1)
&& (href.indexOf('http://') === -1)
&& (href.indexOf('https://') === -1)
- && (href.charAt(0) !== '/');
+ && (href.charAt(0) !== '/')
+ && (href.charAt(0) !== '.');
return res;
}
var needUpdateURL = false;
|
fix partial navigation in case of relative links
|
diff --git a/spec/unit/synchronization_spec.rb b/spec/unit/synchronization_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/synchronization_spec.rb
+++ b/spec/unit/synchronization_spec.rb
@@ -49,7 +49,7 @@ module WebsocketRails
context "when dispatching user events" do
before do
- @event = Event.new(:channel_event, :user_id => :username, :data => 'hello channel one')
+ @event = Event.new(:channel_event, :user_id => "username", :data => 'hello channel one')
end
context "and the user is not connected to this server" do
@@ -61,11 +61,11 @@ module WebsocketRails
context "and the user is connected to this server" do
before do
@connection = double('Connection')
- WebsocketRails.users[:username] = @connection
+ WebsocketRails.users["username"] = @connection
end
it "triggers the event on the correct user" do
- WebsocketRails.users[:username].should_receive(:trigger).with @event
+ WebsocketRails.users["username"].should_receive(:trigger).with @event
subject.trigger_incoming @event
end
end
|
Type cast username to string in Synchronization spec.
|
diff --git a/lib/rango/templates/helpers.rb b/lib/rango/templates/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/rango/templates/helpers.rb
+++ b/lib/rango/templates/helpers.rb
@@ -79,7 +79,7 @@ module Rango
raise ArgumentError, "Block has to have a name!" if name.nil?
raise ArgumentError, "You have to provide value or block, not both of them!" if value && block
value = self.template.scope.capture(&block) if value.nil? && block
- self.template.blocks[name] = "#{self.template.blocks[name]}\n#{value}" if value
+ self.template.blocks[name] = value if value
return self.template.blocks[name]
end
|
You have to can block(:name) in your extend/enhance so you can wrap block content in a tag.
Example:
extend_block(:content) do
#wrapper= block(:content)
|
diff --git a/spec/bitbucket_rest_api/repos_spec.rb b/spec/bitbucket_rest_api/repos_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/bitbucket_rest_api/repos_spec.rb
+++ b/spec/bitbucket_rest_api/repos_spec.rb
@@ -119,11 +119,19 @@ describe BitBucket::Repos do
'/1.0/repositories/mock_username/mock_repo/tags/',
{},
{}
- )
+ ).and_return(['tag1', 'tag2' ,'tag3'])
end
- it 'should send a GET request for the tags belonging to the given repo' do
- repo.tags('mock_username', 'mock_repo')
+ context 'without a block' do
+ it 'should send a GET request for the tags belonging to the given repo' do
+ repo.tags('mock_username', 'mock_repo')
+ end
+ end
+
+ context 'with a block' do
+ it 'should send a GET request for the tags belonging to the given repo' do
+ repo.tags('mock_username', 'mock_repo') { |tag| tag }
+ end
end
end
|
Test .tags with a block in repos_spec
|
diff --git a/lib/pdk/config.rb b/lib/pdk/config.rb
index <HASH>..<HASH> 100644
--- a/lib/pdk/config.rb
+++ b/lib/pdk/config.rb
@@ -8,6 +8,7 @@ module PDK
class Config
autoload :JSON, 'pdk/config/json'
autoload :JSONSchemaNamespace, 'pdk/config/json_schema_namespace'
+ autoload :JSONSchemaSetting, 'pdk/config/json_schema_setting'
autoload :LoadError, 'pdk/config/errors'
autoload :Namespace, 'pdk/config/namespace'
autoload :Setting, 'pdk/config/setting'
diff --git a/lib/pdk/config/json_schema_setting.rb b/lib/pdk/config/json_schema_setting.rb
index <HASH>..<HASH> 100644
--- a/lib/pdk/config/json_schema_setting.rb
+++ b/lib/pdk/config/json_schema_setting.rb
@@ -1,4 +1,4 @@
-require 'pdk/config/json_schema_namespace'
+require 'pdk'
module PDK
class Config
|
(maint) Ensure pdk/config/json_schema_setting works standalone
|
diff --git a/ipuz/__init__.py b/ipuz/__init__.py
index <HASH>..<HASH> 100644
--- a/ipuz/__init__.py
+++ b/ipuz/__init__.py
@@ -110,7 +110,7 @@ def validate_clueplacement(field_name, field_data):
def validate_answer(field_name, field_data):
- if type(field_data) not in [str, unicode]:
+ if type(field_data) not in [str, unicode] or field_data == "":
raise IPUZException("Invalid answer value found")
diff --git a/tests/test_ipuz.py b/tests/test_ipuz.py
index <HASH>..<HASH> 100644
--- a/tests/test_ipuz.py
+++ b/tests/test_ipuz.py
@@ -342,6 +342,10 @@ class IPUZAnswerTestCase(IPUZSampleCrosswordTestCase):
self.puzzle["answer"] = 3
self.validate("Invalid answer value found")
+ def test_answer_is_non_empty_string(self):
+ self.puzzle["answer"] = ""
+ self.validate("Invalid answer value found")
+
def test_answers_not_a_list(self):
self.puzzle["answers"] = 3
self.validate("Invalid answers value found")
|
Ensure answer value is not an empty string
|
diff --git a/restclients/models/bridge.py b/restclients/models/bridge.py
index <HASH>..<HASH> 100644
--- a/restclients/models/bridge.py
+++ b/restclients/models/bridge.py
@@ -37,7 +37,7 @@ class BridgeCustomField(models.Model):
class BridgeUser(models.Model):
- bridge_id = models.IntegerField(default=0)
+ bridge_id = models.CharField(max_length=16, null=True, default=None)
uwnetid = models.CharField(max_length=128)
first_name = models.CharField(max_length=128)
full_name = models.CharField(max_length=128)
|
bridge_id is a string.
|
diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -28,7 +28,7 @@ return array(
'name' => 'taoQtiItem',
'label' => 'QTI item model',
'license' => 'GPL-2.0',
- 'version' => '10.3.3',
+ 'version' => '10.4.0',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoItems' => '>=4.2.4',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -439,6 +439,6 @@ class Updater extends \common_ext_ExtensionUpdater
$this->setVersion('10.0.0');
}
- $this->skip('10.0.0', '10.3.3');
+ $this->skip('10.0.0', '10.4.0');
}
}
|
Bump to version <I>
|
diff --git a/librosa/__init__.py b/librosa/__init__.py
index <HASH>..<HASH> 100644
--- a/librosa/__init__.py
+++ b/librosa/__init__.py
@@ -10,6 +10,27 @@ Includes constants, core utility functions, etc
import numpy, scipy
import beat, framegenerator, _chroma, _mfcc, tf_agc
+import audioread
+
+def load(path, mono=True, frame_size=1024):
+ '''
+ Load an audio file into a single, long time series
+
+ Input:
+ path: path to the input file
+ mono: convert to mono? | Default: True
+ frame_size: buffer size | Default: 1024 samples
+ Output:
+ y: the time series
+ sr: the sampling rate
+ '''
+
+ with audioread.audio_open(path) as f:
+ sr = f.samplerate
+ y = numpy.concatenate([frame for frame in framegenerator.audioread_timeseries(f, frame_size)], axis=0)
+ pass
+
+ return (y, sr)
def pad(w, d_pad, v=0.0, center=True):
'''
|
added a wrapper to audioread
|
diff --git a/lib/provider/ticket.rb b/lib/provider/ticket.rb
index <HASH>..<HASH> 100644
--- a/lib/provider/ticket.rb
+++ b/lib/provider/ticket.rb
@@ -16,7 +16,8 @@ module TicketMaster::Provider
:backlog => object.backlog,
:wip => object.wip,
:created_at => object.created_at,
- :updated_at => object.updated_at}
+ :updated_at => object.updated_at,
+ :project_slug => object.project_slug}
else
hash = object
end
|
added project_slug field to tickets initialization
|
diff --git a/lib/coveralls/configuration.rb b/lib/coveralls/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/coveralls/configuration.rb
+++ b/lib/coveralls/configuration.rb
@@ -143,8 +143,7 @@ module Coveralls
}
# Branch
- branch = `git branch`.split("\n").delete_if { |i| i[0] != "*" }
- hash[:branch] = [branch].flatten.first.gsub("* ","")
+ hash[:branch] = `git rev-parse --abbrev-ref HEAD`
# Remotes
remotes = nil
|
Improve method for determining current git branch
|
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index <HASH>..<HASH> 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1685,9 +1685,9 @@ class Cmd(cmd.Cmd):
if py_bridge_call:
# Stop saving command's stdout before command finalization hooks run
self.stdout.pause_storage = True
- except KeyboardInterrupt as e:
+ except KeyboardInterrupt as ex:
if raise_keyboard_interrupt:
- raise e
+ raise ex
except (Cmd2ArgparseError, EmptyStatement):
# Don't do anything, but do allow command finalization hooks to run
pass
@@ -3255,10 +3255,8 @@ class Cmd(cmd.Cmd):
# noinspection PyBroadException
try:
interp.runcode(py_code_to_run)
- except KeyboardInterrupt as e:
- raise e
except BaseException:
- # We don't care about any other exceptions that happened in the Python code
+ # We don't care about any exceptions that happened in the Python code
pass
# Otherwise we will open an interactive Python shell
|
Since runcode() catches most KeyboardInterrupts, just ignore any that make their way up to our code.
This is more consistent than raising the rare few that we see.
|
diff --git a/src/main/java/liquibase/ext/ora/truncate/TruncateStatement.java b/src/main/java/liquibase/ext/ora/truncate/TruncateStatement.java
index <HASH>..<HASH> 100644
--- a/src/main/java/liquibase/ext/ora/truncate/TruncateStatement.java
+++ b/src/main/java/liquibase/ext/ora/truncate/TruncateStatement.java
@@ -27,8 +27,8 @@ public class TruncateStatement extends AbstractSqlStatement {
return clusterName;
}
- public boolean purgeMaterializedViewLog() {
- return purgeMaterializedViewLog != null ? purgeMaterializedViewLog.booleanValue() : false;
+ public Boolean purgeMaterializedViewLog() {
+ return purgeMaterializedViewLog;
}
public TruncateStatement setPurgeMaterializedViewLog(Boolean purgeMaterializedViewLog) {
@@ -36,8 +36,8 @@ public class TruncateStatement extends AbstractSqlStatement {
return this;
}
- public boolean reuseStorage() {
- return reuseStorage != null ? reuseStorage.booleanValue() : false;
+ public Boolean reuseStorage() {
+ return reuseStorage;
}
public TruncateStatement setReuseStorage(Boolean reuseStorage) {
|
Modified boolean get methods to be able to return null.
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,8 @@ with open(metadata['__file__'], 'r') as f:
BASE_DIR = os.path.join(os.path.expanduser("~"), ".indy")
-tests_require = ['attrs==19.1.0', 'pytest==3.3.1', 'pytest-xdist==1.22.1', 'python3-indy==1.11.1-dev-1343', 'pytest-asyncio==0.8.0']
+tests_require = ['attrs==19.1.0', 'pytest==3.3.1', 'pytest-xdist==1.22.1', 'pytest-forked==0.2',
+ 'python3-indy==1.11.1-dev-1343', 'pytest-asyncio==0.8.0']
setup(
name=metadata['__title__'],
|
INDY-<I>: fix pytest-forked version
|
diff --git a/underfs/s3/src/main/java/tachyon/underfs/s3/S3UnderFileSystem.java b/underfs/s3/src/main/java/tachyon/underfs/s3/S3UnderFileSystem.java
index <HASH>..<HASH> 100644
--- a/underfs/s3/src/main/java/tachyon/underfs/s3/S3UnderFileSystem.java
+++ b/underfs/s3/src/main/java/tachyon/underfs/s3/S3UnderFileSystem.java
@@ -180,6 +180,12 @@ public class S3UnderFileSystem extends UnderFileSystem {
@Override
public String[] list(String path) throws IOException {
// Non recursive list
+ if (!isFolder(path)) {
+ return null;
+ }
+ System.out.println("List with : " + path);
+ path = path.endsWith(PATH_SEPARATOR) ? path : path + PATH_SEPARATOR;
+ System.out.println("List after : " + path);
return listInternal(path, false);
}
@@ -387,6 +393,7 @@ public class S3UnderFileSystem extends UnderFileSystem {
* @throws IOException
*/
private boolean isFolder(String key) {
+ key = key.endsWith(PATH_SEPARATOR) ? key.substring(0, key.length() - 1) : key;
// Root is always a folder
if (isRoot(key)) {
return true;
|
Some additional parsing in list status for s3.
|
diff --git a/molgenis-ontology/src/main/resources/js/sorta-result-anonymous.js b/molgenis-ontology/src/main/resources/js/sorta-result-anonymous.js
index <HASH>..<HASH> 100644
--- a/molgenis-ontology/src/main/resources/js/sorta-result-anonymous.js
+++ b/molgenis-ontology/src/main/resources/js/sorta-result-anonymous.js
@@ -63,6 +63,12 @@
}
});
+ $(thresholdValue).keydown(function(e){
+ if(e.keyCode === 13){
+ $(inputGroupButton).click();
+ }
+ });
+
getMatchResults(function(matchedResults){
var perfectMatches = [];
var partialMatches = [];
|
after hitting the enter to update the threshold, the page is stopped from submitting the form therefore causing an error
|
diff --git a/scss/functions/compass/helpers.py b/scss/functions/compass/helpers.py
index <HASH>..<HASH> 100644
--- a/scss/functions/compass/helpers.py
+++ b/scss/functions/compass/helpers.py
@@ -91,17 +91,15 @@ def reject(lst, *values):
@register('first-value-of')
-def first_value_of(lst):
- if isinstance(lst, QuotedStringValue):
- first = lst.value.split()[0]
- return type(lst)(first)
- elif isinstance(lst, List):
- if len(lst):
- return lst[0]
- else:
- return Null()
+def first_value_of(*args):
+ args = List.from_maybe_starargs(args)
+ if len(args) == 1 and isinstance(args[0], QuotedStringValue):
+ first = args[0].value.split()[0]
+ return type(args[0])(first)
+ elif len(args):
+ return args[0]
else:
- return lst
+ return Null()
@register('-compass-list')
|
first-value-of() fixed to maybe receive lists
|
diff --git a/src/Ouzo/Goodies/Utilities/Clock.php b/src/Ouzo/Goodies/Utilities/Clock.php
index <HASH>..<HASH> 100644
--- a/src/Ouzo/Goodies/Utilities/Clock.php
+++ b/src/Ouzo/Goodies/Utilities/Clock.php
@@ -117,10 +117,8 @@ class Clock
private function _modify($interval)
{
- $freshDateTime = new DateTime();
- $freshDateTime->setTimestamp($this->dateTime->getTimestamp());
- $freshDateTime->modify($interval);
- return new Clock($freshDateTime);
+ $freshDateTime = clone $this->dateTime;
+ return new Clock($freshDateTime->modify($interval));
}
public function minusDays($days)
|
[Utilities] Fixed maintaining timeZone in Clock
|
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,4 +1,3 @@
-'use strict';
const chai = require('chai');
const expect = chai.expect;
const sinon = require('sinon');
|
Remove 'use-strict' to be able to use const
|
diff --git a/tests/calculators/hazard/event_based/core_next_test.py b/tests/calculators/hazard/event_based/core_next_test.py
index <HASH>..<HASH> 100644
--- a/tests/calculators/hazard/event_based/core_next_test.py
+++ b/tests/calculators/hazard/event_based/core_next_test.py
@@ -185,7 +185,6 @@ class EventBasedHazardCalculatorTestCase(unittest.TestCase):
self.job.save()
hc = self.job.hazard_calculation
- num_sites = len(hc.points_to_compute())
rlz1, rlz2 = models.LtRealization.objects.filter(
hazard_calculation=hc.id)
|
tests/calcs/hazard/event_based/core_next_test:
pyflakes
|
diff --git a/lib/runtime.js b/lib/runtime.js
index <HASH>..<HASH> 100644
--- a/lib/runtime.js
+++ b/lib/runtime.js
@@ -679,8 +679,14 @@ yr.selectNametest = function selectNametest(step, context, result) {
if (!data || typeof data !== 'object') { return result; }
if (step === '*') {
- for (step in data) {
- yr.selectNametest(step, context, result);
+ if (data instanceof Array) {
+ for (var i = 0, l = data.length; i < l; i++) {
+ yr.selectNametest(i, context, result);
+ }
+ } else {
+ for (step in data) {
+ yr.selectNametest(step, context, result);
+ }
}
return result;
}
|
monkey-patching `for .*` enumeration for nested arrays
arrays now enumerated using for (;;) instead of for-in
|
diff --git a/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php b/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php
index <HASH>..<HASH> 100644
--- a/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php
+++ b/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php
@@ -19,7 +19,7 @@
<?php if($todo->description): ?>
<div class="entity-description">
- <?= @content($todo->description); ?>
+ <?= @content( nl2br($todo->description) ); ?>
</div>
<?php endif; ?>
|
added nl2br to display body
|
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php
@@ -51,7 +51,7 @@ class IniFileLoaderTest extends TestCase
public function testTypeConversionsWithNativePhp($key, $value, $supported)
{
if (defined('HHVM_VERSION_ID')) {
- return $this->markTestSkipped();
+ $this->markTestSkipped();
}
if (!$supported) {
|
Don't use return on Assert::markTestSkipped.
|
diff --git a/salt/modules/smtp.py b/salt/modules/smtp.py
index <HASH>..<HASH> 100644
--- a/salt/modules/smtp.py
+++ b/salt/modules/smtp.py
@@ -39,7 +39,6 @@ Module for Sending Messages via SMTP
'''
import logging
import socket
-import sys
log = logging.getLogger(__name__)
diff --git a/salt/states/smtp.py b/salt/states/smtp.py
index <HASH>..<HASH> 100644
--- a/salt/states/smtp.py
+++ b/salt/states/smtp.py
@@ -25,7 +25,7 @@ def __virtual__():
return 'smtp' if 'smtp.send_msg' in __salt__ else False
-def send_msg(name, recipient, subject, sender, use_ssl='True', profile):
+def send_msg(name, recipient, subject, sender, profile, use_ssl='True'):
'''
Send a message via SMTP
|
fixing some pylint issues.
|
diff --git a/src/Handler/DateHandler.php b/src/Handler/DateHandler.php
index <HASH>..<HASH> 100644
--- a/src/Handler/DateHandler.php
+++ b/src/Handler/DateHandler.php
@@ -35,12 +35,12 @@ class DateHandler implements SubscribingHandlerInterface
public static function getSubscribingMethods()
{
$methods = array();
- $deserialisationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval');
+ $deserializationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval');
$serialisationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval');
foreach (array('json', 'xml', 'yml') as $format) {
- foreach ($deserialisationTypes as $type) {
+ foreach ($deserializationTypes as $type) {
$methods[] = [
'type' => $type,
'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
|
Rename "deserialisation" variable
|
diff --git a/lib/xcode/install.rb b/lib/xcode/install.rb
index <HASH>..<HASH> 100644
--- a/lib/xcode/install.rb
+++ b/lib/xcode/install.rb
@@ -92,7 +92,8 @@ module XcodeInstall
`hdiutil mount -nobrowse -noverify #{dmgPath}`
puts 'Please authenticate for Xcode installation...'
- `sudo ditto "/Volumes/Xcode/Xcode.app" "#{xcode_path}"`
+ source = Dir.glob('/Volumes/Xcode/Xcode*.app').first
+ `sudo ditto "#{source}" "#{xcode_path}"`
`umount "/Volumes/Xcode"`
`sudo xcode-select -s #{xcode_path}`
|
Actually support installing beta versions of Xcode
|
diff --git a/lang/en/moodle.php b/lang/en/moodle.php
index <HASH>..<HASH> 100644
--- a/lang/en/moodle.php
+++ b/lang/en/moodle.php
@@ -788,6 +788,8 @@ $string['passwordsenttext'] = ' <P>An email has been sent to your address at $
<P><B>Please check your email for your new password</B>
<P>The new password was automatically generated, so you might like to
<A HREF=$a->link>change it to something easier to remember</A>.';
+$string['pathnotexists'] = 'Path doesn\'t exist in your server!';
+$string['pathslasherror'] = 'Path can\'t end with a slash!!';
$string['paymentinstant'] = 'Use the button below to pay and be enrolled within minutes!';
$string['paymentrequired'] = 'This course requires a payment for entry.';
$string['paymentsorry'] = 'Thank you for your payment! Unfortunately your payment has not yet been fully processed, and you are not yet registered to enter the course \"$a->fullname\". Please try continuing to the course in a few seconds, but if you continue to have trouble then please alert the $a->teacher or the site administrator';
|
Added two old missing strings for scheduled backups.
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -5,7 +5,7 @@ var multiline = require('multiline');
var template = _.template(multiline(function() {
/*
- <a href="<%= url %>" title="<%= title %>" target="_self" class="fancybox">
+ <a href="<%= url %>" rel="grouped" title="<%= title %>" target="_self" class="fancybox">
<img src="<%= url %>" alt="<%= title %>"></img>
</a>
*/
|
added rel property to group images on the page into a gallery
|
diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -7,6 +7,8 @@ import (
"fmt"
"io"
"net/http"
+
+ "golang.org/x/net/http2"
)
const (
@@ -25,9 +27,8 @@ func NewClient(certificate tls.Certificate) *Client {
Certificates: []tls.Certificate{certificate},
}
tlsConfig.BuildNameToCertificate()
- transport := &http.Transport{
- TLSClientConfig: tlsConfig,
- MaxIdleConnsPerHost: 100,
+ transport := &http2.Transport{
+ TLSClientConfig: tlsConfig,
}
return &Client{
HttpClient: &http.Client{Transport: transport},
|
Support older go until <I> is out of beta
|
diff --git a/tests/unit/test_dependency_register.py b/tests/unit/test_dependency_register.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_dependency_register.py
+++ b/tests/unit/test_dependency_register.py
@@ -160,7 +160,7 @@ class Test_DependencyRegister_register:
def test__giving_resource_name_and_dependent__should_only_call_expected_methods(
self, dep_reg, mock_dep_reg, fake_resource_name, fake_dependent):
- def give_unexpected_calls(method_calls, expected_method_names):
+ def give_unexpected_calls(method_calls, expected_methods_names):
return [call for call in method_calls
if call[0] not in expected_methods_names]
|
tests: Fixes bug in previous commit: typo in function arg name.
The inner function give_unexpected_calls() had an argument 'expected_method_names' which should have been 'expected_methods_names'.
|
diff --git a/examples/async_method_with_class.rb b/examples/async_method_with_class.rb
index <HASH>..<HASH> 100644
--- a/examples/async_method_with_class.rb
+++ b/examples/async_method_with_class.rb
@@ -5,10 +5,16 @@ include Eldritch::DSL
class BabysFirstClass
async def foo(arg)
puts "Hey I got: #{arg}"
+ sleep(1)
+ puts 'foo done'
end
end
obj = BabysFirstClass.new
+
+puts 'calling foo'
obj.foo('stuff')
-sleep(1)
-puts 'done'
\ No newline at end of file
+puts 'doing something else'
+
+# waiting for everyone to stop
+Thread.list.reject{|t| t == Thread.current}.each &:join
\ No newline at end of file
|
did the same simplification to class thread example
|
diff --git a/spec/bblib_spec.rb b/spec/bblib_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/bblib_spec.rb
+++ b/spec/bblib_spec.rb
@@ -16,4 +16,22 @@ describe BBLib do
expect(thash.hash_path('test.path')).to eq ['here']
end
+ it 'squishes hash' do
+ expect(thash.squish).to eq ({"a"=>1, "b"=>2, "c.d[0]"=>3, "c.d[1]"=>4, "c.d[2]"=>5, "c.d[3].e"=>6, "c.f"=>7, "g"=>8, "test.path"=>"here", "e"=>5})
+ end
+
+ squished = thash.squish
+
+ it 'expands hash' do
+ expect(squished.expand).to eq thash.keys_to_sym
+ end
+
+ it 'converts keys to strings' do
+ expect(thash.keys_to_s).to eq ({"a"=>1, "b"=>2, "c"=>{"d"=>[3, 4, 5, {"e"=>6}], "f"=>7}, "g"=>8, "test"=>{"path"=>"here"}, "e"=>5})
+ end
+
+ it 'converts keys to symbols' do
+ expect(thash.keys_to_sym).to eq ({:a=>1, :b=>2, :c=>{:d=>[3, 4, 5, {:e=>6}], :f=>7}, :g=>8, :test=>{:path=>"here"}, :e=>5})
+ end
+
end
|
Added more tests for hash path.
|
diff --git a/spec/public/associations_spec.rb b/spec/public/associations_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/public/associations_spec.rb
+++ b/spec/public/associations_spec.rb
@@ -28,6 +28,14 @@ describe DataMapper::Associations do
end
describe "#has" do
+ before do
+ class Car
+ def self.warn
+ # silence warnings
+ end
+ end
+ end
+
def n
Car.n
end
|
Added Car.warn() method to silence warnings from has() in spec output
|
diff --git a/seaworthy/stream/_timeout.py b/seaworthy/stream/_timeout.py
index <HASH>..<HASH> 100644
--- a/seaworthy/stream/_timeout.py
+++ b/seaworthy/stream/_timeout.py
@@ -33,5 +33,9 @@ def stream_timeout(stream, timeout, timeout_msg=None):
timer.cancel()
# Close the stream's underlying response object (if it has one) to
# avoid potential socket leaks.
+ # This method seems to have more success at preventing ResourceWarnings
+ # than just stream.close() (should this be improved upstream?)
+ # FIXME: Potential race condition if Timer thread closes the stream at
+ # the same time we do here, but hopefully not with serious side effects
if hasattr(stream, '_response'):
stream._response.close()
|
Add a comment about closing the stream
|
diff --git a/tsdb/engine/bz1/bz1.go b/tsdb/engine/bz1/bz1.go
index <HASH>..<HASH> 100644
--- a/tsdb/engine/bz1/bz1.go
+++ b/tsdb/engine/bz1/bz1.go
@@ -170,9 +170,18 @@ func (e *Engine) LoadMetadataIndex(index *tsdb.DatabaseIndex, measurementFields
if err != nil {
return err
}
- for k, series := range series {
- series.InitializeShards()
- index.CreateSeriesIndexIfNotExists(tsdb.MeasurementFromSeriesKey(string(k)), series)
+
+ // Load the series into the in-memory index in sorted order to ensure
+ // it's always consistent for testing purposes
+ a := make([]string, 0, len(series))
+ for k, _ := range series {
+ a = append(a, k)
+ }
+ sort.Strings(a)
+ for _, key := range a {
+ s := series[key]
+ s.InitializeShards()
+ index.CreateSeriesIndexIfNotExists(tsdb.MeasurementFromSeriesKey(string(key)), s)
}
return nil
}); err != nil {
|
Ensure that metadata is always loaded out of the index in sorted order
|
diff --git a/src/RbacService.php b/src/RbacService.php
index <HASH>..<HASH> 100644
--- a/src/RbacService.php
+++ b/src/RbacService.php
@@ -105,7 +105,7 @@ class RbacService implements RbacServiceContract
{
$assignment = $this->overseer->getAssignment($subject->getSubjectId(), $subject->getSubjectName());
- if ($assignment !== null) {
+ if ($assignment instanceof Assignment) {
$assignment->changeRoles($roles);
} else {
$assignment = $this->createAssignment($subject, $roles);
@@ -122,7 +122,9 @@ class RbacService implements RbacServiceContract
{
$assignment = $this->overseer->getAssignment($subject->getSubjectId(), $subject->getSubjectName());
- $this->overseer->deleteAssignment($assignment);
+ if ($assignment instanceof Assignment) {
+ $this->overseer->deleteAssignment($assignment);
+ }
}
|
Add not null check before deleting assignment
|
diff --git a/api/client/container/exec.go b/api/client/container/exec.go
index <HASH>..<HASH> 100644
--- a/api/client/container/exec.go
+++ b/api/client/container/exec.go
@@ -28,7 +28,7 @@ func NewExecCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts execOptions
cmd := &cobra.Command{
- Use: "exec CONTAINER COMMAND [ARG...]",
+ Use: "exec [OPTIONS] CONTAINER COMMAND [ARG...]",
Short: "Run a command in a running container",
Args: cli.RequiresMinArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
|
Modify usage of docker exec command in exec.md
|
diff --git a/injector/wtf-injector-chrome/debugger.js b/injector/wtf-injector-chrome/debugger.js
index <HASH>..<HASH> 100644
--- a/injector/wtf-injector-chrome/debugger.js
+++ b/injector/wtf-injector-chrome/debugger.js
@@ -152,7 +152,7 @@ Debugger.prototype.beginListening_ = function() {
chrome.debugger.sendCommand(this.debugee_, 'Timeline.start', {
// Limit call stack depth to keep messages small - if we ever need this
// data this can be increased.
- 'maxCallStackDepth': 1
+ 'maxCallStackDepth': 0
});
}
|
Making the timeline not record stack traces.
I feel like this didn't work previously, but it seems to now (back to <I>).
|
diff --git a/talon/quotations.py b/talon/quotations.py
index <HASH>..<HASH> 100644
--- a/talon/quotations.py
+++ b/talon/quotations.py
@@ -280,10 +280,15 @@ def preprocess(msg_body, delimiter, content_type='text/plain'):
Replaces link brackets so that they couldn't be taken for quotation marker.
Splits line in two if splitter pattern preceded by some text on the same
line (done only for 'On <date> <person> wrote:' pattern).
+
+ Converts msg_body into a unicode.
"""
# normalize links i.e. replace '<', '>' wrapping the link with some symbols
# so that '>' closing the link couldn't be mistakenly taken for quotation
# marker.
+ if isinstance(msg_body, bytes):
+ msg_body = msg_body.decode('utf8')
+
def link_wrapper(link):
newline_index = msg_body[:link.start()].rfind("\n")
if msg_body[newline_index + 1] == ">":
|
Convert msg_body into unicode in preprocess.
|
diff --git a/aiohttp_json_rpc/client.py b/aiohttp_json_rpc/client.py
index <HASH>..<HASH> 100644
--- a/aiohttp_json_rpc/client.py
+++ b/aiohttp_json_rpc/client.py
@@ -99,6 +99,9 @@ class JsonRpcClient:
decode_error(msg)
)
+ except asyncio.CancelledError:
+ raise
+
except Exception as e:
self._logger.error(e, exc_info=True)
|
client: _message_worker: properly handle asyncio.CancelledError
|
diff --git a/salt/utils/serializers/json.py b/salt/utils/serializers/json.py
index <HASH>..<HASH> 100644
--- a/salt/utils/serializers/json.py
+++ b/salt/utils/serializers/json.py
@@ -15,7 +15,7 @@ try:
except ImportError:
import json
-from six import string_types
+from salt.utils.six import string_types
from salt.utils.serializers import DeserializationError, SerializationError
__all__ = ['deserialize', 'serialize', 'available']
|
Replaced module six in file /salt/utils/serializers/json.py
|
diff --git a/addon/edit/closetag.js b/addon/edit/closetag.js
index <HASH>..<HASH> 100644
--- a/addon/edit/closetag.js
+++ b/addon/edit/closetag.js
@@ -131,7 +131,7 @@
function autoCloseSlash(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
- autoCloseCurrent(cm, true);
+ return autoCloseCurrent(cm, true);
}
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
[closetag addon] Properly pass through return value for / key handler
So that the CodeMirror.Pass it will return actually ends up in the editor.
|
diff --git a/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java b/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java
index <HASH>..<HASH> 100644
--- a/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java
+++ b/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java
@@ -83,6 +83,8 @@ public class MotownCentralSystemService implements io.motown.ocpp.v15.soap.centr
ComponentStatus componentStatus = getComponentStatusFromChargePointStatus(request.getStatus());
String errorCode = request.getErrorCode() != null ? request.getErrorCode().value() : null;
+ //TODO timestamp is not mandatory in the WSDL, however it's mandatory in the statusNotification command! - Mark van den Bergh, Februari 21st 2014
+
domainService.statusNotification(chargingStationId, evseId, errorCode, componentStatus, request.getInfo(), request.getTimestamp(), request.getVendorId(), request.getVendorErrorCode());
return new StatusNotificationResponse();
}
|
Added TODO in statusNotification mandatory field
|
diff --git a/lib/middleware.js b/lib/middleware.js
index <HASH>..<HASH> 100644
--- a/lib/middleware.js
+++ b/lib/middleware.js
@@ -175,7 +175,10 @@ module.exports.log = function(req, res, next) {
};
const log = function() {
- let message = '@{status}, user: @{user}, req: \'@{request.method} @{request.url}\'';
+ let forwardedFor = req.headers['x-forwarded-for'];
+ let remoteAddress = req.connection.remoteAddress;
+ let remoteIP = forwardedFor ? `${forwardedFor} via ${remoteAddress}` : remoteAddress;
+ let message = '@{status}, user: @{user}(@{remoteIP}), req: \'@{request.method} @{request.url}\'';
if (res._verdaccio_error) {
message += ', error: @{!error}';
} else {
@@ -187,6 +190,7 @@ module.exports.log = function(req, res, next) {
request: {method: req.method, url: req.url},
level: 35, // http
user: req.remote_user && req.remote_user.name,
+ remoteIP,
status: res.statusCode,
error: res._verdaccio_error,
bytes: {
|
add remote ip to request log
|
diff --git a/Manager/WishlistManager.php b/Manager/WishlistManager.php
index <HASH>..<HASH> 100755
--- a/Manager/WishlistManager.php
+++ b/Manager/WishlistManager.php
@@ -12,7 +12,7 @@
namespace WellCommerce\Bundle\WishlistBundle\Manager;
-use WellCommerce\Bundle\CoreBundle\Manager\AbstractManager;
+use WellCommerce\Bundle\DoctrineBundle\Manager\AbstractManager;
/**
* Class WishlistManager
diff --git a/Tests/Manager/WishlistManagerTest.php b/Tests/Manager/WishlistManagerTest.php
index <HASH>..<HASH> 100755
--- a/Tests/Manager/WishlistManagerTest.php
+++ b/Tests/Manager/WishlistManagerTest.php
@@ -12,7 +12,7 @@
namespace WellCommerce\Bundle\WishlistBundle\Tests\Manager;
-use WellCommerce\Bundle\CoreBundle\Manager\ManagerInterface;
+use WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface;
use WellCommerce\Bundle\CoreBundle\Test\Manager\AbstractManagerTestCase;
use WellCommerce\Bundle\WishlistBundle\Entity\Wishlist;
|
Moved manager to DoctrineBundle
|
diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php
index <HASH>..<HASH> 100644
--- a/cake/libs/controller/controller.php
+++ b/cake/libs/controller/controller.php
@@ -812,7 +812,7 @@ class Controller extends Object {
*/
public function render($action = null, $layout = null, $file = null) {
$this->beforeRender();
- $this->Component->triggerCallback('beforeRender', $this);
+ $this->Components->triggerCallback('beforeRender', $this);
$viewClass = $this->view;
if ($this->view != 'View') {
|
Fixing issue that came up in rebasing.
|
diff --git a/src/Connection.php b/src/Connection.php
index <HASH>..<HASH> 100644
--- a/src/Connection.php
+++ b/src/Connection.php
@@ -86,8 +86,7 @@ class Connection extends \hiqdev\hiart\rest\Connection implements ConnectionInte
}
/**
- * Prepares authorization data.
- * If user is not authorized redirects to authorization.
+ * Gets auth data from user.
* @return array
*/
public function getAuth()
@@ -96,24 +95,6 @@ class Connection extends \hiqdev\hiart\rest\Connection implements ConnectionInte
return [];
}
- $user = Yii::$app->user;
-
- $identity = $user->identity;
- if ($identity === null) {
- Yii::$app->response->redirect('/site/login');
- Yii::$app->end();
- }
-
- $token = $identity->getAccessToken();
- if (empty($token)) {
- /// this is very important line
- /// without this line - redirect loop
- Yii::$app->user->logout();
-
- Yii::$app->response->redirect('/site/login');
- Yii::$app->end();
- }
-
- return ['access_token' => $token];
+ return $this->app->user->getAuthData();
}
}
|
moved getting auth data to User component in hipanel-core
|
diff --git a/tests/test_output_format.py b/tests/test_output_format.py
index <HASH>..<HASH> 100644
--- a/tests/test_output_format.py
+++ b/tests/test_output_format.py
@@ -153,3 +153,18 @@ def test_video():
return 'test'
assert hug.output_format.avi_video(FakeVideoWithSave()) == 'test'
+
+def test_on_content_type():
+ '''Ensure that it's possible to route the output type format by the requested content-type'''
+ formatter = hug.output_format.on_content_type({'application/json': hug.output_format.json,
+ 'text/plain': hug.output_format.text})
+ class FakeRequest(object):
+ content_type = 'application/json'
+
+ request = FakeRequest()
+ response = FakeRequest()
+ converted = hug.input_format.json(formatter(BytesIO(hug.output_format.json({'name': 'name'})), request, response))
+ assert converted == {'name': 'name'}
+
+ request.content_type = 'text/plain'
+ assert formatter('hi', request, response) == b'hi'
|
Add test for multiple output formats based on content type
|
diff --git a/grimoire/elk/git.py b/grimoire/elk/git.py
index <HASH>..<HASH> 100644
--- a/grimoire/elk/git.py
+++ b/grimoire/elk/git.py
@@ -222,11 +222,15 @@ class GitEnrich(Enrich):
# Other enrichment
eitem["repo_name"] = item["origin"]
# Number of files touched
- eitem["files"] = len(commit["files"])
+ eitem["files"] = 0
# Number of lines added and removed
lines_added = 0
lines_removed = 0
for cfile in commit["files"]:
+ if 'action' not in cfile:
+ # merges are not counted
+ continue
+ eitem["files"] += 1
if 'added' in cfile and 'removed' in cfile:
try:
lines_added += int(cfile["added"])
|
[enrich][git] Don't count files and lines in clean merges
|
diff --git a/great_expectations/render/renderer/notebook_renderer.py b/great_expectations/render/renderer/notebook_renderer.py
index <HASH>..<HASH> 100755
--- a/great_expectations/render/renderer/notebook_renderer.py
+++ b/great_expectations/render/renderer/notebook_renderer.py
@@ -1,6 +1,9 @@
import os
-import autopep8
+# FIXME : Abe 2020/02/04 : this line is breaking my environment in weird ways.
+# Temporarily suppressing in order to move forward.
+# DO NOT MERGE without reinstating.
+# import autopep8
import nbformat
from great_expectations.core import ExpectationSuite
|
Shamefacedly suppress autopep8
|
diff --git a/lib/developmentTeam.js b/lib/developmentTeam.js
index <HASH>..<HASH> 100644
--- a/lib/developmentTeam.js
+++ b/lib/developmentTeam.js
@@ -60,8 +60,13 @@ function getFromSearch() {
"name": "basedir",
"message": "Where should I search for your existing XCode projects?",
"default": homedir,
- "validate": (answer)=>{return answer && fs.existsSync(answer);}
+ "validate": (answer)=>{
+ if(!answer) return false;
+ answer = answer.replace("~", process.env.HOME);
+ return fs.existsSync(answer);
+ }
}]).then((answers)=>{
+ const basedir = answers.basedir.replace("~", process.env.HOME);
const command = "find " + answers.basedir + " | grep -m500 \"project\\.pbxproj\" | xargs -L1 -JABC grep \"evelopmentTeam\" \"ABC\" 2>/dev/null | sort | uniq";
console.log("\nLooking for development teams...")
cpp.exec(command, {encoding: "utf8"}).then((out)=>{
|
Fixing up validate to properly handle the tilde for home directory.
|
diff --git a/base/edf/thread_test.go b/base/edf/thread_test.go
index <HASH>..<HASH> 100644
--- a/base/edf/thread_test.go
+++ b/base/edf/thread_test.go
@@ -55,5 +55,6 @@ func TestThreadFindAndWrite(T *testing.T) {
})
})
})
+ os.Remove("hello.db")
})
-}
\ No newline at end of file
+}
|
Delete tmpfile after edf test
|
diff --git a/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java b/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java
index <HASH>..<HASH> 100644
--- a/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java
+++ b/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java
@@ -280,8 +280,12 @@ public class CmsCloneModule extends CmsJspActionElement {
adjustModuleResources(sourceModule, targetModule, sourcePathPart, targetPathPart, iconPaths);
// search and replace the localization keys
- List<CmsResource> props = getCmsObject().readResources(targetClassesPath, CmsResourceFilter.DEFAULT_FILES);
- replacesMessages(descKeys, props);
+ if (getCmsObject().existsResource(targetClassesPath)) {
+ List<CmsResource> props = getCmsObject().readResources(
+ targetClassesPath,
+ CmsResourceFilter.DEFAULT_FILES);
+ replacesMessages(descKeys, props);
+ }
int type = OpenCms.getResourceManager().getResourceType(CmsVfsBundleManager.TYPE_XML_BUNDLE).getTypeId();
CmsResourceFilter filter = CmsResourceFilter.requireType(type);
|
Improved stability of the module clone process.
|
diff --git a/src/Orchestra/Control/Validation/Role.php b/src/Orchestra/Control/Validation/Role.php
index <HASH>..<HASH> 100644
--- a/src/Orchestra/Control/Validation/Role.php
+++ b/src/Orchestra/Control/Validation/Role.php
@@ -16,7 +16,6 @@ class Role extends Validator
/**
* On create validations.
*
- * @access public
* @return void
*/
protected function onCreate()
@@ -27,7 +26,6 @@ class Role extends Validator
/**
* On update validations.
*
- * @access public
* @return void
*/
protected function onUpdate()
|
remove some unrelevant docblock.
|
diff --git a/core/server/api/authentication.js b/core/server/api/authentication.js
index <HASH>..<HASH> 100644
--- a/core/server/api/authentication.js
+++ b/core/server/api/authentication.js
@@ -287,6 +287,25 @@ authentication = {
}).then(function (result) {
return Promise.resolve({users: [result]});
});
+ },
+
+ revoke: function (object) {
+ var token;
+
+ if (object.token_type_hint && object.token_type_hint === 'access_token') {
+ token = dataProvider.Accesstoken;
+ } else if (object.token_type_hint && object.token_type_hint === 'refresh_token') {
+ token = dataProvider.Refreshtoken;
+ } else {
+ return errors.BadRequestError('Invalid token_type_hint given.');
+ }
+
+ return token.destroyByToken({token: object.token}).then(function () {
+ return Promise.resolve({token: object.token});
+ }, function () {
+ // On error we still want a 200. See https://tools.ietf.org/html/rfc7009#page-5
+ return Promise.resolve({token: object.token, error: 'Invalid token provided'});
+ });
}
};
|
re-added revoke method to authentication api
closes #<I>
- adds revoke api method back into code base
|
diff --git a/args4j/src/org/kohsuke/args4j/CmdLineParser.java b/args4j/src/org/kohsuke/args4j/CmdLineParser.java
index <HASH>..<HASH> 100644
--- a/args4j/src/org/kohsuke/args4j/CmdLineParser.java
+++ b/args4j/src/org/kohsuke/args4j/CmdLineParser.java
@@ -23,7 +23,6 @@ import java.util.ResourceBundle;
import java.util.Set;
import java.util.TreeMap;
import java.util.logging.Logger;
-
import org.kohsuke.args4j.spi.BooleanOptionHandler;
import org.kohsuke.args4j.spi.ByteOptionHandler;
import org.kohsuke.args4j.spi.CharOptionHandler;
@@ -380,7 +379,7 @@ public class CmdLineParser {
int lineLength;
String candidate = restOfLine.substring(0, maxLength);
int sp=candidate.lastIndexOf(' ');
- if(sp>maxLength*3/4) lineLength=sp;
+ if(sp>maxLength*3/5) lineLength=sp;
else lineLength=maxLength;
rv.add(restOfLine.substring(0, lineLength));
restOfLine = restOfLine.substring(lineLength).trim();
|
a bit more graceful line breaking in usage printer
|
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java b/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java
+++ b/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java
@@ -61,12 +61,11 @@ import com.sun.tools.javac.util.Name;
* @author cushon@google.com (Liam Miller-Cushon)
*/
@BugPattern(name = "Finally", altNames = "finally",
- summary = "Finally clause cannot complete normally",
- explanation = "Transferring control from a finally block (via break, continue, return, or "
- + "throw) has unintuitive behavior. Please restructure your code so that you "
- + "don't have to transfer control flow from a finally block.\n\n"
- + "Please see the positive cases below for examples and explanations of why this is "
- + "dangerous.",
+ summary = "Finally block may not complete normally",
+ explanation = "Terminating a finally block abruptly preempts the outcome of the try block, "
+ + "and will cause the result of any previously executed return or throw statements to "
+ + "be ignored. This is considered extremely confusing. Please refactor this code to ensure "
+ + "that the finally block will always complete normally.",
category = JDK, severity = ERROR, maturity = EXPERIMENTAL)
public class Finally extends BugChecker
implements ContinueTreeMatcher, ThrowTreeMatcher, BreakTreeMatcher, ReturnTreeMatcher {
|
Improve description for Finally check.
-------------
Created by MOE: <URL>
|
diff --git a/client/driver/exec_linux.go b/client/driver/exec_linux.go
index <HASH>..<HASH> 100644
--- a/client/driver/exec_linux.go
+++ b/client/driver/exec_linux.go
@@ -13,6 +13,9 @@ const (
)
func (d *ExecDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstructs.FingerprintResponse) error {
+ // The exec driver will be detected in every case
+ resp.Detected = true
+
// Only enable if cgroups are available and we are root
if !cgroupsMounted(req.Node) {
if d.fingerprintSuccess == nil || *d.fingerprintSuccess {
@@ -35,6 +38,5 @@ func (d *ExecDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstruct
}
resp.AddAttribute(execDriverAttr, "1")
d.fingerprintSuccess = helper.BoolToPtr(true)
- resp.Detected = true
return nil
}
diff --git a/client/driver/java.go b/client/driver/java.go
index <HASH>..<HASH> 100644
--- a/client/driver/java.go
+++ b/client/driver/java.go
@@ -119,6 +119,7 @@ func (d *JavaDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstruct
}
d.fingerprintSuccess = helper.BoolToPtr(false)
resp.RemoveAttribute(javaDriverAttr)
+ resp.Detected = true
return nil
}
|
add detected to more drivers where the driver is found but unusable
|
diff --git a/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java b/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java
+++ b/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java
@@ -30,6 +30,14 @@ public class InMemoryJavaCompiler {
}
/**
+ * @return the class loader used internally by the compiler
+ */
+ public ClassLoader getClassloader()
+ {
+ return classLoader;
+ }
+
+ /**
* Options used by the compiler, e.g. '-Xlint:unchecked'.
* @param options
* @return
|
Added getter for classloader
|
diff --git a/django_db_geventpool/utils.py b/django_db_geventpool/utils.py
index <HASH>..<HASH> 100644
--- a/django_db_geventpool/utils.py
+++ b/django_db_geventpool/utils.py
@@ -8,7 +8,8 @@ from django.core.signals import request_finished
def close_connection(f):
@wraps(f)
def wrapper(*args, **kwargs):
- result = f(*args, **kwargs)
- request_finished.send(sender='greenlet')
- return result
+ try:
+ return f(*args, **kwargs)
+ finally:
+ request_finished.send(sender='greenlet')
return wrapper
|
ensuring that connection is closed, even if error is raised
|
diff --git a/lib/archiving/archive_table.rb b/lib/archiving/archive_table.rb
index <HASH>..<HASH> 100644
--- a/lib/archiving/archive_table.rb
+++ b/lib/archiving/archive_table.rb
@@ -104,10 +104,11 @@ module Archiving
def archive!
transaction do
archived_instance = self.class.archive.new
- attributes.each do |name, value|
- archived_instance.send("#{name}=", value)
+ attributes.keys.each do |name|
+ archived_instance.send(:write_attribute, name, read_attribute(name))
end
- archived_instance.save(validate: false)
+ raise "Unarchivable attributes" if archived_instance.attributes != attributes
+ archived_instance.save!(validate: false)
self.class.archive_associations.each do |assoc_name|
assoc = send(assoc_name)
if assoc && assoc.respond_to?(:archive!)
|
Use attr. read and writer. Added an attr. safety check and fail on failed save()
|
diff --git a/self_out_request.js b/self_out_request.js
index <HASH>..<HASH> 100644
--- a/self_out_request.js
+++ b/self_out_request.js
@@ -64,14 +64,18 @@ function makeInreq(id, options) {
self.inreq.headers = self.headers;
function onError(err) {
- if (called) return;
+ if (called) {
+ return;
+ }
called = true;
self.conn.ops.popOutReq(id);
self.errorEvent.emit(self, err);
}
function onResponse(res) {
- if (called) return;
+ if (called) {
+ return;
+ }
called = true;
self.conn.ops.popOutReq(id);
self.emitResponse(res);
@@ -85,7 +89,9 @@ SelfStreamingOutRequest.prototype._sendCallRequestCont =
function passRequestParts(args, isLast ) {
var self = this;
self.inreq.handleFrame(args, isLast);
- if (!self.closing) self.conn.ops.lastTimeoutTime = 0;
+ if (!self.closing) {
+ self.conn.ops.lastTimeoutTime = 0;
+ }
};
module.exports.OutRequest = SelfOutRequest;
|
linting: [self_out_request] comply with curly rule
|
diff --git a/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php b/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php
+++ b/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php
@@ -504,6 +504,7 @@ class VersionTest extends MigrationTestCase
'doctrine_param' => [[[1,2,3,4,5]], [Connection::PARAM_INT_ARRAY], '[1, 2, 3, 4, 5]'],
'doctrine_param_grouped' => [[[1,2],[3,4,5]], [Connection::PARAM_INT_ARRAY, Connection::PARAM_INT_ARRAY], '[1, 2], [3, 4, 5]'],
'boolean' => [[true], [''], '[true]'],
+ 'object' => [[new \stdClass('test')], [''], '[?]'],
];
}
|
Add a test for the object case
|
diff --git a/generators/client/index.js b/generators/client/index.js
index <HASH>..<HASH> 100644
--- a/generators/client/index.js
+++ b/generators/client/index.js
@@ -150,6 +150,7 @@ module.exports = JhipsterClientGenerator.extend({
this.enableTranslation = this.config.get('enableTranslation'); // this is enabled by default to avoid conflicts for existing applications
this.nativeLanguage = this.config.get('nativeLanguage');
this.languages = this.config.get('languages');
+ this.messageBroker = this.config.get('messageBroker');
this.packagejs = packagejs;
var baseName = this.config.get('baseName');
if (baseName) {
|
set messageBroker when generating just the client
|
diff --git a/lib/inherited_resources/base_helpers.rb b/lib/inherited_resources/base_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/inherited_resources/base_helpers.rb
+++ b/lib/inherited_resources/base_helpers.rb
@@ -231,6 +231,9 @@ module InheritedResources
# given and returns it. Otherwise returns nil.
#
def respond_with_dual_blocks(object, options, &block) #:nodoc:
+
+ options[:location] = collection_url unless self.respond_to?(:show)
+
args = (with_chain(object) << options)
case block.try(:arity)
|
Redirect to index action in show not defined
|
diff --git a/armet/connectors/sqlalchemy/resources.py b/armet/connectors/sqlalchemy/resources.py
index <HASH>..<HASH> 100644
--- a/armet/connectors/sqlalchemy/resources.py
+++ b/armet/connectors/sqlalchemy/resources.py
@@ -174,6 +174,9 @@ class ModelResource(object):
self.session.add(target)
self.session.flush()
+ # Refresh the target object to avoid inconsistencies with storage.
+ self.session.expire(target)
+
# Return the target.
return target
|
Refresh the target object to avoid inconsistencies with storage (In create)
|
diff --git a/executionserver/engine_lsf.js b/executionserver/engine_lsf.js
index <HASH>..<HASH> 100644
--- a/executionserver/engine_lsf.js
+++ b/executionserver/engine_lsf.js
@@ -9,7 +9,7 @@ module.exports = function (conf) {
var Joi = require('joi');
var executionmethods = require('./executionserver.methods')(conf);
- var joijob = require('./joi.job')();
+ var joijob = require('./joi.job')(Joi);
var handler = {};
diff --git a/executionserver/engine_unix.js b/executionserver/engine_unix.js
index <HASH>..<HASH> 100644
--- a/executionserver/engine_unix.js
+++ b/executionserver/engine_unix.js
@@ -9,7 +9,7 @@ module.exports = function (conf) {
var Joi = require('joi');
var executionmethods = require('./executionserver.methods')(conf);
- var joijob = require('./joi.job')();
+ var joijob = require('./joi.job')(Joi);
var handler = {};
|
BUG: Add joi dependency as a parameter
In the execution server Joi is not installed for the server plugin
|
diff --git a/src/geotiff.js b/src/geotiff.js
index <HASH>..<HASH> 100644
--- a/src/geotiff.js
+++ b/src/geotiff.js
@@ -212,8 +212,8 @@ GeoTIFF.prototype = {
this.dataView.getUint16(nextIFDByteOffset, this.littleEndian);
var fileDirectory = {};
-
- for (var i = byteOffset + (this.bigTiff ? 8 : 2), entryCount = 0; entryCount < numDirEntries; i += (this.bigTiff ? 20 : 12), ++entryCount) {
+ var i = nextIFDByteOffset + (this.bigTiff ? 8 : 2)
+ for (var entryCount = 0; entryCount < numDirEntries; i += (this.bigTiff ? 20 : 12), ++entryCount) {
var fieldTag = this.dataView.getUint16(i, this.littleEndian);
var fieldType = this.dataView.getUint16(i + 2, this.littleEndian);
var typeCount = this.bigTiff ?
|
Fixing wrong base offset, only the first IFD offset was used.
|
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb
index <HASH>..<HASH> 100644
--- a/lib/axlsx/util/validators.rb
+++ b/lib/axlsx/util/validators.rb
@@ -297,4 +297,10 @@ module Axlsx
def self.validate_display_blanks_as(v)
RestrictionValidator.validate :display_blanks_as, [:gap, :span, :zero], v
end
+
+ # Requires that the value is one of :visible, :hidden, :very_hidden
+ def self.validate_view_visibility(v)
+ RestrictionValidator.validate :visibility, [:visible, :hidden, :very_hidden], v
+ end
+
end
|
add validation for Worksheet#state and WorkbookView#visibility
|
diff --git a/tests/functional/CreateCept.php b/tests/functional/CreateCept.php
index <HASH>..<HASH> 100644
--- a/tests/functional/CreateCept.php
+++ b/tests/functional/CreateCept.php
@@ -7,7 +7,8 @@ $I = new TestGuy($scenario);
$I->wantTo('ensure that user creation works');
$loginPage = LoginPage::openBy($I);
-$loginPage->login('user@example.com', 'qwerty');
+$user = $I->getFixture('user')->getModel('user');
+$loginPage->login($user->email, 'qwerty');
$page = CreatePage::openBy($I);
diff --git a/tests/functional/UpdateCept.php b/tests/functional/UpdateCept.php
index <HASH>..<HASH> 100644
--- a/tests/functional/UpdateCept.php
+++ b/tests/functional/UpdateCept.php
@@ -7,7 +7,8 @@ $I = new TestGuy($scenario);
$I->wantTo('ensure that user update works');
$loginPage = LoginPage::openBy($I);
-$loginPage->login('user@example.com', 'qwerty');
+$user = $I->getFixture('user')->getModel('user');
+$loginPage->login($user->email, 'qwerty');
$page = UpdatePage::openBy($I, ['id' => 2]);
|
refactored admin cepts
|
diff --git a/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java b/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java
index <HASH>..<HASH> 100644
--- a/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java
+++ b/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java
@@ -295,7 +295,9 @@ public abstract class JdbcExtractor extends QueryBasedExtractor<JsonArray, JsonE
public void extractMetadata(String schema, String entity, WorkUnit workUnit) throws SchemaException, IOException {
this.log.info("Extract metadata using JDBC");
String inputQuery = workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_QUERY);
- if (hasJoinOperation(inputQuery)) {
+ if (workUnitState.getPropAsBoolean(ConfigurationKeys.SOURCE_QUERYBASED_IS_METADATA_COLUMN_CHECK_ENABLED,
+ Boolean.valueOf(ConfigurationKeys.DEFAULT_SOURCE_QUERYBASED_IS_METADATA_COLUMN_CHECK_ENABLED)) &&
+ hasJoinOperation(inputQuery)) {
throw new RuntimeException("Query across multiple tables not supported");
}
|
[GOBBLIN-<I>] Allow join operations if metadata check is disabled
Closes #<I> from jack-moseley/mysql-join-check
|
diff --git a/pandas/tseries/period.py b/pandas/tseries/period.py
index <HASH>..<HASH> 100644
--- a/pandas/tseries/period.py
+++ b/pandas/tseries/period.py
@@ -50,7 +50,8 @@ class Period(PandasObject):
value : Period or compat.string_types, default None
The time period represented (e.g., '4Q2005')
freq : str, default None
- e.g., 'B' for businessday. Must be a singlular rule-code (e.g. 5T is not allowed).
+ e.g., 'B' for businessday. Must be a singular rule-code (e.g. 5T is not
+ allowed).
year : int, default None
month : int, default 1
quarter : int, default None
|
CLN: tiny typo from GH<I>: Period() docstring
|
diff --git a/src/org/zaproxy/zap/model/Context.java b/src/org/zaproxy/zap/model/Context.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/model/Context.java
+++ b/src/org/zaproxy/zap/model/Context.java
@@ -35,6 +35,7 @@ import org.parosproxy.paros.model.Session;
import org.parosproxy.paros.model.SiteMap;
import org.parosproxy.paros.model.SiteNode;
import org.parosproxy.paros.network.HttpRequestHeader;
+import org.parosproxy.paros.view.View;
import org.zaproxy.zap.authentication.AuthenticationMethod;
import org.zaproxy.zap.authentication.ManualAuthenticationMethodType.ManualAuthenticationMethod;
import org.zaproxy.zap.extension.authorization.AuthorizationDetectionMethod;
@@ -556,7 +557,7 @@ public class Context {
}
public void restructureSiteTree() {
- if (EventQueue.isDispatchThread()) {
+ if (!View.isInitialised() || EventQueue.isDispatchThread()) {
restructureSiteTreeEventHandler();
} else {
try {
|
Do not access EDT in daemon mode in Context class
Change Context class to not access the EDT if the view is not
initialised, when restructuring the sites tree.
|
diff --git a/lib/ardes/resources_controller.rb b/lib/ardes/resources_controller.rb
index <HASH>..<HASH> 100644
--- a/lib/ardes/resources_controller.rb
+++ b/lib/ardes/resources_controller.rb
@@ -824,6 +824,10 @@ module Ardes#:nodoc:
resource_specification.find ? resource_specification.find_custom(controller) : super
end
+ def new(*args, &block)
+ service.new(*args, &block)
+ end
+
def respond_to?(method)
super || service.respond_to?(method)
end
|
Adding explicit call to service.new, because of recent change in rails (see <URL>)
|
diff --git a/config_test.go b/config_test.go
index <HASH>..<HASH> 100644
--- a/config_test.go
+++ b/config_test.go
@@ -62,6 +62,18 @@ var _ = Describe("JWTAuth Config", func() {
path /path1
path /path2
}`, true, nil},
+ {`jwt {
+ path /
+ except /login
+ except /test
+ allowroot
+ }`, false, []Rule{
+ Rule{
+ Path: "/",
+ ExceptedPaths: []string{"/login", "/test"},
+ AllowRoot: true,
+ },
+ }},
}
for _, test := range tests {
c := caddy.NewTestController("http", test.input)
@@ -76,6 +88,8 @@ var _ = Describe("JWTAuth Config", func() {
Expect(rule.Path).To(Equal(actualRule.Path))
Expect(rule.Redirect).To(Equal(actualRule.Redirect))
Expect(rule.AccessRules).To(Equal(actualRule.AccessRules))
+ Expect(rule.ExceptedPaths).To(Equal(actualRule.ExceptedPaths))
+ Expect(rule.AllowRoot).To(Equal(actualRule.AllowRoot))
}
}
|
add test for new config block directives
|
diff --git a/polymodels/tests/test_managers.py b/polymodels/tests/test_managers.py
index <HASH>..<HASH> 100644
--- a/polymodels/tests/test_managers.py
+++ b/polymodels/tests/test_managers.py
@@ -52,7 +52,10 @@ class PolymorphicQuerySetTest(TestCase):
if django.VERSION < (1, 6):
animal_mammals_expected_num_queries += Monkey.objects.count()
animal_mammals_expected_query_select_related['mammal'] = {}
- self.assertEquals(animal_mammals.query.select_related, animal_mammals_expected_query_select_related)
+ self.assertEqual(
+ animal_mammals.query.select_related,
+ animal_mammals_expected_query_select_related
+ )
with self.assertNumQueries(animal_mammals_expected_num_queries):
self.assertQuerysetEqual(animal_mammals.all(),
['<Mammal: mammal>',
|
Use asserEqual instead of assertEquals
|
diff --git a/solvebio/resource/manifest.py b/solvebio/resource/manifest.py
index <HASH>..<HASH> 100644
--- a/solvebio/resource/manifest.py
+++ b/solvebio/resource/manifest.py
@@ -62,6 +62,8 @@ class Manifest(object):
return bool(p.scheme)
for path in args:
+ path = os.path.expandpath(path)
+
if _is_url(path):
self.add_url(path)
elif os.path.isfile(path):
@@ -74,7 +76,6 @@ class Manifest(object):
self.add_file(f)
else:
raise ValueError(
- 'Paths in manifest must be valid URL '
- '(starting with http:// or https://) or '
- 'a valid local filename, directory, '
- 'or glob (such as: *.vcf)')
+ 'Manifest paths must be files, directories, or URLs. '
+ 'The following extensions are supported: '
+ '.vcf .vcf.gz .json .json.gz')
|
expanduser prior to checking ispath or isdir in manifest (fixes #<I>)
|
diff --git a/lib/engine_ws.js b/lib/engine_ws.js
index <HASH>..<HASH> 100644
--- a/lib/engine_ws.js
+++ b/lib/engine_ws.js
@@ -26,6 +26,10 @@ WSEngine.prototype.step = function (requestSpec, ee) {
return engineUtil.createLoopWithCount(requestSpec.count || -1, steps);
}
+ if (requestSpec.think) {
+ return engineUtil.createThink(requestSpec);
+ }
+
let f = function(context, callback) {
ee.emit('request');
let startedAt = process.hrtime();
|
Enable 'think' in ws engine
|
diff --git a/config/webpack.config.js b/config/webpack.config.js
index <HASH>..<HASH> 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -1,4 +1,8 @@
var path = require('path');
+var webpack = require('webpack');
+
+
+
// for prod builds, we have already done AoT and AoT writes to disk
// so read the JS file from disk
@@ -12,8 +16,20 @@ function getEntryPoint() {
return '{{TMP}}/app/main.dev.js';
}
+function getPlugins() {
+ if (process.env.IONIC_ENV === 'prod') {
+ return [
+ // This helps ensure the builds are consistent if source hasn't changed:
+ new webpack.optimize.OccurrenceOrderPlugin(),
+ // Try to dedupe duplicated modules, if any:
+ // Add this back in when Angular fixes the issue: https://github.com/angular/angular-cli/issues/1587
+ //new DedupePlugin()
+ ];
+ }
+ return [];
+}
+
module.exports = {
- devtool: 'source-map',
entry: getEntryPoint(),
output: {
path: '{{BUILD}}',
@@ -31,5 +47,15 @@ module.exports = {
loader: 'json'
}
]
+ },
+
+ plugins: getPlugins(),
+
+ // Some libraries import Node modules but don't use them in the browser.
+ // Tell Webpack to provide empty mocks for them so importing them works.
+ node: {
+ fs: 'empty',
+ net: 'empty',
+ tls: 'empty'
}
};
\ No newline at end of file
|
chore(webpack): add optimize plugins
|
diff --git a/cheroot/server.py b/cheroot/server.py
index <HASH>..<HASH> 100644
--- a/cheroot/server.py
+++ b/cheroot/server.py
@@ -1162,7 +1162,8 @@ class HTTPRequest:
# Override the decision to not close the connection if the connection
# manager doesn't have space for it.
if not self.close_connection:
- can_keep = self.server.connections.can_add_keepalive_connection
+ can_keep = self.ready \
+ and self.server.connections.can_add_keepalive_connection
self.close_connection = not can_keep
if b'connection' not in hkeys:
|
server: don't use connections after it's closed
|
diff --git a/lib/health-data-standards/models/svs/value_set.rb b/lib/health-data-standards/models/svs/value_set.rb
index <HASH>..<HASH> 100644
--- a/lib/health-data-standards/models/svs/value_set.rb
+++ b/lib/health-data-standards/models/svs/value_set.rb
@@ -11,7 +11,7 @@ module HealthDataStandards
scope :by_oid, ->(oid){where(:oid => oid)}
def self.load_from_xml(doc)
- doc.root.add_namespace_uri("vs","urn:ihe:iti:svs:2008")
+ doc.root.add_namespace_definition("vs","urn:ihe:iti:svs:2008")
vs_element = doc.at_xpath("/vs:RetrieveValueSetResponse/vs:ValueSet")
if vs_element
vs = ValueSet.new(oid: vs_element["ID"], display_name: vs_element["displayName"], version: vs_element["version"])
@@ -21,7 +21,6 @@ module HealthDataStandards
code_system_version: con["code_system_version"],
display_name: con["displayName"])
end
- vs.save
return vs
end
end
|
changing bad method call to correct one to add namespace to document
|
diff --git a/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java b/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java
+++ b/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java
@@ -1,6 +1,6 @@
/*
* aocode-public - Reusable Java library of general tools with minimal external dependencies.
- * Copyright (C) 2009, 2010, 2011, 2013, 2015, 2016, 2018, 2019 AO Industries, Inc.
+ * Copyright (C) 2009, 2010, 2011, 2013, 2015, 2016, 2018, 2019, 2020 AO Industries, Inc.
* support@aoindustries.com
* 7262 Bull Pen Cir
* Mobile, AL 36695
@@ -213,6 +213,7 @@ abstract public class EditableResourceBundle extends ModifiablePropertiesResourc
* @see BundleLookupThreadContext
* </p>
* TODO: Add language resources to properties files (but do not make it an editable properties file to avoid possible infinite recursion?)
+ * TODO: Decouple from aocode-public and use ao-fluent-html
*/
public static void printEditableResourceBundleLookups(
Encoder textInJavaScriptEncoder,
|
TODO: Decouple from aocode-public and use ao-fluent-html
|
diff --git a/lib/patternEmitter.js b/lib/patternEmitter.js
index <HASH>..<HASH> 100644
--- a/lib/patternEmitter.js
+++ b/lib/patternEmitter.js
@@ -258,20 +258,20 @@ PatternEmitter.prototype._getMatching = function(type) {
continue;
}
- if (regex.test(type)) {
- if (!matching) {
- matching = this._patternEvents[pattern];
- } else {
- listeners = this._patternEvents[pattern];
- if (!(listeners instanceof Array)) {
- listeners = [listeners];
- }
-
- if (!(matching instanceof Array)) {
- matching = [matching];
- }
- matching = matching.concat(listeners);
+ if (!regex.test(type)) continue;
+
+ if (!matching) {
+ matching = this._patternEvents[pattern];
+ } else {
+ listeners = this._patternEvents[pattern];
+ if (!(listeners instanceof Array)) {
+ listeners = [listeners];
}
+
+ if (!(matching instanceof Array)) {
+ matching = [matching];
+ }
+ matching = matching.concat(listeners);
}
}
|
Small style fix in _getMatching
|
diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/ServiceProvider.php
+++ b/src/ServiceProvider.php
@@ -5,7 +5,6 @@ namespace Freyo\Flysystem\QcloudCOSv4;
use Freyo\Flysystem\QcloudCOSv4\Plugins\GetUrl;
use Freyo\Flysystem\QcloudCOSv4\Plugins\PutRemoteFile;
use Freyo\Flysystem\QcloudCOSv4\Plugins\PutRemoteFileAs;
-use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
use Laravel\Lumen\Application as LumenApplication;
use League\Flysystem\Filesystem;
@@ -29,11 +28,11 @@ class ServiceProvider extends LaravelServiceProvider
$this->app->make('filesystem')
->extend('cosv4', function ($app, $config) {
$flysystem = new Filesystem(new Adapter($config));
-
+
$flysystem->addPlugin(new PutRemoteFile());
$flysystem->addPlugin(new PutRemoteFileAs());
$flysystem->addPlugin(new GetUrl());
-
+
return $flysystem;
});
}
|
Apply fixes from StyleCI (#<I>)
|
diff --git a/nyawc/Options.py b/nyawc/Options.py
index <HASH>..<HASH> 100644
--- a/nyawc/Options.py
+++ b/nyawc/Options.py
@@ -22,6 +22,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+import os
import requests
from nyawc.CrawlerActions import CrawlerActions
@@ -190,7 +191,10 @@ class OptionsIdentity:
def __init__(self):
"""Constructs an OptionsIdentity instance."""
- semver = open(".semver", "r")
+ file = os.path.realpath(__file__)
+ folder = os.path.dirname(file)
+
+ semver = open(folder + "/../.semver", "r")
self.auth = None
self.cookies = requests.cookies.RequestsCookieJar()
|
Fixed reference to .semver file.
|
diff --git a/server/api.php b/server/api.php
index <HASH>..<HASH> 100755
--- a/server/api.php
+++ b/server/api.php
@@ -127,6 +127,14 @@ class api
$compiled = default_addons($phoxy_loading_module);
$this->default_addons = array_merge_recursive($compiled, $this->addons);
+
+ $this->default_addons =
+ $this->override_addons_on_init($this->default_addons);
+ }
+
+ public function override_addons_on_init($addons)
+ {
+ return $addons;
}
public function APICall( $name, $arguments )
|
Allow module override its own addons
|
diff --git a/graphite_api/utils.py b/graphite_api/utils.py
index <HASH>..<HASH> 100644
--- a/graphite_api/utils.py
+++ b/graphite_api/utils.py
@@ -30,9 +30,9 @@ class RequestParams(object):
if request.json and key in request.json:
return request.json[key]
if key in request.form:
- return request.form[key]
+ return request.form.getlist(key)[-1]
if key in request.args:
- return request.args[key]
+ return request.args.getlist(key)[-1]
raise KeyError
def __contains__(self, key):
|
Switch request.GET and request.POST to last-provided wins to match Django's request handling
Refs #<I>
|
diff --git a/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py b/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py
index <HASH>..<HASH> 100644
--- a/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py
+++ b/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py
@@ -64,7 +64,7 @@ TD = 4
REG_DELAY = 10
NETWORK_ID_TIMEOUT = 120
-WAIT_TIME_ALLOWANCE = 30
+WAIT_TIME_ALLOWANCE = 60
class MATN_15_ChangeOfPrimaryBBRTriggersRegistration(thread_cert.TestCase):
@@ -140,8 +140,6 @@ class MATN_15_ChangeOfPrimaryBBRTriggersRegistration(thread_cert.TestCase):
# Make sure that BR_2 becomes the primary BBR
self.assertEqual('disabled', br1.get_state())
- self.assertEqual('leader', br2.get_state())
- self.assertEqual('router', router1.get_state())
self.assertFalse(br1.is_primary_backbone_router)
self.assertTrue(br2.is_primary_backbone_router)
|
[github-actions] fix MATN_<I>_ChangeOfPrimaryBBRTriggersRegistration (#<I>)
|
diff --git a/test/test_buffer.py b/test/test_buffer.py
index <HASH>..<HASH> 100644
--- a/test/test_buffer.py
+++ b/test/test_buffer.py
@@ -101,10 +101,10 @@ def test_number():
def test_name():
vim.command('new')
eq(vim.current.buffer.name, '')
- new_name = vim.eval('tempname()')
+ new_name = vim.eval('resolve(tempname())')
vim.current.buffer.name = new_name
eq(vim.current.buffer.name, new_name)
- vim.command('w!')
+ vim.command('silent w!')
ok(os.path.isfile(new_name))
os.unlink(new_name)
|
Resolve file name and silent write.
This fixes symlink issues on OS X for /var and /private/var
It also stops vim.command('w!') from blocking.
|
diff --git a/shared/simplestreams/simplestreams.go b/shared/simplestreams/simplestreams.go
index <HASH>..<HASH> 100644
--- a/shared/simplestreams/simplestreams.go
+++ b/shared/simplestreams/simplestreams.go
@@ -148,7 +148,7 @@ func (s *SimpleStreams) parseStream() (*Stream, error) {
return s.cachedStream, nil
}
- body, err := s.cachedDownload("/streams/v1/index.json")
+ body, err := s.cachedDownload("streams/v1/index.json")
if err != nil {
return nil, err
}
|
shared/simplestreams: Fix stream's index download url
Since commit aef8f<I> ("shared/simplestreams: Implement caching support")
the index url contains double '/' between the host part and the path part,
so the resulting url looks like:
<URL>, by removing the prepended '/' passed to
s.cachedDownload().
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.