fedux_org-stdlib 0.7.16 → 0.7.17

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: 64dbc6097497bcaa8993b41c1c3652946056aebb
4
- data.tar.gz: f9fda713e22ed13a0c9508eecd1a3e0e759d2e57
3
+ metadata.gz: 240f671fac277d1dc2adf2cb194d01a81413d71c
4
+ data.tar.gz: f965cf7fb5772abf3e082a47d1b58eb14d7cecb4
5
5
  SHA512:
6
- metadata.gz: 2d4262771a40968e48c80fab8b6c1353a7295d581e0fde5307a578cb4ea227595d4d4c7d2ef14b7a81c5b8ff90a889acb24922bb498acfd309cc6ff5f0c1bb18
7
- data.tar.gz: afb8467ea171c53dfab51cf3ff6cfd4b7f07ce98fd5c767c31bbb7e3a58f2aff1d262f6557f0e21a46ee611faff5bc30c7f838b890e4164c9046ef7769e02c87
6
+ metadata.gz: 8d7ebd39d190dbd685d651e40be2aae536968a0a504495f0ebc7343febf05f96631e77ebcf789b112abe677a656a715193cb9f3401273207e0f07f7fc69fbab5
7
+ data.tar.gz: d5890bdff2c34b7072b1fadc4f1a3c8760ffe53ea2a4570177a407d7f8d37e10f5be6117bc5c402bf1ce2b1acc26a9abf908712b989ff7f0449351a80f7ef6dc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fedux_org-stdlib (0.7.15)
4
+ fedux_org-stdlib (0.7.16)
5
5
  activesupport
6
6
 
7
7
  PATH
@@ -0,0 +1,10 @@
1
+ # encoding: utf-8
2
+ class String
3
+ def underline(character: '-')
4
+ result = []
5
+ result << self
6
+ result << self.gsub(/./, character)
7
+
8
+ result.join("\n")
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # FeduxOrgStdlib
3
3
  module FeduxOrgStdlib
4
- VERSION = '0.7.16'
4
+ VERSION = '0.7.17'
5
5
  end
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'fedux_org_stdlib/core_ext/string/underline'
4
+
5
+ RSpec.describe 'String#underline' do
6
+ it 'returns a string which is underlined' do
7
+ expect('Headline'.underline).to eq <<-EOS.strip_heredoc.chomp
8
+ Headline
9
+ --------
10
+ EOS
11
+ end
12
+
13
+ it 'is possible to change the character used' do
14
+ expect('Headline'.underline(character: '#')).to eq <<-EOS.strip_heredoc.chomp
15
+ Headline
16
+ ########
17
+ EOS
18
+ end
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fedux_org-stdlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.16
4
+ version: 0.7.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer
@@ -68,6 +68,7 @@ files:
68
68
  - lib/fedux_org_stdlib/core_ext/shellwords.rb
69
69
  - lib/fedux_org_stdlib/core_ext/shellwords/clean.rb
70
70
  - lib/fedux_org_stdlib/core_ext/string.rb
71
+ - lib/fedux_org_stdlib/core_ext/string/underline.rb
71
72
  - lib/fedux_org_stdlib/environment.rb
72
73
  - lib/fedux_org_stdlib/file_template.rb
73
74
  - lib/fedux_org_stdlib/file_template/exceptions.rb
@@ -161,6 +162,7 @@ files:
161
162
  - spec/core_ext/hash/list_spec.rb
162
163
  - spec/core_ext/hash/options_spec.rb
163
164
  - spec/core_ext/shellwords/clean_spec.rb
165
+ - spec/core_ext/string/underline_spec.rb
164
166
  - spec/environment_spec.rb
165
167
  - spec/examples/models/class_based/forbidden_keyword.rb
166
168
  - spec/examples/models/class_based/ignore/ignored.rb
@@ -238,6 +240,7 @@ test_files:
238
240
  - spec/core_ext/hash/list_spec.rb
239
241
  - spec/core_ext/hash/options_spec.rb
240
242
  - spec/core_ext/shellwords/clean_spec.rb
243
+ - spec/core_ext/string/underline_spec.rb
241
244
  - spec/environment_spec.rb
242
245
  - spec/examples/models/class_based/forbidden_keyword.rb
243
246
  - spec/examples/models/class_based/ignore/ignored.rb