Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tongueroo/text_injector
Text Injector: injects text to a file
https://github.com/tongueroo/text_injector
Last synced: about 1 month ago
JSON representation
Text Injector: injects text to a file
- Host: GitHub
- URL: https://github.com/tongueroo/text_injector
- Owner: tongueroo
- License: mit
- Created: 2014-05-06T04:24:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-08T06:26:54.000Z (over 10 years ago)
- Last Synced: 2024-04-29T20:53:40.656Z (8 months ago)
- Language: Ruby
- Size: 199 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Text Injector
[![Build Status](https://travis-ci.org/tongueroo/text_injector.svg?branch=master)](https://travis-ci.org/tongueroo/text_injector)
Injects text to a file with markers around the text so it can update it again.
## Installation
Add this line to your application's Gemfile:
gem 'text_injector'
And then execute:
$ bundle
Or install it yourself as:
$ gem install text_injector
## Usage
require 'text_injector'
injector = TextInjector.new(
:identifier => "custom-id",
:file => "/tmp/test.txt",
:content => "added content"
)
injector.run # first run
injector.content = "updated content"
injector.run # second runStarting /tmp/test.txt file:
test fileAfter first run:
test file# Begin TextInjector marker for custom-id
added content
# End TextInjector marker for custom-idAfter second run:
test file# Begin TextInjector marker for custom-id
updated content
# End TextInjector marker for custom-id## Contributing
1. Fork it ( http://github.com/tongueroo/text_injector/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request