demotape 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: b7a68e716ef2ec6d5115371bc0e836e25cbe4e19b20e2c3d7d514b4909dafa6a
4
- data.tar.gz: 989fb3ed0c2ad24c30dbedcf706d6d4b51475e58796bfd1dfd8bef6ca6710a7c
3
+ metadata.gz: 4d2d9c7696e6ae9e4a0013f5e431e2ce1140ea7a536ce3027b7d1fe055835be7
4
+ data.tar.gz: 96318b40137c65f80b9a25d1d7aef2a9d2b5abda54137b3155fad72d22c65df4
5
5
  SHA512:
6
- metadata.gz: 58bc92cd8ce53899ddcd6a56e24113697987b1ae6b9ea71edf5c05e3a1f1560c412c66c4306a67cc3f13769169fdd1fa2c591fbbdca4d09ccd27a54c5deb69b3
7
- data.tar.gz: 18f8f3cd2420a788b527677da604aa0b68bdd9aa99755981a01e378a3fdb7592c4582916969b9814714daec45b40832afb481e06ce1b7d0b01a7d22c9e6d0889
6
+ metadata.gz: 3ae5db1753a91ef17835e0a77ec046ef05a8b67245a8fc86634eb51216fee0216a5d2596402ccddbb12074982dae06b1d7ef3e315b266ac61f8c318cb5db0e5f
7
+ data.tar.gz: f53681e7e489a9390905ce79fc47c8417f9fb2df65cc13496a7c58737e8f6cd9cbc4d209a925043f78a526bde42504fd4b025557d370fa0cb94c61c0157e97de
data/CHANGELOG.md CHANGED
@@ -11,6 +11,11 @@ Prefix your message with one of the following:
11
11
  - [Security] in case of vulnerabilities.
12
12
  -->
13
13
 
14
+ ## v0.0.5
15
+
16
+ - [Changed] Add newline to multiline strings if they don't end with one.
17
+ - [Fixed] Ensure multiline strings are passed as the argument.
18
+
14
19
  ## v0.0.4
15
20
 
16
21
  - [Fixed] Fix how Thor handle defaults for arrays.
@@ -268,7 +268,7 @@ module DemoTape
268
268
  duration = token.value[:raw].to_s.strip
269
269
  duration = "#{duration}s" if token.value[:unit].to_s.strip == ""
270
270
  values << thor.set_color(duration, :cyan)
271
- when Token::String
271
+ when Token::String, Token::MultilineString
272
272
  values << thor.set_color(token.raw, :yellow)
273
273
  when Token::Operator
274
274
  values << thor.set_color(token.value, :white)
@@ -266,8 +266,18 @@ module DemoTape
266
266
  compute_at_duration!(tokens, options)
267
267
 
268
268
  # Find the string/value argument
269
- string_token = tokens.find(&:string?)
270
- args = string_token ? string_token.value : ""
269
+ string_token = tokens.find(&:string?) ||
270
+ tokens.find(&:multiline_string?)
271
+
272
+ args = case string_token
273
+ when Token::String
274
+ string_token.value
275
+ when Token::MultilineString
276
+ text = string_token.value
277
+ text.end_with?("\n") ? text : "#{text}\n"
278
+ else
279
+ ""
280
+ end
271
281
 
272
282
  # For Sleep, Wait - check for duration/number
273
283
  if %w[
@@ -31,9 +31,10 @@ module DemoTape
31
31
  end
32
32
 
33
33
  def fail_with(error)
34
- error = error.message if error.respond_to?(:message)
34
+ error_message = error
35
+ error_message = error.message if error.respond_to?(:message)
35
36
 
36
- thor.say_error "\nERROR: #{error}", :red
37
+ thor.say_error "\nERROR: #{error_message}", :red
37
38
  puts error.backtrace if error.respond_to?(:backtrace)
38
39
  exit 1
39
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DemoTape
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: demotape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
@@ -691,10 +691,10 @@ metadata:
691
691
  rubygems_mfa_required: 'true'
692
692
  homepage_uri: https://github.com/fnando/demotape
693
693
  bug_tracker_uri: https://github.com/fnando/demotape/issues
694
- source_code_uri: https://github.com/fnando/demotape/tree/v0.0.4
695
- changelog_uri: https://github.com/fnando/demotape/tree/v0.0.4/CHANGELOG.md
696
- documentation_uri: https://github.com/fnando/demotape/tree/v0.0.4/README.md
697
- license_uri: https://github.com/fnando/demotape/tree/v0.0.4/LICENSE.md
694
+ source_code_uri: https://github.com/fnando/demotape/tree/v0.0.5
695
+ changelog_uri: https://github.com/fnando/demotape/tree/v0.0.5/CHANGELOG.md
696
+ documentation_uri: https://github.com/fnando/demotape/tree/v0.0.5/README.md
697
+ license_uri: https://github.com/fnando/demotape/tree/v0.0.5/LICENSE.md
698
698
  rdoc_options: []
699
699
  require_paths:
700
700
  - lib