trecs 0.4.1 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ff49f07ddfe14f4149cc6633011195b0bcbfe93
4
- data.tar.gz: a619e937967b0a856b470ed366f1704e073b43da
3
+ metadata.gz: 8c77342d400595d338672aa1d47bb45ec43757bc
4
+ data.tar.gz: 9c7611b89930b1086d33c1c10ae88c4cbdbf0895
5
5
  SHA512:
6
- metadata.gz: 02bd8f5842139767983a1f2b9a9d7dc791f42345167e884dbc0a0620dd76b447d3f2caa95d0ffc6a07def1097e69a75c33e3e285fd4ac3c0431e4edbd5117f6b
7
- data.tar.gz: 35330ad17b08a0322368ef750dba3fa2fa5c890262e0e81f4c256574fe398f2ddd15a226b64f5520fbfe68fb2adb608ba64dc310304d91e7817da15c890cb5c6
6
+ metadata.gz: ef53e600a45895483fa52679146749b80fd37753931bc7ca99d95ff8ab67b900b1cde003ffe8c27a59e47c43acd879935f67c537b722cc53e59858ae518f0251
7
+ data.tar.gz: 3e698602a8a3f53cd20e37c56f2942934f67eb0668d1d4c657d5bafd9433aeaedf567254ea9a04a755d928e03118bab5e22aaf25978af85387bdbd115097fce9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trecs (0.4.1)
4
+ trecs (0.4.2)
5
5
  minitar (~> 0.5.4)
6
6
  trollop (~> 2.0)
7
7
 
@@ -3,10 +3,10 @@ require "strategies/strategy"
3
3
  module TRecs
4
4
  class TmuxSessionStrategy < Strategy
5
5
  attr_reader :recording
6
+ attr_reader :format
6
7
 
7
8
  def initialize(options={})
8
9
  super(options)
9
- # @frames = []
10
10
  @step = options.fetch(:step) { 100 }
11
11
  @color = options.fetch(:color) { true }
12
12
  set_color_or_bw
@@ -19,6 +19,7 @@ module TRecs
19
19
  t += step
20
20
  current_time(t)
21
21
  current_content(get_current_frame)
22
+ current_format(format)
22
23
  save_frame
23
24
  sleep(step/1000.0)
24
25
  end
@@ -38,7 +39,13 @@ module TRecs
38
39
  end
39
40
 
40
41
  def set_color_or_bw
41
- @color = @color ? "-e" : "-C"
42
+ if @color
43
+ @color = "-e"
44
+ @format = "ansi"
45
+ else
46
+ @color = "-C"
47
+ @format = "raw"
48
+ end
42
49
  end
43
50
 
44
51
  def set_capture_command
@@ -1,3 +1,3 @@
1
1
  module TRecs
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -22,7 +22,7 @@ module TRecs
22
22
  time = options.fetch(:time)
23
23
  content = options.fetch(:content)
24
24
  format = options[:format]
25
-
25
+
26
26
  frame = {
27
27
  format: format,
28
28
  content: content,
@@ -35,8 +35,12 @@ module TRecs
35
35
  source.create_recording do |source|
36
36
  source[:format] = "json"
37
37
 
38
- json_string = frames.to_json
39
-
38
+ frames_hash = frames.each_with_object({}) { |frame, h|
39
+ h[frame.first] = frame.last.to_h
40
+ }
41
+
42
+ json_string = frames_hash.to_json
43
+
40
44
  source.create_file('frames.json') do |f|
41
45
  f.write json_string
42
46
  end
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Iachetti