str_sanitizer 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6b123fd47f74c4b42a1b9b8218f4a0172606aa2
4
- data.tar.gz: 800f32fdd6c75bcdcf71c4335d222bdd14c98dbd
3
+ metadata.gz: b538c943e4d55ad6963787e0959efa1bdc2c22e1
4
+ data.tar.gz: d0c9877e414a122aba5837fcf040e96e8f3064ea
5
5
  SHA512:
6
- metadata.gz: 73609aa3ddc115b9c1a3f4b04b7c243e002b9690a396fe6e18a1c2f36b57b2f5711ab42dc56ed258e815dea5f885fe76323501d5778f1612d0921c10eddc214d
7
- data.tar.gz: 12f62821e68ea2ec9f19e4bff06281fd0d270591458a5c035f1d5ba3b8133c7f669e8449c85540b4e03e2bbe88057bc89c43e0a5b100168c12ef96824d7e2ab3
6
+ metadata.gz: e6c2d75091881c70ade7114a0e057df01e338d43221a6d3882b39ff4aa0b798a25e352911a1240a0a0afc8b11503fe4dc75b0884ada0a7985beb6fb59e7e64c7
7
+ data.tar.gz: 8c5da11e494e9d36f4734c7d1cfc543a81a8d707d7aa7738d14e925380cd35c76538b348d7f75f321dc0a03053726e2f5ed2d021c5a502b92c705f9384f30854
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## StrSanitizer 0.1.1 (August 07, 2017) ##
2
+
3
+ * In v0.1.0, the single_quote method wasn't working properly. This release fixes it.
4
+ *
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # StrSanitizer
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/str_sanitizer`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to this gem. This gem is about String Sanitization. This gem sanitizes the string which is given.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
5
 
7
6
  ## Installation
8
7
 
@@ -22,7 +21,16 @@ Or install it yourself as:
22
21
 
23
22
  ## Usage
24
23
 
25
- TODO: Write usage instructions here
24
+ ##### To escape quotes of a string
25
+ ```ruby
26
+ require "str_sanitizer"
27
+
28
+ hello = "He said, 'Hello!'"
29
+ StrSanitizer.double_quote hello # => He said, \'Hello!\'
30
+
31
+ hello = 'She said, "Hello!"'
32
+ StrSanitizer.single_quote hello # => She said, \"Hello!\"
33
+ ```
26
34
 
27
35
  ## Development
28
36
 
@@ -32,7 +40,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
40
 
33
41
  ## Contributing
34
42
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/str_sanitizer. 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.
43
+ Bug reports and pull requests are welcome on GitHub at https://github.com/JakariaBlaine/str_sanitizer. 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.
36
44
 
37
45
  ## License
38
46
 
@@ -40,4 +48,4 @@ The gem is available as open source under the terms of the [MIT License](http://
40
48
 
41
49
  ## Code of Conduct
42
50
 
43
- Everyone interacting in the StrSanitizer project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/str_sanitizer/blob/master/CODE_OF_CONDUCT.md).
51
+ Everyone interacting in the StrSanitizer project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/JakariaBlaine/str_sanitizer/blob/master/CODE_OF_CONDUCT.md).
@@ -10,11 +10,11 @@ class StrSanitizer
10
10
 
11
11
  module ClassMethods
12
12
  def double_quote(str)
13
- str.gsub!(/"/, '\"')
13
+ str.gsub(/"/, /\\"/.source)
14
14
  end
15
15
 
16
16
  def single_quote(str)
17
- str.gsub!(/'/, "\'")
17
+ str.gsub(/'/, /\\'/.source)
18
18
  end
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  class StrSanitizer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: str_sanitizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakaria Blaine
@@ -62,6 +62,7 @@ files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
64
  - ".travis.yml"
65
+ - CHANGELOG.md
65
66
  - CODE_OF_CONDUCT.md
66
67
  - Gemfile
67
68
  - LICENSE.txt