drb_fileclient 0.1.2 → 0.2.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/drb_fileclient.rb +41 -16
- metadata +4 -3
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2acd6009e3a7703f659abb25bfa4ec482669bede
         | 
| 4 | 
            +
              data.tar.gz: 58e4aa65be961f907f19c8ba5bcf9476b0351bce
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 01dd234914af6e493790eeb66787fbcca94278cd27bf0a4942bf8f5619c99ae7d345122adbf1b909fccb1b8082d93288e4cbe3215c71340f807b207102b70ebd
         | 
| 7 | 
            +
              data.tar.gz: 03aaf68ad10862a095409a1080f44e3c35d85897cd25c816c58d90de7a8c2d9ccbe3598ed6302bdbb3265c8a22d441fa4186b269bb74d502d5d6cffde2dfc72e
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/lib/drb_fileclient.rb
    CHANGED
    
    | @@ -24,9 +24,32 @@ class DRbFileClient | |
| 24 24 |  | 
| 25 25 | 
             
              end
         | 
| 26 26 |  | 
| 27 | 
            -
              def exists?(filename=@filename)
         | 
| 27 | 
            +
              def exists?(filename=@filename)  
         | 
| 28 | 
            +
                
         | 
| 29 | 
            +
                filename2 = parse_path(filename)
         | 
| 30 | 
            +
                @file.exists? filename2
         | 
| 31 | 
            +
                
         | 
| 32 | 
            +
              end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
              def read(filename=@filename)
         | 
| 35 | 
            +
                
         | 
| 36 | 
            +
                filename2 = parse_path(filename)
         | 
| 37 | 
            +
                @file.read filename2
         | 
| 38 | 
            +
                
         | 
| 39 | 
            +
              end
         | 
| 28 40 |  | 
| 29 | 
            -
             | 
| 41 | 
            +
              def write(filename=@filename, s)
         | 
| 42 | 
            +
                
         | 
| 43 | 
            +
                filename2 = parse_path(filename)
         | 
| 44 | 
            +
                @file.write filename2, s
         | 
| 45 | 
            +
                
         | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              private
         | 
| 49 | 
            +
              
         | 
| 50 | 
            +
              def parse_path(filename)
         | 
| 51 | 
            +
                
         | 
| 52 | 
            +
                if @file then
         | 
| 30 53 |  | 
| 31 54 | 
             
                  filename
         | 
| 32 55 |  | 
| @@ -38,22 +61,24 @@ class DRbFileClient | |
| 38 61 | 
             
                  @file = DRbObject.new nil, "druby://#{host}:#{port}"
         | 
| 39 62 | 
             
                  filename[/(?<=^dfs:\/\/)[^\/]+\/(.*)/,1]      
         | 
| 40 63 |  | 
| 41 | 
            -
                end
         | 
| 42 | 
            -
                
         | 
| 43 | 
            -
                @file.exists? filename2
         | 
| 64 | 
            +
                end    
         | 
| 44 65 |  | 
| 45 66 | 
             
              end
         | 
| 46 67 |  | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 49 | 
            -
             | 
| 50 | 
            -
             | 
| 68 | 
            +
            end 
         | 
| 69 | 
            +
             | 
| 70 | 
            +
            class DfsFile
         | 
| 71 | 
            +
              
         | 
| 72 | 
            +
              def self.exists?(filename)
         | 
| 73 | 
            +
                DRbFileClient.new(filename).exists?
         | 
| 51 74 | 
             
              end
         | 
| 52 75 |  | 
| 53 | 
            -
              def  | 
| 54 | 
            -
                
         | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
               | 
| 58 | 
            -
             | 
| 59 | 
            -
            end | 
| 76 | 
            +
              def self.read(filename)
         | 
| 77 | 
            +
                DRbFileClient.new.read(filename)
         | 
| 78 | 
            +
              end
         | 
| 79 | 
            +
              
         | 
| 80 | 
            +
              def self.write(filename, s)
         | 
| 81 | 
            +
                DRbFileClient.new.write(filename, s)
         | 
| 82 | 
            +
              end
         | 
| 83 | 
            +
              
         | 
| 84 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: drb_fileclient
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - James Robertson
         | 
| @@ -30,7 +30,7 @@ cert_chain: | |
| 30 30 | 
             
              2aIZ9lf6/AT4LP07t9jB5oYLHlr2nBLIqtPXdJvg5RKKr79CQVmpJ5LCTjwTg9h+
         | 
| 31 31 | 
             
              g1Q=
         | 
| 32 32 | 
             
              -----END CERTIFICATE-----
         | 
| 33 | 
            -
            date: 2018-05- | 
| 33 | 
            +
            date: 2018-05-26 00:00:00.000000000 Z
         | 
| 34 34 | 
             
            dependencies: []
         | 
| 35 35 | 
             
            description: 
         | 
| 36 36 | 
             
            email: james@jamesrobertson.eu
         | 
| @@ -62,5 +62,6 @@ rubyforge_project: | |
| 62 62 | 
             
            rubygems_version: 2.6.13
         | 
| 63 63 | 
             
            signing_key: 
         | 
| 64 64 | 
             
            specification_version: 4
         | 
| 65 | 
            -
            summary: Reads or writes files from a remote DRb server.
         | 
| 65 | 
            +
            summary: Reads or writes files from a remote DRb server. Simple as DfsFile.read  or
         | 
| 66 | 
            +
              DfsFile.write.
         | 
| 66 67 | 
             
            test_files: []
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file |