dorian-replace 0.1.0
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 +7 -0
- data/bin/dorian-replace +4 -0
- data/lib/dorian/replace.rb +19 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 32afae97fc3fdf941709e93ab80915640afb35bcfca035c2ee912daeb82a7268
|
4
|
+
data.tar.gz: a0ea1f6b8478eba762ed7c175f448a959c6b1a7893ce8c8db76aa14ea6ed006e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e372cba358b922fad014f761f258289173da93c0ff3b0cb600bc95a9c8c3428a18c850382ff8f0c54feb143cfc105687cb08074c6ee8d898b2290f328419c0bf
|
7
|
+
data.tar.gz: 18f9e54002fdafc57b2d511fee1aedd5fce1c9cb66fa7785e32401ddf57c8eb67b464624048d52671fe6317fc47f52170cd7d02b9f7029de9850ad0532d36568
|
data/bin/dorian-replace
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Dorian
|
2
|
+
class Each
|
3
|
+
def self.run
|
4
|
+
if ARGV.size < 3
|
5
|
+
puts "USAGE: dorian-replace FROM TO FILES..."
|
6
|
+
exit
|
7
|
+
end
|
8
|
+
|
9
|
+
from = ARGV[0]
|
10
|
+
to = ARGV[1]
|
11
|
+
files = ARGV[2..-1]
|
12
|
+
|
13
|
+
files.each do |file|
|
14
|
+
next if File.directory?(file)
|
15
|
+
File.write(file, File.read(file).gsub(from, to))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dorian-replace
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dorian Marié
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-10-08 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: e.g. `ruby-replace "cool" "coolest" *.md`
|
14
|
+
email: dorian@dorianmarie.fr
|
15
|
+
executables:
|
16
|
+
- dorian-replace
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- bin/dorian-replace
|
21
|
+
- lib/dorian/replace.rb
|
22
|
+
homepage: https://github.com/dorianmariefr/replace
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubygems_version: 3.2.19
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Evaluates some code on each line of the input
|
45
|
+
test_files: []
|