subify 0.0.0 → 1.0.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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -7
  3. data/bin/subify +11 -0
  4. data/lib/subify/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfca3b8699fcf76fb45275dad9b07d9e74ddb6b2
4
- data.tar.gz: 202a19c708d97fb996e2577fbfd284520b4d9487
3
+ metadata.gz: f648736963542b84c86ce3fc7a913c329dc120e2
4
+ data.tar.gz: 591c49e9d8cf4ca757a2bbcc0499f35913b09b8e
5
5
  SHA512:
6
- metadata.gz: a884f5da7a5e5169d30f9ffb23effc26f279b4fa33823ef029be898773e88f2fc9544237963cf884370537f31f8e0c9527c6a0d2cd396ea330277ed4ef2a6714
7
- data.tar.gz: b5490fb2d3c38fc4f0d9e630f0efb670590e550caab7c5bc0b22ceedb960bd81edcd2144f6ec3f9b718862af9294a22f0e5473a6ebc912442acc8a8510115f58
6
+ metadata.gz: 2a747e2d75608862c0e2d7c7c24965344afd23b64bc625c447a1359a1c233aa317fbed5e989248f5c46c0209c0a40b84d30e49a0aac435695bb95742c535161f
7
+ data.tar.gz: 2fc933a842c3b4dadc34dcb79c97f785fe45cfe90481b5d4cf82dd15d2f986da39763ad86dd42387b108607078125aef35f0cc7fa3dac6f0869d7d19c648f195
data/README.md CHANGED
@@ -1,8 +1,38 @@
1
1
  # Subify
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/subify`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Replace the a string with another string. A scenario I use this for is pasting sensitive code on stackoverflow or reddit. Sure search and replace in file works but I use this in conjuntion with my [leftify](https://github.com/vmcilwain/subify) gem so that it is also indented.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ## Disclaimer
6
+
7
+ `Use at your own risk!` I am not responsible any damage to your file or fystem. If you are not sure this will work for you, install it on a vagrant vm and give it a try there. You can use the Vagrantfile that is in this repo to take care of configuring a useable vm.
8
+
9
+ ## Usage
10
+
11
+ Replaces `Hello` with `Bye`
12
+
13
+ ```
14
+ printf "Hello World" | subify Hello Bye
15
+ ```
16
+
17
+ produces:
18
+
19
+ ```
20
+ Bye World
21
+ ```
22
+
23
+ Using with Leftify gem
24
+
25
+ ```
26
+ printf "Hello
27
+ World" | leftify | subify Hello Bye
28
+ ```
29
+
30
+ produces:
31
+
32
+ ```
33
+ Bye
34
+ World
35
+ ```
6
36
 
7
37
  ## Installation
8
38
 
@@ -20,16 +50,31 @@ Or install it yourself as:
20
50
 
21
51
  $ gem install subify
22
52
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
53
  ## Development
28
54
 
29
55
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
56
 
31
57
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
58
 
59
+ ## Releasing
60
+
61
+ To release a new version:
62
+
63
+ * update the version number in `version.rb`
64
+ * tag the the code `git tag v1.0.0`
65
+ * push the tag `git push --tags`
66
+ * then run `bundle exec rake build`
67
+ * `gem push pkg/subify-version`
68
+
69
+ Which will push the `.gem` file to [rubygems.org](https://rubygems.org).
70
+
33
71
  ## Contributing
34
72
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/subify.
73
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/vmcilwain/subify).
74
+
75
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
76
+
77
+
78
+ ## License
79
+
80
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/bin/subify CHANGED
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ search_text, replace_text = ARGV
4
+
5
+ raise 'Argument Missing' if ARGV.empty?
6
+
7
+ ARGV.size.times {ARGV.shift}
8
+
9
+ ARGF.each_line do |line|
10
+ puts line.gsub(search_text, replace_text)
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Subify
2
- VERSION = "0.0.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vell