rundoc 1.1.0 → 1.1.1
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
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 0e767697a50da725490c5a2af1dd2a8ef894c9fa79e8260230ec2a41000ffefa
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b682ac2f59204b1a62edd00f46817c27a63c58a95c87fd312803d42a6dd7b668
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: cee0548716aa1cd4bb14f1eb21541dc010f5d8c706de49240b9e3245d847fbdfc08c34858a5ba7755d45d091671f3c712bd02a4d91e561927cae3b114780fd7f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: aa340da522f964e0daeb3e7fd3b03bb340ecbe062a18c456474f00392ce660d0f28afdf427c99812013d4765b362e1bc11d1585330c8653118d1b8d0edd97d76
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -48,9 +48,9 @@ class Rundoc::CodeCommand::Background 
     | 
|
| 
       48 
48 
     | 
    
         
             
                def initialize(command , timeout: 5, log: Tempfile.new("log"), out: "2>&1")
         
     | 
| 
       49 
49 
     | 
    
         
             
                  @command = command
         
     | 
| 
       50 
50 
     | 
    
         
             
                  @timeout_value = timeout
         
     | 
| 
       51 
     | 
    
         
            -
                  @ 
     | 
| 
      
 51 
     | 
    
         
            +
                  @log_reference = log # https://twitter.com/schneems/status/1285289971083907075
         
     | 
| 
       52 
52 
     | 
    
         | 
| 
       53 
     | 
    
         
            -
                  @log = Pathname.new( 
     | 
| 
      
 53 
     | 
    
         
            +
                  @log = Pathname.new(log)
         
     | 
| 
       54 
54 
     | 
    
         
             
                  @log.dirname.mkpath
         
     | 
| 
       55 
55 
     | 
    
         
             
                  FileUtils.touch(@log)
         
     | 
| 
       56 
56 
     | 
    
         | 
    
        data/lib/rundoc/version.rb
    CHANGED
    
    
| 
         @@ -1,6 +1,32 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class BackgroundTest < Minitest::Test
         
     | 
| 
      
 4 
     | 
    
         
            +
              def test_process_spawn_gc
         
     | 
| 
      
 5 
     | 
    
         
            +
                Dir.mktmpdir do |dir|
         
     | 
| 
      
 6 
     | 
    
         
            +
                  Dir.chdir(dir) do
         
     | 
| 
      
 7 
     | 
    
         
            +
                    file = "foo.txt"
         
     | 
| 
      
 8 
     | 
    
         
            +
                    `echo 'foo' >> #{file}`
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                    background_start = Rundoc::CodeCommand::Background::Start.new("tail -f #{file}",
         
     | 
| 
      
 11 
     | 
    
         
            +
                      name: "tail2",
         
     | 
| 
      
 12 
     | 
    
         
            +
                      wait: "f"
         
     | 
| 
      
 13 
     | 
    
         
            +
                    )
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                    GC.start
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                    output = background_start.call
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                    assert_match("foo", output)
         
     | 
| 
      
 20 
     | 
    
         
            +
                    assert_equal(true, background_start.alive?)
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                    background_stop = Rundoc::CodeCommand::Background::Stop.new(name: "tail2")
         
     | 
| 
      
 23 
     | 
    
         
            +
                    background_stop.call
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                    assert_equal(false, background_start.alive?)
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
                end
         
     | 
| 
      
 28 
     | 
    
         
            +
              end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
       4 
30 
     | 
    
         
             
              def test_background_start
         
     | 
| 
       5 
31 
     | 
    
         
             
                Dir.mktmpdir do |dir|
         
     | 
| 
       6 
32 
     | 
    
         
             
                  Dir.chdir(dir) do
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rundoc
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Richard Schneeman
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2020- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-07-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: thor
         
     |