embrace 1.2.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dae26e29a55be3acf9f332a29efe864b7e4229f2
4
- data.tar.gz: ff87e70520367861480d49a0819b2cf82676e18f
3
+ metadata.gz: 3f0856e151fca20a74510706e3f8b307c6ed60e0
4
+ data.tar.gz: 0ff40ea0aeb1bdc5e8260b9ce8acb6bfe2b58b2f
5
5
  SHA512:
6
- metadata.gz: abc92d9bcca9a57f95bc71241bdb0595a6f09945a4badf9b9d3fcfbff23de380e5495427a42d822b08f1d883556cb42fa4faf6c8168dd1623ef9867dd318b096
7
- data.tar.gz: 68a3e6165980cb667a62c5bc743bc60195bdd6c4776fa6b50a9387be5e0b1b3d78b7e723693888084ad3f81d827c074abd654ea656ff8d3917f3e8957e244bab
6
+ metadata.gz: a04168f385733e7806ad82cbb0e46f9035efd3e0a463f249dc1daac58a728b07649440dc258334f3e38cf0195c44fce8b067abe1096d7dd5be35b980b45cc2f9
7
+ data.tar.gz: 0a211ab0b2fbb834525ad7798425b3835116b559647e28265bbf7103ec3f91128131699d193aab812b2bc9a263b38768f00540e50979414e43735861e0152d1b
data/.gitignore CHANGED
@@ -7,3 +7,6 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+
11
+ .ruby-version
12
+ .ruby-gemset
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
@@ -1,3 +1,3 @@
1
1
  module Embrace
2
- VERSION = "1.2.3"
2
+ VERSION = "2.0.0"
3
3
  end
data/lib/embrace.rb CHANGED
@@ -7,6 +7,9 @@ module Embrace
7
7
  PARENTHESES = Brackets("(", ")").freeze
8
8
  BRACES = Brackets("{", "}").freeze
9
9
 
10
+ SINGLE_QUOTES = Brackets("'", "'").freeze
11
+ DOUBLE_QUOTES = Brackets('"', '"').freeze
12
+
10
13
  refine String do
11
14
  include StringMethods
12
15
  end
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: 1.2.3
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: 2016-11-13 00:00:00.000000000 Z
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.5.1
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.