Skip to content

Commit eac7589

Browse files
committed
Change non-gem lines
1 parent bfa28f5 commit eac7589

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
![Coverage](https://img.shields.io/badge/Coverage-100%25-coverage.svg?colorA=1f7a1f&colorB=2aa22a)</span> <span>
88
![Rubocop Status](https://img.shields.io/badge/Rubocop-passing-rubocop.svg?colorA=1f7a1f&colorB=2aa22a)</span> <span>
99
[![MIT license](https://img.shields.io/badge/License-MIT-mit.svg?colorA=1f7a1f&colorB=2aa22a)](http://opensource.org/licenses/MIT)</span> <span>
10-
![Commits](https://img.shields.io/github/commit-activity/y/ddnexus/pagy.svg?label=Commits&colorA=004d99&colorB=0073e6)</span> <span>
11-
![Downloads](https://img.shields.io/gem/dt/pagy.svg?label=Downloads&colorA=004d99&colorB=0073e6)</span> <span>
10+
[![Commits](https://img.shields.io/github/commit-activity/y/ddnexus/pagy.svg?label=Commits&colorA=004d99&colorB=0073e6)](https://github.com/ddnexus/pagy/commits/master/)</span> <span>
11+
[![Downloads](https://img.shields.io/gem/dt/pagy.svg?label=Downloads&colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/pagy)</span> <span>
1212
[![Stars](https://shields.io/github/stars/ddnexus/pagy?style=social)](https://github.com/ddnexus/pagy/stargazers)</span>
1313

1414
## 🏆 The Best Pagination Ruby Gem 🥇

scripts/bump.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
gitlog.puts body
4141
end
4242
# Abort if there is no gem change
43-
abort("No gem changes since version #{old_version}!") if gitlog.empty?
43+
abort("No gem changes since version #{old_version}!") if gitlog.size.zero? # rubocop:disable Style/ZeroLengthPredicate (bug)
4444

4545
gitlog.close
4646

@@ -81,9 +81,7 @@
8181
end
8282

8383
# Bumps docs example
84-
replace_string_in_file('quick-start.md',
85-
old_version.split('.')[0, 2].join('.'),
86-
new_version.split('.')[0, 2].join('.'))
84+
replace_string_in_file('quick-start.md', *[old_version, new_version].map { |v| v.split('.')[0, 2].join('.') })
8785

8886
# Build javascript files
8987
system(Scripty::ROOT.join('src/build').to_s)

scripts/scripty.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ def edit_file?(filepath, caption = filepath)
2121
system("nano #{filepath}") if gets.chomp.start_with?(/y/i)
2222
end
2323

24-
# Substitute a string in filepth
24+
# Replace a string in filepth
2525
def replace_string_in_file(filepath, search, replace)
2626
filepath = ROOT.join(filepath)
2727
content = filepath.read
2828
content.sub!(search, replace)
2929
filepath.write(content)
3030
end
3131

32-
# Extract a tagged string in filepth
32+
# Extract a section from filepth
3333
def extract_section_from_file(filepath, section)
3434
filepath = ROOT.join(filepath)
3535
content = filepath.read
3636
content[/<!-- #{section}_start -->\n(.*)<!-- #{section}_end -->/m, 1]
3737
end
3838

39-
# Substitute a tagged string in filepth
39+
# Replace a section in filepth
4040
def replace_section_in_file(filepath, section, new_content)
4141
filepath = ROOT.join(filepath)
4242
content = filepath.read

0 commit comments

Comments
 (0)