trecs 0.2.5 → 0.3.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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +4 -4
  4. data/bin/trecs_record +1 -1
  5. data/lib/trecs/readers/json_reader.rb +2 -1
  6. data/lib/trecs/sources/tgz_source.rb +0 -1
  7. data/lib/trecs/{recording_strategies → strategies}/asterisk_swipe_strategy.rb +5 -2
  8. data/lib/trecs/{recording_strategies → strategies}/config_strategy.rb +1 -1
  9. data/lib/trecs/{recording_strategies → strategies}/custom_strategy.rb +0 -0
  10. data/lib/trecs/{recording_strategies → strategies}/file_frames_strategy.rb +1 -1
  11. data/lib/trecs/{recording_strategies → strategies}/fly_from_right_strategy.rb +2 -2
  12. data/lib/trecs/{recording_strategies → strategies}/hash_strategy.rb +2 -2
  13. data/lib/trecs/{recording_strategies → strategies}/incremental_strategy.rb +2 -2
  14. data/lib/trecs/{recording_strategies → strategies}/raw_file_strategy.rb +1 -1
  15. data/lib/trecs/{recording_strategies → strategies}/shell_command_strategy.rb +0 -0
  16. data/lib/trecs/{recording_strategies → strategies}/strategy.rb +0 -0
  17. data/lib/trecs/{recording_strategies → strategies}/tmux_session_strategy.rb +2 -1
  18. data/lib/trecs/{recording_strategies → strategies}/ttyrec_strategy.rb +1 -1
  19. data/lib/trecs/version.rb +1 -1
  20. data/lib/trecs/writers/json_writer.rb +1 -1
  21. data/spec/trecs/recorder_spec.rb +2 -2
  22. data/spec/trecs/{recording_strategies → strategies}/asterisk_swipe_strategy_spec.rb +2 -2
  23. data/spec/trecs/{recording_strategies → strategies}/config_strategy_spec.rb +2 -2
  24. data/spec/trecs/{recording_strategies → strategies}/file_frames_strategy_spec.rb +1 -1
  25. data/spec/trecs/{recording_strategies → strategies}/fly_from_right_strategy_spec.rb +1 -1
  26. data/spec/trecs/{recording_strategies → strategies}/hash_strategy_spec.rb +1 -1
  27. data/spec/trecs/{recording_strategies → strategies}/incremental_strategy_spec.rb +1 -1
  28. data/spec/trecs/{recording_strategies → strategies}/raw_file_strategy_spec.rb +1 -1
  29. data/spec/trecs/{recording_strategies → strategies}/shell_command_strategy_spec.rb +1 -1
  30. metadata +30 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f55c1a39b3a6ebae2392a7f4145c4662597ec90
4
- data.tar.gz: 4b33cf2b0e68eb4b4202f273574b2823871793d9
3
+ metadata.gz: 063ffb002a27203278a25d1514da9f5175309148
4
+ data.tar.gz: b2d61f5b666dcd311c8257da9f6bc8e653edf23c
5
5
  SHA512:
6
- metadata.gz: 5f3d6c135be532b2f5721cda11e2d5e2e3a8e18933de834ef8549d192550094c0ca68363244d23259fa0c199e3e71c351cf85adbf767fdcb8b642d41cfd3f868
7
- data.tar.gz: c9c47cd6cb0be7efccbd9761e9ef8e48d67ee9813f356686744287ef9113d49fc09df387fd5a0a7790bb31e346999682d6a2fb614b2ee25469ba14aaf0ee9064
6
+ metadata.gz: f236b56eeeda0aa44602e8714cf4ed1e06aa4119b179f2c847cc0259d4e7e616f1e43807d819f632fb8262c16f2ead7546bb60e0717381fa4d40e9d49da44d36
7
+ data.tar.gz: 9f32b4ad8fe607200d5a7ccb72adbf91f43d97ff87348db46712d047db40e280e4447942d3a272106344e0d24413767ffd976032a654f51fa5444b89d02da034
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
1
  source "https://rubygems.org"
2
- gemspec
2
+ gemspec
3
+
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trecs (0.2.5)
4
+ trecs (0.3.0)
5
5
  minitar (~> 0.5.4)
6
6
  trollop (~> 2.0)
7
7
 
@@ -17,13 +17,13 @@ GEM
17
17
  rspec-core (~> 2.99.0)
18
18
  rspec-expectations (~> 2.99.0)
