trecs 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1af4ab48e2ddf4708ce082fbf58661d2be18315e
4
- data.tar.gz: d5476d4d97cbb09aa01a5bda951f65b7f0e95a9a
3
+ metadata.gz: 4cc795a9ca5013664916c0ba34da4d00a70dd217
4
+ data.tar.gz: 1d83ad903e4e6541142b0c9beb228cca14b9af8b
5
5
  SHA512:
6
- metadata.gz: 84bb6266b6901012bfad708845410538b98e322e377ed92cce3be73079e39b4ebcaf2545c4ec8c0a75a1f1cb2a4ea91f3dd3bc77a1b22576b642fa37e1f29148
7
- data.tar.gz: 16724b43e5a994b7d7a8cdb1895a60a85911ec9faefd5e96198173c90ae1c4bafabb1f5a7360e52849879fd403fe996f54c01ea0e58885a0aa76e9997ede3bfb
6
+ metadata.gz: 6156e0bafe7db093e2d7b6155e2befed626f29b77942960e5837f6bc97876ce5f17c483980bcc33e8d4419d661428fe742197106dd5c16dac37a7722bd616e7d
7
+ data.tar.gz: 100a464b6f6949b36c7da8862e17cc60fd17befe740d02b9024a118ca77d62c32b1863c9db3d25acb7e4e50532bddf3733b08780e488261f38bcbf17a6a445c4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trecs (0.2.2)
4
+ trecs (0.2.3)
5
5
  minitar (~> 0.5.4)
6
6
  trollop (~> 2.0)
7
7
 
@@ -4,24 +4,24 @@ require "recording_strategies/hash_strategy"
4
4
  module TRecs
5
5
  class AsteriskSwipeStrategy < HashStrategy
6
6
  include Strategy
7
- attr_reader :text
7
+ attr_reader :message
8
8
  attr_reader :step
9
9
 
10
10
  def initialize(options={})
11
- @text = options.fetch(:text)
11
+ @message = options.fetch(:message)
12
12
  @step = options.fetch(:step) { 100 }
13
13
  @frames = {}
14
14
  end
15
15
 
16
16
  def perform
17
- max_line_size = text.each_line.inject(0) { |max, l| l.size > max ? l.size : max }
17
+ max_line_size = message.each_line.inject(0) { |max, l| l.size > max ? l.size : max }
18
18
 
19
- text.each_line do |line|
20
- curr_text = " %-#{max_line_size}s " % line.chomp
21
- (0..(curr_text.length-1)).each do |i|
19
+ message.each_line do |line|
20
+ curr_message = " %-#{max_line_size}s " % line.chomp
21
+ (0..(curr_message.length-1)).each do |i|
22
22
  current_time = step * i
23
23
 
24
- c = curr_text.dup
24
+ c = curr_message.dup
25
25
  c[i] = "|"
26
26
  (i+1..c.length-3).each do |j|
27
27
  c[j] = "*"
data/lib/trecs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TRecs
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -9,7 +9,7 @@ module TRecs
9
9
  describe AsteriskSwipeStrategy do
10
10
  context "initialization" do
11
11
  When(:strategy) { AsteriskSwipeStrategy.new }
12
- Then { expect(strategy).to have_raised(/key not found: :text/) }
12
+ Then { expect(strategy).to have_raised(/key not found: :message/) }
13
13
  end
14
14
 
15
15
  context "performing" do
@@ -20,7 +20,7 @@ module TRecs
20
20
  When { recorder.record }
21
21
 
22
22
  context "one char" do
23
- Given(:strategy) { AsteriskSwipeStrategy.new(text: "a") }
23
+ Given(:strategy) { AsteriskSwipeStrategy.new(message: "a") }
24
24
  Then { writer.frames[0] == "*" }
25
25
  Then { writer.frames[100] == "|" }
26
26
  Then { writer.frames[200] == "a|" }
@@ -28,7 +28,7 @@ module TRecs
28
28
  end
29
29
 
30
30
  context "two chars" do
31
- Given(:strategy) { AsteriskSwipeStrategy.new(text: "ab", step: 10) }
31
+ Given(:strategy) { AsteriskSwipeStrategy.new(message: "ab", step: 10) }
32
32
  Then { writer.frames[0] == "**" }
33
33
  Then { writer.frames[10] == "|*" }
34
34
  Then { writer.frames[20] == "a|" }
@@ -37,7 +37,7 @@ module TRecs
37
37
  end
38
38
 
39
39
  context "multiple_lines" do
40
- Given(:strategy) { AsteriskSwipeStrategy.new(text: "FIRST\nSECOND") }
40
+ Given(:strategy) { AsteriskSwipeStrategy.new(message: "FIRST\nSECOND") }
41
41
  Then { writer.frames[0] == "******\n******" }
42
42
  Then { writer.frames[100] == "|*****\n|*****" }
43
43
  Then { writer.frames[200] == "F|****\nS|****" }
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.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Iachetti