ipfs 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +6 -0
- data/lib/ipfs/client.rb +5 -0
- data/lib/ipfs/commands/pin_rm.rb +15 -0
- data/lib/ipfs/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b627cffcb5c7f4cd191b75694bdb8562edb2d0a
|
4
|
+
data.tar.gz: 850e634f1bad6014d20f1c66a72c6053283c0d16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab8cb99336c4bafa0d267e508f83657aeaf84cecf89bef9e639fed091be613e3520e6cf3b8b3de3976eb661c1f5eadb751b6616010aa2ec5c5d50ef754996c8c
|
7
|
+
data.tar.gz: eac6418ae148eacdfc595273666d1d885db1e3477c958b1e0ebb3120e5ef713e851ecfec4c6cf55b6e7ca5c2979e614f2caa5526acab57f0c0bd7e24fdab4d50
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -71,6 +71,12 @@ client.cat 'QmaVwjMgqjBD25apiuVVnaDqU8SsiiREAAy3Amb1Bs2XHs'
|
|
71
71
|
# => "This is some example content."
|
72
72
|
```
|
73
73
|
|
74
|
+
### pin rm
|
75
|
+
```ruby
|
76
|
+
client.pin_rm 'QmaVwjMgqjBD25apiuVVnaDqU8SsiiREAAy3Amb1Bs2XHs', recursive: true
|
77
|
+
# => HTTP::Response
|
78
|
+
```
|
79
|
+
|
74
80
|
## Development
|
75
81
|
|
76
82
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/ipfs/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'ipfs/commands/ls'
|
2
2
|
require 'ipfs/commands/cat'
|
3
3
|
require 'ipfs/commands/add'
|
4
|
+
require 'ipfs/commands/pin_rm'
|
4
5
|
|
5
6
|
module IPFS
|
6
7
|
class Client
|
@@ -34,5 +35,9 @@ module IPFS
|
|
34
35
|
def add(file)
|
35
36
|
Commands::Add.call self, file
|
36
37
|
end
|
38
|
+
|
39
|
+
def pin_rm(node, recursive: true)
|
40
|
+
Commands::PinRm.call self, node, recursive: recursive
|
41
|
+
end
|
37
42
|
end
|
38
43
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'http'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module IPFS
|
7
|
+
module Commands
|
8
|
+
class PinRm
|
9
|
+
# @return [HTTP::Response]
|
10
|
+
def self.call(client, node, recursive:)
|
11
|
+
HTTP.get "#{client.api_url}/pin/rm?arg=#{node}&recursive=#{recursive}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/ipfs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierpaolo Frasa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- lib/ipfs/commands/add.rb
|
131
131
|
- lib/ipfs/commands/cat.rb
|
132
132
|
- lib/ipfs/commands/ls.rb
|
133
|
+
- lib/ipfs/commands/pin_rm.rb
|
133
134
|
- lib/ipfs/content/link.rb
|
134
135
|
- lib/ipfs/content/node.rb
|
135
136
|
- lib/ipfs/version.rb
|