trecs 0.0.2.alpha2 → 0.0.3

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 892a0d64c6d2ee439cfbedbf62c73de9906b7047
4
- data.tar.gz: a5c72782a6941095199d2297ec2d7c4e958c9d8b
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDJhM2IwN2MzYzlhOTFhNjNjYmY1YWRiNTExNmY2OGI4MWU3ZWNiYg==
5
+ data.tar.gz: !binary |-
6
+ OTk1Njk3M2RhYzJhZTFhODg5ZTBhM2IzMmZhYzI5YjcyNjY1NDQ4YQ==
5
7
  SHA512:
6
- metadata.gz: f0d586c1bc749e4e6e9c5182c6b46addb03072871575fec1fb5821c98e25a7d281c11184508f171df2600bb289ae4cd5e2209e9d7fcf58e55090cc70305d3a18
7
- data.tar.gz: ecfbedadaf28ab44eede5ae3e6da236f644b6660c8400ccee2dffc3bff122f363a52ce138f3669c5ebe476e1d1000bea4c31500a7099d650e4dcfbf0881485e4
8
+ metadata.gz: !binary |-
9
+ ZWYxOGI0NTU1YTM3MjRkYjk5NDgxNThjZGNjOGE3YTRhMzNmMjZjMmU5NmJm
10
+ YzE0NjAwZWYyZDQxODRlMmZjYzdmMzFhZmY5NWJkNTBiYjE3NzMyNmU5Nzky
11
+ YmI3YTUxYmYwYTVkMWIyNWQ3ODYwYTM4MDZhMTM0OWYzMDcwODM=
12
+ data.tar.gz: !binary |-
13
+ NTQzY2U1NmM2Yjc3YjkyODdjOGU3NmQxYzY2NDE4MzFkODk5ODY4YTk2YzRl
14
+ MjA0YWM0M2ZmYTQ0OGM2ZTg3MGU0N2NlZTA5NTg4NmQ0ZTA2YzI3OGYwN2I0
15
+ Mjc4ZDQ4MGFkNzU2ZWI4ZjlkZDU3N2NhZTE5YTQ0Y2RkOTEyOTk=
@@ -1,4 +1,8 @@
1
1
  rvm:
2
+ - 1.9.3
3
+ - 1.9.2
4
+ - jruby-19mode
5
+ - rbx
2
6
  - 2.1.0
3
7
  - 2.1.1
4
8
  - 2.1.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trecs (0.0.2.alpha2)
4
+ trecs (0.0.3)
5
5
  rubyzip (~> 1.1.4)
6
6
  trollop (~> 2.0)
7
7
 
@@ -5,12 +5,13 @@ module TRecs
5
5
  class Player
6
6
  attr_reader :output
7
7
 
8
- def initialize(time: nil, step: 100, output: TerminalScreen.new, testing: false, **options)
8
+ def initialize(options={})
9
+ time = options.fetch(:time) { nil }
9
10
  @current_time = time
10
- @step = step
11
+ @step = options.fetch(:step) { 100 }
12
+ @output = options.fetch(:output) { TerminalScreen.new }
13
+ @testing = options.fetch(:testing) { false }
11
14
  @ticks = time ? Array(time.to_i) : ticks
12
- @output = output
13
- @testing = testing
14
15
  end
15
16
 
16
17
  def play
@@ -5,13 +5,13 @@ module TRecs
5
5
  class ZipFilePlayer < Player
6
6
  include FileUtils
7
7
 
8
- def initialize(file_name: "", **options)
9
- @file_name = file_name
8
+ def initialize(options={})
9
+ @file_name = options.fetch(:file_name)
10
10
 
11
11
  create_directory
12
12
  extract_file
13
13
 
14
- super(**options)
14
+ super
15
15
  end
16
16
 
17
17
  # this
@@ -3,8 +3,8 @@ module TRecs
3
3
  attr_writer :current_time
4
4
  attr_reader :step
5
5
 
6
- def initialize(step: 100, **options)
7
- @step = step
6
+ def initialize(options={})
7
+ @step = options.fetch(:step) { 100 }
8
8
  end
9
9
 
10
10
  def next_timestamp
@@ -26,7 +26,9 @@ module TRecs
26
26
  @current_content
27
27
  end
28
28
 
29
- def current_frame(time: next_timestamp, content:)
29
+ def current_frame(options={})
30
+ time = options.fetch(:time) { next_timestamp }
31
+ content = options.fetch(:content)
30
32
  current_time(time)
