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
|
---|---|---|---|---|---|
5fff014411e5e59efb0e3ccd5cec3d3e2db93d49 | diff --git a/resources/recorder/src/main/java/org/mobicents/media/server/impl/resource/audio/AudioRecorderImpl.java b/resources/recorder/src/main/java/org/mobicents/media/server/impl/resource/audio/AudioRecorderImpl.java
index <HASH>..<HASH> 100644
--- a/resources/recorder/src/main/java/org/mobicents/media/server/impl/resource/audio/AudioRecorderImpl.java
+++ b/resources/recorder/src/main/java/org/mobicents/media/server/impl/resource/audio/AudioRecorderImpl.java
@@ -634,7 +634,7 @@ public class AudioRecorderImpl extends AbstractSink implements Recorder {
toneBuffer.put(DtmfTonesData.buffer[data[0]]);
toneBuffer.rewind();
logger.info("Going to store oob tone , position:" + toneBuffer.position() + ",available:" + toneBuffer.remaining());
- int wroteBytes=fout.getChannel().write(byteBuffer);
+ int wroteBytes=fout.getChannel().write(toneBuffer);
logger.info("Wrote bytes:" + wroteBytes);
} | Resolved oob recording bug | RestComm_media-core | train | java |
b684c784c8986226889feb1524bc029b913c9571 | diff --git a/lib/lifecycles/changelog.js b/lib/lifecycles/changelog.js
index <HASH>..<HASH> 100644
--- a/lib/lifecycles/changelog.js
+++ b/lib/lifecycles/changelog.js
@@ -23,8 +23,9 @@ function outputChangelog (args, newVersion) {
var header = '# Change Log\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n'
var oldContent = args.dryRun ? '' : fs.readFileSync(args.infile, 'utf-8')
// find the position of the last release and remove header:
- if (oldContent.indexOf('<a name=') !== -1) {
- oldContent = oldContent.substring(oldContent.indexOf('<a name='))
+ const changelogSectionRegExp = /<a name=|##? \[?[0-9]+\.[0-9]+\.[0-9]+\]?/
+ if (oldContent.search(changelogSectionRegExp) !== -1) {
+ oldContent = oldContent.substring(oldContent.search(changelogSectionRegExp))
}
var content = ''
var context | fix: make pattern for finding CHANGELOG sections work for non anchors (#<I>) | conventional-changelog_standard-version | train | js |
bd9e16e1ca344f9933d64bc1ba4ab9171c2e192b | diff --git a/class.csstidy.php b/class.csstidy.php
index <HASH>..<HASH> 100644
--- a/class.csstidy.php
+++ b/class.csstidy.php
@@ -583,7 +583,10 @@ function parse($string) {
{
$this->selector .= $this->_unicode($string,$i);
}
- else $this->selector .= $string{$i};
+ // remove unnecessary universal selector, FS#147
+ else if(!($string{$i} == '*' && @in_array($string{$i+1}, array('.', '#', '[', ':')))) {
+ $this->selector .= $string{$i};
+ }
}
else
{ | FS#<I> - Universal selector before classes, IDs and attribute selectors | Cerdic_CSSTidy | train | php |
24a0f2bba2412ce0fafa7e702c927e5be7243ec9 | diff --git a/agent/local/state.go b/agent/local/state.go
index <HASH>..<HASH> 100644
--- a/agent/local/state.go
+++ b/agent/local/state.go
@@ -22,6 +22,8 @@ import (
uuid "github.com/hashicorp/go-uuid"
)
+const fullSyncReadMaxStale = 2 * time.Second
+
// Config is the configuration for the State.
type Config struct {
AdvertiseAddr string
@@ -1046,9 +1048,13 @@ func (l *State) Stats() map[string]string {
func (l *State) updateSyncState() error {
// Get all checks and services from the master
req := structs.NodeSpecificRequest{
- Datacenter: l.config.Datacenter,
- Node: l.config.NodeName,
- QueryOptions: structs.QueryOptions{Token: l.tokens.AgentToken()},
+ Datacenter: l.config.Datacenter,
+ Node: l.config.NodeName,
+ QueryOptions: structs.QueryOptions{
+ Token: l.tokens.AgentToken(),
+ AllowStale: true,
+ MaxStaleDuration: fullSyncReadMaxStale,
+ },
}
var out1 structs.IndexedNodeServices | ae: use stale requests when performing full sync (#<I>)
Read requests performed during anti antropy full sync currently target
the leader only. This generates a non-negligible load on the leader when
the DC is large enough and can be offloaded to the followers following
the "eventually consistent" policy for the agent state.
We switch the AE read calls to use stale requests with a small (2s)
MaxStaleDuration value and make sure we do not read too fast after a
write. | hashicorp_consul | train | go |
0d9d0e0b3076a369eb427f1dcb565cfe3d69039b | diff --git a/ezp/PublicAPI/Exceptions/UnauthorizedException.php b/ezp/PublicAPI/Exceptions/UnauthorizedException.php
index <HASH>..<HASH> 100644
--- a/ezp/PublicAPI/Exceptions/UnauthorizedException.php
+++ b/ezp/PublicAPI/Exceptions/UnauthorizedException.php
@@ -3,7 +3,7 @@ namespace ezp\PublicAPI\Exceptions;
/**
* This Exception is thrown if theuser has is not allowed to perform a service operation
*/
-abstract class UnauthorizedException extends ForbiddenException
+abstract class UnauthorizedException extends RuntimeException
{
} | fixed extends "ForbiddenException" | ezsystems_ezpublish-kernel | train | php |
690d2dd16c7bac74b1e421246144de5f4e46b194 | diff --git a/RoleLookup.js b/RoleLookup.js
index <HASH>..<HASH> 100644
--- a/RoleLookup.js
+++ b/RoleLookup.js
@@ -9,7 +9,7 @@
this.rolelookup=function(obj_or_address) {
if(typeof obj_or_address == "undefined") obj_or_address=parent.options.rolelookup;
-
+
var p1 = new Promise(function(resolve, reject) {
var instance=parent._objInstance(obj_or_address,'StromDAO-BO.sol:RoleLookup');
diff --git a/StromDAONode.js b/StromDAONode.js
index <HASH>..<HASH> 100644
--- a/StromDAONode.js
+++ b/StromDAONode.js
@@ -30,10 +30,13 @@ module.exports = {
resolve2(parent._keepHashRef(o));
});
};
+ this._getBlockNumber=function() {
+ return parent.rpcprovider.getBlockNumber();
+ }
this._waitNextBlock = function(cb) {
var block1=0;
var interval = setInterval(function() {
- parent.provider.getBlockNumber().then(function(blockNumber) {
+ parent.rpcprovider.getBlockNumber().then(function(blockNumber) {
if(block1 === 0) block1=blockNumber;
var block2=blockNumber;
if(block1!=block2) { | Added Blocknumber to generic functions and removed bug in waitFor functions | energychain_StromDAO-BusinessObject | train | js,js |
f1551a51afeb94009acb04f7bd4364c5e2e0d389 | diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/SwitchFallthrough.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/SwitchFallthrough.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/detect/SwitchFallthrough.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/SwitchFallthrough.java
@@ -68,8 +68,8 @@ public class SwitchFallthrough extends BytecodeScanningDetector implements State
priority = NORMAL_PRIORITY;
fallthroughDistance = 1000;
super.visit(obj);
- if (!found.isEmpty() // && found.size() < 4
- ) {
+ if (!found.isEmpty()) {
+ if (found.size() >= 4 && priority == NORMAL_PRIORITY) priority = LOW_PRIORITY;
BugInstance bug = new BugInstance(this, "SF_SWITCH_FALLTHROUGH", priority)
.addClassAndMethod(this).addAnnotations(found);
bugReporter.reportBug(bug); | if lots of fall throughs, report as low priority
git-svn-id: <URL> | spotbugs_spotbugs | train | java |
f2d3e4d00ec1706f0a0376c928d62215e522fdcc | diff --git a/search_test.go b/search_test.go
index <HASH>..<HASH> 100644
--- a/search_test.go
+++ b/search_test.go
@@ -37,18 +37,6 @@ func TestSolrSearchDebugQuery(t *testing.T) {
if res != "wt=json&debug=true&indent=true&testing=test" {
t.Errorf("Expected to be: 'wt=json&debug=true&indent=true&testing=test' but got '%s'", res)
}
-
- resp, err := s.Result(&StandardResultParser{})
- if resp != nil {
- t.Errorf("resp expected to be nil due to no connection is set")
- }
- if err == nil {
- t.Errorf("err expected to be not empty due to no connection is set")
- }
- expectedErrorMessage := "No connection found for making request to solr"
- if err.Error() != expectedErrorMessage {
- t.Errorf("The error message expecte to be '%s' but got '%s'", expectedErrorMessage, err.Error())
- }
}
func TestSolrSearchWithoutConnection(t *testing.T) { | #2 should remove those assertion since they are moved to their own test case | vanng822_go-solr | train | go |
1d8ceb3a69074a661baf73b310ff3354b0fe2204 | diff --git a/fireplace/card.py b/fireplace/card.py
index <HASH>..<HASH> 100644
--- a/fireplace/card.py
+++ b/fireplace/card.py
@@ -40,6 +40,7 @@ class BaseCard(Entity):
super().__init__()
self._auras = []
self.requirements = data.requirements.copy()
+ self.entourage = CardList(self.data.entourage)
self.id = id
self.controller = None
self.aura = False | Create a copy of the entourage as a cardlist in Card.entourage | jleclanche_fireplace | train | py |
453fcc83cb34d0fed3be79859aebe1e369a6f0e5 | diff --git a/src/pfs/drive/btrfs/driver.go b/src/pfs/drive/btrfs/driver.go
index <HASH>..<HASH> 100644
--- a/src/pfs/drive/btrfs/driver.go
+++ b/src/pfs/drive/btrfs/driver.go
@@ -51,14 +51,18 @@ type driver struct {
}
func newDriver(rootDir string, namespace string) (*driver, error) {
- d := driver{rootDir, namespace}
- if err := os.MkdirAll(filepath.Join(d.basePath(), blockDir), 0700); err != nil {
+ driver := &driver{
+ rootDir,
+ namespace,
+ }
+ if err := os.MkdirAll(driver.blockDir(), 0700); err != nil {
return nil, err
}
- if err := os.MkdirAll(filepath.Join(d.basePath(), repoDir), 0700); err != nil {
+ if err := os.MkdirAll(driver.repoDir(), 0700); err != nil {
+ _ = os.Remove(driver.blockDir())
return nil, err
}
- return &d, nil
+ return driver, nil
}
func (d *driver) CreateRepo(repo *pfs.Repo) error { | remove block dir on failure to make repo dir for new driver | pachyderm_pachyderm | train | go |
2f2236c3dbbd39bf53a0bc698f04a0654f57c395 | diff --git a/tergraw/constant.py b/tergraw/constant.py
index <HASH>..<HASH> 100644
--- a/tergraw/constant.py
+++ b/tergraw/constant.py
@@ -17,7 +17,7 @@ CORNER_UPRIGHT, CORNER_UPLEFT = '└', '┘'
CORNER_DOWNRIGHT, CORNER_DOWNLEFT = '┌', '┐'
BAR_UPDOWN, BAR_LEFT_RIGHT = '│', '─'
REWRITABLE_LETTERS = (CORNER_UPRIGHT, CORNER_UPLEFT, CORNER_DOWNLEFT,
- CORNER_DOWNRIGHT, BAR_UPDOWN, BAR_LEFT_RIGHT)
+ CORNER_DOWNRIGHT, BAR_UPDOWN, BAR_LEFT_RIGHT, ' ')
# {current direction, next direction: character to be printed}
CHARACTER = { # {current direction, next direction: character to be printed} | constant: space is a rewritable letter | Aluriak_tergraw | train | py |
c9eda19d88a64fe644c16e77e3e8ea32d12a1c4d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -62,7 +62,7 @@ def find_longdesc():
def revision():
svn_rev = "$Revision$"
match = re.search("\d+", svn_rev)
- return match.group() or "unknown"
+ return match and match.group() or "unknown"
if sys.version_info >= (3,):
src_root = setup_python3() | DavidBurns, on behalf of AndiAlbrecht, correcting return for revision() in issue <I>
r<I> | SeleniumHQ_selenium | train | py |
21de3d3ff269b6ee6d6cd76939604f599f9d345a | diff --git a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php
+++ b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php
@@ -35,7 +35,6 @@ class DatabaseDriverTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertEquals('id', $metadata->fieldMappings['id']['fieldName']);
$this->assertEquals('id', strtolower($metadata->fieldMappings['id']['columnName']));
$this->assertEquals('integer', (string)$metadata->fieldMappings['id']['type']);
- $this->assertEquals('', $metadata->fieldMappings['id']['default']);
$this->assertTrue($metadata->fieldMappings['id']['notnull']);
$this->assertArrayHasKey('bar', $metadata->fieldMappings); | [<I>] DDC-<I> - Remove support "default" option in metadata mappings, but keep it as a concept in DBAL layer to support for example versionable entities. | doctrine_annotations | train | php |
dffd306f7d811c681f7b4cfb010a7d1ccb651474 | diff --git a/test/spec/CodeHintUtils-test.js b/test/spec/CodeHintUtils-test.js
index <HASH>..<HASH> 100644
--- a/test/spec/CodeHintUtils-test.js
+++ b/test/spec/CodeHintUtils-test.js
@@ -21,7 +21,6 @@ define(function (require, exports, module) {
$("body").append("<div id='editor'/>");
myDocument = SpecRunnerUtils.createMockDocument("");
myEditor = new Editor(myDocument, true, "", $("#editor").get(0), {});
- myDocument._makeEditable(myEditor);
});
afterEach(function () { | Re-fix unit tests that were broken when the _makeEditable() call was moved
into Editor. | adobe_brackets | train | js |
328722a2d31ebe73ee47d70c1dc48c9c41a1f68b | diff --git a/lib/component-css-postprocessor.js b/lib/component-css-postprocessor.js
index <HASH>..<HASH> 100644
--- a/lib/component-css-postprocessor.js
+++ b/lib/component-css-postprocessor.js
@@ -64,7 +64,10 @@ ComponentCssPostprocessor.prototype.write = function (readTree, destDir) {
var assetFiles = fs.readdirSync(path.join(destDir, 'assets'));
var vendorjs = assetFiles.filter(function(i){ return i.match(/vendor.*?\.js/); })[0];
var vendorjsPath = path.join(destDir, 'assets', vendorjs);
- fs.appendFileSync(vendorjsPath, cssInjectionSource);
+ // FIXME: This is a quick and ugly workaround to fix #114
+ if (fs.readFileSync(vendorjsPath).toString().indexOf('Ember.COMPONENT_CSS_LOOKUP') === -1) {
+ fs.appendFileSync(vendorjsPath, cssInjectionSource);
+ }
if (hashFn && vendorjs.indexOf('-') > -1){
var vendorJsContent = fs.readFileSync(vendorjsPath, { encoding: 'utf8' }); | Quick workaround to fix #<I> | ebryn_ember-component-css | train | js |
806754b512f52937fa6bdd6df54e1be15408c22f | diff --git a/models/repo.go b/models/repo.go
index <HASH>..<HASH> 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1452,6 +1452,8 @@ func DeleteRepository(uid, repoID int64) error {
&PullRequest{BaseRepoID: repoID},
&ProtectBranch{RepoID: repoID},
&ProtectBranchWhitelist{RepoID: repoID},
+ &Webhook{RepoID: repoID},
+ &HookTask{RepoID: repoID},
); err != nil {
return fmt.Errorf("deleteBeans: %v", err)
} | repo: clean up webhook and hook_task when delete repository (#<I>) | gogs_gogs | train | go |
0bdf2ecb08f7d165f49243170a5f4a7d643bd55a | diff --git a/go/client/chat_api_handler.go b/go/client/chat_api_handler.go
index <HASH>..<HASH> 100644
--- a/go/client/chat_api_handler.go
+++ b/go/client/chat_api_handler.go
@@ -129,7 +129,7 @@ func (c ChatChannel) GetMembersType() chat1.ConversationMembersType {
if typ, ok := chat1.ConversationMembersTypeMap[strings.ToUpper(c.MembersType)]; ok {
return typ
}
- return chat1.ConversationMembersType_IMPTEAM
+ return chat1.ConversationMembersType_KBFS
}
// ChatMessage represents a text message to be sent. | Change members type default to kbfs | keybase_client | train | go |
bc4ec7223888b830b6d7989d2aeccd8a212f66fa | diff --git a/lib/travis/model/repository.rb b/lib/travis/model/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/model/repository.rb
+++ b/lib/travis/model/repository.rb
@@ -90,6 +90,7 @@ class Repository < ActiveRecord::Base
end
def last_finished_builds_by_branches
- branches.map { |branch| builds.last_finished_on_branch(branch) }.compact
+ n = branches.map { |branch| builds.last_finished_on_branch(branch) }.compact
+ n.sort { |a, b| b.finished_at <=> a.finished_at }
end
end | sort last branch builds by finished_at desc | travis-ci_travis-core | train | rb |
302ad612648f815a92c2128117db6ea1af177927 | diff --git a/src/frontend/org/voltdb/export/ExportDataSource.java b/src/frontend/org/voltdb/export/ExportDataSource.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/export/ExportDataSource.java
+++ b/src/frontend/org/voltdb/export/ExportDataSource.java
@@ -1120,21 +1120,27 @@ public class ExportDataSource implements Comparable<ExportDataSource> {
/**
* set the runnable task that is to be executed on mastership designation
+ *
* @param toBeRunOnMastership a {@link @Runnable} task
+ * @param runEveryWhere Set if connector "replicated" property is set to true Like replicated table, every
+ * replicated export stream is its own master.
*/
- public void setOnMastership(Runnable toBeRunOnMastership, boolean isRunEveryWhere) {
+ public void setOnMastership(Runnable toBeRunOnMastership, boolean runEveryWhere) {
Preconditions.checkNotNull(toBeRunOnMastership, "mastership runnable is null");
m_onMastership = toBeRunOnMastership;
- if (isRunEveryWhere) {
- acceptMastership();
- }
+ setRunEveryWhere(runEveryWhere);
}
public ExportFormat getExportFormat() {
return m_format;
}
- //Set it from client.
+ /**
+ * Set it from the client
+ *
+ * @param runEveryWhere Set if connector "replicated" property is set to true Like replicated table, every
+ * replicated export stream is its own master.
+ */
public void setRunEveryWhere(boolean runEveryWhere) {
m_runEveryWhere = runEveryWhere;
if (m_runEveryWhere) { | ENG-<I>: Fix usage of variable ExportDataSource.m_runEveryWhere
m_runEveryWhere could be set but setOnMastership or setRunEveryWhere but
was actually not being updated by setOnMastership. Update
setOnMastership to call setRunEveryWhere to correctly set the value. | VoltDB_voltdb | train | java |
157ccd71a2eab7d03bfd817cd47a364d06aadc6a | diff --git a/tscreen_solaris.go b/tscreen_solaris.go
index <HASH>..<HASH> 100644
--- a/tscreen_solaris.go
+++ b/tscreen_solaris.go
@@ -1,6 +1,6 @@
-// +build solaris
+// +build solaris illumos
-// Copyright 2019 The TCell Authors
+// Copyright 2020 The TCell Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use file except in compliance with the License.
@@ -115,3 +115,8 @@ func (t *tScreen) getWinSize() (int, int, error) {
}
return int(wsz.Col), int(wsz.Row), nil
}
+
+func (t *tScreen) Beep() error {
+ t.writeString(string(byte(7)))
+ return nil
+} | fix build on illumos after Beep() API
The build for the "solaris" and "illumos" tags appears to have been
broken by commit 8ec<I>b6fa6c<I>d5d<I>c<I>b<I>f<I>ba2f, which
introduced the Beep() API. Restore functionality by using the same
implementation as every other UNIX family platform. | gdamore_tcell | train | go |
983bdbf2e41e6f7b0f29dd4bd49b9b8b6c4dda6a | diff --git a/src/toil/job.py b/src/toil/job.py
index <HASH>..<HASH> 100644
--- a/src/toil/job.py
+++ b/src/toil/job.py
@@ -941,7 +941,12 @@ class FunctionWrappingJob(Job):
if userFunctionModule.dirPath not in sys.path:
# FIXME: prepending to sys.path will probably fix #103
sys.path.append(userFunctionModule.dirPath)
- return getattr(importlib.import_module(userFunctionModule.name), self.userFunctionName)
+ try:
+ return getattr(importlib.import_module(userFunctionModule.name), self.userFunctionName)
+ except AttributeError:
+ logger.error("Error retrieving user module. Confirm that the script's name is not also "
+ "a standard python module")
+ raise
def run(self,fileStore):
userFunction = self._getUserFunction( ) | Helpful message to warn user about module name conflicts (resolves #<I>) | DataBiosphere_toil | train | py |
a06332949b2256b8bf295841bc97e8f0deae9099 | diff --git a/src/Illuminate/Foundation/Mix.php b/src/Illuminate/Foundation/Mix.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Mix.php
+++ b/src/Illuminate/Foundation/Mix.php
@@ -31,7 +31,7 @@ class Mix
if (is_file(public_path($manifestDirectory.'/hot'))) {
$url = rtrim(file_get_contents(public_path($manifestDirectory.'/hot')));
-
+
$hot_proxy_url = app('config')->get('app.mix_hot_proxy_url');
if (! empty($hot_proxy_url)) {
return new HtmlString("{$hot_proxy_url}{$path}"); | Update Mix.php
Style violation; remove spaces. | laravel_framework | train | php |
5c888caa2e5fc552d5feb832092d40d3c9663536 | diff --git a/sharding-orchestration/sharding-orchestration-core/src/test/java/io/shardingsphere/orchestration/internal/state/service/DataSourceServiceTest.java b/sharding-orchestration/sharding-orchestration-core/src/test/java/io/shardingsphere/orchestration/internal/state/service/DataSourceServiceTest.java
index <HASH>..<HASH> 100644
--- a/sharding-orchestration/sharding-orchestration-core/src/test/java/io/shardingsphere/orchestration/internal/state/service/DataSourceServiceTest.java
+++ b/sharding-orchestration/sharding-orchestration-core/src/test/java/io/shardingsphere/orchestration/internal/state/service/DataSourceServiceTest.java
@@ -73,7 +73,7 @@ public class DataSourceServiceTest {
}
@Test
- public void testGetAvailableDataSourceConfigurations() {
+ public void assertGetAvailableDataSourceConfigurations() {
when(regCenter.getChildrenKeys("/test/config/schema")).thenReturn(Collections.singletonList("sharding_db"));
when(regCenter.getDirectly("/test/config/schema/sharding_db/rule")).thenReturn(SHARDING_MASTER_SLAVE_RULE_YAML);
when(regCenter.getDirectly("/test/config/schema/sharding_db/datasource")).thenReturn(DATA_SOURCE_YAML); | rename to assertGetAvailableDataSourceConfigurations() | apache_incubator-shardingsphere | train | java |
ae507c9f729d9990781a1ff4b61baffa177d8858 | diff --git a/src/utils/device.js b/src/utils/device.js
index <HASH>..<HASH> 100644
--- a/src/utils/device.js
+++ b/src/utils/device.js
@@ -1,12 +1,23 @@
var THREE = require('../lib/three');
var dolly = new THREE.Object3D();
-var controls = new THREE.VRControls(dolly);
+
+var getControls = (function () {
+ var controls;
+ return function () {
+ if (!controls) {
+ // Lazy-instantiate VRControls to not break in Node.
+ controls = new THREE.VRControls(dolly);
+ }
+ return controls;
+ };
+})();
/**
* Determine if a headset is connected by checking if the orientation is available.
*/
function checkHeadsetConnected () {
var orientation;
+ var controls = getControls();
var vrDisplay = controls.getVRDisplay();
// If `isConnected` is available, just use that.
@@ -25,6 +36,7 @@ module.exports.checkHeadsetConnected = checkHeadsetConnected;
* Check for positional tracking.
*/
function checkHasPositionalTracking () {
+ var controls = getControls();
var vrDisplay = controls.getVRDisplay();
if (isMobile() || isGearVR()) { return false; }
return vrDisplay && vrDisplay.capabilities.hasPosition; | delay VRControls initialization for node | aframevr_aframe | train | js |
ada4c5fe1c17b4dcc1f17902146e1f9891e7057a | diff --git a/event/event_test.go b/event/event_test.go
index <HASH>..<HASH> 100644
--- a/event/event_test.go
+++ b/event/event_test.go
@@ -39,7 +39,7 @@ type S struct {
var _ = check.Suite(&S{})
func setBaseConfig() {
- config.Set("database:url", "127.0.0.1:27017?maxPoolSize=100")
+ config.Set("database:url", "127.0.0.1:27017?maxPoolSize=150")
config.Set("database:name", "tsuru_events_tests")
config.Set("auth:hash-cost", bcrypt.MinCost)
} | event: increase mongodb pool size in test
(cherry picked from commit <I>f<I>e<I>fcb9bd<I>c<I>deb<I>c7d3ecaafb) | tsuru_tsuru | train | go |
081e92ddcea017fa8009f24011980b3dd988f39b | diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go
index <HASH>..<HASH> 100644
--- a/go/vt/sqlparser/parse_test.go
+++ b/go/vt/sqlparser/parse_test.go
@@ -3255,6 +3255,27 @@ func TestCreateTable(t *testing.T) {
}
}
+func TestOne(t *testing.T) {
+ testOne := struct {
+ input, output string
+ }{
+ input: "",
+ output: "",
+ }
+ if testOne.input == "" {
+ return
+ }
+ sql := strings.TrimSpace(testOne.input)
+ tree, err := Parse(sql)
+ require.NoError(t, err)
+ got := String(tree)
+ expected := testOne.output
+ if expected == "" {
+ expected = sql
+ }
+ require.Equal(t, expected, got)
+}
+
func TestCreateTableLike(t *testing.T) {
normal := "create table a like b"
testCases := []struct { | test: added testOne to parse_test | vitessio_vitess | train | go |
a2189fc50dba2561a4a11468bdc4d8ccd1167326 | 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
@@ -8,9 +8,8 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
require 'blockscore'
module ResourceTest
- mattr_accessor :resource
-
- def self.extended(base)
+ def self.included(base)
+ base.mattr_accessor :resource
base.resource = base.to_s[/^(\w+)ResourceTest/, 1].underscore
end | use included instead; move mattr_accessor | BlockScore_blockscore-ruby | train | rb |
bf38a9b01fd70fa674d9cf8c15d9528d2e62cc02 | diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php
index <HASH>..<HASH> 100644
--- a/classes/PodsAPI.php
+++ b/classes/PodsAPI.php
@@ -8322,9 +8322,9 @@ class PodsAPI {
$id = $this->save_pod_item( $params );
// Always return $id for AJAX requests.
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
- return $id;
- }
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
+ return $id;
+ }
if ( 0 < $id && ! empty( $thank_you ) ) {
$thank_you = str_replace( 'X_ID_X', $id, $thank_you ); | Spaces as indentation to match surrounding code
sigh... | pods-framework_pods | train | php |
80a526e461789b8bee9192881b39b674941d173b | diff --git a/src/Compoships.php b/src/Compoships.php
index <HASH>..<HASH> 100644
--- a/src/Compoships.php
+++ b/src/Compoships.php
@@ -14,13 +14,13 @@ trait Compoships
public function getAttribute($key)
{
- if(is_array($key)){ //Check for multi-column relationship
+ if(is_array($key)){ //Check for multi-columns relationship
return array_map(function($k){
- return parent::getAttribute(camel_case($k));
+ return parent::getAttribute($k);
}, $key);
}
- return parent::getAttribute(camel_case($key));
+ return parent::getAttribute($key);
} | Cleared accidental call to 'camel_case' | topclaudy_compoships | train | php |
b1ae52a18843cfb69e86b0499a2dd9543fa68784 | diff --git a/spec/graph_mapper_spec.rb b/spec/graph_mapper_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/graph_mapper_spec.rb
+++ b/spec/graph_mapper_spec.rb
@@ -14,12 +14,17 @@ describe Grom::GraphMapper do
end
end
- xdescribe '#statements_mapper' do
- it 'should return a hash with the mapped predicates and the respective objects from a graph' do
- arya = extended_class.statements_mapper(PEOPLE_GRAPH).select{ |o| o[:id] == '2' }.first
- expect(arya[:forename]).to eq 'Arya'
- surname_pattern = RDF::Query::Pattern.new(:subject, RDF::URI.new("#{DATA_URI_PREFIX}/schema/surname"), :object)
- expect(arya[:graph].query(surname_pattern).first_object.to_s).to eq 'Stark'
+ describe '#statement_mapper' do
+ it 'should insert a hash with the id from a given statement in rdf format into the given hash' do
+ result = {}
+ extended_class.statement_mapper(ONE_STATEMENT_STUB, result)
+ expect(result["1"][:id]).to eq '1'
+ end
+
+ it 'should modify a given hash with the predicate and object from a given statement in ttl format' do
+ result = {}
+ extended_class.statement_mapper(ONE_STATEMENT_STUB, result)
+ expect(result).to eq 'bla'
end
end | started writing tests for statement-mapper | ukparliament_grom | train | rb |
8c4339da8b5c118c1a33e36c90045886ce4defb8 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -118,11 +118,11 @@ groups.Groups = function(optionsArg, callback) {
async.series([addId, addExtras, removeId, removeExtras], callback);
function addId(callback) {
- return self._apos.pages.update({ _id: { $in: personIds } }, { $addToSet: { groupIds: snippet._id, groupName: snippet.title } }, { multi: true }, callback);
+ return self._apos.pages.update({ _id: { $in: personIds } }, { $addToSet: { groupIds: snippet._id } }, { multi: true }, callback);
}
function removeId(callback) {
- return self._apos.pages.update({ type: self._instance, _id: { $nin: personIds } }, { $pull: { groupIds: snippet._id, groupName: snippet.title } }, { multi: true }, callback);
+ return self._apos.pages.update({ type: self._instance, _id: { $nin: personIds } }, { $pull: { groupIds: snippet._id } }, { multi: true }, callback);
}
// Extras like job titles are stored in an object property | Allowing groups to come through as a full property of user. | apostrophecms-legacy_apostrophe-groups | train | js |
e52d71c9e81f5e3d8f0f0402ef69cdcaa1b566be | diff --git a/indra/reach/processor.py b/indra/reach/processor.py
index <HASH>..<HASH> 100644
--- a/indra/reach/processor.py
+++ b/indra/reach/processor.py
@@ -202,7 +202,7 @@ class ReachProcessor(object):
# When the controller is not a simple entity
if controller is None:
if a['argument-type'] == 'complex':
- controllers = a.get('args').values()
+ controllers = list(a.get('args').values())
controller_agent =\
self._get_agent_from_entity(controllers[0])
bound_agents = [self._get_agent_from_entity(c) | Fix indexing into dict.values() view (cast to list) | sorgerlab_indra | train | py |
adcf9873e544286a1afec718f935a9cf92945920 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ A simple wrapper around pdfminer 201105115.
setup(
name="unpdfer",
- version="0.0.3",
+ version="0.0.4",
license="GPL3",
author="Timothy Duffy",
author_email="[email protected]",
diff --git a/unpdfer.py b/unpdfer.py
index <HASH>..<HASH> 100644
--- a/unpdfer.py
+++ b/unpdfer.py
@@ -62,6 +62,7 @@ class Unpdfer:
except:
self._report("CreationDate field could not be decoded within PDF, setting to ''")
pass
+ created = created.encode('ascii','ignore')
retVal = (created,txt,True)
retstr.close()
except Exception, e: | added utf-8 conversion to creationdate field | thequbit_unpdfer | train | py,py |
4ee864475ac84be5d0ba2e12eb44b5000c0be7e7 | diff --git a/salt/modules/smartos_vmadm.py b/salt/modules/smartos_vmadm.py
index <HASH>..<HASH> 100644
--- a/salt/modules/smartos_vmadm.py
+++ b/salt/modules/smartos_vmadm.py
@@ -389,3 +389,19 @@ def create(domain):
salt '*' virt.create <domain>
'''
return start(domain)
+
+
+def destroy(domain):
+ '''
+ .. deprecated:: Boron
+ Use :py:func:`~salt.modules.virt.stop` instead.
+
+ Power off a defined domain
+
+ CLI Example:
+
+ .. code-block:: bash
+
+ salt '*' virt.destroy <domain>
+ '''
+ return stop(domain) | Add an alias for deprecated function "destroy" on SmartOS | saltstack_salt | train | py |
355a42f36d7e27578ecd645c0fc6e07d793b8154 | diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go
index <HASH>..<HASH> 100644
--- a/cmd/geth/chaincmd.go
+++ b/cmd/geth/chaincmd.go
@@ -123,6 +123,7 @@ func initGenesis(ctx *cli.Context) error {
if err != nil {
utils.Fatalf("failed to read genesis file: %v", err)
}
+ defer genesisFile.Close()
block, err := core.WriteGenesisBlock(chaindb, genesisFile)
if err != nil {
diff --git a/cmd/swarm/hash.go b/cmd/swarm/hash.go
index <HASH>..<HASH> 100644
--- a/cmd/swarm/hash.go
+++ b/cmd/swarm/hash.go
@@ -36,6 +36,7 @@ func hash(ctx *cli.Context) {
fmt.Println("Error opening file " + args[1])
os.Exit(1)
}
+ defer f.Close()
stat, _ := f.Stat()
chunker := storage.NewTreeChunker(storage.NewChunkerParams()) | cmd/geth, cmd/swarm: Fix to close file handler appropriately | ethereum_go-ethereum | train | go,go |
d98a551f084146d011c2374f018289ad633cd497 | diff --git a/pywal/sequences.py b/pywal/sequences.py
index <HASH>..<HASH> 100644
--- a/pywal/sequences.py
+++ b/pywal/sequences.py
@@ -54,7 +54,7 @@ def create_sequences(colors):
set_special(13, colors["special"]["foreground"], "l"),
set_special(17, colors["special"]["foreground"], "l"),
set_special(19, colors["special"]["background"], "l"),
- set_special(708, colors["special"]["background"], "l"),
+ set_special(708, colors["special"]["background"], "l", alpha),
set_color(232, colors["special"]["background"]),
set_color(256, colors["special"]["foreground"])
]) | Fix URxvt borders not respecting background opacity | dylanaraps_pywal | train | py |
5cf1dcfa2b319e24ccad4ff3b3179d25473cafe6 | diff --git a/src/Components/Apollo/Apollo.php b/src/Components/Apollo/Apollo.php
index <HASH>..<HASH> 100644
--- a/src/Components/Apollo/Apollo.php
+++ b/src/Components/Apollo/Apollo.php
@@ -34,6 +34,8 @@ class Apollo
}
if (isset($settings['client_ip'])) {
$this->clientIp = $settings['client_ip'];
+ } else {
+ $this->clientIp = current(swoole_get_local_ip()) ?: null;
}
if (isset($settings['pull_timeout'])) {
$this->pullTimeout = $settings['pull_timeout']; | optimize clientIp for apollo | hhxsv5_laravel-s | train | php |
f7b3ebdb99539c84bb2ed8fd2bea820f1ca39649 | diff --git a/src/utils.js b/src/utils.js
index <HASH>..<HASH> 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -101,7 +101,7 @@
function getPublicMethods(inst, iterator, context) {
getPrototypeMethods(inst, function(m, k) {
- if( typeof(m) === 'function' && !/^_/.test(k) ) {
+ if( typeof(m) === 'function' && k.charAt(0) !== '_' ) {
iterator.call(context, m, k);
}
});
@@ -144,7 +144,8 @@
function each(obj, iterator, context) {
angular.forEach(obj, function(v,k) {
- if( !k.match(/^[_$]/) ) {
+ var c = k.charAt(0);
+ if( c !== '_' && c !== '$' ) {
iterator.call(context, v, k, obj);
}
}); | Use charAt() instead of regex for efficiency. | firebase_angularfire | train | js |
4729f0c76c94e2c0fd89210edd7d5d584b309272 | diff --git a/src/NewTwitchApi/NewTwitchApi.php b/src/NewTwitchApi/NewTwitchApi.php
index <HASH>..<HASH> 100644
--- a/src/NewTwitchApi/NewTwitchApi.php
+++ b/src/NewTwitchApi/NewTwitchApi.php
@@ -57,7 +57,7 @@ class NewTwitchApi
return $this->oauthApi;
}
- public function getBitsApi(): ClipsApi
+ public function getBitsApi(): BitsApi
{
return $this->bitsApi;
}
@@ -72,7 +72,7 @@ class NewTwitchApi
return $this->gamesApi;
}
- public function getHypeTrainApi(): GamesApi
+ public function getHypeTrainApi(): HypeTrainApi
{
return $this->hypeTrainApi;
}
@@ -82,7 +82,7 @@ class NewTwitchApi
return $this->moderationApi;
}
- public function getSearchApi(): StreamsApi
+ public function getSearchApi(): SearchApi
{
return $this->searchApi;
} | Resolved Class issues in NewTwitchApi | nicklaw5_twitch-api-php | train | php |
4786883f42f7fc6f55d0e4e7d1a5af3d1208ed37 | diff --git a/tests/Test/Database/Cli/StatusTaskTest.php b/tests/Test/Database/Cli/StatusTaskTest.php
index <HASH>..<HASH> 100644
--- a/tests/Test/Database/Cli/StatusTaskTest.php
+++ b/tests/Test/Database/Cli/StatusTaskTest.php
@@ -2,6 +2,8 @@
namespace Test\Database\Cli;
+use Neutrino\Cli\Output\Decorate;
+
/**
* Class StatusTaskTest
*
@@ -96,9 +98,9 @@ class StatusTaskTest extends DatabaseCliTestCase
['+------+---------------------------+', true],
['| RAN? | MIGRATION |', true],
['+------+---------------------------+', true],
- ['| Y | 123_create_users_table |', true],
- ['| N | 456_create_profiles_table |', true],
- ['| N | 789_create_roles_table |', true],
+ ['| ' . Decorate::info('Y') . ' | 123_create_users_table |', true],
+ ['| ' . Decorate::apply('N', 'red') . ' | 456_create_profiles_table |', true],
+ ['| ' . Decorate::apply('N', 'red') . ' | 789_create_roles_table |', true],
['+------+---------------------------+', true]
); | test(StatusTaskTest): fix missing coloration excepted | phalcon-nucleon_framework | train | php |
a00cb9f556377bc6057d37d0cfb4e6d8eb76964e | diff --git a/modules/cms/twig/DebugExtension.php b/modules/cms/twig/DebugExtension.php
index <HASH>..<HASH> 100644
--- a/modules/cms/twig/DebugExtension.php
+++ b/modules/cms/twig/DebugExtension.php
@@ -107,7 +107,7 @@ class DebugExtension extends Twig_Extension
$var = func_get_arg($i);
if ($var instanceof ComponentBase) {
- $caption = static::COMPONENT_CAPTION;
+ $caption = [static::COMPONENT_CAPTION, get_class($var)];
} elseif (is_array($var)) {
$caption = static::ARRAY_CAPTION;
} else { | (7:<I>:<I> PM) Flynsarmy: i feel component should also show the subheader too | octobercms_october | train | php |
24123524dd50d431ac0eda7f99c09ae188426217 | diff --git a/src/site/components/com_actors/controllers/behaviors/followable.php b/src/site/components/com_actors/controllers/behaviors/followable.php
index <HASH>..<HASH> 100644
--- a/src/site/components/com_actors/controllers/behaviors/followable.php
+++ b/src/site/components/com_actors/controllers/behaviors/followable.php
@@ -69,6 +69,11 @@ class ComActorsControllerBehaviorFollowable extends KControllerBehaviorAbstract
*/
protected function _actionFollow(KCommandContext $context)
{
+ if ($this->getItem()->eql($this->actor)) {
+ throw new LibBaseControllerExceptionForbidden('Forbidden');
+ return false;
+ }
+
$this->getResponse()->status = KHttpResponse::RESET_CONTENT;
if (!$this->getItem()->leading($this->actor)) {
@@ -120,6 +125,11 @@ class ComActorsControllerBehaviorFollowable extends KControllerBehaviorAbstract
*/
protected function _actionLead(KCommandContext $context)
{
+ if ($this->getItem()->eql($this->actor)) {
+ throw new LibBaseControllerExceptionForbidden('Forbidden');
+ return false;
+ }
+
$this->getResponse()->status = KHttpResponse::RESET_CONTENT;
if (!$this->getItem()->following($this->actor)) { | In the controller made sure that actor and this->item aren't the same when following and leading. | anahitasocial_anahita | train | php |
71669016632effa00dcd0f832a894c5223b0625c | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -122,8 +122,8 @@ export async function showLocation(options) {
url = prefixes['apple-maps'];
url = useSourceDestiny
? `${url}?saddr=${sourceLatLng}&daddr=${latlng}`
- : `${url}?sll=${latlng}`;
- !sourceLatLng && (url += `&q=${title ? encodedTitle : 'Location'}`);
+ : `${url}?ll=${latlng}`;
+ url += `&q=${title ? encodedTitle : 'Location'}`
url += appleDirectionMode ? `&dirflg=${appleDirectionMode}` : '';
break;
case 'google-maps': | Undoing the change to use sll and using lss instead | leanmotherfuckers_react-native-map-link | train | js |
8bcdc5753b45e935b8dfa7efdefe431a33d22bec | diff --git a/lib/fog/aws/requests/compute/describe_snapshots.rb b/lib/fog/aws/requests/compute/describe_snapshots.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/aws/requests/compute/describe_snapshots.rb
+++ b/lib/fog/aws/requests/compute/describe_snapshots.rb
@@ -71,6 +71,9 @@ module Fog
if filters.delete('owner-alias')
Formatador.display_line("[yellow][WARN] describe_snapshots with owner-alias is not mocked[/] [light_black](#{caller.first})[/]")
end
+ if filters.delete('RestorableBy')
+ Formatador.display_line("[yellow][WARN] describe_snapshots with RestorableBy is not mocked[/] [light_black](#{caller.first})[/]")
+ end
aliases = {
'description' => 'description', | [aws|compute] fix describe_snapshots mock to disregard, but warn on RestorableBy | fog_fog | train | rb |
47c162227b1fc6f08a576dafd92fad7c8df3a1b6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -81,7 +81,7 @@ class PyTest(TestCommand):
sys.exit(errcode)
-tests_require = ["pandas == 0.17.1",
+tests_require = ["pandas >= 0.17.1",
'easygui',
'pyqt',
# 'pyside',
@@ -98,13 +98,13 @@ setup(
url='https://github.com/draperjames/qtpandas',
license='MIT License',
namespace_packages=['qtpandas'],
- author='Matthias Ludwig, Marcel Radischat, Zeke, James Draper',
+ author='Matthias Ludwig, Marcel Radischat, Zeke Barge, James Draper',
tests_require=tests_require,
install_requires=[
- "pandas == 0.17.1",
+ "pandas >= 0.17.1",
'easygui',
'pytest',
- 'pytest-qt==1.2.2',
+ 'pytest-qt>=1.2.2',
'qtpy',
'future',
'pytest-cov', | Updated setup.py to not downgrade pandas/pytest | draperjames_qtpandas | train | py |
a883c78d3e9f4aede4081c1a9cac65e01a477bfe | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -33,10 +33,6 @@ setup (name = 'phoebe',
description = 'PHOEBE 2.0 devel',
packages = ['phoebe', 'phoebe.constants', 'phoebe.parameters', 'phoebe.frontend', 'phoebe.constraints', 'phoebe.dynamics', 'phoebe.distortions', 'phoebe.algorithms', 'phoebe.atmospheres', 'phoebe.backend', 'phoebe.utils'],
install_requires=['numpy','scipy','astropy'],
- package_data={'phoebe.atmospheres':['tables/wd/*', 'tables/ptf/*.*','redlaws/*.*','tables/ld_coeffs/README',
- 'tables/ld_coeffs/blackbody_uniform_none_teff.fits',
- 'tables/spectra/README','tables/spec_intens/README',
- 'tables/gravb/claret.dat', 'tables/gravb/espinosa.dat',
- 'tables/passbands/*'],
+ package_data={'phoebe.atmospheres':['tables/wd/*', 'tables/passbands/*'],
},
ext_modules = ext_modules) | remove unused package data from setup script
tables are now stored in a separate repo and fetch/installed automatically | phoebe-project_phoebe2 | train | py |
6446b44c599a03cbc90ec0ac553963c85a799d80 | diff --git a/src/Server/Manager.php b/src/Server/Manager.php
index <HASH>..<HASH> 100644
--- a/src/Server/Manager.php
+++ b/src/Server/Manager.php
@@ -211,8 +211,14 @@ class Manager
} catch (Exception $e) {
$this->logServerError($e);
- $swooleResponse->status(500);
- $swooleResponse->end('Oops! An unexpected error occurred.');
+ try {
+ $swooleResponse->status(500);
+ $swooleResponse->end('Oops! An unexpected error occurred.');
+ } catch (Exception $e) {
+ // Catch: zm_deactivate_swoole: Fatal error: Uncaught exception
+ // 'ErrorException' with message 'swoole_http_response::status():
+ // http client#2 is not exist.
+ }
}
} | improve <I> response while on request | swooletw_laravel-swoole | train | php |
878eb559b1559da3752ddfd8b50ffc69105ef331 | diff --git a/cmd/arpc/main.go b/cmd/arpc/main.go
index <HASH>..<HASH> 100644
--- a/cmd/arpc/main.go
+++ b/cmd/arpc/main.go
@@ -37,6 +37,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
+ defer c.Close()
// Set request deadline from flag
if err := c.SetDeadline(time.Now().Add(*durFlag)); err != nil {
@@ -51,7 +52,4 @@ func main() {
}
fmt.Printf("%s -> %s", ip, mac)
-
- // Clean up ARP client socket
- _ = c.Close()
} | cmd/arpc: defer cleanup of client | mdlayher_arp | train | go |
dda590f53ccf671b53f9bc53939a4ba24fd5607f | diff --git a/tests/unit/components/sl-tab-panel-test.js b/tests/unit/components/sl-tab-panel-test.js
index <HASH>..<HASH> 100755
--- a/tests/unit/components/sl-tab-panel-test.js
+++ b/tests/unit/components/sl-tab-panel-test.js
@@ -47,8 +47,15 @@ test( 'setupTabs() does so correctly', function() {
equal( $('.sl-tab-pane.active[data-tab-name="a"]').length, 1 );
});
-// @TODO 2nd test - selector does not return results when there's an expectation that it should (in test environment)
test( 'ARIA roles are implemented', function() {
+ var component = this.subject({
+ template : Ember.Handlebars.compile(
+ '{{#sl-tab-pane label="A" name="a"}}A content{{/sl-tab-pane}}' +
+ '{{#sl-tab-pane label="B" name="b"}}B content{{/sl-tab-pane}}' +
+ '{{#sl-tab-pane label="C" name="c"}}C content{{/sl-tab-pane}}'
+ )
+ });
+
this.append();
equal( $('.nav-tabs[role="tablist"]').length, 1 ); | Make "ARIA roles are implemented" test pass | softlayer_sl-ember-components | train | js |
e46ed99915c0bd557995e740e51ee8cb5e7e11a1 | diff --git a/lib/pkgforge/components/package.rb b/lib/pkgforge/components/package.rb
index <HASH>..<HASH> 100644
--- a/lib/pkgforge/components/package.rb
+++ b/lib/pkgforge/components/package.rb
@@ -29,7 +29,9 @@ module PkgForge
Contract None => nil
def copy_tarball!
FileUtils.mkdir_p 'pkg'
- FileUtils.cp tmpfile(:tarball), "pkg/#{name}-#{git_hash}.tar.gz"
+ pkg_file = "pkg/#{name}-#{git_hash}.tar.gz"
+ FileUtils.cp tmpfile(:tarball), pkg_file
+ FileUtils.chmod 0644, pkg_file
nil
end
end
diff --git a/lib/pkgforge/version.rb b/lib/pkgforge/version.rb
index <HASH>..<HASH> 100644
--- a/lib/pkgforge/version.rb
+++ b/lib/pkgforge/version.rb
@@ -1,5 +1,5 @@
##
# Declare version number
module PkgForge
- VERSION = '0.4.2'.freeze
+ VERSION = '0.4.3'.freeze
end | fix file perms on tarball | akerl_pkgforge | train | rb,rb |
bc53dfdfb272ab44c97f6f69c8782d13bec37246 | diff --git a/indra/tests/test_db.py b/indra/tests/test_db.py
index <HASH>..<HASH> 100644
--- a/indra/tests/test_db.py
+++ b/indra/tests/test_db.py
@@ -257,11 +257,17 @@ def test_full_upload():
db.TextContent.text_type == texttypes.FULLTEXT)
assert len(tc_list), "No fulltext was added."
Manuscripts(ftp_url=TEST_FTP, local=True).populate(db)
- tc_list = db.select_all(
- 'text_content',
+ tcs_manu = db.filter_query(
+ db.TextContent,
db.TextContent.source == Manuscripts.my_source
- )
- assert len(tc_list), "No manuscripts uploaded."
+ ).count()
+ assert tcs_manu, "No manuscripts uploaded."
+ trs_w_mids = db.filter_query(
+ db.TextRef,
+ db.TextRef.manuscript_id.isnot(None)
+ ).count()
+ assert trs_w_mids >= tcs_manu,\
+ "Only %d of at least %d manuscript id's added." % (trs_w_mids, tcs_manu)
tc_list = db.select_all('text_content')
set_exp = {('manuscripts', 'xml', 'fulltext'),
('pmc_oa', 'xml', 'fulltext'), | Add test for presence of manuscript ids.
Note that this makes the test fail, as the manuscript id's are currently
not uploaded. This issue will need to be fixed. | sorgerlab_indra | train | py |
58a801b78ed930264b6a613a69381e05a98267ac | diff --git a/src/sports/division.js b/src/sports/division.js
index <HASH>..<HASH> 100644
--- a/src/sports/division.js
+++ b/src/sports/division.js
@@ -50,7 +50,7 @@ module.exports = function(ngin) {
standings: function(options, callback) {
options = _.extend({division_id: this.id}, options)
- return ngin.Standings.create(options).fetch(callback)
+ return ngin.Standings.create(options).fetch(options, callback)
}
}, {
diff --git a/src/sports/season.js b/src/sports/season.js
index <HASH>..<HASH> 100644
--- a/src/sports/season.js
+++ b/src/sports/season.js
@@ -55,7 +55,8 @@ module.exports = function(ngin) {
},
standings: function(callback) {
- return ngin.Standings.create({season_id: this.id}).fetch(callback)
+ options = _.extend({season_id: this.id}, options)
+ return ngin.Standings.create({season_id: this.id}).fetch(otpions, callback)
}
},{ | passing options to standings fetch for querying by game_type | sportngin_ngin_client_node | train | js,js |
ceebb4dde36144fc01bf9c2cc8d65a64019ce18a | diff --git a/test/remote_test.rb b/test/remote_test.rb
index <HASH>..<HASH> 100644
--- a/test/remote_test.rb
+++ b/test/remote_test.rb
@@ -136,6 +136,16 @@ module Byebug
assert_equal true, t.value.success?
end
+
+ define_test("ignoring_main_server_and_control_threads_using_#{code}") do
+ write_program(send(code))
+
+ remote_debug("thread list", "cont")
+
+ check_output_includes \
+ %r{!.*/byebug/remote/server.rb},
+ %r{!.*/byebug/remote/server.rb}
+ end
end
def test_interrupting_client_doesnt_abort_server_after_a_second_breakpoint | Test server & control threads are ignored | deivid-rodriguez_byebug | train | rb |
5df35657e71fb17f9ceadbec2bf08afd17be4331 | diff --git a/lib/ical/time.js b/lib/ical/time.js
index <HASH>..<HASH> 100644
--- a/lib/ical/time.js
+++ b/lib/ical/time.js
@@ -863,6 +863,9 @@
*/
fromUnixTime: function fromUnixTime(seconds) {
this.zone = ICAL.Timezone.utcTimezone;
+ // We could use `fromJSDate` here, but this is about twice as fast.
+ // We could also clone `epochTime` and use `adjust` for a more
+ // ical.js-centric approach, but this is about 100 times as fast.
var date = new Date(seconds * 1000);
this.year = date.getUTCFullYear();
this.month = date.getUTCMonth() + 1; | Add a comment in fromUnixTime (#<I>) | mozilla-comm_ical.js | train | js |
0902cc35f41966e1491cd7e7d86aa6b6f36d322e | diff --git a/sprd/manager/SprdSvgMeasurer.js b/sprd/manager/SprdSvgMeasurer.js
index <HASH>..<HASH> 100644
--- a/sprd/manager/SprdSvgMeasurer.js
+++ b/sprd/manager/SprdSvgMeasurer.js
@@ -38,11 +38,15 @@ define(["text/composer/SvgMeasurer", "xaml!text/ui/SvgTextArea"], function (SvgM
var textEl = this.svgTextArea.$.text.$el;
var bbox = textEl.getBBox();
+ // Chrome returns 0 for y, which is correct
+ // Safari returns some value for y
+ // when adding this value to the height, the height is correct in safari
+ // same for FF
return {
x: bbox.x,
- y: Math.max(bbox.y, 0),
+ y: 0,
width: bbox.width,
- height: bbox.height - (bbox.y < 0 ? bbox.y : 0)
+ height: bbox.height + (bbox.y)
};
} | DEV-<I> - fixed measurement of composed textflow for safari and ff | spreadshirt_rAppid.js-sprd | train | js |
5f20c404416f3e77ce557d3630c194610cd3242a | diff --git a/core/serial.js b/core/serial.js
index <HASH>..<HASH> 100644
--- a/core/serial.js
+++ b/core/serial.js
@@ -84,8 +84,12 @@
}
if (!(serialPort in portToDevice)) {
- console.error("Port "+JSON.stringify(serialPort)+" not found");
- return connectCallback(undefined);
+ if (serialPort.toLowerCase() in portToDevice) {
+ serialPort = serialPort.toLowerCase();
+ } else {
+ console.error("Port "+JSON.stringify(serialPort)+" not found");
+ return connectCallback(undefined);
+ }
}
connectionInfo = undefined;
currentDevice = portToDevice[serialPort]; | Check to see if serial port name is using the wrong case - fix #<I> | espruino_EspruinoTools | train | js |
d1d0f99617b1394c860864852326be673f9b935f | diff --git a/nopassword/__init__.py b/nopassword/__init__.py
index <HASH>..<HASH> 100644
--- a/nopassword/__init__.py
+++ b/nopassword/__init__.py
@@ -1 +1 @@
-__version__ = '4.0.1'
+__version__ = '5.0.0' | <I>
Automatically generated by python-semantic-release | relekang_django-nopassword | train | py |
18f2c03c81ec8798af2cc55d6172988f5edd2ec8 | diff --git a/python/lib/uploader.py b/python/lib/uploader.py
index <HASH>..<HASH> 100644
--- a/python/lib/uploader.py
+++ b/python/lib/uploader.py
@@ -5,8 +5,7 @@ import os
import string
import threading
import sys
-import urllib2, urllib
-from httplib import BadStatusLine
+import urllib2, urllib, httplib
import socket
import mimetypes
import random
@@ -271,12 +270,12 @@ def upload_file(filepath, url, permission, signature, key=None, move_files=True,
except urllib2.URLError as e:
print("URL error: {0} on {1}".format(e, filename))
time.sleep(5)
+ except httplib.HTTPException as e:
+ print("HTTP exception: {0} on {1}".format(e, filename))
+ time.sleep(5)
except OSError as e:
print("OS error: {0} on {1}".format(e, filename))
time.sleep(5)
- except BadStatusLine as e:
- print "BadStatusLine, could not fetch url"
- time.sleep(5)
except socket.timeout as e:
# Specific timeout handling for Python 2.7
print("Timeout error: {0} (retrying)".format(filename)) | Merge pull request #<I> from Aly0sha/patch-1 | mapillary_mapillary_tools | train | py |
6e4f17176feb2b688ac0be2beb17c8dd3c59e17c | diff --git a/src/Http/Controllers/VoyagerController.php b/src/Http/Controllers/VoyagerController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/VoyagerController.php
+++ b/src/Http/Controllers/VoyagerController.php
@@ -51,8 +51,11 @@ class VoyagerController extends Controller
->resize($resizeWidth, $resizeHeight, function (Constraint $constraint) {
$constraint->aspectRatio();
$constraint->upsize();
- })
- ->encode($file->getClientOriginalExtension(), 75);
+ });
+ if ($ext !== 'gif') {
+ $image->orientate();
+ }
+ $image->encode($file->getClientOriginalExtension(), 75);
// move uploaded file from temp to uploads directory
if (Storage::disk(config('voyager.storage.disk'))->put($fullPath, (string) $image, 'public')) { | Fix images not orrientated when uploaded through VoyagerController@upload (#<I>) | the-control-group_voyager | train | php |
dfbacbbdc7ddb19adef466a892dd9378f804d1f4 | diff --git a/packages/table/src/TableWithSticky.js b/packages/table/src/TableWithSticky.js
index <HASH>..<HASH> 100644
--- a/packages/table/src/TableWithSticky.js
+++ b/packages/table/src/TableWithSticky.js
@@ -323,7 +323,7 @@ const TableWithSticky = ({
selected={getActiveColumnIndex === headerIndex && getActiveRowIndex === -1}
setActiveMultiSelectColumn={setActiveMultiSelectColumn}
>
- <div css={styles.headerHolder}>
+ <div className={css(styles.headerHolder)}>
{column.canGroupBy && meta.groupElements ? (
<span {...column.getGroupByToggleProps()}>
{<GroupHeaderElements isGrouped={column.isGrouped} groupHeaderElementStyles={styles.groupHeaderElement}/>} | refactor: use the proper emotion prop | Autodesk_hig | train | js |
4acbd9ee1d3449017d21c4b4a25a1db97c2c067e | diff --git a/lib/rom/repository/root.rb b/lib/rom/repository/root.rb
index <HASH>..<HASH> 100644
--- a/lib/rom/repository/root.rb
+++ b/lib/rom/repository/root.rb
@@ -46,7 +46,7 @@ module ROM
# @see Repository#initialize
def initialize(container)
super
- @root = __send__(self.class.root)
+ @root = relations[self.class.root]
end
# Compose a relation aggregate from the root relation
@@ -102,7 +102,7 @@ module ROM
if args.first.is_a?(Symbol) && relations.key?(args.first)
super
else
- super(self.class.root, *args)
+ super(root.name, *args)
end
end
end | Minor clean up in Repository::Root | rom-rb_rom | train | rb |
2341bbbb37d0a1ce552fc49a739ef780699812df | diff --git a/lib/tty/table.rb b/lib/tty/table.rb
index <HASH>..<HASH> 100644
--- a/lib/tty/table.rb
+++ b/lib/tty/table.rb
@@ -298,8 +298,7 @@ module TTY
if row == Border::SEPARATOR
separators << columns_size - (header ? 0 : 2)
else
- rows_copy = rows.dup
- assert_row_sizes rows_copy << row
+ assert_row_size(row, rows)
rows << to_row(row)
end
self | Use assert_row_size method in TTY::Table#<< | piotrmurach_tty-table | train | rb |
d61710d303b05d61be5fe2f449caa0b6d4f5ffba | diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -7,12 +7,6 @@ require "kudzu"
module Dummy
class Application < Rails::Application
- # Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 5.1
-
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
end
end | Remove unnecessary setting from dummy app | kanety_kudzu | train | rb |
8ddee5ca896dc3b49ebcdcadff4a2d704fba4858 | diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/Tests/bootstrap.php
+++ b/Tests/bootstrap.php
@@ -11,7 +11,20 @@ $loader->registerNamespaces(array(
'Symfony' => array(
__DIR__.'/'.$_SERVER['SYMFONY'],
__DIR__.'/'.$_SERVER['SYMFONY'].'/../tests'
- ),
- 'Ivory' => __DIR__.'/../../..'
+ )
));
$loader->register();
+
+spl_autoload_register(function($class)
+{
+ if(strpos($class, 'Ivory\\CKEditorBundle\\') === 0)
+ {
+ $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
+
+ if(!stream_resolve_include_path($path))
+ return false;
+
+ require_once $path;
+ return true;
+ }
+}); | Update boostrap to allow running the test suite outside a dummy project | egeloen_IvoryCKEditorBundle | train | php |
8efe666e835b5b9674007d485bee63ba0ae6bfda | diff --git a/insights/core/evaluators.py b/insights/core/evaluators.py
index <HASH>..<HASH> 100644
--- a/insights/core/evaluators.py
+++ b/insights/core/evaluators.py
@@ -32,8 +32,8 @@ class Evaluator(object):
if plugins.is_rule(p):
self.handle_result(p, r)
- def run_components(self):
- dr.run(dr.COMPONENTS[dr.GROUPS.single], broker=self.broker)
+ def run_components(self, graph=None):
+ dr.run(graph or dr.COMPONENTS[dr.GROUPS.single], broker=self.broker)
def format_response(self, response):
"""
@@ -48,9 +48,9 @@ class Evaluator(object):
"""
return result
- def process(self):
+ def process(self, graph=None):
self.pre_process()
- self.run_components()
+ self.run_components(graph)
self.post_process()
return self.get_response() | adding a way to specify an execution graph in process | RedHatInsights_insights-core | train | py |
d5f54192491aac2e0a22857793704fc48576a6b2 | diff --git a/sources/scalac/symtab/classfile/AttributeParser.java b/sources/scalac/symtab/classfile/AttributeParser.java
index <HASH>..<HASH> 100644
--- a/sources/scalac/symtab/classfile/AttributeParser.java
+++ b/sources/scalac/symtab/classfile/AttributeParser.java
@@ -327,9 +327,9 @@ public class AttributeParser implements ClassfileConstants {
nextToken();
Type[] args = new Type[types.size()];
types.toArray(args);
- return Type.TypeRef(clazz.owner().thisType(), clazz, args);
+ return Type.TypeRef(clazz.owner().thisType(), clazz, args).unalias();
} else {
- return clazz.typeConstructor();
+ return clazz.typeConstructor().unalias();
}
} | - Changed method parseType to unalias the type ...
- Changed method parseType to unalias the type it returns (needed for
example to get rid of scala.AnyRef types). | scala_scala | train | java |
5fe20dd48018a21a59e8885d9f8be74d6dced453 | diff --git a/lib/bq-translator.js b/lib/bq-translator.js
index <HASH>..<HASH> 100644
--- a/lib/bq-translator.js
+++ b/lib/bq-translator.js
@@ -100,8 +100,8 @@ BooleanQueryTranslator.prototype = {
} else if (character == ")") {
this.throwTranslateError("operator is missing");
} else {
- // TODO: invalid operator
- return "";
+ this.throwTranslateError("invalid operator character: " +
+ "<" + character + ">");
}
}
diff --git a/test/bq-translator.test.js b/test/bq-translator.test.js
index <HASH>..<HASH> 100644
--- a/test/bq-translator.test.js
+++ b/test/bq-translator.test.js
@@ -138,6 +138,10 @@ suite('BoolanQueryTranslator', function() {
"()",
"(|)|",
"operator is missing");
+ testGroupError("invalid operator character",
+ "(operat0r f1:'k1' f2:'k2')",
+ "(operat|0|r f1:'k1' f2:'k2')",
+ "invalid operator character: <0>");
testExpression("value only: stirng: and: space",
"'keyword1 keyword2' 'other keyword'", | bq: throw exception for invalid operator chracter | groonga_gcs | train | js,js |
5f649c035241dcabadf6c5433865e3313649d646 | diff --git a/android/src/forplay/android/AndroidGraphics.java b/android/src/forplay/android/AndroidGraphics.java
index <HASH>..<HASH> 100644
--- a/android/src/forplay/android/AndroidGraphics.java
+++ b/android/src/forplay/android/AndroidGraphics.java
@@ -79,7 +79,7 @@ class AndroidGraphics implements Graphics {
@Override
public int screenWidth() {
// TODO(jgw):
- return 320;//activity.gameView().getWidth();
+ return 800;//activity.gameView().getWidth();
}
@Override | Another temporary hack to hardcode <I>x<I> landscape. | threerings_playn | train | java |
40ca65807639e0470dab22585847a7582687167f | diff --git a/lib/tokenizer/tokenize.js b/lib/tokenizer/tokenize.js
index <HASH>..<HASH> 100644
--- a/lib/tokenizer/tokenize.js
+++ b/lib/tokenizer/tokenize.js
@@ -373,6 +373,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
position.index++;
buffer = [];
isBufferEmpty = true;
+ isVariable = false;
ruleToken[2] = intoTokens(source, externalContext, internalContext, true);
ruleToken = null; | Fixes #<I> - double hyphen in at-rule breaks parsing (#<I>) | jakubpawlowicz_clean-css | train | js |
d0b755fa7ff8f336cd07f758302d8d89f0e7c05c | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100755
--- a/lib/index.js
+++ b/lib/index.js
@@ -206,11 +206,12 @@ FSWatcher.prototype._isIgnored = function(path, stats) {
// symlink and glob handling
//
// * path - string, file, directory, or glob pattern being watched
+// * depth - int, at any depth > 0, this isn't a glob
//
// Returns object containing helpers for this path
-FSWatcher.prototype._getWatchHelpers = function(path) {
+FSWatcher.prototype._getWatchHelpers = function(path, depth) {
path = path.replace(/^\.[\/\\]/, '');
- var watchPath = globparent(path);
+ var watchPath = depth ? path : globparent(path);
var hasGlob = watchPath !== path;
var globFilter = hasGlob ? anymatch(path) : false;
diff --git a/lib/nodefs-handler.js b/lib/nodefs-handler.js
index <HASH>..<HASH> 100644
--- a/lib/nodefs-handler.js
+++ b/lib/nodefs-handler.js
@@ -418,7 +418,7 @@ function(path, initialAdd, priorWh, depth, target, callback) {
return callback(null, false);
}
- var wh = this._getWatchHelpers(path);
+ var wh = this._getWatchHelpers(path, depth);
if (!wh.hasGlob && priorWh) {
wh.hasGlob = priorWh.hasGlob;
wh.filterPath = priorWh.filterPath; | Recursively detected paths can't be globs
Resolves gh-<I> | paulmillr_chokidar | train | js,js |
3fc92ee371613c23dddb44dae8588d4ac8712a26 | diff --git a/lib/connect/driver.js b/lib/connect/driver.js
index <HASH>..<HASH> 100644
--- a/lib/connect/driver.js
+++ b/lib/connect/driver.js
@@ -98,7 +98,7 @@ util.inherits(Driver, EventEmitter);
*/
Driver.prototype.setInput = function (input) {
if (this.input !== null) {
- this.input.removeListener('event', this.transmitMIDIEvent);
+ this.input.removeListener('event', this._transmitMIDIEvent);
}
if (!input) {
@@ -115,7 +115,7 @@ Driver.prototype.setInput = function (input) {
}
this.input = input;
- this.input.on('event', this.transmitMIDIEvent);
+ this.input.on('event', this._transmitMIDIEvent);
};
/**
@@ -126,7 +126,7 @@ Driver.prototype.setInput = function (input) {
* Event to be transmitted
* @return {void}
*/
-Driver.prototype.transmitMIDIEvent = function (event) {
+Driver.prototype._transmitMIDIEvent = function (event) {
this.emit('event', event);
}; | :bulb: Make transmit event private | matteodelabre_midijs | train | js |
f1be05385b330b5c058702ae27682e446a25ba3f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,16 +3,12 @@ from setuptools import setup, Command, find_packages
import glob
import os.path
import os
-import sys
curdir = os.getcwd()
-sys.path.append(curdir)
-
-import anyconfig
PACKAGE = "anyconfig"
-VERSION = anyconfig.VERSION
+VERSION = "0.0.5" # see anyconfig.globals.VERSION
# For daily snapshot versioning mode:
if os.environ.get("_SNAPSHOT_BUILD", None) is not None: | do not refer anyconfig.VERSION in setup.py, copy that value instead in it | ssato_python-anyconfig | train | py |
5c6e1707dec9550c6b109d22345e13da7c7a96f7 | diff --git a/mkl_fft/tests/test_fft1d.py b/mkl_fft/tests/test_fft1d.py
index <HASH>..<HASH> 100644
--- a/mkl_fft/tests/test_fft1d.py
+++ b/mkl_fft/tests/test_fft1d.py
@@ -55,10 +55,7 @@ class Test_mklfft_vector(TestCase):
rnd.seed(1234567)
self.xd1 = rnd.standard_normal(128)
self.xf1 = self.xd1.astype(np.float32)
- self.xz1 = np.dot(
- rnd.standard_normal((128,2)),
- np.array([1.0 + 0.0j, 0.0 + 1.0j], dtype=np.complex128)
- )
+ self.xz1 = rnd.standard_normal((128,2)).view(dtype=np.complex128)
self.xc1 = self.xz1.astype(np.complex64)
def test_vector1(self):
@@ -69,7 +66,7 @@ class Test_mklfft_vector(TestCase):
f1 = mkl_fft.fft(self.xc1)
f2 = np_fft.fft(self.xc1)
- assert_allclose(f1,f2, rtol=1e-6, atol=2e-6)
+ assert_allclose(f1,f2, rtol=2e-6, atol=2e-6)
def test_vector2(self):
"ifft(fft(x)) is identity" | simplified creation of complex double precision input data set. Relaxed relative tolerance a little bit | IntelPython_mkl_fft | train | py |
fa6f2f03c7f319c108fabc9f3303339bbcca694b | diff --git a/src/Testing/TestResponseMixin.php b/src/Testing/TestResponseMixin.php
index <HASH>..<HASH> 100644
--- a/src/Testing/TestResponseMixin.php
+++ b/src/Testing/TestResponseMixin.php
@@ -38,17 +38,17 @@ class TestResponseMixin
return function (array $keys) {
$validation = TestResponseUtils::extractValidationErrors($this);
- Assert::assertNotNull($validation, TestResponseMixin::EXPECTED_VALIDATION_KEYS);
+ Assert::assertNotNull($validation, self::EXPECTED_VALIDATION_KEYS);
/** @var array<string, mixed> $validation */
Assert::assertArrayHasKey('extensions', $validation);
$extensions = $validation['extensions'];
- Assert::assertNotNull($extensions, TestResponseMixin::EXPECTED_VALIDATION_KEYS);
+ Assert::assertNotNull($extensions, self::EXPECTED_VALIDATION_KEYS);
/** @var array<string, mixed> $extensions */
Assert::assertSame(
$keys,
array_keys($extensions['validation']),
- TestResponseMixin::EXPECTED_VALIDATION_KEYS
+ self::EXPECTED_VALIDATION_KEYS
);
return $this; | Apply fixes from StyleCI (#<I>) | nuwave_lighthouse | train | php |
66c0c88f065774ce00307fdbf480a5184a25d6ed | diff --git a/lib/rspec_command.rb b/lib/rspec_command.rb
index <HASH>..<HASH> 100644
--- a/lib/rspec_command.rb
+++ b/lib/rspec_command.rb
@@ -273,6 +273,7 @@ module RSpecCommand
# its(:stdout) { is_expected.to match(/a thing/) }
# end
def command(cmd=nil, options={}, &block)
+ metadata[:command] = true
subject do |example|
# If a block is given, use it to get the command.
cmd = block.call if block | Set a metadata flag for all command-based tests for easier filtering. | coderanger_rspec-command | train | rb |
724ceb8719c51c83470755c06dd0eab96c607a77 | diff --git a/lib/commands/abstract_command.rb b/lib/commands/abstract_command.rb
index <HASH>..<HASH> 100644
--- a/lib/commands/abstract_command.rb
+++ b/lib/commands/abstract_command.rb
@@ -107,7 +107,7 @@ class Gem::AbstractCommand < Gem::Command
end
request = request_method.new( url.path )
- request.add_field "User-Agent", "Nexus Gem Command"
+ request.add_field "User-Agent", "Ruby" unless RUBY_VERSION =~ /^1.9/
yield request if block_given?
http.request(request)
diff --git a/test/nexus_command_test.rb b/test/nexus_command_test.rb
index <HASH>..<HASH> 100644
--- a/test/nexus_command_test.rb
+++ b/test/nexus_command_test.rb
@@ -49,13 +49,12 @@ class NexusCommandTest < CommandTest
assert_requested(:post, @url,
:times => 1)
assert_requested(:post, @url,
+ :body => @gem_binary,
:headers => {
'Authorization' => 'key',
'Content-Type' => 'application/octet-stream',
- 'User-Agent'=>'Nexus Gem Command'
+ 'User-Agent'=>'Ruby'
})
- #assert_requested(:post, @url,
- # :headers => {'Content-Length' => @gem_binary.size.to_s})
end
end
end | use same user agent for ruby <I> and <I> | sonatype_nexus-gem | train | rb,rb |
bf3b86d166ab9bbcf48335b2324a21aff50de0c3 | diff --git a/Bundle/CoreBundle/EventSubscriber/WidgetSubscriber.php b/Bundle/CoreBundle/EventSubscriber/WidgetSubscriber.php
index <HASH>..<HASH> 100644
--- a/Bundle/CoreBundle/EventSubscriber/WidgetSubscriber.php
+++ b/Bundle/CoreBundle/EventSubscriber/WidgetSubscriber.php
@@ -76,8 +76,10 @@ class WidgetSubscriber implements EventSubscriber
$widgetMap = $entity->getWidgetMap();
if ($widgetMap->getAction() !== WidgetMap::ACTION_DELETE) {
$view = $widgetMap->getView();
- $this->updateViewCss($view);
- $this->setTemplateInheritorsCssToUpdate($view);
+ if ($this->em->contains($view)) {
+ $this->updateViewCss($view);
+ $this->setTemplateInheritorsCssToUpdate($view);
+ }
}
} | check if EntityManager is aware of the view before regereate the css. If not, the view will be deleted anyway | Victoire_victoire | train | php |
076834c465ec1def812be9f6583dbb038d1e99c2 | diff --git a/spec/watirspec/filefield_spec.rb b/spec/watirspec/filefield_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/watirspec/filefield_spec.rb
+++ b/spec/watirspec/filefield_spec.rb
@@ -160,7 +160,7 @@ describe "FileField" do
expected = path
expected.gsub!("/", "\\") if WatirSpec.platform == :windows
- expect(browser.file_field.value).to eq expected
+ expect(browser.file_field.value).to include(File.basename(expected)) # only some browser will return the full path
end
it "does not alter its argument" do | Tolerate relative path for file_field.value (as other specs already do) | watir_watir | train | rb |
d09949754143209bd8dc0f1212139c9d0ae5baf5 | diff --git a/wayback-core/src/main/java/org/archive/wayback/resourceindex/cdxserver/EmbeddedCDXServerIndex.java b/wayback-core/src/main/java/org/archive/wayback/resourceindex/cdxserver/EmbeddedCDXServerIndex.java
index <HASH>..<HASH> 100644
--- a/wayback-core/src/main/java/org/archive/wayback/resourceindex/cdxserver/EmbeddedCDXServerIndex.java
+++ b/wayback-core/src/main/java/org/archive/wayback/resourceindex/cdxserver/EmbeddedCDXServerIndex.java
@@ -308,6 +308,10 @@ public class EmbeddedCDXServerIndex extends AbstractRequestHandler implements Me
if (wbRequest.isTimestampSearchKey()) {
query.setClosest(wbRequest.getReplayTimestamp());
}
+
+ // set explicit matchType, or CDXServer will run prefix
+ // query when URL ends with "*".
+ query.setMatchType(MatchType.exact);
} else if (wbRequest.isCaptureQueryRequest()) {
// Add support for range calendar queries:
// eg: /2005-2007*/ | EmbeddedCDXServerIndex: pass matchType=exact explicitly
to prevent CDXServer from interpreting URL with trailing
asterisk as prefix query. | iipc_openwayback | train | java |
eac65b5c5485e6b079bee1ad1461559d9c95c226 | diff --git a/lib/observable/index.js b/lib/observable/index.js
index <HASH>..<HASH> 100644
--- a/lib/observable/index.js
+++ b/lib/observable/index.js
@@ -28,7 +28,7 @@ observable.define({
if(this.$on) {
this.$on.$newParent( this )
}
- this.$emit( '$new', event )
+ this.$emit( '$new', event, this.__proto__ )
})
},
$setValueInternal: function( val, event ) { | $new emits the current __proto__ | vigour-io_vjs | train | js |
9f04c7189fa75e78ec8f21d4719956cb583d8b38 | diff --git a/src/js/orb.ui.header.js b/src/js/orb.ui.header.js
index <HASH>..<HASH> 100644
--- a/src/js/orb.ui.header.js
+++ b/src/js/orb.ui.header.js
@@ -216,7 +216,7 @@ orb.ui.dataCell = function(pgrid, isvisible, rowinfo, colinfo) {
axetype: null,
type: orb.ui.HeaderType.DATA_VALUE,
template: 'cell-template-datavalue',
- value: pgrid.getData(datafield.name, rowdim, coldim),
+ value: pgrid.getData(datafield ? datafield.name : null, rowdim, coldim),
cssclass: 'cell ' + orb.ui.HeaderType.getCellClass(rowtype, coltype),
isvisible: isvisible
}
@@ -251,4 +251,4 @@ orb.ui.emptyCell = function(hspan, vspan) {
);
};
-}());
\ No newline at end of file
+}()); | Fix data cell value when no datafields is empty. | nnajm_orb | train | js |
68dbb04563faa7552867e2fc37c333138d4bf74d | diff --git a/kernel/classes/datatypes/ezuser/ezldapuser.php b/kernel/classes/datatypes/ezuser/ezldapuser.php
index <HASH>..<HASH> 100644
--- a/kernel/classes/datatypes/ezuser/ezldapuser.php
+++ b/kernel/classes/datatypes/ezuser/ezldapuser.php
@@ -181,7 +181,7 @@ class eZLDAPUser extends eZUser
if ( $LDAPIni->hasVariable( 'LDAPSettings', 'Utf8Encoding' ) )
{
$Utf8Encoding = $LDAPIni->variable( 'LDAPSettings', 'Utf8Encoding' );
- if ( $isUtf8Encoding == "true" )
+ if ( $Utf8Encoding == "true" )
$isUtf8Encoding = true;
else
$isUtf8Encoding = false; | - Fixed typo (related to: <URL>)
#- This does not fix the main bug in the report
git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I> | ezsystems_ezpublish-legacy | train | php |
7152ece70a6f1935e91f1a8fde9478a6fe940fd5 | diff --git a/src/client.js b/src/client.js
index <HASH>..<HASH> 100644
--- a/src/client.js
+++ b/src/client.js
@@ -2459,6 +2459,7 @@ MatrixClient.prototype._sendCompleteEvent = function(roomId, eventObject, txnId,
const localEvent = new MatrixEvent(Object.assign(eventObject, {
event_id: "~" + roomId + ":" + txnId,
user_id: this.credentials.userId,
+ sender: this.credentials.userId,
room_id: roomId,
origin_server_ts: new Date().getTime(),
})); | Fix sender of local echo events in unsigned redactions | matrix-org_matrix-js-sdk | train | js |
5f7a3f2b69ea355cf862b40377fae6bc3d6265a8 | diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/collection.rb
+++ b/lib/jekyll/collection.rb
@@ -52,7 +52,7 @@ module Jekyll
def filtered_entries
return Array.new unless exists?
Dir.chdir(directory) do
- entry_filter.filter(entries)
+ entry_filter.filter(entries).reject { |f| File.directory?(f) }
end
end | Filter out directories from entries in the collection | jekyll_jekyll | train | rb |
619ded93adc01a870b8ee29722ff5e426c6fb8d7 | diff --git a/lib/utils/lang.js b/lib/utils/lang.js
index <HASH>..<HASH> 100644
--- a/lib/utils/lang.js
+++ b/lib/utils/lang.js
@@ -5,6 +5,8 @@ var MAP = {
};
function normalize(lang) {
+ if(!lang) { return null; }
+
var lower = lang.toLowerCase();
return MAP[lower] || lower;
} | Improve language normalization
Check for null before converting to lower case | GitbookIO_gitbook | train | js |
49862db1e9140240280a5645110dc6df8ab5d7c5 | diff --git a/src/shared/js/Component.js b/src/shared/js/Component.js
index <HASH>..<HASH> 100644
--- a/src/shared/js/Component.js
+++ b/src/shared/js/Component.js
@@ -90,6 +90,13 @@
} else if (options !== undefined && typeof options === 'object') {
this._options = ch.util.extend(defaults, options);
}
+ // selector is HTMLElement
+ } else if (selector.nodeType !== undefined & selector.nodeType === document.ELEMENT_NODE) {
+
+ this._el = selector;
+
+ // we extend defaults with options parameter
+ this._options = ch.util.extend(defaults, options);
// selector is an object configuration
} else if (typeof selector === 'object' || selector === undefined) { | #<I> components are able to use a DOM Object to instanciate | mercadolibre_chico | train | js |
508fe4d8b5ca69db6e55b70cde5a861660933137 | diff --git a/mod/lesson/format.php b/mod/lesson/format.php
index <HASH>..<HASH> 100644
--- a/mod/lesson/format.php
+++ b/mod/lesson/format.php
@@ -223,7 +223,21 @@ class qformat_default {
// Somewhere to specify question parameters that are not handled
// by import but are required db fields.
// This should not be overridden.
+ global $CFG;
+
$question = new stdClass();
+ $question->shuffleanswers = $CFG->quiz_shuffleanswers;
+ $question->defaultgrade = 1;
+ $question->image = "";
+ $question->usecase = 0;
+ $question->multiplier = array();
+ $question->generalfeedback = '';
+ $question->correctfeedback = '';
+ $question->partiallycorrectfeedback = '';
+ $question->incorrectfeedback = '';
+ $question->answernumbering = 'abc';
+ $question->penalty = 0.1;
+ $question->length = 1;
$question->qoption = 0;
$question->layout = 1; | MDL-<I>
defaultquestion() now reflects the one in the question bank code, thus supressing
lots of notices
Merged from STABLE_<I> | moodle_moodle | train | php |
ca89d61c053bad0eb4abb7151de115d26bccf1e9 | diff --git a/benchexec/tools/verifuzz.py b/benchexec/tools/verifuzz.py
index <HASH>..<HASH> 100644
--- a/benchexec/tools/verifuzz.py
+++ b/benchexec/tools/verifuzz.py
@@ -28,7 +28,7 @@ class Tool(benchexec.tools.template.BaseTool):
VeriFuzz
"""
- REQUIRED_PATHS = ["lib", "exp-in", "afl-2.35b", "scripts", "supportFiles", "prism", "bin", "jars"]
+ REQUIRED_PATHS = ["lib", "exp-in", "fuzzEngine", "scripts", "supportFiles", "prism", "bin", "jars"]
def executable(self):
return util.find_executable('scripts/verifuzz.py') | Updated tools .py file for Verifuzz | sosy-lab_benchexec | train | py |
3ba9d1b83224b5133d0c4db23c5cca14c646c4f4 | diff --git a/eth/vm/memory.py b/eth/vm/memory.py
index <HASH>..<HASH> 100644
--- a/eth/vm/memory.py
+++ b/eth/vm/memory.py
@@ -48,12 +48,6 @@ class Memory(object):
validate_length(value, length=size)
validate_lte(start_position + size, maximum=len(self))
- if len(self._bytes) < start_position + size:
- self._bytes.extend(itertools.repeat(
- 0,
- len(self._bytes) - (start_position + size),
- ))
-
for idx, v in enumerate(value):
self._bytes[start_position + idx] = v | Remove Unnecessary Lazy Extension Code (#<I>) | ethereum_py-evm | train | py |
594f2e08195221dfcd8fb84e5570ac90388a642c | diff --git a/lib/ohai/plugins/aix/filesystem.rb b/lib/ohai/plugins/aix/filesystem.rb
index <HASH>..<HASH> 100644
--- a/lib/ohai/plugins/aix/filesystem.rb
+++ b/lib/ohai/plugins/aix/filesystem.rb
@@ -55,7 +55,6 @@ Ohai.plugin(:Filesystem) do
fs[filesystem] = Mash.new unless fs.has_key?(filesystem)
fs[filesystem][:mount] = fields[1]
fs[filesystem][:fs_type] = fields[2]
- #fs[filesystem][:mount_options] = fields[6]
fs[filesystem][:mount_options] = fields[6]
else
fields = line.split | Remove the unneeded line from aix filesystem plugin. | chef_ohai | train | rb |
a8cd0c13a447ed2fdbad93a9afbf7f4302d386ab | diff --git a/transport/http2_client.go b/transport/http2_client.go
index <HASH>..<HASH> 100644
--- a/transport/http2_client.go
+++ b/transport/http2_client.go
@@ -1166,7 +1166,7 @@ func (t *http2Client) applySettings(ss []http2.Setting) {
t.mu.Lock()
for _, stream := range t.activeStreams {
// Adjust the sending quota for each stream.
- stream.sendQuotaPool.add(int(s.Val - t.streamSendQuota))
+ stream.sendQuotaPool.add(int(s.Val) - int(t.streamSendQuota))
}
t.streamSendQuota = s.Val
t.mu.Unlock()
diff --git a/transport/http2_server.go b/transport/http2_server.go
index <HASH>..<HASH> 100644
--- a/transport/http2_server.go
+++ b/transport/http2_server.go
@@ -875,7 +875,7 @@ func (t *http2Server) applySettings(ss []http2.Setting) {
t.mu.Lock()
defer t.mu.Unlock()
for _, stream := range t.activeStreams {
- stream.sendQuotaPool.add(int(s.Val - t.streamSendQuota))
+ stream.sendQuotaPool.add(int(s.Val) - int(t.streamSendQuota))
}
t.streamSendQuota = s.Val
} | Avoid int<I> overflow when applying initial window size setting | grpc_grpc-go | train | go,go |
fdf79164f2c159e06816a664296868da1294a45a | diff --git a/lang/fr/auth.php b/lang/fr/auth.php
index <HASH>..<HASH> 100644
--- a/lang/fr/auth.php
+++ b/lang/fr/auth.php
@@ -97,6 +97,7 @@ $string['auth_shibboleth_login'] = 'Connexion Shibboleth';
$string['auth_shibboleth_manual_login'] = 'Connexion manuelle';
$string['auth_shib_convert_data'] = 'API de modification de donn�es';
$string['auth_shib_convert_data_description'] = 'Vous pouvez utiliser cette API pour modifier les donn�es fournies par Shibboleth. Lisez le fichier <a href=\"../auth/shibboleth/README.txt\" target=\"_blank\">README</a> pour d\'autres instructions.';
+$string['auth_shib_convert_data_warning'] = 'Le fichier n\'existe pas ou n\'est pas accessible en lecture par le serveurweb !';
$string['auth_shib_only'] = 'Seulement Shibboleth';
$string['auth_shib_only_description'] = 'Cocher cette option pour imposer l\'authentiication Shibboleth';
$string['auth_shib_username_description'] = 'Nom de la variable d\'environement du serveur web Shibboleth � utiliser comme nom d\'utilisateur Moodle'; | Added a file check for the Shibboleth data manipulation API | moodle_moodle | train | php |
1601e7e1efa81eecc3b112cafb748ac4507159fd | diff --git a/src/lib/reducers/apps.js b/src/lib/reducers/apps.js
index <HASH>..<HASH> 100644
--- a/src/lib/reducers/apps.js
+++ b/src/lib/reducers/apps.js
@@ -52,7 +52,9 @@ export const fetchApps = () => async dispatch => {
try {
await dispatch({ type: FETCH_APPS })
const rawAppList = await stack.get.apps()
- const apps = rawAppList.filter(app => !EXCLUDES.includes(app.attributes.slug))
+ const apps = rawAppList
+ .filter(app => !EXCLUDES.includes(app.attributes.slug))
+ .map(mapApp)
// TODO load only one time icons
await dispatch(setHomeApp(apps))
await dispatch(receiveAppList(apps))
@@ -103,7 +105,7 @@ const reducer = (state = defaultState, action) => {
)
}
case RECEIVE_APP_LIST:
- const appsList = action.apps.map(mapApp).map(app => ({
+ const appsList = action.apps.map(app => ({
...app,
isCurrentApp: isCurrentApp(state, app)
})) | fix: :bug: map app before all processes | cozy_cozy-bar | train | js |
cd46eddbc3ca95d2e4f8e38bb8420a87ca18af9a | diff --git a/simple_history/models.py b/simple_history/models.py
index <HASH>..<HASH> 100644
--- a/simple_history/models.py
+++ b/simple_history/models.py
@@ -174,8 +174,8 @@ class HistoricalRecords(object):
[getattr(self, opts.pk.attname), self.history_id])
def get_instance(self):
- return model(**{field.attname: getattr(self, field.attname)
- for field in fields.values()})
+ return model(**dict([(field.attname, getattr(self, field.attname))
+ for field in fields.values()]))
return {
'history_id': models.AutoField(primary_key=True), | Removed dictionary comprehension for py<I> support (woo!) | treyhunner_django-simple-history | train | py |
8b8ad76c4aa6c7362c9055d211f4e8a53612266b | diff --git a/assets/javascripts/kitten/components/layout/hero-layout/stories.js b/assets/javascripts/kitten/components/layout/hero-layout/stories.js
index <HASH>..<HASH> 100644
--- a/assets/javascripts/kitten/components/layout/hero-layout/stories.js
+++ b/assets/javascripts/kitten/components/layout/hero-layout/stories.js
@@ -16,8 +16,8 @@ import {
TYPOGRAPHY,
Grid,
GridCol,
- HeartWithClickIconNext,
- GiftIconNext,
+ ColorHeartWithClickIconNext,
+ ColorGiftIconNext,
ColorCheckedShieldIconNext,
CrossCircleIconNext,
Separator,
@@ -304,7 +304,7 @@ export const Default = ({
</Text>
</GridCol>
<StyledGridCol col="12" col-s="6" col-l="3">
- <HeartWithClickIconNext
+ <ColorHeartWithClickIconNext
color="var(--color-grey-900)"
secondaryColor="var(--color-primary-500)"
/>
@@ -332,7 +332,7 @@ export const Default = ({
</Paragraph>
</StyledGridCol>
<StyledGridCol col="12" col-s="6" col-l="3">
- <GiftIconNext
+ <ColorGiftIconNext
color="var(--color-grey-900)"
secondaryColor="var(--color-primary-500)"
/> | [HeroLayout] Fix story (#<I>) | KissKissBankBank_kitten | train | js |
34876d66c12dc346a0972a21dc808274fdde9568 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -97,7 +97,7 @@ test('missing "versions" property', function (t) {
}
})
cp.on('close', function (code) {
- t.strictEqual(code, semver.satisfies(process.version, '0.10.x') ? 8 : 1)
+ t.strictEqual(code, 1)
t.ok(found)
process.chdir('../..')
t.end() | test: clean up tests from old node versions | watson_test-all-versions | train | js |
e302f98c43c95ff972e57c96c90d5e96042b397a | diff --git a/lib/ViewModels/DataCatalogTabViewModel.js b/lib/ViewModels/DataCatalogTabViewModel.js
index <HASH>..<HASH> 100644
--- a/lib/ViewModels/DataCatalogTabViewModel.js
+++ b/lib/ViewModels/DataCatalogTabViewModel.js
@@ -17,7 +17,7 @@ var svgInfo = require('../SvgPaths/svgInfo');
var DataCatalogTabViewModel = function(options) {
ExplorerTabViewModel.call(this);
- this.name = 'Data Catalogue';
+ this.name = defaultValue(options.name, 'Data Catalogue');
this.catalog = options.catalog;
this.svgCheckboxChecked = defaultValue(options.svgCheckboxChecked, svgCheckboxChecked); | Allow alternative name to "Data Catalogue" to be passed as option. (For NEII) | TerriaJS_terriajs | train | js |
4b2a5a89a3c0a7456f4eb8182d06f9a45cc20a12 | diff --git a/drools-compiler/src/main/java/org/drools/compiler/xml/processes/AbstractNodeHandler.java b/drools-compiler/src/main/java/org/drools/compiler/xml/processes/AbstractNodeHandler.java
index <HASH>..<HASH> 100644
--- a/drools-compiler/src/main/java/org/drools/compiler/xml/processes/AbstractNodeHandler.java
+++ b/drools-compiler/src/main/java/org/drools/compiler/xml/processes/AbstractNodeHandler.java
@@ -154,7 +154,7 @@ public abstract class AbstractNodeHandler extends BaseAbstractHandler implements
protected void writeNode(final String name, final Node node, final StringBuilder xmlDump, final boolean includeMeta) {
xmlDump.append(" <" + name + " id=\"" + node.getId() + "\" ");
if (node.getName() != null) {
- xmlDump.append("name=\"" + node.getName() + "\" ");
+ xmlDump.append("name=\"" + XmlDumper.replaceIllegalChars(node.getName()) + "\" ");
}
if (includeMeta) {
Integer x = (Integer) node.getMetaData("x"); | JBRULES-<I>: Conversion issues when using comparaison in name of a ruletask.
- made sure node names are escaped
git-svn-id: <URL> | kiegroup_drools | train | java |
d75556443eec151129ad0029e87d232e22848a31 | diff --git a/src/pluggable.js b/src/pluggable.js
index <HASH>..<HASH> 100644
--- a/src/pluggable.js
+++ b/src/pluggable.js
@@ -1,3 +1,9 @@
+const RESERVED_PLUGINS = {
+ 'compact': true,
+ 'minimal': true,
+ 'serialize': true,
+}
+
export class Pluggable {
static get POST_EXTRACT() { return 'postExtract' };
static get POST_VALUE() { return 'postValue' };
@@ -14,13 +20,23 @@ export class Pluggable {
this._stagePlugins = {};
}
+ requirePlugin(plugin) {
+ if(typeof plugin === 'string') {
+ if(RESERVED_PLUGINS[plugin]) {
+ return require(`./plugins/${plugin}`);
+ } else {
+ return require(plugin);
+ }
+ } else {
+ return plugin;
+ }
+ }
+
init() {
this._plugins.forEach(plugin => {
- if(!plugin) {
- throw new Error('undefined plugin provided');
- }
+ const requiredPlugin = this.requirePlugin(plugin);
- const pluginRun = plugin.run;
+ const pluginRun = requiredPlugin.run;
if(typeof pluginRun !== 'function') {
throw new Error('Plugins must provide a run function'); | feat(plugins): allow plugin to be applied by module name | jgranstrom_sass-extract | train | js |
090e8d788ddabd9a43bc6e0334706bc71142871a | diff --git a/src/Transformers/Request.php b/src/Transformers/Request.php
index <HASH>..<HASH> 100644
--- a/src/Transformers/Request.php
+++ b/src/Transformers/Request.php
@@ -4,6 +4,7 @@ namespace SwooleTW\Http\Transformers;
use Illuminate\Http\Request as IlluminateRequest;
use Illuminate\Http\Response as IlluminateResponse;
+use Illuminate\Http\Testing\MimeType;
use Swoole\Http\Request as SwooleRequest;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
@@ -191,7 +192,7 @@ class Request
return false;
}
- $contentType = mime_content_type($fileName);
+ $contentType = MimeType::from($fileName);
$swooleResponse->status(IlluminateResponse::HTTP_OK);
$swooleResponse->header('Content-Type', static::EXTENSION_MIMES[$contentType] ?? $contentType); | using MimeType to detect mimetype of file | swooletw_laravel-swoole | train | php |
Subsets and Splits