0.0
No commit activity in last 3 years
No release in over 3 years
Replaces unnecessary double quotes with single quotes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Gem Version Dependency Status Build Status Code Climate Test Coverage security

ReplaceQuotes

This gem is used for improving RuboCop compliance by replacing unnecessary double quotes with single quotes in a file. To avoid causing errors, ReplaceQuotes leaves double quotes alone when they are used in a line containing single quotes or "#{".

Before:

"There is Ruby on High Speed Rails, and there is Not Exactly."
"Make sure you choose the correct one."

"I hope we're using Ruby on High Speed Rails"
"There's Ruby on High Speed Rails, and there's Not Exactly."

option1 = "High Speed Ruby on Rails"
option2 = "Not Exactly"
"#{option1} is much better and faster than #{option2}."

After:

'There is Ruby on High Speed Rails, and there is Not Exactly.'
'Make sure you choose the correct one.'

"I hope we're using Ruby on High Speed Rails"
"There's Ruby on High Speed Rails, and there's Not Exactly."

option1 = 'High Speed Ruby on Rails'
option2 = 'Not Exactly'
"#{option1} is much better and faster than #{option2}."

Installation

Add this line to your application's Gemfile:

gem 'replace_quotes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install replace_quotes

Usage

In a Ruby script or console, enter the command ReplaceQuotes.update(filename), where filename is the name of the file for which you wish to replace unnecessary double quotes with single quotes.

Development

Testing this gem

Enter sh gem_test.sh.

Testing the source code

Enter sh gem_code.sh.

Running this gem in irb

Enter sh gem_console.sh.

Installing this gem

Enter sh gem_install.sh.

Testing this gem and source code AND installing this gem

Enter sh all.sh.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/replace_quotes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.