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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f50808872b27d1fd6fca92c3e3e729c291b975e8
4
- data.tar.gz: 354aa620a6e16020014d521a027b12ac028512cd
3
+ metadata.gz: a4a87f48e4c76f8bdfc5577272025276239ae208
4
+ data.tar.gz: c8ad1c97d15f4b84898fe6d2bd9dcf01c2aedd1d
5
5
  SHA512:
6
- metadata.gz: 57db6ea24b3106ae1cb5c9f0f838bd2ba160ca49948443dfb09d880019eb249474780d06855c39e2bf867c4cf380de6cab675304bdaa284a92c357610333bb2c
7
- data.tar.gz: a8fc16826a356dc650d601f800a087595272f2d60669c86b6fca814be346125095ab049bb6ab10ce51d49473c6455b55c124960e27026f493844814cbf42b737
6
+ metadata.gz: 6b88d42ba4c7dd899eea336823fac460fbb227d50d1ec10d8b156c254c5d2487889caf1f479202d89c84ae023101a364a8a5ac821e0477ac784faee6f9cb24e1
7
+ data.tar.gz: 72a4a6df5c5097a3d681276d9580ff7e7eab49455eb62e22ebc382bd6d753d53041358c22c58f3750b212ebeb178a7ec3a311c1d1e27833bbcbf3065702b29bc
@@ -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::ReadFile.new(bucket_name, path).call
25
+ Remote::ReadFileBody.new(bucket_name, path).call
22
26
  end
23
27
 
24
28
  def self.head(bucket_name, path)
@@ -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/read_file'
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 ReadFile
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.body
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
@@ -1,3 +1,3 @@
1
1
  module Pansophy
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
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.3.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-01 00:00:00.000000000 Z
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/read_file.rb
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