dshelf 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/dshelf/dir.rb +11 -1
  2. data/lib/dshelf.rb +1 -1
  3. metadata +3 -3
data/lib/dshelf/dir.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  class Dir
2
4
  class << self; include DistributedShelf end
3
5
 
@@ -31,7 +33,15 @@ class Dir
31
33
  end
32
34
 
33
35
  proxy_method(:entries) do |dir|
34
- p "remote entries"
36
+ dir = File.expand_path(dir, Dir.pwd)
37
+ RestClient.get("#{server_url}/dir#{dir}", {:params => {:method => :entries}, :accept => :json}) do |response, request, result|
38
+ case response.code
39
+ when 200
40
+ JSON.parse response
41
+ when 404
42
+ raise Errno::ENOENT
43
+ end
44
+ end
35
45
  end
36
46
 
37
47
  proxy_method(:mkdir) do |dir|
data/lib/dshelf.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module DistributedShelf
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
 
4
4
  @@config = {}
5
5
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Phil Pirozhkov
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-18 00:00:00 +04:00
17
+ date: 2010-10-07 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency