subtxt 0.2.1 → 0.2.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: 1b9a0e570950736b7d8fbdf42a30cdd248cd0b4e
4
- data.tar.gz: 562d31ccc403e5aeed9b14394e75f6a351f887d8
3
+ metadata.gz: a51e2f5f00771df588dde9f6f06e8b7818864e5a
4
+ data.tar.gz: 0539a1ae0e32fa61f031866717aa2c7b9879312d
5
5
  SHA512:
6
- metadata.gz: aab98db6e54554ee67c50906796f0232494f6e1fb313ec5cf5c5692e0e53932f32fe15e706061c7552e4a14c44390316942c3c5af662c1281f67e318c8125716
7
- data.tar.gz: 2ee7631dad5eb4415c6cfe7d6c54c150c67bbae4db255954c62130357fe404fcf2dd7c6d6ad7b7f8bd4cf2845490151fe78be199a359f866da26593c37b0e3c5
6
+ metadata.gz: e93bfc67f375571700fb3d4e65d5838d864d1da275207dc514f8e609e979b5f99acce8b8a219a71e3432deae9a5bbb727939354797a2d6581e93f0624301b9e7
7
+ data.tar.gz: 13dd9ae68de892ba890f622b077cbbfa5770c3a27c709dc1eaf7572e76796e5d119b56c636eec123f49b800221152020c1912e05b5fe0e6090000a027fa45e1f
@@ -1,3 +1,3 @@
1
1
  module Subtxt
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/subtxt.rb CHANGED
@@ -59,7 +59,8 @@ def subtexts opts
59
59
  sandr = []
60
60
  patterns.each do |rec|
61
61
  fnd = rec['fnd']
62
- rep = rec['rep'].gsub(/\\n/, "\n")
62
+ rep = rec['rep'].gsub('\n', "\n")
63
+ rep = rep.gsub('\r', "\r")
63
64
  if opts[:verbose] or opts[:debug]
64
65
  matches = text.gsub(/#{fnd}/).count
65
66
  syms = text.gsub(/#{fnd}/) {|sym| "-#{sym}-"}
@@ -117,7 +118,8 @@ parser = OptionParser.new do|opts|
117
118
 
118
119
  Pattern files are formatted in 3-row sets. The first row is the find pattern,
119
120
  the second row is the replace pattern, and the third row delimits the set for
120
- the convenience of your eyeballs. Like so:
121
+ the convenience of your eyeballs. The file must terminate with an explicit
122
+ ""EOF"" Like so:
121
123
  \t---------------------------------------
122
124
  \tfind pattern
123
125
  \treplace pattern
@@ -144,7 +146,7 @@ parser = OptionParser.new do|opts|
144
146
  end
145
147
 
146
148
  if ARGV[0].split("").first == "-"
147
- opts.on('-p PATH', '--patterns PATH', "Full (relative or absolute) path to a text file\n\t\t\t\t\tcontaining find & replace patterns in the designated format.\n\t\t\t\t\tREQUIRED. Ex: -p path/to/patterns.rgxp") do |n|
149
+ opts.on('-p PATH', '--patterns PATH', "Full (relative or absolute) path to a text file containing\n\t\t\t\t\tfind & replace patterns in the designated format.\n\t\t\t\t\tREQUIRED. Ex: -p path/to/patterns.rgxp") do |n|
148
150
  @options[:patterns] = n;
149
151
  end
150
152
  else # the first arg has no leading - or --, it must be our path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subtxt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dominick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler