trecs 0.0.1.alpha → 0.0.1.alpha2
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/README.org +4 -10
- data/bin/trecs_raw_file +28 -0
- data/lib/recorder.rb +4 -0
- data/lib/recorders/raw_file_recorder.rb +13 -0
- data/lib/recording_strategies/raw_file_recording_strategy.rb +37 -0
- data/lib/trecs/version.rb +1 -1
- data/pkg/trecs-0.0.1.alpha.gem +0 -0
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0b32ef95a9219398a69256bc96e3d3423e2ef29
|
4
|
+
data.tar.gz: c8e721483e6f8f8fd85487c95bce9c8a4310b3d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd6c7ca7f2b396b7ff45618dde8770dcc89c725db4434ac1e08c38ca68711c5b30d004716e81498fae91ad173f08b907181f5de07e3b2ce485e5b9c9b12db1e8
|
7
|
+
data.tar.gz: 7053a8ad09c2bb97f31e95e3942956e8b3eda22ed08abc338cf835282e6fafb70f25c1e0adcf0991a7e5bfd46b44d14c86fbac351135bc96909d25320d41acfb
|
data/Gemfile.lock
CHANGED
data/README.org
CHANGED
@@ -1,12 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#+LANGUAGE: en
|
5
|
-
#+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:nil -:t f:t *:t <:t
|
6
|
-
#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
|
7
|
-
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
|
8
|
-
#+EXPORT_SELECT_TAGS: export
|
9
|
-
#+EXPORT_EXCLUDE_TAGS: noexport
|
1
|
+
* T-Recs
|
2
|
+
|
3
|
+
[[https://travis-ci.org/iachettifederico/trecs][Build State]] [[https://travis-ci.org/iachettifederico/trecs.svg]]
|
10
4
|
|
11
5
|
#+BEGIN_EXAMPLE
|
12
6
|
__________
|
@@ -26,7 +20,7 @@
|
|
26
20
|
|_| |_| \_\___|\___|___/
|
27
21
|
|
28
22
|
#+END_EXAMPLE
|
29
|
-
|
23
|
+
|
30
24
|
Text Recordings.
|
31
25
|
|
32
26
|
Record screencasts in plain text.
|
data/bin/trecs_raw_file
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift(File.expand_path("../../lib", __FILE__))
|
4
|
+
|
5
|
+
require "trollop"
|
6
|
+
|
7
|
+
require "recorders/raw_file_recorder"
|
8
|
+
|
9
|
+
options = Trollop::options do
|
10
|
+
opt :input_file, "File to process", short: 'i', type: String
|
11
|
+
opt :output_file, "Output file", short: 'o', type: String, default: "/tmp/output.txt"
|
12
|
+
opt :step, "Step", short: 's', type: Integer, default: 100
|
13
|
+
end
|
14
|
+
|
15
|
+
unless options[:output_file]
|
16
|
+
puts "Please give an input and an output file file name"
|
17
|
+
exit(1)
|
18
|
+
end
|
19
|
+
|
20
|
+
RECORDER = TRecs::RawFileRecorder.new(options)
|
21
|
+
|
22
|
+
trap "SIGINT" do
|
23
|
+
RECORDER.stop
|
24
|
+
end
|
25
|
+
|
26
|
+
puts "Recording ..."
|
27
|
+
RECORDER.record
|
28
|
+
puts "Finish Recording ..."
|
data/lib/recorder.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "timestamps"
|
2
|
+
|
3
|
+
require "recorders/zip_file_recorder"
|
4
|
+
require "recording_strategies/raw_file_recording_strategy"
|
5
|
+
|
6
|
+
module TRecs
|
7
|
+
class RawFileRecorder < ZipFileRecorder
|
8
|
+
def initialize(input_file:, output_file:, **options)
|
9
|
+
@recording_strategy = RawFileRecordingStrategy.new(recorder: self, file: input_file, **options)
|
10
|
+
super(file_name: output_file, **options)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "recording_strategy"
|
2
|
+
module TRecs
|
3
|
+
class RawFileRecordingStrategy < RecordingStrategy
|
4
|
+
def initialize(file:, height: 24, width: 80, step: 100, **options)
|
5
|
+
raise "File does not exist: #{file}" unless File.exist?(file)
|
6
|
+
@file = File.new(file)
|
7
|
+
@step = step
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def perform
|
12
|
+
@recording = true
|
13
|
+
start_time = Time.now
|
14
|
+
|
15
|
+
while @recording
|
16
|
+
time = timestamp(Time.now - start_time)
|
17
|
+
content = File.read(@file)
|
18
|
+
recorder.current_frame(time: time, content: content)
|
19
|
+
sleep(sleep_time)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def stop
|
24
|
+
@recording = false
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
def sleep_time
|
29
|
+
# TODO: Fix this to use the current time
|
30
|
+
@sleep_time ||= (@step/1000.0)
|
31
|
+
end
|
32
|
+
|
33
|
+
def timestamp(time)
|
34
|
+
(time * 1000).to_i
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/trecs/version.rb
CHANGED
Binary file
|
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.0.1.
|
4
|
+
version: 0.0.1.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Iachetti
|
@@ -100,6 +100,7 @@ email:
|
|
100
100
|
executables:
|
101
101
|
- trecs
|
102
102
|
- trecs_message
|
103
|
+
- trecs_raw_file
|
103
104
|
- trecs_terminal
|
104
105
|
extensions: []
|
105
106
|
extra_rdoc_files: []
|
@@ -116,20 +117,24 @@ files:
|
|
116
117
|
- Rakefile
|
117
118
|
- bin/trecs
|
118
119
|
- bin/trecs_message
|
120
|
+
- bin/trecs_raw_file
|
119
121
|
- bin/trecs_terminal
|
120
122
|
- doc/steps.org
|
121
123
|
- lib/player.rb
|
122
124
|
- lib/players/zip_file_player.rb
|
123
125
|
- lib/recorder.rb
|
124
126
|
- lib/recorders/message_recorder.rb
|
127
|
+
- lib/recorders/raw_file_recorder.rb
|
125
128
|
- lib/recorders/ttyrec_recorder.rb
|
126
129
|
- lib/recorders/zip_file_recorder.rb
|
127
130
|
- lib/recording_strategies/incremental_recording_strategy.rb
|
131
|
+
- lib/recording_strategies/raw_file_recording_strategy.rb
|
128
132
|
- lib/recording_strategies/ttyrec_recording_strategy.rb
|
129
133
|
- lib/recording_strategy.rb
|
130
134
|
- lib/screens/terminal_screen.rb
|
131
135
|
- lib/timestamps.rb
|
132
136
|
- lib/trecs/version.rb
|
137
|
+
- pkg/trecs-0.0.1.alpha.gem
|
133
138
|
- sandbox/create_recording.rb
|
134
139
|
- sandbox/lipsum_end
|
135
140
|
- sandbox/lipsum_start
|