trecs 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
 - data/Gemfile.lock +1 -1
 - data/lib/trecs/readers/yaml_store_reader.rb +2 -1
 - data/lib/trecs/recording_strategies/ttyrec_strategy.rb +3 -3
 - data/lib/trecs/version.rb +1 -1
 - data/pkg/trecs-0.1.0.gem +0 -0
 - data/pkg/trecs-0.1.1.gem +0 -0
 - data/spec/trecs/recording_strategies/raw_file_strategy_spec.rb +4 -4
 - metadata +3 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 83eccd67f68d1a54db2d98b7651d28d5b556bbe6
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 78aa67212bc365a20d630edec08c0dc9d7f93784
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f9d480236bcdb4803e6cdfd990d10459a5d8e3c583f9653c30217dbdc039fc8ff436b6a95e01bbe92cca68e12a348a84566c2f1351a9cef418217cb39417c5ed
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a190df120622377885bc671f967e53e043e01c821e8721fa13b0bed43afaee7b75a436bffdf8c2cf0f4e0eb31fed9d4a6d64f14b322a8ec433d5462c17534477
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'yaml/store'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require "pathname"
         
     | 
| 
       2 
3 
     | 
    
         | 
| 
       3 
4 
     | 
    
         
             
            module TRecs
         
     | 
| 
       4 
5 
     | 
    
         
             
              class YamlStoreReader
         
     | 
| 
         @@ -12,7 +13,7 @@ module TRecs 
     | 
|
| 
       12 
13 
     | 
    
         
             
                  @file = options.fetch(:trecs_file)
         
     | 
| 
       13 
14 
     | 
    
         
             
                  File.open(@file)
         
     | 
| 
       14 
15 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
                  store = YAML::Store.new  
     | 
| 
      
 16 
     | 
    
         
            +
                  store = YAML::Store.new Pathname(@file)
         
     | 
| 
       16 
17 
     | 
    
         
             
                  @frames = store.transaction do
         
     | 
| 
       17 
18 
     | 
    
         
             
                    store["frames"]
         
     | 
| 
       18 
19 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -19,9 +19,9 @@ module TRecs 
     | 
|
| 
       19 
19 
     | 
    
         
             
                    curr_data = @file.read(len)
         
     | 
| 
       20 
20 
     | 
    
         
             
                    @full_output << curr_data
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                     
     | 
| 
       23 
     | 
    
         
            -
                     
     | 
| 
       24 
     | 
    
         
            -
                     
     | 
| 
      
 22 
     | 
    
         
            +
                    data_array  = @full_output.each_line.to_a
         
     | 
| 
      
 23 
     | 
    
         
            +
                    height     = data_array.size > @height ? @height : 0
         
     | 
| 
      
 24 
     | 
    
         
            +
                    frame      = data_array[-height..-1].join
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
                    frame = @prev_frame + curr_data
         
     | 
| 
       27 
27 
     | 
    
         | 
    
        data/lib/trecs/version.rb
    CHANGED
    
    
    
        data/pkg/trecs-0.1.0.gem
    ADDED
    
    | 
         Binary file 
     | 
    
        data/pkg/trecs-0.1.1.gem
    ADDED
    
    | 
         Binary file 
     | 
| 
         @@ -7,7 +7,7 @@ module TRecs 
     | 
|
| 
       7 
7 
     | 
    
         
             
                  context "file" do
         
     | 
| 
       8 
8 
     | 
    
         
             
                    Given(:input_file) { "tmp/input_file.txt" }
         
     | 
| 
       9 
9 
     | 
    
         
             
                    Given { FileUtils.touch(input_file) }
         
     | 
| 
       10 
     | 
    
         
            -
                    When(:strategy) { RawFileStrategy.new( 
     | 
| 
      
 10 
     | 
    
         
            +
                    When(:strategy) { RawFileStrategy.new(input_file: input_file) }
         
     | 
| 
       11 
11 
     | 
    
         
             
                    Then { Pathname(strategy.file).to_s == input_file }
         
     | 
| 
       12 
12 
     | 
    
         
             
                  end
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
         @@ -22,10 +22,10 @@ module TRecs 
     | 
|
| 
       22 
22 
     | 
    
         
             
                    Given { FileUtils.touch(existent) }
         
     | 
| 
       23 
23 
     | 
    
         
             
                    Given { FileUtils.rm(inexistent, force: true) }
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
                    When(:strategy1) { RawFileStrategy.new( 
     | 
| 
      
 25 
     | 
    
         
            +
                    When(:strategy1) { RawFileStrategy.new(input_file: existent) }
         
     | 
| 
       26 
26 
     | 
    
         
             
                    Then { expect(strategy1).not_to have_failed }
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
     | 
    
         
            -
                    When(:strategy2) { RawFileStrategy.new( 
     | 
| 
      
 28 
     | 
    
         
            +
                    When(:strategy2) { RawFileStrategy.new(input_file: inexistent) }
         
     | 
| 
       29 
29 
     | 
    
         
             
                    Then { expect(strategy2).to have_failed(Errno::ENOENT, /No such file or directory/) }
         
     | 
| 
       30 
30 
     | 
    
         
             
                  end
         
     | 
| 
       31 
31 
     | 
    
         
             
                end
         
     | 
| 
         @@ -35,7 +35,7 @@ module TRecs 
     | 
|
| 
       35 
35 
     | 
    
         
             
                  Given { FileUtils.touch(input_file) }
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
                  Given(:strategy) {
         
     | 
| 
       38 
     | 
    
         
            -
                    RawFileStrategy.new( 
     | 
| 
      
 38 
     | 
    
         
            +
                    RawFileStrategy.new(input_file: input_file)
         
     | 
| 
       39 
39 
     | 
    
         
             
                  }
         
     | 
| 
       40 
40 
     | 
    
         
             
                  Given(:recorder) { Object.new }
         
     | 
| 
       41 
41 
     | 
    
         
             
                  When { strategy.recorder = recorder }
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: trecs
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Federico Iachetti
         
     | 
| 
         @@ -189,6 +189,8 @@ files: 
     | 
|
| 
       189 
189 
     | 
    
         
             
            - pkg/trecs-0.0.7.gem
         
     | 
| 
       190 
190 
     | 
    
         
             
            - pkg/trecs-0.0.8.gem
         
     | 
| 
       191 
191 
     | 
    
         
             
            - pkg/trecs-0.0.9.gem
         
     | 
| 
      
 192 
     | 
    
         
            +
            - pkg/trecs-0.1.0.gem
         
     | 
| 
      
 193 
     | 
    
         
            +
            - pkg/trecs-0.1.1.gem
         
     | 
| 
       192 
194 
     | 
    
         
             
            - sandbox/create_recording.rb
         
     | 
| 
       193 
195 
     | 
    
         
             
            - sandbox/lipsum_end
         
     | 
| 
       194 
196 
     | 
    
         
             
            - sandbox/lipsum_start
         
     |