diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/locabulary/json_creator.rb b/lib/locabulary/json_creator.rb
index <HASH>..<HASH> 100644
--- a/lib/locabulary/json_creator.rb
+++ b/lib/locabulary/json_creator.rb
@@ -2,6 +2,7 @@ require "google/api_client"
require "google_drive"
require 'highline/import'
require 'locabulary'
+require 'locabulary/item'
require 'json'
module Locabulary
@@ -59,13 +60,8 @@ module Locabulary
end
def convert_to_json(data)
- json_array = []
- data.each do |row|
- data_map = {}
- Item::ATTRIBUTE_NAMES.each do |key|
- data_map[key] = row.fetch(key) { row.fetch(key.to_s, nil) }
- end
- json_array << data_map
+ json_array = data.map do |row|
+ Locabulary::Item.new(row).to_h
end
@json_data = JSON.pretty_generate("predicate_name" => predicate_name, "values" => json_array)
end
|
Removing repetition of initialization knowledge
|
diff --git a/jaraco/mongodb/tests/test_compat.py b/jaraco/mongodb/tests/test_compat.py
index <HASH>..<HASH> 100644
--- a/jaraco/mongodb/tests/test_compat.py
+++ b/jaraco/mongodb/tests/test_compat.py
@@ -44,3 +44,12 @@ def test_save_no_id_extant_docs(database):
assert database.test_coll.count() == 1
compat.save(database.test_coll, doc)
assert database.test_coll.count() == 2
+
+
+def test_save_adds_id(database):
+ """
+ Ensure _id is added to an inserted document.
+ """
+ doc = dict(foo='bar')
+ compat.save(database.test_coll, doc)
+ assert '_id' in doc
|
Add test capturing expectation that document is mutated on an insert.
|
diff --git a/src/main/java/com/conveyal/gtfs/GTFSFeed.java b/src/main/java/com/conveyal/gtfs/GTFSFeed.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/conveyal/gtfs/GTFSFeed.java
+++ b/src/main/java/com/conveyal/gtfs/GTFSFeed.java
@@ -104,7 +104,7 @@ public class GTFSFeed implements Cloneable, Closeable {
new FeedInfo.Loader(this).loadTable(zip);
// maybe we should just point to the feed object itself instead of its ID, and null out its stoptimes map after loading
if (feedId == null) {
- feedId = zip.getName().replaceAll("\\.zip$", "");
+ feedId = new File(zip.getName()).getName().replaceAll("\\.zip$", "");
LOG.info("Feed ID is undefined, pester maintainers to include a feed ID. Using file name {}.", feedId); // TODO log an error, ideally feeds should include a feedID
}
else {
|
fix feed IDs to use file name not file path.
|
diff --git a/src/main/java/com/datumbox/common/dataobjects/Dataframe.java b/src/main/java/com/datumbox/common/dataobjects/Dataframe.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/datumbox/common/dataobjects/Dataframe.java
+++ b/src/main/java/com/datumbox/common/dataobjects/Dataframe.java
@@ -32,7 +32,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.Random;
import java.util.Set;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
@@ -277,7 +276,7 @@ public final class Dataframe implements Serializable, Collection<Record> {
*/
@Override
public boolean contains(Object o) {
- return records.containsValue(o);
+ return records.containsValue((Record)o);
}
/**
@@ -386,7 +385,7 @@ public final class Dataframe implements Serializable, Collection<Record> {
public boolean removeAll(Collection<?> c) {
boolean modified = false;
for(Object o : c) {
- modified |= remove(o);
+ modified |= remove((Record)o);
}
if(modified) {
recalculateMeta();
|
Fixing imports and casts.
|
diff --git a/agouti_dsl.go b/agouti_dsl.go
index <HASH>..<HASH> 100644
--- a/agouti_dsl.go
+++ b/agouti_dsl.go
@@ -6,7 +6,6 @@ import (
"github.com/sclevine/agouti/phantom"
"github.com/sclevine/agouti/webdriver"
"time"
- "fmt"
)
const PHANTOM_HOST = "127.0.0.1"
|
Removed extra fmt package import
|
diff --git a/hamlpy/elements.py b/hamlpy/elements.py
index <HASH>..<HASH> 100644
--- a/hamlpy/elements.py
+++ b/hamlpy/elements.py
@@ -4,13 +4,13 @@ import re
class Element(object):
"""contains the pieces of an element and can populate itself from haml element text"""
- self_closing_tags = ('meta', 'img', 'link', 'script', 'br', 'hr')
+ self_closing_tags = ('meta', 'img', 'link', 'br', 'hr')
ELEMENT = '%'
ID = '#'
CLASS = '.'
- HAML_REGEX = re.compile(r"(?P<tag>%\w+)?(?P<id>#\w*)?(?P<class>\.[\w\.-]*)*(?P<attributes>\{.*\})?(?P<selfclose>/)?(?P<django>=)?(?P<inline>[^\w\.#\{].*)?")
+ HAML_REGEX = re.compile(r"(?P<tag>%\w+)?(?P<id>#[\w-]*)?(?P<class>\.[\w\.-]*)*(?P<attributes>\{.*\})?(?P<selfclose>/)?(?P<django>=)?(?P<inline>[^\w\.#\{].*)?")
def __init__(self, haml):
self.haml = haml
|
adding hyphens to the CSS selector regex
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -99,6 +99,8 @@ export function serializeComponents (props) {
return;
}
+ if (props[component] === undefined) { return; }
+
if (props[component].constructor === Function) { return; }
var ind = Object.keys(components).indexOf(component.split('__')[0]);
|
Adding a check for if a component has not been set yet
|
diff --git a/src/Leviu/Html/View.php b/src/Leviu/Html/View.php
index <HASH>..<HASH> 100644
--- a/src/Leviu/Html/View.php
+++ b/src/Leviu/Html/View.php
@@ -55,14 +55,14 @@ class View
//standard js file
//$this->js[] = URL . 'js/jquery-2.1.4.min.js';
- $this->js[] = URL . 'js/main.js';
- $this->js[] = URL . 'js/ajax.js';
+ //$this->js[] = URL . 'js/main.js';
+ //$this->js[] = URL . 'js/ajax.js';
//$this->js[] = URL . 'js/application.js';
//standard css file
- $this->css[] = URL . 'css/style.css';
+ //$this->css[] = URL . 'css/style.css';
- $this->title = 'App_Mk0';
+ $this->title = 'App';
}
/**
|
Change standard loaded css and js file
|
diff --git a/Tone/source/Source.js b/Tone/source/Source.js
index <HASH>..<HASH> 100644
--- a/Tone/source/Source.js
+++ b/Tone/source/Source.js
@@ -144,7 +144,7 @@ function(Tone){
*/
Tone.Source.prototype.start = function(time, offset, duration){
if (this.isUndef(time) && this._synced){
- time = Tone.Transport.position;
+ time = Tone.Transport.seconds;
} else {
time = this.toSeconds(time);
}
@@ -178,7 +178,7 @@ function(Tone){
*/
Tone.Source.prototype.stop = function(time){
if (this.isUndef(time) && this._synced){
- time = Tone.Transport.position;
+ time = Tone.Transport.seconds;
} else {
time = this.toSeconds(time);
}
|
using Tone.seconds instead of Tone.position in start/stop
so that it can be fed straight into getStateAtTime
|
diff --git a/classes/Gems/Loader.php b/classes/Gems/Loader.php
index <HASH>..<HASH> 100644
--- a/classes/Gems/Loader.php
+++ b/classes/Gems/Loader.php
@@ -54,6 +54,12 @@ class Gems_Loader extends Gems_Loader_LoaderAbstract
/**
*
+ * @var Gems_Export
+ */
+ protected $export;
+
+ /**
+ *
* @var Gems_Model
*/
protected $models;
@@ -116,6 +122,15 @@ class Gems_Loader extends Gems_Loader_LoaderAbstract
/**
*
+ * @return Gems_Export
+ */
+ public function getExport()
+ {
+ return $this->_getClass('export');
+ }
+
+ /**
+ *
* @return Gems_Model
*/
public function getModels()
|
Fix, forgot to move export from project to gems loader
|
diff --git a/spec/opal/core/time_spec.rb b/spec/opal/core/time_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/opal/core/time_spec.rb
+++ b/spec/opal/core/time_spec.rb
@@ -61,7 +61,7 @@ describe Time do
end
describe '#utc_offset' do
- context 'returns 0 if the date is UTC' do
+ it 'returns 0 if the date is UTC' do
Time.new.utc.utc_offset.should == 0
end
end
|
Avoid should outside of nil in spec/opal
|
diff --git a/fmt/fmtutil/fmtutil.go b/fmt/fmtutil/fmtutil.go
index <HASH>..<HASH> 100644
--- a/fmt/fmtutil/fmtutil.go
+++ b/fmt/fmtutil/fmtutil.go
@@ -5,6 +5,8 @@ import (
"encoding/json"
"expvar"
"fmt"
+
+ "github.com/grokify/gotilla/encoding/jsonutil"
)
var (
@@ -35,6 +37,16 @@ func PrintJSON(in interface{}) error {
return nil
}
+// PrintJSONMore pretty prints anything using supplied indentation.
+func PrintJSONMore(in interface{}, jsonPrefix, jsonIndent string) error {
+ j, err := jsonutil.MarshalSimple(in, jsonPrefix, jsonIndent)
+ if err != nil {
+ return err
+ }
+ fmt.Println(string(j))
+ return nil
+}
+
// PrintJSON pretty prints anything using a default indentation
func PrintJSONMin(in interface{}) error {
if j, err := json.Marshal(in); err != nil {
|
add fmtutil.PrintJSONMore to support compact JSON
|
diff --git a/tests/test_widgets.py b/tests/test_widgets.py
index <HASH>..<HASH> 100644
--- a/tests/test_widgets.py
+++ b/tests/test_widgets.py
@@ -37,8 +37,11 @@ class TestFrame(Frame):
layout = Layout([1, 18, 1])
self.add_layout(layout)
self._reset_button = Button("Reset", self._reset)
- self.label = Label("Group 1:", height=label_height)
- layout.add_widget(self.label, 1)
+
+ # Test that layout.add_widget returns the widget
+ self.label = layout.add_widget(
+ Label("Group 1:", height=label_height), 1)
+
layout.add_widget(TextBox(5,
label="My First Box:",
name="TA",
|
Update unit tests to check the change to add_widget
|
diff --git a/colr/__main__.py b/colr/__main__.py
index <HASH>..<HASH> 100755
--- a/colr/__main__.py
+++ b/colr/__main__.py
@@ -125,11 +125,13 @@ def main(argd):
clr = get_colr(txt, argd)
- # Justify options...
+ # Center, ljust, rjust, or not.
clr = justify(clr, argd)
-
- print(str(clr), file=fd, end=end)
- return 0
+ if clr:
+ print(str(clr), file=fd, end=end)
+ return 0
+ # Error while building Colr.
+ return 1
def get_colr(txt, argd):
|
Woops, clr is None on errors.
|
diff --git a/nodeconductor/structure/serializers.py b/nodeconductor/structure/serializers.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/structure/serializers.py
+++ b/nodeconductor/structure/serializers.py
@@ -486,11 +486,13 @@ class ProjectPermissionSerializer(PermissionFieldFilteringMixin,
core_serializers.AugmentedSerializerMixin,
serializers.HyperlinkedModelSerializer):
+ customer_name = serializers.ReadOnlyField(source='project.customer.name')
+
class Meta(object):
model = models.ProjectPermission
fields = (
'url', 'pk', 'role', 'created', 'expiration_time', 'created_by',
- 'project', 'project_uuid', 'project_name',
+ 'project', 'project_uuid', 'project_name', 'customer_name'
) + STRUCTURE_PERMISSION_USER_FIELDS['fields']
related_paths = {
|
Render customer name in project permission serializer.
|
diff --git a/src/discoursegraphs/discoursegraph.py b/src/discoursegraphs/discoursegraph.py
index <HASH>..<HASH> 100644
--- a/src/discoursegraphs/discoursegraph.py
+++ b/src/discoursegraphs/discoursegraph.py
@@ -941,11 +941,10 @@ def get_span(docgraph, node_id, debug=False):
span : list of str
sorted list of token nodes (token node IDs)
"""
- if debug is True:
- if is_directed_acyclic_graph(docgraph) is False:
- warnings.warn(
- ("Can't reliably extract span '{0}' from cyclical graph'{1}'."
- "Maximum recursion depth may be exceeded.").format(node_id,
+ if debug is True and is_directed_acyclic_graph(docgraph) is False:
+ warnings.warn(
+ ("Can't reliably extract span '{0}' from cyclical graph'{1}'."
+ "Maximum recursion depth may be exceeded.").format(node_id,
docgraph))
span = []
if docgraph.ns+':token' in docgraph.node[node_id]:
|
quantifiedcode: Avoid consecutive if-statements
|
diff --git a/tests/test_api.py b/tests/test_api.py
index <HASH>..<HASH> 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -79,6 +79,7 @@ def test_pull_success(request_mocker, download_url, query_project):
download_url(request_mocker)
with CliRunner().isolated_filesystem():
os.mkdir('.wandb')
+ os.mkdir('wandb')
res = api.pull("test/test")
assert res[0].status_code == 200
@@ -88,6 +89,7 @@ def test_pull_existing_file(request_mocker, mocker, download_url, query_project)
download_url(request_mocker)
with CliRunner().isolated_filesystem():
os.mkdir('.wandb')
+ os.mkdir('wandb')
with open("model.json", "w") as f:
f.write("{}")
mocked = mocker.patch.object(
|
Try to fix circleci tests.
|
diff --git a/core/src/main/java/com/graphhopper/util/ViaInstruction.java b/core/src/main/java/com/graphhopper/util/ViaInstruction.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/graphhopper/util/ViaInstruction.java
+++ b/core/src/main/java/com/graphhopper/util/ViaInstruction.java
@@ -42,6 +42,9 @@ public class ViaInstruction extends Instruction
public int getViaCount()
{
+ if (viaPosition < 0)
+ throw new IllegalStateException("Uninitialized via count in instruction " + getName());
+
return viaPosition;
}
|
throw exception if via count is uninitialized
|
diff --git a/lib/aws4signer.js b/lib/aws4signer.js
index <HASH>..<HASH> 100644
--- a/lib/aws4signer.js
+++ b/lib/aws4signer.js
@@ -60,6 +60,11 @@ const aws4signer = (esRequest, parent) => {
esRequest.region = parent.options.awsRegion
}
+ // refreshes the token if has expired.
+ credentials.get(err => {
+ if (err) throw err
+ })
+
esRequest.headers = Object.assign({ host: urlObj.hostname, 'Content-Type': 'application/json' }, esRequest.headers)
esRequest.path = `${urlObj.pathname}?${urlObj.searchParams.toString()}`
aws4.sign(esRequest, credentials)
|
check if credential has expired
and trigger a refresh
|
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -57,13 +57,15 @@ class UserTest < ActiveSupport::TestCase
end
def test_should_reset_password
- @user.update_attributes(:password => 'new password', :password_confirmation => 'new password')
- assert_equal @user, User.authenticate(@user.login, @user.password)
+ user = User.make(:login => "foo", :password => "barbarbar")
+ user.update_attributes(:password => 'new password', :password_confirmation => 'new password')
+ assert_equal user, User.authenticate(user.login, user.password)
end
def test_should_not_rehash_password
- @user.update_attributes(:login => 'quentin2')
- assert_equal @user, User.authenticate('quentin2', @user.password)
+ user = User.make(:login => "foo", :password => "barbarbar")
+ user.update_attributes(:login => 'quentin2')
+ assert_equal user, User.authenticate('quentin2', user.password)
end
def test_should_authenticate_user
|
fix two more tests like that
(cherry picked from commit <I>f<I>f6d<I>f1abc<I>bed<I>a2a5f7b<I>)
|
diff --git a/chess/__init__.py b/chess/__init__.py
index <HASH>..<HASH> 100644
--- a/chess/__init__.py
+++ b/chess/__init__.py
@@ -1736,7 +1736,7 @@ class Board(BaseBoard):
"""
transposition_key = self._transposition_key()
repetitions = 1
- switchyard = collections.deque()
+ switchyard = []
while self.move_stack and repetitions < 5:
move = self.pop()
@@ -1784,7 +1784,7 @@ class Board(BaseBoard):
transpositions.update((transposition_key, ))
# Count positions.
- switchyard = collections.deque()
+ switchyard = []
while self.move_stack:
move = self.pop()
switchyard.append(move)
|
Use list for stacks (rather than deque)
|
diff --git a/Auth/OpenID/Consumer.php b/Auth/OpenID/Consumer.php
index <HASH>..<HASH> 100644
--- a/Auth/OpenID/Consumer.php
+++ b/Auth/OpenID/Consumer.php
@@ -2089,7 +2089,7 @@ class Auth_OpenID_SuccessResponse extends Auth_OpenID_ConsumerResponse {
foreach ($msg_args as $key => $value) {
if (!$this->isSigned($ns_uri, $key)) {
- return null;
+ unset($msg_args[$key]);
}
}
|
As written in doc, don't erase signed args when some of the args are unsigned
|
diff --git a/src/Scheduler.php b/src/Scheduler.php
index <HASH>..<HASH> 100644
--- a/src/Scheduler.php
+++ b/src/Scheduler.php
@@ -96,7 +96,9 @@ class Scheduler extends ArrayObject
});
if (--$this->minutes > 0) {
$wait = max(60 - (time() - $start), 0);
- sleep($wait);
+ if (!getenv('TOAST')) {
+ sleep($wait);
+ }
$this->now += 60;
$this->process();
}
|
don't actually sleep when in testing mode
|
diff --git a/pharen.php b/pharen.php
index <HASH>..<HASH> 100755
--- a/pharen.php
+++ b/pharen.php
@@ -1252,7 +1252,7 @@ class SpliceWrapper extends UnquoteWrapper{
if(MacroNode::$ghosting){
return "";
}
- return $this->compile_exprs($this->get_exprs(), $prefix);
+ return $this->compile_exprs($this->get_exprs(), $prefix, __FUNCTION__);
}
public function compile_statement($prefix=""){
@@ -1263,7 +1263,7 @@ class SpliceWrapper extends UnquoteWrapper{
if(MacroNode::$ghosting){
return "";
}
- return $this->compile_exprs($this->get_exprs(), "", True);
+ return $this->compile_exprs($this->get_exprs(), "", __FUNCTION__, True);
}
}
|
Make SpliceWrapper use the correct function on the exprs it contains.
Before, it was assumed that splicing would only be done on things that are compiled to statements. Since now splicing is done where expressions are expected, SpliceWrapper must be able to handle this situation by not using compile_statement all the time.
|
diff --git a/shinken/macroresolver.py b/shinken/macroresolver.py
index <HASH>..<HASH> 100644
--- a/shinken/macroresolver.py
+++ b/shinken/macroresolver.py
@@ -156,24 +156,6 @@ class MacroResolver(Borg):
env['NAGIOS__' + o.__class__.__name__.upper() + cmacro[1:].upper()] = o.customs[cmacro]
return env
- clss = [d.__class__ for d in data]
- for o in data:
- for cls in clss:
- if o.__class__ == cls:
- macros = cls.macros
- for macro in macros:
-# print "Macro in %s : %s" % (o.__class__, macro)
- prop = macros[macro]
- value = self.get_value_from_element(o, prop)
-# print "Value: %s" % value
- env['NAGIOS_'+macro] = value
- if hasattr(o, 'customs'):
- # make NAGIOS__HOSTMACADDR from _MACADDR
- for cmacro in o.customs:
- env['NAGIOS__' + o.__class__.__name__.upper() + cmacro[1:].upper()] = o.customs[cmacro]
-
- return env
-
# This function will look at elements in data (and args if it filled)
# to replace the macros in c_line with real value.
|
*forgot to remove leftover code before the ast commit.
|
diff --git a/go/teams/chain_parse.go b/go/teams/chain_parse.go
index <HASH>..<HASH> 100644
--- a/go/teams/chain_parse.go
+++ b/go/teams/chain_parse.go
@@ -38,8 +38,9 @@ type SCTeamMembers struct {
}
type SCTeamParent struct {
- ID SCTeamID `json:"id"`
- Seqno keybase1.Seqno `json:"seqno"`
+ ID SCTeamID `json:"id"`
+ Seqno keybase1.Seqno `json:"seqno"`
+ SeqType keybase1.SeqType `json:"seq_type"`
}
type SCSubteam struct {
diff --git a/go/teams/create.go b/go/teams/create.go
index <HASH>..<HASH> 100644
--- a/go/teams/create.go
+++ b/go/teams/create.go
@@ -392,8 +392,9 @@ func makeSubteamTeamSection(subteamName keybase1.TeamName, subteamID keybase1.Te
Name: (*SCTeamName)(&subteamName2),
ID: (SCTeamID)(subteamID),
Parent: &SCTeamParent{
- ID: SCTeamID(parentTeam.GetID()),
- Seqno: parentTeam.GetLatestSeqno() + 1, // the seqno of the *new* parent link
+ ID: SCTeamID(parentTeam.GetID()),
+ Seqno: parentTeam.GetLatestSeqno() + 1, // the seqno of the *new* parent link
+ SeqType: keybase1.SeqType_SEMIPRIVATE,
},
PerTeamKey: &SCPerTeamKey{
Generation: 1,
|
sending seqtype from client (#<I>)
|
diff --git a/go/teams/loader2.go b/go/teams/loader2.go
index <HASH>..<HASH> 100644
--- a/go/teams/loader2.go
+++ b/go/teams/loader2.go
@@ -270,11 +270,16 @@ func (l *TeamLoader) verifyLink(ctx context.Context,
return &signer, proofSet, nil
}
- if link.outerLink.LinkType.RequiresAdminPermission() {
- // Reassign signer, might set implicitAdmin
- proofSet, signer, err = l.verifyAdminPermissions(ctx, state, me, link, readSubteamID, user.ToUserVersion(), proofSet)
- } else {
+ var isReaderOrAbove bool
+ if !link.outerLink.LinkType.RequiresAdminPermission() {
err = l.verifyWriterOrReaderPermissions(ctx, state, link, user.ToUserVersion())
+ isReaderOrAbove = (err == nil)
+ }
+ if link.outerLink.LinkType.RequiresAdminPermission() || !isReaderOrAbove {
+ // Check for admin permissions if they are not an on-chain reader/writer
+ // because they might be an implicit admin.
+ // Reassigns signer, might set implicitAdmin.
+ proofSet, signer, err = l.verifyAdminPermissions(ctx, state, me, link, readSubteamID, user.ToUserVersion(), proofSet)
}
return &signer, proofSet, err
}
|
check for implicit admins when need reader power
|
diff --git a/lib/joint/FrictionJoint.js b/lib/joint/FrictionJoint.js
index <HASH>..<HASH> 100644
--- a/lib/joint/FrictionJoint.js
+++ b/lib/joint/FrictionJoint.js
@@ -39,6 +39,7 @@ var Velocity = require('../common/Velocity');
var Position = require('../common/Position');
var Joint = require('../Joint');
+var Body = require('../Body');
FrictionJoint.TYPE = 'friction-joint';
@@ -117,6 +118,28 @@ function FrictionJoint(def, bodyA, bodyB, anchor) {
// K = invI1 + invI2
}
+FrictionJoint.prototype._serialize = function() {
+ return {
+ type: this.m_type,
+ bodyA: this.m_bodyA,
+ bodyB: this.m_bodyB,
+ collideConnected: this.m_collideConnected,
+
+ maxForce: this.m_maxForce,
+ maxTorque: this.m_maxTorque,
+
+ localAnchorA: this.m_localAnchorA,
+ localAnchorB: this.m_localAnchorB,
+ };
+};
+
+FrictionJoint._deserialize = function(data, world, restore) {
+ data.bodyA = restore(Body, data.bodyA, world);
+ data.bodyB = restore(Body, data.bodyB, world);
+ var joint = new FrictionJoint(data);
+ return joint;
+};
+
/**
* The local anchor point relative to bodyA's origin.
*/
|
FrictionJoint serializer
|
diff --git a/upup/pkg/fi/cloudup/apply_cluster.go b/upup/pkg/fi/cloudup/apply_cluster.go
index <HASH>..<HASH> 100644
--- a/upup/pkg/fi/cloudup/apply_cluster.go
+++ b/upup/pkg/fi/cloudup/apply_cluster.go
@@ -1424,7 +1424,8 @@ func (n *nodeUpConfigBuilder) buildWarmPoolImages(ig *kops.InstanceGroup) []stri
// Add component and addon images that impact startup time
// TODO: Exclude images that only run on control-plane nodes in a generic way
desiredImagePrefixes := []string{
- "602401143452.dkr.ecr.us-west-2.amazonaws.com/", // Amazon VPC CNI
+ // Ignore images hosted in private ECR repositories as containerd cannot actually pull these
+ //"602401143452.dkr.ecr.us-west-2.amazonaws.com/", // Amazon VPC CNI
// Ignore images hosted on docker.io until a solution for rate limiting is implemented
//"docker.io/calico/",
//"docker.io/cilium/",
|
Ignore images hosted in private ECR repositories as containerd cannot actually pull these
|
diff --git a/src/controls/folder/folder.js b/src/controls/folder/folder.js
index <HASH>..<HASH> 100644
--- a/src/controls/folder/folder.js
+++ b/src/controls/folder/folder.js
@@ -34,7 +34,7 @@ class Folder extends Component {
<label>{ label }</label>
<Chevron style={{marginLeft:'auto'}} />
</div>
- { open ? <div style={{padding:'1em', backgroundColor: 'rgba( 1, 1, 1, 0.05 )', borderRadius:2}}>{ value() }</div> : null }
+ { open ? <div style={{padding:'1em', backgroundColor: 'rgba( 1, 1, 1, 0.04 )', borderRadius:2}}>{ value() }</div> : null }
</div>
}
|
Changed background opacity of folder
|
diff --git a/vendor/plugins/authentication/app/models/user.rb b/vendor/plugins/authentication/app/models/user.rb
index <HASH>..<HASH> 100644
--- a/vendor/plugins/authentication/app/models/user.rb
+++ b/vendor/plugins/authentication/app/models/user.rb
@@ -55,17 +55,4 @@ class User < ActiveRecord::Base
!other_user.superuser and User.count > 1 and (other_user.nil? or self.id != other_user.id)
end
-protected
-
- # before filter
- def encrypt_password
- return if password.blank?
- self.password_salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--") if new_record?
- self.crypted_password = encrypt(password)
- end
-
- def password_required?
- crypted_password.blank? || !password.blank?
- end
-
end
|
doesn't seem like we use these methods anywhere and password encryption works without them.
|
diff --git a/make/build.js b/make/build.js
index <HASH>..<HASH> 100644
--- a/make/build.js
+++ b/make/build.js
@@ -102,7 +102,7 @@ class Builder {
// Generate UMD AST
resultAst = clone(this._toAst("UMD"));
// Grab the final placeholder
- this._placeholder = resultAst.body[0].expression[ARGUMENTS][1].body.body;
+ this._placeholder = resultAst.body[0].expression[ARGUMENTS][0].body.body;
this._placeholder.pop(); // remove __gpf__
// Generate all ASTs and aggregate to the final result
this._addAst("boot");
|
Fix after changing UMD.js (#<I>)
|
diff --git a/lib/lovely_rufus/layers/email_quote_stripper.rb b/lib/lovely_rufus/layers/email_quote_stripper.rb
index <HASH>..<HASH> 100644
--- a/lib/lovely_rufus/layers/email_quote_stripper.rb
+++ b/lib/lovely_rufus/layers/email_quote_stripper.rb
@@ -7,6 +7,7 @@ module LovelyRufus
private
+ # :reek:UnusedPrivateMethod
def fixed_quote
quote.size > 0 ? quote.delete(' ') + ' ' : ''
end
|
a surprisingly futile attempt to ignore a smell
|
diff --git a/test/errors_test.rb b/test/errors_test.rb
index <HASH>..<HASH> 100644
--- a/test/errors_test.rb
+++ b/test/errors_test.rb
@@ -4,6 +4,9 @@ class ErrorsTest < Rugged::TestCase
def test_rugged_error_classes_exist
error_classes = [
+ Rugged::NoMemError,
+ Rugged::OSError,
+ Rugged::InvalidError,
Rugged::Error,
Rugged::ReferenceError,
Rugged::ZlibError,
@@ -19,8 +22,12 @@ class ErrorsTest < Rugged::TestCase
Rugged::IndexerError
]
- error_classes.each do |err|
- assert_equal err.class, Class
+ # All should descend from StandardError (correctly), except
+ # Rugged::NoMemError which descends from Ruby's built-in NoMemoryError,
+ # which descends from Exception
+ error_classes.each do |klass|
+ err = klass.new
+ assert err.is_a?(StandardError) || err.is_a?(Exception)
end
end
end
|
A more expression version of the errors test
|
diff --git a/lib/jets/commands/delete.rb b/lib/jets/commands/delete.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/commands/delete.rb
+++ b/lib/jets/commands/delete.rb
@@ -38,7 +38,8 @@ class Jets::Commands::Delete
end
def delete_logs
- log = Jets::Commands::Commands.Log.new(mute: true, sure: true)
+ puts "Deleting CloudWatch logs"
+ log = Jets::Commands::Clean::Log.new(mute: true, sure: true)
log.clean
end
|
fix delete cloudwatch logs on jets delete
|
diff --git a/client/src/views/autocomplete.js b/client/src/views/autocomplete.js
index <HASH>..<HASH> 100644
--- a/client/src/views/autocomplete.js
+++ b/client/src/views/autocomplete.js
@@ -315,7 +315,11 @@ var AutoComplete = Backbone.View.extend({
if (this.matches[this.selected_idx]) {
this.trigger('match', this.currentMatch(), this.matches[this.selected_idx]);
event.preventDefault();
- dont_process_other_input_keys = true;
+
+ // If the UI is not open, let the return key keep processing as normal.
+ // If we did not let this happen, since there is no visual UI it would look
+ // weird to the user if they had to press return twice for something to happen.
+ dont_process_other_input_keys = this._show_ui ? true : false;
}
}
else if (event.keyCode === 27) { // escape
|
Pressing return twice fix if autocomplete UI is not open
|
diff --git a/node_examples/getReadableContent.js b/node_examples/getReadableContent.js
index <HASH>..<HASH> 100644
--- a/node_examples/getReadableContent.js
+++ b/node_examples/getReadableContent.js
@@ -1,5 +1,5 @@
var sax = require("sax"),
- readability = require("../readabilitysax"),
+ readability = require("../readabilitySAX"),
url = require("url");
exports.get = function(uri, cb){
diff --git a/node_examples/readabilityAPI.js b/node_examples/readabilityAPI.js
index <HASH>..<HASH> 100644
--- a/node_examples/readabilityAPI.js
+++ b/node_examples/readabilityAPI.js
@@ -1,4 +1,4 @@
-var readability = require('./getreadablecontent'),
+var readability = require("./getReadableContent.js"),
url = require("url"),
http = require("http");
@@ -8,4 +8,4 @@ http.createServer(function(request, response){
response.writeHead(200, {"content-type":"application/json"});
response.end(JSON.stringify(ret));
});
-}).listen(80);
\ No newline at end of file
+}).listen(process.argv.length > 2 ? process.argv[2] : 80);
\ No newline at end of file
|
Fixed paths for case sensitive filesystems
|
diff --git a/cumulusci/cli/service.py b/cumulusci/cli/service.py
index <HASH>..<HASH> 100644
--- a/cumulusci/cli/service.py
+++ b/cumulusci/cli/service.py
@@ -97,7 +97,7 @@ class ConnectServiceCommand(click.MultiCommand):
click.Option(
("--default",),
is_flag=True,
- help="Set this service as the global defualt.",
+ help="Set this service as the global default.",
)
)
if runtime.project_config is not None:
|
[CCI] Fixing service connect help typo
|
diff --git a/tilelive.js b/tilelive.js
index <HASH>..<HASH> 100644
--- a/tilelive.js
+++ b/tilelive.js
@@ -1,7 +1,7 @@
require.paths.unshift(__dirname + '/modules',
__dirname + '/lib/node', __dirname);
-var mapnik = require('./modules/mapnik.node');
+var mapnik = require('mapnik');
mapnik.register_datasources('/usr/local/lib/mapnik2/input');
mapnik.register_fonts('/usr/local/lib/mapnik2/fonts/');
diff --git a/tl/sphericalmercator.js b/tl/sphericalmercator.js
index <HASH>..<HASH> 100644
--- a/tl/sphericalmercator.js
+++ b/tl/sphericalmercator.js
@@ -1,4 +1,4 @@
-var mapnik = require('../modules/mapnik.node');
+var mapnik = require('mapnik');
var mercator = new mapnik.Projection('+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over');
|
Change how mapnik module is required.
|
diff --git a/app/controllers/roboto/robots_controller.rb b/app/controllers/roboto/robots_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/roboto/robots_controller.rb
+++ b/app/controllers/roboto/robots_controller.rb
@@ -1,7 +1,7 @@
module Roboto
class RobotsController < Roboto::ApplicationController
def show
- render :text => robot_contents,
+ render :plain => robot_contents,
:layout => false,
:content_type => 'text/plain'
end
|
fix DEPRECATION WARNING: `render :text` is deprecated because it does not actually render a `text/plain` response.
|
diff --git a/Extension/UserExtension.php b/Extension/UserExtension.php
index <HASH>..<HASH> 100644
--- a/Extension/UserExtension.php
+++ b/Extension/UserExtension.php
@@ -24,7 +24,7 @@ class UserExtension extends \Twig_Extension
$user = $this->userManager->getUserById($user);
}
- return $user->isGranted($role);
+ return $user->hasRole($role);
}
public function getName()
|
can't use isGranted on user
|
diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -1,9 +1,25 @@
var assert = require('assert')
+var fs = require('fs')
var db = require('..')
describe('mime-db', function () {
+ it('should not contain types not in src/', function () {
+ var path = __dirname + '/../src'
+ var types = []
+
+ // collect all source types
+ fs.readdirSync(path).forEach(function (file) {
+ if (!/^\w+\.json$/.test(file)) return
+ types.push.apply(types, Object.keys(require(path + '/' + file)))
+ })
+
+ Object.keys(db).forEach(function (name) {
+ assert.ok(types.indexOf(name) !== -1, 'type "' + name + '" should be in src/')
+ })
+ })
+
it('should all be mime types', function () {
assert(Object.keys(db).every(function (name) {
return ~name.indexOf('/') || console.log(name)
|
tests: add test for all types to be in src/
|
diff --git a/lib/eztemplate/classes/eztemplatecompiler.php b/lib/eztemplate/classes/eztemplatecompiler.php
index <HASH>..<HASH> 100644
--- a/lib/eztemplate/classes/eztemplatecompiler.php
+++ b/lib/eztemplate/classes/eztemplatecompiler.php
@@ -463,7 +463,8 @@ class eZTemplateCompiler
// have enough time to compile
// However if time limit is unlimited (0) we leave it be
// Time limit will also be reset after subtemplates are compiled
- if ( ini_get( 'max_execution_time' ) != 0 )
+ $maxExecutionTime = ini_get( 'max_execution_time' );
+ if ( $maxExecutionTime != 0 && $maxExecutionTime < 30 )
{
@set_time_limit( 30 );
}
@@ -2288,7 +2289,8 @@ $rbracket
* ensure that remaining template has
* enough time to compile. However if time
* limit is unlimited (0) we leave it be */
- if ( ini_get( 'max_execution_time' ) != 0 )
+ $maxExecutionTime = ini_get( 'max_execution_time' );
+ if ( $maxExecutionTime != 0 && $maxExecutionTime < 60 )
{
@set_time_limit( 60 );
}
|
eZTemplateCompiler:
- Make sure we only set the execution time if it's less then we want it to be.
git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
|
diff --git a/src/components/networked-share.js b/src/components/networked-share.js
index <HASH>..<HASH> 100644
--- a/src/components/networked-share.js
+++ b/src/components/networked-share.js
@@ -644,7 +644,7 @@ AFRAME.registerComponent('networked-share', {
this.removeOwnership();
var data = { networkId: this.networkId };
- naf.connection.broadcastData('r', data);
+ naf.connection.broadcastDataGuaranteed('r', data);
this.unbindOwnershipEvents();
this.unbindOwnerEvents();
|
use broadcastDataGuaranteed within remove()
|
diff --git a/lib/pusher/webhook.rb b/lib/pusher/webhook.rb
index <HASH>..<HASH> 100644
--- a/lib/pusher/webhook.rb
+++ b/lib/pusher/webhook.rb
@@ -4,7 +4,7 @@ require 'hmac-sha2'
module Pusher
# Used to parse and authenticate WebHooks
#
- # @example
+ # @example Sinatra
# post '/webhooks' do
# webhook = Pusher::WebHook.new(request)
# if webhook.valid?
@@ -48,9 +48,7 @@ module Pusher
# matches the configured key & secret. In the case that the webhook is
# invalid, the reason is logged
#
- # @param extra_tokens [Hash] If you have extra tokens for your Pusher
- # app, you can specify them here so that they're used to attempt
- # validation.
+ # @param extra_tokens [Hash] If you have extra tokens for your Pusher app, you can specify them so that they're used to attempt validation.
#
def valid?(extra_tokens = nil)
extra_tokens = [extra_tokens] if extra_tokens.kind_of?(Hash)
|
Tweak WebHook rdoc
* rdoc.info likes long lines...
|
diff --git a/merb-core/lib/merb-core/controller/mixins/responder.rb b/merb-core/lib/merb-core/controller/mixins/responder.rb
index <HASH>..<HASH> 100644
--- a/merb-core/lib/merb-core/controller/mixins/responder.rb
+++ b/merb-core/lib/merb-core/controller/mixins/responder.rb
@@ -297,7 +297,7 @@ module Merb
#
# :api: private
def _perform_content_negotiation
- if fmt = params[:format]
+ if fmt = params[:format] and !fmt.blank?
accepts = [fmt.to_sym]
else
accepts = _accept_types
|
[merb-core] Content negotiation handles blank formats like nil
Fixes specs to support the "get/post/put/delete"
test helpers properly.
|
diff --git a/src/main/groovy/org/codehaus/gant/GantBuilder.java b/src/main/groovy/org/codehaus/gant/GantBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/groovy/org/codehaus/gant/GantBuilder.java
+++ b/src/main/groovy/org/codehaus/gant/GantBuilder.java
@@ -99,7 +99,7 @@ public class GantBuilder extends AntBuilder {
@SuppressWarnings ( "unchecked" )
public BuildLogger getLogger ( ) {
final List<? extends BuildListener> listeners = getProject ( ).getBuildListeners ( ) ; // Unchecked conversion here.
- assert listeners.size ( ) == 1 ;
+ assert listeners.size ( ) > 0 ;
return (BuildLogger) listeners.get ( 0 ) ;
}
}
|
Trying a GMaven build shows that the original assertion was too restrictive.
git-svn-id: <URL>
|
diff --git a/packages/devtools-components/src/tree.js b/packages/devtools-components/src/tree.js
index <HASH>..<HASH> 100644
--- a/packages/devtools-components/src/tree.js
+++ b/packages/devtools-components/src/tree.js
@@ -786,6 +786,10 @@ class Tree extends Component {
onExpand: this._onExpand,
onCollapse: this._onCollapse,
onClick: e => {
+ // We can stop the propagation since click handler on the node can be
+ // created in `renderItem`.
+ e.stopPropagation();
+
// Since the user just clicked the node, there's no need to check if
// it should be scrolled into view.
this._focus(item, { preventAutoScroll: true });
|
Stop the propagation on tree node click. (#<I>)
Not having it was causing issue in the console ([Bug <I>](<URL>)),
and I think it's safe to stop the propagation since click events are handled
through renderItem result.
|
diff --git a/annis-widgets/src/main/java/annis/gui/components/medialement/MediaElementPlayer.java b/annis-widgets/src/main/java/annis/gui/components/medialement/MediaElementPlayer.java
index <HASH>..<HASH> 100644
--- a/annis-widgets/src/main/java/annis/gui/components/medialement/MediaElementPlayer.java
+++ b/annis-widgets/src/main/java/annis/gui/components/medialement/MediaElementPlayer.java
@@ -100,12 +100,19 @@ public class MediaElementPlayer extends AbstractJavaScriptComponent
@Override
public void play(double start)
{
+ // we get the time in seconds with fractions but the HTML5 players
+ // only have a resolution of seconds
+ start = Math.floor(start);
callFunction("play", start);
}
@Override
public void play(double start, double end)
{
+ // we get the time in seconds with fractions but the HTML5 players
+ // only have a resolution of seconds
+ start = Math.floor(start);
+ end = Math.ceil(end);
callFunction("playRange", start, end);
}
|
don't miss play range due to bad rounding
|
diff --git a/dvc/version.py b/dvc/version.py
index <HASH>..<HASH> 100644
--- a/dvc/version.py
+++ b/dvc/version.py
@@ -6,7 +6,7 @@
import os
import subprocess
-_BASE_VERSION = "2.0.9"
+_BASE_VERSION = "2.0.10"
def _generate_version(base_version):
|
dvc: bump to <I>
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -30,8 +30,11 @@ setup(
author='Evan Gray',
author_email='hello@evanscottgray.com',
description='stream from papertrail into slack.',
+ long_description=open('README.rst').read(),
install_requires=install_requires,
packages=find_packages(),
+ classifiers=['Development Status :: 4 - Beta',
+ 'License :: OSI Approved :: Apache Software License'],
license='Apache Software License',
url='https://github.com/evanscottgray/paperslacktail',
entry_points={
|
update setup.py to have classifiers and readme reader thingy
|
diff --git a/src/mal.js b/src/mal.js
index <HASH>..<HASH> 100644
--- a/src/mal.js
+++ b/src/mal.js
@@ -30,7 +30,7 @@ MyAnimeList.getUserList = function (username, type = "anime") {
if (resp.statusCode < 200 || resp.statusCode > 299) { /* Status Code errors */
return reject(resp.statusCode);
}
- parseString(body, function (err, result) {
+ parseString(body, {explicitArray: false}, function (err, result) {
resolve(result["myanimelist"][type] || []);
});
});
@@ -68,7 +68,7 @@ MyAnimeList.prototype.search = function (name, type = "anime") {
if (resp.statusCode < 200 || resp.statusCode > 299) { /* Status Code errors */
return reject(resp.statusCode);
}
- parseString(body, function (err, result) {
+ parseString(body, {explicitArray: false}, function (err, result) {
resolve(result["anime"]["entry"]);
});
});
|
set explicitArray to false to clean up the return
|
diff --git a/lib/go/blobserver/localdisk/localdisk.go b/lib/go/blobserver/localdisk/localdisk.go
index <HASH>..<HASH> 100644
--- a/lib/go/blobserver/localdisk/localdisk.go
+++ b/lib/go/blobserver/localdisk/localdisk.go
@@ -247,7 +247,9 @@ func (ds *diskStorage) ReceiveBlob(blobRef *blobref.BlobRef, source io.Reader, m
if err != nil {
return
}
- // TODO: fsync before close.
+ if err = tempFile.Sync(); err != nil {
+ return
+ }
if err = tempFile.Close(); err != nil {
return
}
|
Go has fsync now.
|
diff --git a/modeltranslation/tests/settings.py b/modeltranslation/tests/settings.py
index <HASH>..<HASH> 100644
--- a/modeltranslation/tests/settings.py
+++ b/modeltranslation/tests/settings.py
@@ -39,5 +39,3 @@ SITE_ID = 1
LANGUAGES = (('de', 'Deutsch'),
('en', 'English'))
DEFAULT_LANGUAGE = 'de'
-
-MODELTRANSLATION_TRANSLATION_REGISTRY = 'modeltranslation.tests'
|
Removed deprecated MODELTRANSLATION_TRANSLATION_REGISTRY setting from test settings.
|
diff --git a/spec/tools.rb b/spec/tools.rb
index <HASH>..<HASH> 100644
--- a/spec/tools.rb
+++ b/spec/tools.rb
@@ -43,12 +43,6 @@ module DeepCover
::Coverage.result.fetch(fn)
end
- def branch_coverage(fn)
- DeepCover.start
- with_warnings(nil) { DeepCover.require fn }
- DeepCover.branch_coverage(fn)
- end
-
def our_coverage(fn)
DeepCover.start
with_warnings(nil) { DeepCover.require fn }
|
Remove Tools.branch_coverage
It relies on things that don't exist anymore
|
diff --git a/lib/bento_search/util.rb b/lib/bento_search/util.rb
index <HASH>..<HASH> 100644
--- a/lib/bento_search/util.rb
+++ b/lib/bento_search/util.rb
@@ -97,6 +97,8 @@ module BentoSearch::Util
# Get back a Nokogiri node, call #inner_html on it to go back to a string
# (and you probably want to call .html_safe on the string you get back for use
# in rails view)
+ #
+ # (In future consider using this gem instead of doing it ourselves? https://github.com/nono/HTML-Truncator )
def self.nokogiri_truncate(node, max_length, omission = '…', seperator = nil)
if node.kind_of?(::Nokogiri::XML::Text)
|
comment for future third-party html truncator
|
diff --git a/lib/right_http_connection.rb b/lib/right_http_connection.rb
index <HASH>..<HASH> 100644
--- a/lib/right_http_connection.rb
+++ b/lib/right_http_connection.rb
@@ -232,11 +232,21 @@ them.
# try to connect server(if connection does not exist) and get response data
begin
# (re)open connection to server if none exists
+ # TODO TRB 8/2/07 - you also need to get a new connection if the
+ # server, port, or proto has changed in the request_params
start(request_params) unless @http
# get response and return it
request = request_params[:request]
request['User-Agent'] = get_param(:user_agent) || ''
+
+ # Detect if the body is a streamable object like a file or socket. If so, stream that
+ # bad boy.
+ if(request.body && request.body.respond_to?(:read))
+ body = request.body
+ request.content_length = body.respond_to?(:lstat) ? body.lstat.size : body.size
+ request.body_stream = request.body
+ end
response = @http.request(request)
error_reset
|
(#<I>) Stream uploads (PUTs) if the source is a file, stream, or anything
read()-able
git-svn-id: <URL>
|
diff --git a/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgres.java b/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgres.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgres.java
+++ b/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgres.java
@@ -448,7 +448,16 @@ public class EmbeddedPostgres implements Closeable
*/
private static String getOS()
{
- return SystemUtils.IS_OS_WINDOWS ? "Windows" : system("uname", "-s").get(0);
+ if (SystemUtils.IS_OS_WINDOWS) {
+ return "Windows";
+ }
+ if (SystemUtils.IS_OS_MAC_OSX) {
+ return "Darwin";
+ }
+ if (SystemUtils.IS_OS_LINUX) {
+ return "Linux";
+ }
+ throw new UnsupportedOperationException("Unknown OS " + SystemUtils.OS_NAME);
}
/**
|
Operating system detection: remove system() call
|
diff --git a/lib/spinach/runner/scenario_runner.rb b/lib/spinach/runner/scenario_runner.rb
index <HASH>..<HASH> 100644
--- a/lib/spinach/runner/scenario_runner.rb
+++ b/lib/spinach/runner/scenario_runner.rb
@@ -38,7 +38,8 @@ module Spinach
Spinach.hooks.run_before_step step
unless @exception
begin
- step_location = feature_steps.execute_step(step['name'])
+ step_location = feature_steps.get_step_location(step['name'])
+ feature_steps.execute_step(step['name'])
Spinach.hooks.run_on_successful_step step, step_location
rescue *Spinach.config[:failure_exceptions] => e
@exception = e
|
Make scenario_runner to get step location before executing it
|
diff --git a/lib/Thelia/Action/Product.php b/lib/Thelia/Action/Product.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Action/Product.php
+++ b/lib/Thelia/Action/Product.php
@@ -90,17 +90,14 @@ class Product extends BaseAction implements EventSubscriberInterface
->setTitle($event->getTitle())
->setVisible($event->getVisible() ? 1 : 0)
->setVirtual($event->getVirtual() ? 1 : 0)
-
- // Set the default tax rule to this product
- ->setTaxRule(TaxRuleQuery::create()->findOneByIsDefault(true))
-
->setTemplateId($event->getTemplateId())
->create(
$event->getDefaultCategory(),
$event->getBasePrice(),
$event->getCurrencyId(),
- $event->getTaxRuleId(),
+ // Set the default tax rule if not defined
+ $event->getTaxRuleId() ?: TaxRuleQuery::create()->findOneByIsDefault(true),
$event->getBaseWeight(),
$event->getBaseQuantity()
)
@@ -386,7 +383,7 @@ class Product extends BaseAction implements EventSubscriberInterface
$fileList['documentList']['list'] = ProductDocumentQuery::create()
->findByProductId($event->getProductId());
$fileList['documentList']['type'] = TheliaEvents::DOCUMENT_DELETE;
-
+
// Delete product
$product
->setDispatcher($this->eventDispatcher)
|
Set default tax rule if it not defined in create product event
|
diff --git a/lib/lazy_xml_model/collection_proxy.rb b/lib/lazy_xml_model/collection_proxy.rb
index <HASH>..<HASH> 100644
--- a/lib/lazy_xml_model/collection_proxy.rb
+++ b/lib/lazy_xml_model/collection_proxy.rb
@@ -100,18 +100,20 @@ module LazyXmlModel
if item_from_collection.present?
item_from_collection
else
- item = begin
- new_item = klass.new
- new_item.xml_parent_element = xml_parent_element
- new_item.xml_element = element
- new_item
- end
+ item = build_item_for_element(element)
@collection << item
item
end
end
end
+ def build_item_for_element(element)
+ new_item = klass.new
+ new_item.xml_parent_element = xml_parent_element
+ new_item.xml_element = element
+ new_item
+ end
+
def element_name
klass.tag || association_name
end
|
small refactor of CollectionProxy
|
diff --git a/openstack_dashboard/dashboards/project/snapshots/views.py b/openstack_dashboard/dashboards/project/snapshots/views.py
index <HASH>..<HASH> 100644
--- a/openstack_dashboard/dashboards/project/snapshots/views.py
+++ b/openstack_dashboard/dashboards/project/snapshots/views.py
@@ -47,7 +47,6 @@ class SnapshotsView(tables.DataTableView, tables.PagedTableMixin):
volumes = api.cinder.volume_list(self.request)
volumes = dict((v.id, v) for v in volumes)
except Exception:
- raise
exceptions.handle(self.request, _("Unable to retrieve "
"volume snapshots."))
|
Remove unnecessary raise
If exception arise, it will be raised and the following
code will not be executed.
Change-Id: I<I>eef<I>d6baeeeb<I>e<I>e2ab9c5fa2f4e<I>b8a4
Closes-Bug: <I>
|
diff --git a/src/Command/SonataListFormMappingCommand.php b/src/Command/SonataListFormMappingCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/SonataListFormMappingCommand.php
+++ b/src/Command/SonataListFormMappingCommand.php
@@ -29,7 +29,7 @@ class SonataListFormMappingCommand extends ContainerAwareCommand
public function isEnabled()
{
- return Kernel::MAJOR_VERSION !== 3;
+ return Kernel::MAJOR_VERSION < 3;
}
protected function configure()
|
SonataListFormMappingCommand is enabled on symfony v4
#<I>
SonataListFormMappingCommand is enabled on symfony v4, this commit fix it.
|
diff --git a/pyphi/network.py b/pyphi/network.py
index <HASH>..<HASH> 100644
--- a/pyphi/network.py
+++ b/pyphi/network.py
@@ -214,7 +214,7 @@ class Network:
def generate_node_indices(self, nodes):
"""Returns the nodes indices for nodes, where ``nodes`` is either
already integer indices or node labels."""
- if len(nodes) == 0:
+ if not nodes:
indices = ()
elif all(isinstance(node, str) for node in nodes):
indices = self.labels2indices(nodes)
|
Don't use `len` to check for empty sequence
|
diff --git a/draft/polling.go b/draft/polling.go
index <HASH>..<HASH> 100644
--- a/draft/polling.go
+++ b/draft/polling.go
@@ -153,6 +153,10 @@ func (p *Poller) PollAll(timeout time.Duration) ([]Polled, error) {
func (p *Poller) poll(timeout time.Duration, all bool) ([]Polled, error) {
lst := make([]Polled, 0, len(p.items))
+ if len(p.items) == 0 {
+ return lst, nil
+ }
+
var ctx *Context
for _, soc := range p.socks {
if !soc.opened {
diff --git a/polling.go b/polling.go
index <HASH>..<HASH> 100644
--- a/polling.go
+++ b/polling.go
@@ -153,6 +153,10 @@ func (p *Poller) PollAll(timeout time.Duration) ([]Polled, error) {
func (p *Poller) poll(timeout time.Duration, all bool) ([]Polled, error) {
lst := make([]Polled, 0, len(p.items))
+ if len(p.items) == 0 {
+ return lst, nil
+ }
+
var ctx *Context
for _, soc := range p.socks {
if !soc.opened {
|
Fix Poller poll to handle empty case
|
diff --git a/packages/create-react-app/createReactApp.js b/packages/create-react-app/createReactApp.js
index <HASH>..<HASH> 100755
--- a/packages/create-react-app/createReactApp.js
+++ b/packages/create-react-app/createReactApp.js
@@ -21,10 +21,12 @@ const tmp = require('tmp');
const unpack = require('tar-pack').unpack;
const hyperquest = require('hyperquest');
+const packageJson = require('./package.json');
+
let projectName;
-const program = commander
- .version(require('./package.json').version)
+const program = new commander.Command(packageJson.name)
+ .version(packageJson.version)
.arguments('<project-directory>')
.usage(`${chalk.green('<project-directory>')} [options]`)
.action(name => {
|
Provide commander with package name (#<I>)
commander to figure it out on its own
|
diff --git a/sacrud/preprocessing.py b/sacrud/preprocessing.py
index <HASH>..<HASH> 100644
--- a/sacrud/preprocessing.py
+++ b/sacrud/preprocessing.py
@@ -146,7 +146,7 @@ class RequestPreprocessing(object):
value = value[0]
if not value and not hasattr(value, 'filename'):
- if self.column.default:
+ if self.column.default or self.column.primary_key:
return None
if column_type in list(self.types_list.keys()):
@@ -172,6 +172,7 @@ class ObjPreprocessing(object):
continue # pragma: no cover
value = request_preprocessing.check_type(table, key)
if value is None:
+ request.pop(key, None)
continue
request[key] = value
params = {k: v for k, v in request.items() if not k.endswith('[]')}
|
fix preprocessing pk for create action, when pk have not value
|
diff --git a/lxc/manpage.go b/lxc/manpage.go
index <HASH>..<HASH> 100644
--- a/lxc/manpage.go
+++ b/lxc/manpage.go
@@ -37,7 +37,14 @@ func (c *cmdManpage) Run(cmd *cobra.Command, args []string) error {
Title: i18n.G("LXD - Command line client"),
Section: "1",
}
- doc.GenManTree(c.global.cmd, header, args[0])
+
+ opts := doc.GenManTreeOptions{
+ Header: header,
+ Path: args[0],
+ CommandSeparator: ".",
+ }
+
+ doc.GenManTreeFromOpts(c.global.cmd, opts)
return nil
}
diff --git a/lxd/main_manpage.go b/lxd/main_manpage.go
index <HASH>..<HASH> 100644
--- a/lxd/main_manpage.go
+++ b/lxd/main_manpage.go
@@ -43,7 +43,14 @@ func (c *cmdManpage) Run(cmd *cobra.Command, args []string) error {
Title: "LXD - Container server",
Section: "1",
}
- doc.GenManTree(c.global.cmd, header, args[0])
+
+ opts := doc.GenManTreeOptions{
+ Header: header,
+ Path: args[0],
+ CommandSeparator: ".",
+ }
+
+ doc.GenManTreeFromOpts(c.global.cmd, opts)
return nil
}
|
man: Use . as separator
|
diff --git a/cocaine/tools/actions/common.py b/cocaine/tools/actions/common.py
index <HASH>..<HASH> 100644
--- a/cocaine/tools/actions/common.py
+++ b/cocaine/tools/actions/common.py
@@ -79,7 +79,7 @@ class NodeInfo(Node):
for app_ in apps:
info = ''
try:
- app = Service(app_)
+ app = Service(app_, locator=self.locator)
channel = yield app.info()
info = yield channel.rx.get()
if all([self._expand, self._storage is not None, 'profile' in info]):
|
[Info] Use the proper locator to get Info from a remote host
|
diff --git a/eth/rlp/accounts.py b/eth/rlp/accounts.py
index <HASH>..<HASH> 100644
--- a/eth/rlp/accounts.py
+++ b/eth/rlp/accounts.py
@@ -34,3 +34,11 @@ class Account(rlp.Serializable):
code_hash: bytes=EMPTY_SHA3,
**kwargs: Any) -> None:
super().__init__(nonce, balance, storage_root, code_hash, **kwargs)
+
+ def __repr__(self):
+ return "Account(nonce=%d, balance=%d, storage_root=0x%s, code_hash=0x%s)" % (
+ self.nonce,
+ self.balance,
+ self.storage_root.hex(),
+ self.code_hash.hex(),
+ )
|
add repr to eth.rlp.Account
|
diff --git a/src/neuron/loader/instances.js b/src/neuron/loader/instances.js
index <HASH>..<HASH> 100644
--- a/src/neuron/loader/instances.js
+++ b/src/neuron/loader/instances.js
@@ -1,5 +1,7 @@
;(function(K){
+return;
+
var Loader = K._Loader;
@@ -8,8 +10,8 @@ var Loader = K._Loader;
* and also create a new namespace for modules under this application
* will be very useful for business requirement
- <code env="page">
- var Checkin = KM.app('Checkin', {
+ <code env="inline">
+ KM.app('Checkin', {
base: '/q/mods/'
});
@@ -27,13 +29,14 @@ var Loader = K._Loader;
// provide a module of the kernel
KM.provide('io/ajax', function(K, Ajax){
new Ajax( ... )
- })
+ });
+
</code>
<code env="index.js">
// '~/' -> the home dir for the current application
- KM.define(['~/timeline'], function(K, require){
+ KM.define(['~/timeline', 'dom'], function(K, require){
var timeline = require('~/timeline');
});
|
loader: add TODOs; add scheme plan for new features of loader
|
diff --git a/ghost/members-api/subscriptions/payment-processors/stripe/api.js b/ghost/members-api/subscriptions/payment-processors/stripe/api.js
index <HASH>..<HASH> 100644
--- a/ghost/members-api/subscriptions/payment-processors/stripe/api.js
+++ b/ghost/members-api/subscriptions/payment-processors/stripe/api.js
@@ -19,7 +19,7 @@ const getPlanHashSeed = (plan, product) => {
return product.id + plan.interval + plan.currency + plan.amount;
};
-const getProductHashSeed = product => product.name;
+const getProductHashSeed = () => 'Ghost Subscription';
const getCustomerHashSeed = member => member.email;
const plans = createApi('plans', isActive, getPlanAttr, getPlanHashSeed);
|
Updated product hashseed to be hardcoded (#<I>)
no-issue
|
diff --git a/Model/OriginalFile.php b/Model/OriginalFile.php
index <HASH>..<HASH> 100644
--- a/Model/OriginalFile.php
+++ b/Model/OriginalFile.php
@@ -109,6 +109,6 @@ class OriginalFile
public function getOrginalFile()
{
- return base64_decode($this->original_file_base64);
+ return base64_decode(strtr($this->original_file_base64, '-_,', '+/='));
}
}
|
Fixes decoding of rubies urlsafe base<I> encode
|
diff --git a/lib/dugway/liquid/drops/cart_drop.rb b/lib/dugway/liquid/drops/cart_drop.rb
index <HASH>..<HASH> 100755
--- a/lib/dugway/liquid/drops/cart_drop.rb
+++ b/lib/dugway/liquid/drops/cart_drop.rb
@@ -9,10 +9,14 @@ module Dugway
items.map { |item| item.quantity }.inject(:+) || 0
end
- def total
+ def subtotal
items.map { |item| item.price }.inject(:+) || 0
end
+ def total
+ subtotal
+ end
+
def country
nil
end
diff --git a/lib/dugway/liquid/drops/cart_item_drop.rb b/lib/dugway/liquid/drops/cart_item_drop.rb
index <HASH>..<HASH> 100755
--- a/lib/dugway/liquid/drops/cart_item_drop.rb
+++ b/lib/dugway/liquid/drops/cart_item_drop.rb
@@ -12,6 +12,10 @@ module Dugway
def option
ProductOptionDrop.new(source['option'])
end
+
+ def shipping
+ 0.0
+ end
end
end
end
|
Finalize cart drops. Closes #7
|
diff --git a/synapse/cortex.py b/synapse/cortex.py
index <HASH>..<HASH> 100644
--- a/synapse/cortex.py
+++ b/synapse/cortex.py
@@ -2665,6 +2665,8 @@ class Cortex(s_cell.Cell): # type: ignore
async def count(self, text, opts=None):
+ opts = self._initStormOpts(opts)
+
view = self._viewFromOpts(opts)
i = 0
diff --git a/synapse/tests/test_cortex.py b/synapse/tests/test_cortex.py
index <HASH>..<HASH> 100644
--- a/synapse/tests/test_cortex.py
+++ b/synapse/tests/test_cortex.py
@@ -1571,6 +1571,7 @@ class CortexBasicTest(s_t_utils.SynTest):
# test the remote storm result counting API
self.eq(0, await proxy.count('test:pivtarg'))
self.eq(1, await proxy.count('inet:user'))
+ self.eq(1, await core.count('inet:user'))
# Test the getFeedFuncs command to enumerate feed functions.
ret = await proxy.getFeedFuncs()
|
fix for local count() api (#<I>)
|
diff --git a/app/search_engines/bento_search/ebsco_host_engine.rb b/app/search_engines/bento_search/ebsco_host_engine.rb
index <HASH>..<HASH> 100644
--- a/app/search_engines/bento_search/ebsco_host_engine.rb
+++ b/app/search_engines/bento_search/ebsco_host_engine.rb
@@ -228,6 +228,8 @@ class BentoSearch::EbscoHostEngine
# normalization.
if ["Academic Journal", "Journal"].include?(components.first) && ["Article", "Journal Article"].include?(components.last)
return "Journal Article"
+ elsif components.last == "Book: Monograph"
+ return "Book" # Book: Monograph what??
elsif components.first == "Periodical" && components.length > 1
return components.last
elsif components.size == 2 && components.first.include?(components.last)
|
ebscohost, improved heuristic for reasonable format_str
|
diff --git a/js/okx.js b/js/okx.js
index <HASH>..<HASH> 100644
--- a/js/okx.js
+++ b/js/okx.js
@@ -906,7 +906,6 @@ module.exports = class okx extends Exchange {
'margin': spot && (Precise.stringGt (maxLeverage, '1')),
'swap': swap,
'future': future,
- 'futures': future, // deprecated
'option': option,
'active': true,
'contract': contract,
@@ -1297,7 +1296,7 @@ module.exports = class okx extends Exchange {
async fetchTickers (symbols = undefined, params = {}) {
const [ type, query ] = this.handleMarketTypeAndParams ('fetchTickers', undefined, params);
- return await this.fetchTickersByType (type, symbols, this.omit (query, 'type'));
+ return await this.fetchTickersByType (type, symbols, query);
}
parseTrade (trade, market = undefined) {
|
remove deprecated type future from market structure
|
diff --git a/src/Admin/AbstractAdmin.php b/src/Admin/AbstractAdmin.php
index <HASH>..<HASH> 100644
--- a/src/Admin/AbstractAdmin.php
+++ b/src/Admin/AbstractAdmin.php
@@ -1318,6 +1318,11 @@ abstract class AbstractAdmin extends AbstractTaggedAdmin implements AdminInterfa
return;
}
+ // NEXT_MAJOR: Remove this check
+ if (!$admin) {
+ return;
+ }
+
if ($this->hasRequest()) {
$admin->setRequest($this->getRequest());
}
diff --git a/src/Admin/Pool.php b/src/Admin/Pool.php
index <HASH>..<HASH> 100644
--- a/src/Admin/Pool.php
+++ b/src/Admin/Pool.php
@@ -506,7 +506,7 @@ class Pool
* @throws TooManyAdminClassException if there is too many admin for the field description target model
* @throws AdminCodeNotFoundException if the admin_code option is invalid
*
- * @return AdminInterface
+ * @return AdminInterface|false|null NEXT_MAJOR: Restrict to AdminInterface
*/
final public function getAdminByFieldDescription(FieldDescriptionInterface $fieldDescription)
{
|
Handle case of Admin not found (#<I>)
|
diff --git a/lib/jsi/util.rb b/lib/jsi/util.rb
index <HASH>..<HASH> 100644
--- a/lib/jsi/util.rb
+++ b/lib/jsi/util.rb
@@ -17,21 +17,21 @@ module JSI
# @param hash [#to_hash] the hash from which to convert symbol keys to strings
# @return [same class as the param `hash`, or Hash if the former cannot be done] a
# hash(-like) instance containing no symbol keys
- def stringify_symbol_keys(hash)
- unless hash.respond_to?(:to_hash)
- raise(ArgumentError, "expected argument to be a hash; got #{hash.class.inspect}: #{hash.pretty_inspect.chomp}")
+ def stringify_symbol_keys(hashlike)
+ unless hashlike.respond_to?(:to_hash)
+ raise(ArgumentError, "expected argument to be a hash; got #{hashlike.class.inspect}: #{hashlike.pretty_inspect.chomp}")
end
- JSI::Typelike.modified_copy(hash) do |hash_|
+ JSI::Typelike.modified_copy(hashlike) do |hash|
changed = false
out = {}
- hash_.each do |k, v|
+ hash.each do |k, v|
if k.is_a?(Symbol)
changed = true
k = k.to_s
end
out[k] = v
end
- changed ? out : hash_
+ changed ? out : hash
end
end
|
don't shadow in JSI::Typelike#stringify_symbol_keys hash
|
diff --git a/parfait-core/src/main/java/com/custardsource/parfait/MonitorableRegistry.java b/parfait-core/src/main/java/com/custardsource/parfait/MonitorableRegistry.java
index <HASH>..<HASH> 100644
--- a/parfait-core/src/main/java/com/custardsource/parfait/MonitorableRegistry.java
+++ b/parfait-core/src/main/java/com/custardsource/parfait/MonitorableRegistry.java
@@ -8,6 +8,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
/**
* A collection of Monitorables to be monitored by a given output source (or
@@ -74,10 +75,7 @@ public class MonitorableRegistry {
* MonitorableRegistry.
*/
public synchronized Collection<Monitorable<?>> getMonitorables() {
- Preconditions.checkState(stateFrozen,
- "MonitorableRegistry must be frozen before retrieving monitorable list");
- stateFrozen = true;
- return Collections.unmodifiableCollection(monitorables.values());
+ return ImmutableList.copyOf(monitorables.values());
}
/*
|
Tidyup of MonitorableRegistry preconditions, better concurrent semantics
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,8 @@ setup_args = dict(
'console_scripts': [
'wallace = wallace.command_line:wallace',
],
- }
+ },
+ dependency_links=['-e git+git://github.com/berkeley-cocosci/psiTurk.git@wallace3#egg=psiturk']
)
# Read in requirements.txt for dependencies.
|
Add custom psiTurk as dependency link
|
diff --git a/src/Core.php b/src/Core.php
index <HASH>..<HASH> 100755
--- a/src/Core.php
+++ b/src/Core.php
@@ -235,8 +235,20 @@ class Core
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
// @TODO - S.P. to review...
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+ // JBB - these turn off all SSL security checking
+ // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+ // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+
+ // JBB - adding switch to check for a constant in the php bootstrap
+ // which defines the location of a cURL SSL certificate
+ if( defined("CURL_SSL_CERTIFICATE") && is_file(CURL_SSL_CERTIFICATE)) {
+ curl_setopt($ch, CURLOPT_CAINFO, CURL_SSL_CERTIFICATE);
+ curl_setopt($ch, CURLOPT_CAPATH, CURL_SSL_CERTIFICATE);
+ }
+ else {
+ throw new \Exception('cURL SSL certificate not found');
+ }
+
// Manage if user provided headers.
if (count($headers) > 0)
|
VIDA-<I> Adding SSL Certificate check
Commented out the lines which disable cURL's security checking,
Included lines which looks for a cURL SSL certificate file (supplied by using a project defined php constant which will be required in all projects which wish to use cURL), and, if that file is present, uses that file to add those SSL certificates to cURL's configuration.
If the constant is not found, and is not a file, then an exception is thrown.
|
diff --git a/lib/console.js b/lib/console.js
index <HASH>..<HASH> 100644
--- a/lib/console.js
+++ b/lib/console.js
@@ -92,7 +92,11 @@ ConsoleLogger.prototype.write = function (record) {
if (!msg || msg===' ') {
// this is the case where you send in an object as the only argument
var fields = _.omit(record,'name','prefix','showtab','showcr','hostname','pid','level','msg','time','v','problemLogName');
- msg = util.inspect(fields, {colors:true});
+ if (_.isEmpty(fields)) {
+ msg = '';
+ } else {
+ msg = util.inspect(fields, {colors:true});
+ }
}
if (this.showcr && msg.indexOf('\n') > 0) {
var lines = msg.split(/\n/),
|
[CLI-<I>] don't print empty object
|
diff --git a/src/Illuminate/Queue/Console/RetryCommand.php b/src/Illuminate/Queue/Console/RetryCommand.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Queue/Console/RetryCommand.php
+++ b/src/Illuminate/Queue/Console/RetryCommand.php
@@ -51,7 +51,7 @@ class RetryCommand extends Command
*/
protected function getJobIds()
{
- $ids = $this->argument('id');
+ $ids = (array) $this->argument('id');
if (count($ids) === 1 && $ids[0] === 'all') {
$ids = Arr::pluck($this->laravel['queue.failer']->all(), 'id');
|
Ensure getJobIds always return an array. (#<I>)
|
diff --git a/src/cli.js b/src/cli.js
index <HASH>..<HASH> 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -9,7 +9,7 @@ import defaultPublisher from './Publisher/publish.js';
let argv = minimist(process.argv.slice(2));
if (argv.h || argv.help) {
console.log('usage: esdoc [esdoc.json | path/to/js/src]');
- return;
+ process.exit(0)
}
assert.equal(argv._.length, 1, 'specify esdoc.json or dir. see -h');
|
fix: return at non-function scope.
|
diff --git a/APIJet/Request.php b/APIJet/Request.php
index <HASH>..<HASH> 100644
--- a/APIJet/Request.php
+++ b/APIJet/Request.php
@@ -9,6 +9,8 @@ class Request
const PUT = 'PUT';
const DELETE = 'DELETE';
+ private static $inputData = null;
+
private function __construct() {}
private function __clone() {}
@@ -71,4 +73,21 @@ class Request
return (bool) $authorizationCallback();
}
+
+ public static function getInputData()
+ {
+ if (self::$inputData === null) {
+
+ $inputData = [];
+ $rawInput = file_get_contents('php://input');
+
+ if (!empty($rawInput)) {
+ mb_parse_str($rawInput, $inputData);
+ }
+
+ self::$inputData = $inputData;
+ }
+
+ return self::$inputData;
+ }
}
|
Add getInputData in APIJet\Request
|
diff --git a/src/Entities/Subscription.php b/src/Entities/Subscription.php
index <HASH>..<HASH> 100644
--- a/src/Entities/Subscription.php
+++ b/src/Entities/Subscription.php
@@ -195,16 +195,6 @@ final class Subscription extends Entity
}
/**
- * @deprecated
- *
- * @return string
- */
- public function getCancelledTime()
- {
- return $this->getCanceledTime();
- }
-
- /**
* @return string
*/
public function getRenewalTime()
|
Remove deprecated method Subscription::getCancelledTime() (#<I>)
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -64,6 +64,16 @@ Server.prototype.serveClient = function(v){
};
/**
+ * Backwards compatiblity.
+ *
+ * @api public
+ */
+
+Server.prototype.set = function(){
+ return this;
+};
+
+/**
* Sets the client serving path.
*
* @param {String} pathname
|
lib: bc compatibility
|
diff --git a/datasync/kvdbsync/plugin_impl_dbsync.go b/datasync/kvdbsync/plugin_impl_dbsync.go
index <HASH>..<HASH> 100644
--- a/datasync/kvdbsync/plugin_impl_dbsync.go
+++ b/datasync/kvdbsync/plugin_impl_dbsync.go
@@ -49,6 +49,11 @@ type Deps struct {
KvPlugin keyval.KvProtoPlugin // inject
}
+// Name implements PluginNamed
+func (p *Plugin) Name() string {
+ return p.PluginName.String()
+}
+
type infraDeps interface {
// InfraDeps for getting PlugginInfraDeps instance (logger, config, plugin name, statuscheck)
InfraDeps(pluginName string, opts ...local.InfraDepsOpts) *local.PluginInfraDeps
|
Implement Name for kvdbsync
|
diff --git a/js/conversation_controller.js b/js/conversation_controller.js
index <HASH>..<HASH> 100644
--- a/js/conversation_controller.js
+++ b/js/conversation_controller.js
@@ -62,6 +62,9 @@
storage.put("unreadCount", newUnreadCount);
setUnreadCount(newUnreadCount);
+ if (newUnreadCount === 0) {
+ window.clearAttention();
+ }
}
}))();
diff --git a/js/panel_controller.js b/js/panel_controller.js
index <HASH>..<HASH> 100644
--- a/js/panel_controller.js
+++ b/js/panel_controller.js
@@ -22,6 +22,9 @@
extension.windows.drawAttention(inboxWindowId);
}
};
+ window.clearAttention = function() {
+ extension.windows.clearAttention(inboxWindowId);
+ };
/* Inbox window controller */
var inboxFocused = false;
@@ -58,7 +61,7 @@
});
appWindow.contentWindow.addEventListener('focus', function() {
inboxFocused = true;
- extension.windows.clearAttention(inboxWindowId);
+ clearAttention();
});
// close the inbox if background.html is refreshed
|
Clear window attention if all messages are marked read
Fixes #<I>
// FREEBIE
|
diff --git a/lib/tenacity/orm_ext/mongoid.rb b/lib/tenacity/orm_ext/mongoid.rb
index <HASH>..<HASH> 100644
--- a/lib/tenacity/orm_ext/mongoid.rb
+++ b/lib/tenacity/orm_ext/mongoid.rb
@@ -63,15 +63,15 @@ module Tenacity
end
def _t_find_first_by_associate(property, id)
- find(:first, :conditions => { property => _t_serialize(id) })
+ first(:conditions => { property => _t_serialize(id) })
end
def _t_find_all_by_associate(property, id)
- find(:all, :conditions => { property => _t_serialize(id) })
+ all(:conditions => { property => _t_serialize(id) })
end
def _t_find_all_ids_by_associate(property, id)
- results = collection.find({property => _t_serialize(id)}, {:fields => 'id'}).to_a
+ results = collection.find(property => _t_serialize(id))
results.map { |r| r['_id'] }
end
|
Support for Moped in Mongoid 3
|
diff --git a/src/main/java/net/fortuna/ical4j/util/ResourceLoader.java b/src/main/java/net/fortuna/ical4j/util/ResourceLoader.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/fortuna/ical4j/util/ResourceLoader.java
+++ b/src/main/java/net/fortuna/ical4j/util/ResourceLoader.java
@@ -54,7 +54,9 @@ public class ResourceLoader {
public static URL getResource(String name) {
URL resource = null;
try {
- resource = Thread.currentThread().getContextClassLoader().getResource(name);
+ if (Thread.currentThread().getContextClassLoader() != null) {
+ resource = Thread.currentThread().getContextClassLoader().getResource(name);
+ }
} catch (SecurityException e) {
LOG.info("Unable to access context classloader, using default. " + e.getMessage());
}
|
Added null checking to avoid potential null pointer exception on some samsung devices
|
diff --git a/src/Database/Driver/PDODriverTrait.php b/src/Database/Driver/PDODriverTrait.php
index <HASH>..<HASH> 100644
--- a/src/Database/Driver/PDODriverTrait.php
+++ b/src/Database/Driver/PDODriverTrait.php
@@ -93,6 +93,9 @@ trait PDODriverTrait {
*/
public function beginTransaction() {
$this->connect();
+ if ($this->_connection->inTransaction()) {
+ return true;
+ }
return $this->_connection->beginTransaction();
}
@@ -103,6 +106,9 @@ trait PDODriverTrait {
*/
public function commitTransaction() {
$this->connect();
+ if (!$this->_connection->inTransaction()) {
+ return false;
+ }
return $this->_connection->commit();
}
@@ -112,6 +118,9 @@ trait PDODriverTrait {
* @return boolean true on success, false otherwise
*/
public function rollbackTransaction() {
+ if (!$this->_connection->inTransaction()) {
+ return false;
+ }
return $this->_connection->rollback();
}
|
Bringing back some old code removed for hhvm, we do need it
|
diff --git a/bin/sdk/gutenberg.js b/bin/sdk/gutenberg.js
index <HASH>..<HASH> 100644
--- a/bin/sdk/gutenberg.js
+++ b/bin/sdk/gutenberg.js
@@ -4,8 +4,9 @@
* External dependencies
*/
const fs = require( 'fs' );
-const path = require( 'path' );
const GenerateJsonFile = require( 'generate-json-file-webpack-plugin' );
+const path = require( 'path' );
+const { compact } = require( 'lodash' );
const DIRECTORY_DEPTH = '../../'; // Relative path of the extensions to preset directory
@@ -84,7 +85,7 @@ exports.config = ( { argv: { inputDir, outputDir }, getBaseConfig } ) => {
return {
...baseConfig,
- plugins: [
+ plugins: compact( [
...baseConfig.plugins,
fs.existsSync( presetPath ) &&
new GenerateJsonFile( {
@@ -94,10 +95,10 @@ exports.config = ( { argv: { inputDir, outputDir }, getBaseConfig } ) => {
betaBlocks: presetBetaBlocks,
},
} ),
- ],
+ ] ),
entry: {
editor: editorScript,
- 'editor-beta': editorBetaScript,
+ ...( editorBetaScript && { 'editor-beta': editorBetaScript } ),
...viewScriptEntry,
...viewBlocksScripts,
},
|
SDK: Fix build failures without index json files (#<I>)
* Fix broken false plugins
* Entry scripts cannot be undefined
* Alphabetize requires
|
diff --git a/utils_test.go b/utils_test.go
index <HASH>..<HASH> 100644
--- a/utils_test.go
+++ b/utils_test.go
@@ -5,6 +5,8 @@
package gin
import (
+ "bytes"
+ "encoding/xml"
"fmt"
"net/http"
"testing"
@@ -124,3 +126,14 @@ func TestBindMiddleware(t *testing.T) {
Bind(&bindTestStruct{})
})
}
+
+func TestMarshalXMLforH(t *testing.T) {
+ h := H{
+ "": "test",
+ }
+ var b bytes.Buffer
+ enc := xml.NewEncoder(&b)
+ var x xml.StartElement
+ e := h.MarshalXML(enc, x)
+ assert.Error(t, e)
+}
|
improve utils code coverage (#<I>)
|
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -344,9 +344,9 @@ module.exports = function (createFn) {
})
})
- it('200 GET Customers/?bogus=field should ignore unknown parameters', function (done) {
+ it('200 GET Customers?foo=bar should ignore unknown parameters', function (done) {
request.get({
- url: util.format('%s/api/v1/Customers/?foo=bar', testUrl),
+ url: util.format('%s/api/v1/Customers?foo=bar', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
|
chore(tests): remove trailing slash
- This was testing for trailing slash instead of unknown parameter
|
diff --git a/lib/audited/auditor.rb b/lib/audited/auditor.rb
index <HASH>..<HASH> 100644
--- a/lib/audited/auditor.rb
+++ b/lib/audited/auditor.rb
@@ -70,8 +70,8 @@ module Audited
# to notify a party after the audit has been created or if you want to access the newly-created
# audit.
define_callbacks :audit
- set_callback :audit, :after, :after_audit, if: lambda { self.respond_to?(:after_audit) }
- set_callback :audit, :around, :around_audit, if: lambda { self.respond_to?(:around_audit) }
+ set_callback :audit, :after, :after_audit, if: lambda { self.respond_to?(:after_audit, true) }
+ set_callback :audit, :around, :around_audit, if: lambda { self.respond_to?(:around_audit, true) }
attr_accessor :version
diff --git a/spec/support/active_record/models.rb b/spec/support/active_record/models.rb
index <HASH>..<HASH> 100644
--- a/spec/support/active_record/models.rb
+++ b/spec/support/active_record/models.rb
@@ -40,6 +40,8 @@ module Models
audited
attr_accessor :bogus_attr, :around_attr
+ private
+
def after_audit
self.bogus_attr = "do something"
end
|
Allow private / protected callback declarations
Prior to this change, users would have to declare publicly scoped
callback handlers.
|
diff --git a/lib/tire/model/import.rb b/lib/tire/model/import.rb
index <HASH>..<HASH> 100644
--- a/lib/tire/model/import.rb
+++ b/lib/tire/model/import.rb
@@ -1,6 +1,13 @@
module Tire
module Model
+ # Provides support for easy importing of large ActiveRecord- and ActiveModel-bound
+ # recordsets into model index.
+ #
+ # Relies on pagination support in your model, namely the `paginate` class method.
+ #
+ # Please refer to the relevant of the README for more information.
+ #
module Import
module ClassMethods
|
[DOC] Added basic information about Tire::Model::Import module
|
diff --git a/master/buildbot/steps/gitdiffinfo.py b/master/buildbot/steps/gitdiffinfo.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/steps/gitdiffinfo.py
+++ b/master/buildbot/steps/gitdiffinfo.py
@@ -72,7 +72,7 @@ class GitDiffInfo(buildstep.ShellMixin, buildstep.BuildStep):
yield self.runCommand(cmd)
log = yield self.getLog("stdio-merge-base")
- log.finish()
+ yield log.finish()
if cmd.results() != results.SUCCESS:
return cmd.results()
|
steps: Fix unyielded log.finish() in GitDiffInfo step
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
+# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,11 +15,19 @@
# limitations under the License.
import os
+import sys
from setuptools import find_packages
from setuptools import setup
-long_description = 'Ryu is an open-sourced network operating system licensed under Apache License v2. Ryu aims to provide logically centralized control and well defined API that makes it easy for cloud operators to implement network management applications on top of the Ryu. Currently, Ryu supports OpenFlow protocol to control the network devices.'
+doing_bdist = any(arg.startswith('bdist') for arg in sys.argv[1:])
+
+long_description = open('README.rst').read() + '\n\n'
+
+if doing_bdist:
+ start = long_description.find('=\n') + 2
+ long_description = long_description[
+ start:long_description.find('\n\n\n', start)]
classifiers = [
'License :: OSI Approved :: Apache Software License',
|
Update setup.py
Use 'What's Ryu' section for RPM package description. Otherwise, we
use README.rst for long_description so that we have a nice PyPI
website.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.