pansophy 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pansophy.rb +5 -1
- data/lib/pansophy/remote.rb +2 -1
- data/lib/pansophy/remote/{read_file.rb → fetch_file.rb} +2 -2
- data/lib/pansophy/remote/read_file_body.rb +23 -0
- data/lib/pansophy/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4a87f48e4c76f8bdfc5577272025276239ae208
|
4
|
+
data.tar.gz: c8ad1c97d15f4b84898fe6d2bd9dcf01c2aedd1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b88d42ba4c7dd899eea336823fac460fbb227d50d1ec10d8b156c254c5d2487889caf1f479202d89c84ae023101a364a8a5ac821e0477ac784faee6f9cb24e1
|
7
|
+
data.tar.gz: 72a4a6df5c5097a3d681276d9580ff7e7eab49455eb62e22ebc382bd6d753d53041358c22c58f3750b212ebeb178a7ec3a311c1d1e27833bbcbf3065702b29bc
|
data/lib/pansophy.rb
CHANGED
@@ -17,8 +17,12 @@ module Pansophy
|
|
17
17
|
Synchronizer.new(bucket_name, remote_directory, local_directory).push(options)
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.fetch(bucket_name, path)
|
21
|
+
Remote::FetchFile.new(bucket_name, path).call
|
22
|
+
end
|
23
|
+
|
20
24
|
def self.read(bucket_name, path)
|
21
|
-
Remote::
|
25
|
+
Remote::ReadFileBody.new(bucket_name, path).call
|
22
26
|
end
|
23
27
|
|
24
28
|
def self.head(bucket_name, path)
|
data/lib/pansophy/remote.rb
CHANGED
@@ -2,5 +2,6 @@ require 'pansophy/remote/directory'
|
|
2
2
|
require 'pansophy/remote/create_file'
|
3
3
|
require 'pansophy/remote/file'
|
4
4
|
require 'pansophy/remote/read_directory'
|
5
|
-
require 'pansophy/remote/
|
5
|
+
require 'pansophy/remote/fetch_file'
|
6
|
+
require 'pansophy/remote/read_file_body'
|
6
7
|
require 'pansophy/remote/read_file_head'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Pansophy
|
2
2
|
module Remote
|
3
|
-
class
|
3
|
+
class FetchFile
|
4
4
|
include Adamantium::Flat
|
5
5
|
|
6
6
|
def initialize(bucket, path)
|
@@ -10,7 +10,7 @@ module Pansophy
|
|
10
10
|
|
11
11
|
def call
|
12
12
|
fail ArgumentError, "#{@pathname} does not exist" if file.nil?
|
13
|
-
file
|
13
|
+
file
|
14
14
|
end
|
15
15
|
|
16
16
|
private
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Pansophy
|
2
|
+
module Remote
|
3
|
+
class ReadFileBody
|
4
|
+
include Adamantium::Flat
|
5
|
+
|
6
|
+
def initialize(bucket, path)
|
7
|
+
@bucket = bucket
|
8
|
+
@pathname = Pathname.new(path)
|
9
|
+
end
|
10
|
+
|
11
|
+
def call
|
12
|
+
file.body
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def file
|
18
|
+
FetchFile.new(@bucket, @pathname).call
|
19
|
+
end
|
20
|
+
memoize :file
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/pansophy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pansophy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Berardi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-aws
|
@@ -224,9 +224,10 @@ files:
|
|
224
224
|
- lib/pansophy/remote.rb
|
225
225
|
- lib/pansophy/remote/create_file.rb
|
226
226
|
- lib/pansophy/remote/directory.rb
|
227
|
+
- lib/pansophy/remote/fetch_file.rb
|
227
228
|
- lib/pansophy/remote/file.rb
|
228
229
|
- lib/pansophy/remote/read_directory.rb
|
229
|
-
- lib/pansophy/remote/
|
230
|
+
- lib/pansophy/remote/read_file_body.rb
|
230
231
|
- lib/pansophy/remote/read_file_head.rb
|
231
232
|
- lib/pansophy/synchronizer.rb
|
232
233
|
- lib/pansophy/tasks.rb
|