31
33
  current_content(content)
32
34
 
@@ -8,10 +8,10 @@ module TRecs
8
8
  class MessageRecorder < ZipFileRecorder
9
9
  attr_reader :message
10
10
 
11
- def initialize(message:, **options)
12
- @message = message
11
+ def initialize(options={})
12
+ @message = options.fetch(:message)
13
13
  @recording_strategy = IncrementalRecordingStrategy.new(recorder: self, message: message)
14
- super(**options)
14
+ super(options)
15
15
  end
16
16
 
17
17
  end
@@ -5,9 +5,16 @@ require "recording_strategies/raw_file_recording_strategy"
5
5
 
6
6
  module TRecs
7
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)
8
+ def initialize(options={})
9
+ input_file = options.fetch(:input_file)
10
+ output_file = options.fetch(:output_file)
11
+
12
+ options[:recorder] = self
13
+ options[:file] = input_file
14
+ @recording_strategy = RawFileRecordingStrategy.new(options)
15
+
16
+ options[:file_name] = output_file
17
+ super(options)
11
18
  end
12
19
  end
13
20
  end
@@ -5,9 +5,16 @@ require "recording_strategies/ttyrec_recording_strategy"
5
5
 
6
6
  module TRecs
7
7
  class TtyrecRecorder < ZipFileRecorder
8
- def initialize(input_file:, output_file:, **options)
9
- @recording_strategy = TtyrecRecordingStrategy.new(recorder: self, file: input_file, **options)
10
- super(file_name: output_file, **options)
8
+ def initialize(options={})
9
+ input_file = options.fetch(:input_file)
10
+ output_file = options.fetch(:output_file)
11
+
12
+ options[:recorder] = self
13
+ options[:file] = input_file
14
+ @recording_strategy = TtyrecRecordingStrategy.new(options)
15
+
16
+ options[:file_name] = output_file
17
+ super(options)
11
18
  end
12
19
  end
13
20
  end
@@ -4,9 +4,9 @@ require "recorder"
4
4
  module TRecs
5
5
  class ZipFileRecorder < Recorder
6
6
  include FileUtils
7
- def initialize(file_name:, **options)
8
- super(**options)
9
- @file_name = file_name
7
+ def initialize(options={})
8
+ super(options)
9
+ @file_name = options.fetch(:file_name)
10
10
  delete_file
11
11
  end
12
12
 
@@ -1,9 +1,9 @@
1
1
  require "recording_strategy"
2
2
  module TRecs
3
3
  class IncrementalRecordingStrategy < RecordingStrategy
4
- def initialize(message:, **options)
5
- @message = message
6
- super(**options)
4
+ def initialize(options={})
5
+ @message = options.fetch(:message)
6
+ super(options)
7
7
  end
8
8
 
9
9
  def perform
@@ -1,10 +1,15 @@
1
1
  require "recording_strategy"
2
2
  module TRecs
3
3
  class RawFileRecordingStrategy < RecordingStrategy
4
- def initialize(file:, height: 24, width: 80, step: 100, **options)
4
+ def initialize(options)
5
+ file = options.fetch(:file)
5
6
  raise "File does not exist: #{file}" unless File.exist?(file)
6
7
  @file = File.new(file)
7
- @step = step
8
+
9
+ @height = options.fetch(:height) { 24 }
10
+ @width = options.fetch(:width) { 80 }
11
+ @step = options.fetch(:step) { 100 }
12
+
8
13
  super
9
14
  end
10
15
 
@@ -1,7 +1,7 @@
1
1
  module TRecs
2
2
  class RecordingStrategy
3
- def initialize(recorder:, **optionsx)
4
- @recorder = recorder
3
+ def initialize(options={})
4
+ @recorder = options.fetch(:recorder)
5
5
  end
6
6
 
7
7
  private
@@ -1,3 +1,3 @@
1
1
  module TRecs
2
- VERSION = "0.0.2.alpha2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -5,10 +5,12 @@ require "screens/terminal_screen"
5
5
 
6
6
  module TRecs
7
7
  class DummyPlayer < Player
8
- def initialize(frames:, **options)
9
- @frames = frames
10
- super
11
- end
8
+ def initialize(options={})
9
+ frames = options.fetch(:frames) { nil }
10
+ @frames = frames.is_a?(Hash) ? frames : Array(frames)
11
+ super
12
+ end
13
+
12
14
 
