Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 9086663

Browse files
Merge pull request #262 from ipfs/greenkeeper-aegir-3.0.1
Update aegir and ipfsd-ctl
2 parents c05d8f2 + d7aadff commit 9086663

File tree

5 files changed

+30
-38
lines changed

5 files changed

+30
-38
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
},
2525
"devDependencies": {
2626
"chai": "^3.5.0",
27-
"aegir": "^2.1.1",
27+
"aegir": "^3.0.1",
2828
"gulp": "^3.9.1",
29-
"ipfsd-ctl": "^0.11.0",
29+
"ipfsd-ctl": "^0.13.0",
3030
"pre-commit": "^1.1.2",
3131
"raw-loader": "^0.5.1",
3232
"stream-equal": "^0.1.8",

src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ const loadCommands = require('./load-commands')
66
const getConfig = require('./config')
77
const getRequestAPI = require('./request-api')
88

9-
function IpfsAPI (host_or_multiaddr, port, opts) {
9+
function IpfsAPI (hostOrMultiaddr, port, opts) {
1010
const config = getConfig()
1111

1212
try {
13-
const maddr = multiaddr(host_or_multiaddr).nodeAddress()
13+
const maddr = multiaddr(hostOrMultiaddr).nodeAddress()
1414
config.host = maddr.address
1515
config.port = maddr.port
1616
} catch (e) {
17-
if (typeof host_or_multiaddr === 'string') {
18-
config.host = host_or_multiaddr
17+
if (typeof hostOrMultiaddr === 'string') {
18+
config.host = hostOrMultiaddr
1919
config.port = port && typeof port !== 'object' ? port : config.port
2020
}
2121
}

test/api/config.spec.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe('.config', () => {
1212
const confKey = 'arbitraryKey'
1313
const confVal = 'arbitraryVal'
1414

15-
apiClients['a'].config.set(confKey, confVal, (err, res) => {
15+
apiClients.a.config.set(confKey, confVal, (err, res) => {
1616
expect(err).to.not.exist
17-
apiClients['a'].config.get(confKey, (err, res) => {
17+
apiClients.a.config.get(confKey, (err, res) => {
1818
expect(err).to.not.exist
1919
expect(res).to.have.a.property('Value', confVal)
2020
done()
@@ -26,9 +26,9 @@ describe('.config', () => {
2626
const confKey = 'otherKey'
2727
const confVal = true
2828

29-
apiClients['a'].config.set(confKey, confVal, (err, res) => {
29+
apiClients.a.config.set(confKey, confVal, (err, res) => {
3030
expect(err).to.not.exist
31-
apiClients['a'].config.get(confKey, (err, res) => {
31+
apiClients.a.config.get(confKey, (err, res) => {
3232
expect(err).to.not.exist
3333
expect(res.Value).to.deep.equal(confVal)
3434
done()
@@ -40,9 +40,9 @@ describe('.config', () => {
4040
const confKey = 'API.HTTPHeaders.Access-Control-Allow-Origin'
4141
const confVal = ['http://example.io']
4242

43-
apiClients['a'].config.set(confKey, confVal, (err, res) => {
43+
apiClients.a.config.set(confKey, confVal, (err, res) => {
4444
expect(err).to.not.exist
45-
apiClients['a'].config.get(confKey, (err, res) => {
45+
apiClients.a.config.get(confKey, (err, res) => {
4646
expect(err).to.not.exist
4747
expect(res.Value).to.deep.equal(confVal)
4848
done()
@@ -77,9 +77,9 @@ describe('.config', () => {
7777
const confKey = 'arbitraryKey'
7878
const confVal = 'arbitraryVal'
7979

80-
return apiClients['a'].config.set(confKey, confVal)
80+
return apiClients.a.config.set(confKey, confVal)
8181
.then((res) => {
82-
return apiClients['a'].config.get(confKey)
82+
return apiClients.a.config.get(confKey)
8383
})
8484
.then((res) => {
8585
expect(res).to.have.a.property('Value', confVal)
@@ -90,9 +90,9 @@ describe('.config', () => {
9090
const confKey = 'otherKey'
9191
const confVal = true
9292

93-
return apiClients['a'].config.set(confKey, confVal)
93+
return apiClients.a.config.set(confKey, confVal)
9494
.then((res) => {
95-
return apiClients['a'].config.get(confKey)
95+
return apiClients.a.config.get(confKey)
9696
})
9797
.then((res) => {
9898
expect(res.Value).to.deep.equal(confVal)
@@ -103,9 +103,9 @@ describe('.config', () => {
103103
const confKey = 'API.HTTPHeaders.Access-Control-Allow-Origin'
104104
const confVal = ['http://example.com']
105105

106-
return apiClients['a'].config.set(confKey, confVal)
106+
return apiClients.a.config.set(confKey, confVal)
107107
.then((res) => {
108-
return apiClients['a'].config.get(confKey)
108+
return apiClients.a.config.get(confKey)
109109
})
110110
.then((res) => {
111111
expect(res.Value).to.deep.equal(confVal)

test/api/object.spec.js

+8-16
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ describe('.object', () => {
6767
expect(err).to.not.exist
6868

6969
expect(res).to.be.eql({
70-
Hash: 'QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD',
71-
Links: []
70+
Hash: 'QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD'
7271
})
7372
done()
7473
})
@@ -87,8 +86,7 @@ describe('.object', () => {
8786
.addLink(testObjectHash, 'next', testPatchObjectHash, (err, res) => {
8887
expect(err).to.not.exist
8988
expect(res).to.be.eql({
90-
Hash: 'QmZFdJ3CQsY4kkyQtjoUo8oAzsEs5BNguxBhp8sjQMpgkd',
91-
Links: null
89+
Hash: 'QmZFdJ3CQsY4kkyQtjoUo8oAzsEs5BNguxBhp8sjQMpgkd'
9290
})
9391
apiClients.a.object.get(res.Hash, (err, res) => {
9492
expect(err).to.not.exist
@@ -110,8 +108,7 @@ describe('.object', () => {
110108
.rmLink('QmZFdJ3CQsY4kkyQtjoUo8oAzsEs5BNguxBhp8sjQMpgkd', 'next', (err, res) => {
111109
expect(err).to.not.exist
112110
expect(res).to.be.eql({
113-
Hash: testObjectHash,
114-
Links: null
111+
Hash: testObjectHash
115112
})
116113
apiClients.a.object.get(res.Hash, (err, res) => {
117114
expect(err).to.not.exist
@@ -129,8 +126,7 @@ describe('.object', () => {
129126
.appendData(testObjectHash, new Buffer(' hello'), (err, res) => {
130127
expect(err).to.not.exist
131128
expect(res).to.be.eql({
132-
Hash: 'Qmcjhr2QztQxCAoEf8tJPTGTVkTsUrTQ36JurH14DNYNsc',
133-
Links: null
129+
Hash: 'Qmcjhr2QztQxCAoEf8tJPTGTVkTsUrTQ36JurH14DNYNsc'
134130
})
135131
apiClients.a.object.get(res.Hash, (err, res) => {
136132
expect(err).to.not.exist
@@ -147,8 +143,7 @@ describe('.object', () => {
147143
.setData(testObjectHash, new Buffer('hello world'), (err, res) => {
148144
expect(err).to.not.exist
149145
expect(res).to.be.eql({
150-
Hash: 'QmU1Sq1B7RPQD2XcQNLB58qJUyJffVJqihcxmmN1STPMxf',
151-
Links: null
146+
Hash: 'QmU1Sq1B7RPQD2XcQNLB58qJUyJffVJqihcxmmN1STPMxf'
152147
})
153148
apiClients.a.object.get(res.Hash, (err, res) => {
154149
expect(err).to.not.exist
@@ -166,8 +161,7 @@ describe('.object', () => {
166161
apiClients.a.object.new('unixfs-dir', (err, res) => {
167162
expect(err).to.not.exist
168163
expect(res).to.deep.equal({
169-
Hash: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn',
170-
Links: null
164+
Hash: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'
171165
})
172166
done()
173167
})
@@ -226,8 +220,7 @@ describe('.object', () => {
226220
return apiClients.a.object.links(testObjectHash)
227221
.then((res) => {
228222
expect(res).to.be.eql({
229-
Hash: 'QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD',
230-
Links: []
223+
Hash: 'QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD'
231224
})
232225
})
233226
})
@@ -236,8 +229,7 @@ describe('.object', () => {
236229
return apiClients.a.object.new('unixfs-dir')
237230
.then((res) => {
238231
expect(res).to.deep.equal({
239-
Hash: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn',
240-
Links: null
232+
Hash: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'
241233
})
242234
})
243235
})

test/api/swarm.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('.swarm', () => {
2525
})
2626

2727
it('.swarm.addrs', (done) => {
28-
apiClients['a'].swarm.addrs((err, res) => {
28+
apiClients.a.swarm.addrs((err, res) => {
2929
expect(err).to.not.exist
3030

3131
expect(Object.keys(res.Addrs)).to.have.length.above(1)
@@ -34,7 +34,7 @@ describe('.swarm', () => {
3434
})
3535

3636
it('.swarm.localAddrs', (done) => {
37-
apiClients['a'].swarm.localAddrs((err, res) => {
37+
apiClients.a.swarm.localAddrs((err, res) => {
3838
expect(err).to.not.exist
3939

4040
expect(res.Strings).to.have.length.above(1)
@@ -51,14 +51,14 @@ describe('.swarm', () => {
5151
})
5252

5353
it('.swarm.addrs', () => {
54-
return apiClients['a'].swarm.addrs()
54+
return apiClients.a.swarm.addrs()
5555
.then((res) => {
5656
expect(Object.keys(res.Addrs)).to.have.length.above(1)
5757
})
5858
})
5959

6060
it('.swarm.localAddrs', () => {
61-
return apiClients['a'].swarm.localAddrs()
61+
return apiClients.a.swarm.localAddrs()
6262
.then((res) => {
6363
expect(res.Strings).to.have.length.above(1)
6464
})

0 commit comments

Comments
 (0)