19
19
  rspec-mocks (~> 2.99.0)
20
- rspec-core (2.99.1)
21
- rspec-expectations (2.99.1)
20
+ rspec-core (2.99.2)
21
+ rspec-expectations (2.99.2)
22
22
  diff-lcs (>= 1.1.3, < 2.0)
23
23
  rspec-given (3.5.4)
24
24
  given_core (= 3.5.4)
25
25
  rspec (>= 2.12)
26
- rspec-mocks (2.99.1)
26
+ rspec-mocks (2.99.2)
27
27
  sorcerer (1.0.2)
28
28
  trollop (2.0)
29
29
 
data/bin/trecs_record CHANGED
@@ -26,7 +26,7 @@ opts[:trecs_backend] = ARGV[0]
26
26
  require "writers/json_writer"
27
27
  writer_class = TRecs::JsonWriter
28
28
 
29
- strategy_file = "recording_strategies/#{opts[:strategy]}_strategy"
29
+ strategy_file = "strategies/#{opts[:strategy]}_strategy"
30
30
  require strategy_file
31
31
  strategy_class_name = [
32
32
  "TRecs::",
@@ -33,7 +33,8 @@ module TRecs
33
33
  end
34
34
 
35
35
  def frame_at(time)
36
- @frames[time]
36
+ frame = @frames[time]
37
+ frame.is_a?(Hash) ? frame["content"] : frame
37
38
  end
38
39
 
39
40
  def to_s
@@ -63,7 +63,6 @@ module TRecs
63
63
  # Investigar como hacer para descomprimir en memoria
64
64
  def in_tmp_dir
65
65
  unless tmpdir_exists?
66
- p tmpdir
67
66
  Pathname(tmpdir).mkdir
68
67
  end
69
68
  Dir.chdir(tmpdir) do
@@ -1,15 +1,18 @@
1
- require "recording_strategies/strategy"
2
- require "recording_strategies/hash_strategy"
1
+ require "strategies/strategy"
2
+ require "strategies/hash_strategy"
3
+ require "strategies/shell_command_strategy"
3
4
 
4
5
  module TRecs
5
6
  class AsteriskSwipeStrategy < HashStrategy
6
7
  include Strategy
8
+ include ShellCommandStrategy
7
9
  attr_reader :message
8
10
  attr_reader :step
9
11
 
10
12
  def initialize(options={})
11
13
  @message = options.fetch(:message)
12
14
  @step = options.fetch(:step) { 100 }
15
+ @command = options.fetch(:command) { nil }
13
16
  @frames = {}
14
17
  end
15
18
 
@@ -1,4 +1,4 @@
1
- require "recording_strategies/strategy"
1
+ require "strategies/strategy"
2
2
 
3
3
  module TRecs
4
4
  class ConfigStrategy
@@ -1,4 +1,4 @@
1
- require "recording_strategies/strategy"
1
+ require "strategies/strategy"
2
2
  module TRecs
3
3
  class FileFramesStrategy
4
4
  include Strategy
@@ -1,5 +1,5 @@
1
- require "recording_strategies/strategy"
2
- require "recording_strategies/shell_command_strategy"
1
+ require "strategies/strategy"
2
+ require "strategies/shell_command_strategy"
3
3
 
4
4
  module TRecs
5
5
  class FlyFromRightStrategy
@@ -1,5 +1,5 @@
1
- require "recording_strategies/strategy"
2
- require "recording_strategies/shell_command_strategy"
1
+ require "strategies/strategy"
2
+ require "strategies/shell_command_strategy"
3
3
 
4
4
  module TRecs
5
5
  class HashStrategy
@@ -1,5 +1,5 @@
1
- require "recording_strategies/strategy"
2
- require "recording_strategies/shell_command_strategy"
1
+ require "strategies/strategy"
2
+ require "strategies/shell_command_strategy"
3
3
 
4
4
  module TRecs
5
5
  class IncrementalStrategy
@@ -1,4 +1,4 @@
1
- require "recording_strategies/strategy"
1
+ require "strategies/strategy"
2
2
  module TRecs
3
3
  class RawFileStrategy
4
4
  include Strategy
@@ -1,4 +1,5 @@
1
- require "recording_strategies/strategy"
1
+ require "strategies/strategy"
2
+
2
3
  module TRecs
3
4
  class TmuxSessionStrategy
4
5
  include Strategy
@@ -1,4 +1,4 @@
1
- require "recording_strategies/strategy"
1
+ require "strategies/strategy"
2
2
  module TRecs
3
3
  class TtyrecStrategy
4
4
  include Strategy
data/lib/trecs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TRecs
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -25,7 +25,7 @@ module TRecs
25
25
  def create_frame(options={})
26
26
  time = options.fetch(:time)
27
27
  content = options.fetch(:content)
28
- frames[time] = content
28
+ frames[time] = { content: content }
29
29
  end
30
30
 
31
31
  def render
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require "recorder"
3
- require "recording_strategies/hash_strategy"
4
- require "recording_strategies/custom_strategy"
3
+ require "strategies/hash_strategy"
4
+ require "strategies/custom_strategy"
5
5
 
6
6
  module TRecs
7
7
  describe Recorder do
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/asterisk_swipe_strategy"
2
+ require "strategies/asterisk_swipe_strategy"
3
3
 
4
4
  require "recorder"
5
- require "recording_strategies/hash_strategy"
5
+ require "strategies/hash_strategy"
6
6
  require "writers/in_memory_writer"
7
7
 
8
8
  module TRecs
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/config_strategy"
2
+ require "strategies/config_strategy"
3
3
  require "recorder"
4
- require "recording_strategies/hash_strategy"
4
+ require "strategies/hash_strategy"
5
5
  require "writers/in_memory_writer"
6
6
 
7
7
  module TRecs
@@ -1,5 +1,5 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/file_frames_strategy"
2
+ require "strategies/file_frames_strategy"
3
3
 
4
4
  module TRecs
5
5
  describe FileFramesStrategy do
@@ -1,5 +1,5 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/fly_from_right_strategy"
2
+ require "strategies/fly_from_right_strategy"
3
3
 
4
4
  module TRecs
5
5
  describe FlyFromRightStrategy do
@@ -1,5 +1,5 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/hash_strategy"
2
+ require "strategies/hash_strategy"
3
3
 
4
4
  module TRecs
5
5
  describe HashStrategy do
@@ -1,5 +1,5 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/incremental_strategy"
2
+ require "strategies/incremental_strategy"
3
3
 
4
4
  module TRecs
5
5
  describe IncrementalStrategy do
@@ -1,5 +1,5 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/raw_file_strategy"
2
+ require "strategies/raw_file_strategy"
3
3
 
4
4
  module TRecs
5
5
  describe RawFileStrategy do
@@ -1,5 +1,5 @@
1
1
  require "spec_helper"
2
- require "recording_strategies/shell_command_strategy"
2
+ require "strategies/shell_command_strategy"
3
3
 
4
4
  module TRecs
5
5
  describe ShellCommandStrategy do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trecs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Iachetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-01 00:00:00.000000000 Z
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop
@@ -122,21 +122,21 @@ files:
122
122
  - lib/trecs/readers/json_reader.rb
123
123
  - lib/trecs/readers/yaml_store_reader.rb
124
124
  - lib/trecs/recorder.rb
125
- - lib/trecs/recording_strategies/asterisk_swipe_strategy.rb
126
- - lib/trecs/recording_strategies/config_strategy.rb
127
- - lib/trecs/recording_strategies/custom_strategy.rb
128
- - lib/trecs/recording_strategies/file_frames_strategy.rb
129
- - lib/trecs/recording_strategies/fly_from_right_strategy.rb
130
- - lib/trecs/recording_strategies/hash_strategy.rb
131
- - lib/trecs/recording_strategies/incremental_strategy.rb
132
- - lib/trecs/recording_strategies/raw_file_strategy.rb
133
- - lib/trecs/recording_strategies/shell_command_strategy.rb
134
- - lib/trecs/recording_strategies/strategy.rb
135
- - lib/trecs/recording_strategies/tmux_session_strategy.rb
136
- - lib/trecs/recording_strategies/ttyrec_strategy.rb
137
125
  - lib/trecs/screens/terminal_screen.rb
138
126
  - lib/trecs/sources/in_memory_source.rb
139
127
  - lib/trecs/sources/tgz_source.rb
128
+ - lib/trecs/strategies/asterisk_swipe_strategy.rb
129
+ - lib/trecs/strategies/config_strategy.rb
130
+ - lib/trecs/strategies/custom_strategy.rb
131
+ - lib/trecs/strategies/file_frames_strategy.rb
132
+ - lib/trecs/strategies/fly_from_right_strategy.rb
133
+ - lib/trecs/strategies/hash_strategy.rb
134
+ - lib/trecs/strategies/incremental_strategy.rb
135
+ - lib/trecs/strategies/raw_file_strategy.rb
136
+ - lib/trecs/strategies/shell_command_strategy.rb
137
+ - lib/trecs/strategies/strategy.rb
138
+ - lib/trecs/strategies/tmux_session_strategy.rb
139
+ - lib/trecs/strategies/ttyrec_strategy.rb
140
140
  - lib/trecs/tickers/clock_ticker.rb
141
141
  - lib/trecs/tickers/terminal_input_ticker.rb
142
142
  - lib/trecs/tickers/watch_file_ticker.rb
@@ -157,16 +157,16 @@ files:
157
157
  - spec/trecs/readers/json_reader_spec.rb
158
158
  - spec/trecs/readers/yaml_store_reader_spec.rb
159
159
  - spec/trecs/recorder_spec.rb
160
- - spec/trecs/recording_strategies/asterisk_swipe_strategy_spec.rb
161
- - spec/trecs/recording_strategies/config_strategy_spec.rb
162
- - spec/trecs/recording_strategies/file_frames_strategy_spec.rb
163
- - spec/trecs/recording_strategies/fly_from_right_strategy_spec.rb
164
- - spec/trecs/recording_strategies/hash_strategy_spec.rb
165
- - spec/trecs/recording_strategies/incremental_strategy_spec.rb
166
- - spec/trecs/recording_strategies/raw_file_strategy_spec.rb
167
- - spec/trecs/recording_strategies/shell_command_strategy_spec.rb
168
160
  - spec/trecs/sources/in_memory_source_spec.rb
169
161
  - spec/trecs/sources/tgz_source_spec.rb
162
+ - spec/trecs/strategies/asterisk_swipe_strategy_spec.rb
163
+ - spec/trecs/strategies/config_strategy_spec.rb
164
+ - spec/trecs/strategies/file_frames_strategy_spec.rb
165
+ - spec/trecs/strategies/fly_from_right_strategy_spec.rb
166
+ - spec/trecs/strategies/hash_strategy_spec.rb
167
+ - spec/trecs/strategies/incremental_strategy_spec.rb
168
+ - spec/trecs/strategies/raw_file_strategy_spec.rb
169
+ - spec/trecs/strategies/shell_command_strategy_spec.rb
170
170
  - spec/trecs/tickers/clock_ticker_spec.rb
171
171
  - spec/trecs/writers/in_memory_writer_spec.rb
172
172
  - spec/trecs/writers/json_writer_spec.rb
@@ -205,16 +205,16 @@ test_files:
205
205
  - spec/trecs/readers/json_reader_spec.rb
206
206
  - spec/trecs/readers/yaml_store_reader_spec.rb
207
207
  - spec/trecs/recorder_spec.rb
208
- - spec/trecs/recording_strategies/asterisk_swipe_strategy_spec.rb
209
- - spec/trecs/recording_strategies/config_strategy_spec.rb
210
- - spec/trecs/recording_strategies/file_frames_strategy_spec.rb
211
- - spec/trecs/recording_strategies/fly_from_right_strategy_spec.rb
212
- - spec/trecs/recording_strategies/hash_strategy_spec.rb
213
- - spec/trecs/recording_strategies/incremental_strategy_spec.rb
214
- - spec/trecs/recording_strategies/raw_file_strategy_spec.rb
215
- - spec/trecs/recording_strategies/shell_command_strategy_spec.rb
216
208
  - spec/trecs/sources/in_memory_source_spec.rb
217
209
  - spec/trecs/sources/tgz_source_spec.rb
210
+ - spec/trecs/strategies/asterisk_swipe_strategy_spec.rb
211
+ - spec/trecs/strategies/config_strategy_spec.rb
212
+ - spec/trecs/strategies/file_frames_strategy_spec.rb
213
+ - spec/trecs/strategies/fly_from_right_strategy_spec.rb
214
+ - spec/trecs/strategies/hash_strategy_spec.rb
215
+ - spec/trecs/strategies/incremental_strategy_spec.rb
216
+ - spec/trecs/strategies/raw_file_strategy_spec.rb
217
+ - spec/trecs/strategies/shell_command_strategy_spec.rb
218
218
  - spec/trecs/tickers/clock_ticker_spec.rb
219
219
  - spec/trecs/writers/in_memory_writer_spec.rb
220
220
  - spec/trecs/writers/json_writer_spec.rb