13
15
  def get_timestamps
14
16
  @frames.keys
@@ -7,9 +7,10 @@ module TRecs
7
7
  class DummyRecorder < Recorder
8
8
  attr_reader :result
9
9
 
10
- def initialize(frames: nil, **options)
10
+ def initialize(options={})
11
+ frames = options.fetch(:frames) { nil }
11
12
  @frames = frames.is_a?(Hash) ? frames : Array(frames)
12
- super(**options)
13
+ super
13
14
  end
14
15
 
15
16
  def perform_recording
@@ -36,7 +36,8 @@ describe "T-Recs" do
36
36
  end
37
37
  end
38
38
 
39
- def create_recording(file_name: "")
39
+ def create_recording(options={})
40
+ file_name = options.fetch(:file_name) { "" }
40
41
  unless File.exist?(file_name)
41
42
  recording_dir = "#{File.dirname(file_name)}/frames"
42
43
  rm_rf recording_dir
@@ -57,7 +58,11 @@ describe "T-Recs" do
57
58
  end
58
59
  end
59
60
 
60
- def create_frame(file_name: "", content: "", time: 0)
61
+ def create_frame(options={})
62
+ file_name = options.fetch(:file_name) { "" }
63
+ content = options.fetch(:content) { "" }
64
+ time = options.fetch(:time) { 0 }
65
+
61
66
  File.open("#{project_dir}/frames/#{time.to_i}", File::WRONLY|File::CREAT) do |f|
62
67
  f << content
63
68
  end
@@ -9,8 +9,8 @@ module TRecs
9
9
  class DummyRecordingStrategy
10
10
  attr_reader :recorder
11
11
 
12
- def initialize(recorder:)
13
- @recorder = recorder
12
+ def initialize(options={})
13
+ @recorder = options.fetch(:recorder)
14
14
  end
15
15
  def perform
16
16
  recorder.current_frame(time: 0, content: "zero")
@@ -20,9 +20,9 @@ module TRecs
20
20
  end
21
21
 
22
22
  class DummyZipFileRecorder < ZipFileRecorder
23
- def initialize(**options)
23
+ def initialize(options)
24
24
  @recording_strategy = DummyRecordingStrategy.new(recorder: self)
25
- super(**options)
25
+ super
26
26
  end
27
27
  end
28
28
 
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trecs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.alpha2
4
+ version: 0.0.3
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-06-10 00:00:00.000000000 Z
11
+ date: 2014-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.1.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: trollop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.12'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.12'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec-given
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 3.5.4
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.5.4
97
97
  description: Record text screencasts.
@@ -105,11 +105,11 @@ executables:
105
105
  extensions: []
106
106
  extra_rdoc_files: []
107
107
  files:
108
- - ".bundle/config"
109
- - ".gitignore"
110
- - ".rspec"
111
- - ".spec"
112
- - ".travis.yml"
108
+ - .bundle/config
109
+ - .gitignore
110
+ - .rspec
111
+ - .spec
112
+ - .travis.yml
113
113
  - Gemfile
114
114
  - Gemfile.lock
115
115
  - LICENCE.txt
@@ -137,6 +137,7 @@ files:
137
137
  - pkg/trecs-0.0.1.alpha.gem
138
138
  - pkg/trecs-0.0.1.alpha2.gem
139
139
  - pkg/trecs-0.0.2.alpha.gem
140
+ - pkg/trecs-0.0.2.alpha2.gem
140
141
  - sandbox/create_recording.rb
141
142
  - sandbox/lipsum_end
142
143
  - sandbox/lipsum_start
@@ -163,20 +164,20 @@ require_paths:
163
164
  - bin
164
165
  required_ruby_version: !ruby/object:Gem::Requirement
165
166
  requirements:
166
- - - ">="
167
+ - - ! '>='
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
170
  required_rubygems_version: !ruby/object:Gem::Requirement
170
171
  requirements:
171
- - - ">"
172
+ - - ! '>='
172
173
  - !ruby/object:Gem::Version
173
- version: 1.3.1
174
+ version: '0'
174
175
  requirements: []
175
176
  rubyforge_project:
176
177
  rubygems_version: 2.2.2
177
178
  signing_key:
178
179
  specification_version: 4
179
- summary: 'TRecs: Text Recordings.'
180
+ summary: ! 'TRecs: Text Recordings.'
180
181
  test_files:
181
182
  - spec/player_spec.rb
182
183
  - spec/recorder_spec.rb