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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dorian/replace.rb +4 -3
  3. metadata +10 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa75f4ff2ec0da41e34ba2cb3215a4969ec377c329199a97de29eccd8497ef5c
4
- data.tar.gz: 1ff20c8f00e63cf9f102a5077e0b18b4500cb09d09b1b1d95e81df0f5e9376a7
3
+ metadata.gz: 41c6101e4156c4d67157d4a6964fb1410ff7e9e4c579b29d4f1b458691015680
4
+ data.tar.gz: 10d6c30ae3ddaa5697dc2514c92702197d739902ab302e89ccad25c4c3a5deb0
5
5
  SHA512:
6
- metadata.gz: 60ab40305d1af32cf114f8b8339c3a8d5a2410580f65d28066ca811d915871bfc69f99a248a8bf6d2f242b5b8b849e1c3286a0a26a493d9b6dcdc7fbc5f9177c
7
- data.tar.gz: e895a025781cdaa5604f197ade18c7ae3146db57706a20f3344358f387808ebafa032698d770e559fd820b46bcdc040a35b8b4fddca11e7634faf10fb55e2261
6
+ metadata.gz: 4a26575fc20e1248cd53a9bd273473a10c317a2e1e530b96ac747f9e3acd14f9d2644c853b622b03b96f5acda521766603abc4736c5765a87beb2dad65eba05d
7
+ data.tar.gz: 796ae44407cf1299656efd74241a2d6580b671fe321b48736dae8ac76ada1c4f3397200ca64de3412e95989b0539358dd6bf075e6bc1ccfb492512f2182f3484
@@ -1,14 +1,15 @@
1
1
  module Dorian
2
2
  class Replace
3
3
  def self.run
4
- if ARGV.size < 3
5
- puts "USAGE: dorian-replace FROM TO FILES..."
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.1.4
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-10-08 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: e.g. `replace "cool" "coolest" *.md`
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.19
45
+ rubygems_version: 3.2.22
42
46
  signing_key:
43
47
  specification_version: 4
44
- summary: Evaluates some code on each line of the input
48
+ summary: Replace some string with some other string from the files provided
45
49
  test_files: []