embrace 1.2.3 → 2.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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/README.md +3 -1
- data/lib/embrace/string_methods.rb +10 -0
- data/lib/embrace/version.rb +1 -1
- data/lib/embrace.rb +3 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f0856e151fca20a74510706e3f8b307c6ed60e0
|
4
|
+
data.tar.gz: 0ff40ea0aeb1bdc5e8260b9ce8acb6bfe2b58b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04168f385733e7806ad82cbb0e46f9035efd3e0a463f249dc1daac58a728b07649440dc258334f3e38cf0195c44fce8b067abe1096d7dd5be35b980b45cc2f9
|
7
|
+
data.tar.gz: 0a211ab0b2fbb834525ad7798425b3835116b559647e28265bbf7103ec3f91128131699d193aab812b2bc9a263b38768f00540e50979414e43735861e0152d1b
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[![Build status][build-badge]][build]
|
5
5
|
[![Coverage Status][coverage-badge]][coverage]
|
6
6
|
|
7
|
-
Embrace is a simple library for bracketing strings, or parts of strings. While it focuses on three common
|
7
|
+
Embrace is a simple library for bracketing or quoting strings, or parts of strings. While it focuses on three common
|
8
8
|
bracketing styles, you can use custom styles, or even wrap text in arbitrary strings.
|
9
9
|
|
10
10
|
## Usage
|
@@ -40,6 +40,8 @@ available:
|
|
40
40
|
"text".bracket # => "[text]"
|
41
41
|
"text".parenthesize # => "(text)"
|
42
42
|
"text".brace # => "{text}"
|
43
|
+
"text".single_quote # => "'text'"
|
44
|
+
"text".double_quote # => "\"text\""
|
43
45
|
```
|
44
46
|
|
45
47
|
### Custom bracket styles
|
@@ -11,5 +11,15 @@ module Embrace
|
|
11
11
|
def brace(style: BRACES, **options)
|
12
12
|
Embrace.bracket(self, style: style, **options)
|
13
13
|
end
|
14
|
+
|
15
|
+
def single_quote(style: SINGLE_QUOTES, **options)
|
16
|
+
Embrace.bracket(self, style: style, **options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def double_quote(style: DOUBLE_QUOTES, **options)
|
20
|
+
Embrace.bracket(self, style: style, **options)
|
21
|
+
end
|
22
|
+
|
23
|
+
alias_method :quote, :double_quote
|
14
24
|
end
|
15
25
|
end
|
data/lib/embrace/version.rb
CHANGED
data/lib/embrace.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Carney
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.6.11
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Strings are nice. Give 'em a hug.
|