dorian-replace 0.1.4 → 0.3.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 +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41c6101e4156c4d67157d4a6964fb1410ff7e9e4c579b29d4f1b458691015680
|
4
|
+
data.tar.gz: 10d6c30ae3ddaa5697dc2514c92702197d739902ab302e89ccad25c4c3a5deb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a26575fc20e1248cd53a9bd273473a10c317a2e1e530b96ac747f9e3acd14f9d2644c853b622b03b96f5acda521766603abc4736c5765a87beb2dad65eba05d
|
7
|
+
data.tar.gz: 796ae44407cf1299656efd74241a2d6580b671fe321b48736dae8ac76ada1c4f3397200ca64de3412e95989b0539358dd6bf075e6bc1ccfb492512f2182f3484
|
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 "USAGE:
|
4
|
+
if ARGV.size < 2 || ARGV[0] == "--help" || ARGV[0] == "-h"
|
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,16 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-replace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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
|
-
description:
|
13
|
+
description: |-
|
14
|
+
Replace some string with some other string from the files provided
|
15
|
+
|
16
|
+
e.g. `replace "cool" "coolest" *.md`
|
14
17
|
email: dorian@dorianmarie.fr
|
15
18
|
executables:
|
16
19
|
- replace
|
@@ -22,7 +25,8 @@ files:
|
|
22
25
|
homepage: https://github.com/dorianmariefr/replace
|
23
26
|
licenses:
|
24
27
|
- MIT
|
25
|
-
metadata:
|
28
|
+
metadata:
|
29
|
+
rubygems_mfa_required: 'true'
|
26
30
|
post_install_message:
|
27
31
|
rdoc_options: []
|
28
32
|
require_paths:
|
@@ -38,8 +42,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
42
|
- !ruby/object:Gem::Version
|
39
43
|
version: '0'
|
40
44
|
requirements: []
|
41
|
-
rubygems_version: 3.2.
|
45
|
+
rubygems_version: 3.2.22
|
42
46
|
signing_key:
|
43
47
|
specification_version: 4
|
44
|
-
summary:
|
48
|
+
summary: Replace some string with some other string from the files provided
|
45
49
|
test_files: []
|