ipfs 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3bff5c28eaec19587d278aaf451629dd80dc5d7
4
- data.tar.gz: 1a3b6cdfb9d4120f328e47133b1fd02b519b8c93
3
+ metadata.gz: 69aa1d54ba5bb91e6a22401083d53b8d04908b42
4
+ data.tar.gz: c31d8f77f7ad335e4fbd24eaf98d576f07951b49
5
5
  SHA512:
6
- metadata.gz: 4c7592748c4105d12b8fc18dbbc3d6f99b3c172bd649cf5bb8122253803f732d2a507a9b6886ee24b8701b63686e70a4d2f2719273b14d1f2cd0aa3ef4ed714c
7
- data.tar.gz: 94ad3dfd9354c1bc960925ce5a951c78b340798ac9ec5e13d579e96b076ef73a5d48b14e79c77d4419f9f86171749cad39f09effe38e94c10ceeeecab5f860c2
6
+ metadata.gz: 447a358ab84de2bb2f33112a5d1576e047968cc446789c6861c66fd1192a2dc9b45bf0a305edf35aad740f39070a26fff7c71599ffbf5e0f76595243116f2cd0
7
+ data.tar.gz: 76592d96da61e8ca99535937e99d183965c504ef0a1f98e8d247df25718199d522ada5b766179ec1d22531827df87c3aa2003ce407d317967c77d3e844d4c908
data/README.md CHANGED
@@ -6,8 +6,6 @@ Work in progress.
6
6
  ## Installation
7
7
  Requires Ruby >= 2.1, since it uses the new required keyword arguments syntax.
8
8
 
9
- (The following doesn't work yet, the gem is not yet released on Rubygems. In the meantime, run ```rake install``` from the project root.)
10
-
11
9
  Add this line to your application's Gemfile:
12
10
 
13
11
  ```ruby
@@ -57,6 +55,12 @@ nodes.each do |node|
57
55
  end
58
56
  ```
59
57
 
58
+ ### cat
59
+ ```ruby
60
+ client.cat 'QmaVwjMgqjBD25apiuVVnaDqU8SsiiREAAy3Amb1Bs2XHs'
61
+ # => "This is some example content."
62
+ ```
63
+
60
64
  ## Development
61
65
 
62
66
  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.
@@ -1,4 +1,5 @@
1
1
  require 'ipfs/commands/ls'
2
+ require 'ipfs/commands/cat'
2
3
 
3
4
  module IPFS
4
5
  class Client
@@ -23,5 +24,9 @@ module IPFS
23
24
  def ls(node)
24
25
  Commands::LS.call self, node
25
26
  end
27
+
28
+ def cat(node)
29
+ Commands::Cat.call self, node
30
+ end
26
31
  end
27
32
  end
@@ -0,0 +1,11 @@
1
+ require 'http'
2
+
3
+ module IPFS
4
+ module Commands
5
+ class Cat
6
+ def self.call(client, node)
7
+ HTTP.get("#{client.api_url}/cat?arg=#{node}&stream-channels=true").to_s
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module IPFS
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierpaolo Frasa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -127,6 +127,7 @@ files:
127
127
  - ipfs.gemspec
128
128
  - lib/ipfs.rb
129
129
  - lib/ipfs/client.rb
130
+ - lib/ipfs/commands/cat.rb
130
131
  - lib/ipfs/commands/ls.rb
131
132
  - lib/ipfs/content/link.rb
132
133
  - lib/ipfs/content/node.rb
@@ -151,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
152
  version: '0'
152
153
  requirements: []
153
154
  rubyforge_project:
154
- rubygems_version: 2.4.8
155
+ rubygems_version: 2.4.5.1
155
156
  signing_key:
156
157
  specification_version: 4
157
158
  summary: IPFS API bindings