dorian-replace 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dorian/replace.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9807abd4d766405607f92a3c0e32f10d4098211fd2a750a3a04e3c956f5c39c0
|
4
|
+
data.tar.gz: 2e21cc3070a600b4664ddbad46a62fd3f3f8936991f8063bdebd0f60b4e41a74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 524e7e9938ead456b47a102956d156e0b00735e4d8f830cd1c37db9e999dd279efc65df69b72698aeb6d0e42b3f4d63c77a05bc2ec8dd7425ca10bb5186757a6
|
7
|
+
data.tar.gz: 6a36eccb56ec5d7bd0d46aa8675362b886cc44ad2b2cbad1c4df149c67b937c0212062be4b0f33b796dd51b45aaa244ed20948313f921408ab8f030512908981
|
data/lib/dorian/replace.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
module Dorian
|
2
2
|
class Replace
|
3
3
|
def self.run
|
4
|
-
if ARGV.size <
|
5
|
-
puts
|
4
|
+
if ARGV.size < 2
|
5
|
+
puts "USAGE: replace FROM TO FILES..."
|
6
|
+
puts "USAGE: ... | replace FROM TO"
|
6
7
|
exit
|
7
8
|
end
|
8
9
|
|
9
10
|
from = ARGV[0]
|
10
11
|
to = ARGV[1]
|
11
|
-
files = ARGV[2..-1]
|
12
|
+
files = ARGV.size > 2 ? ARGV[2..-1] : STDIN.each_line.to_a.map(&:strip)
|
12
13
|
|
13
14
|
files.each do |file|
|
14
15
|
next if File.directory?(file)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-replace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Replace some string with some other string from the files provided
|