Skip to content

Commit

Permalink
Change non-gem lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Oct 4, 2024
1 parent bfa28f5 commit eac7589
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
![Coverage](https://img.shields.io/badge/Coverage-100%25-coverage.svg?colorA=1f7a1f&colorB=2aa22a)</span> <span>
![Rubocop Status](https://img.shields.io/badge/Rubocop-passing-rubocop.svg?colorA=1f7a1f&colorB=2aa22a)</span> <span>
[![MIT license](https://img.shields.io/badge/License-MIT-mit.svg?colorA=1f7a1f&colorB=2aa22a)](http://opensource.org/licenses/MIT)</span> <span>
![Commits](https://img.shields.io/github/commit-activity/y/ddnexus/pagy.svg?label=Commits&colorA=004d99&colorB=0073e6)</span> <span>
![Downloads](https://img.shields.io/gem/dt/pagy.svg?label=Downloads&colorA=004d99&colorB=0073e6)</span> <span>
[![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>
[![Downloads](https://img.shields.io/gem/dt/pagy.svg?label=Downloads&colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/pagy)</span> <span>
[![Stars](https://shields.io/github/stars/ddnexus/pagy?style=social)](https://github.com/ddnexus/pagy/stargazers)</span>

## 🏆 The Best Pagination Ruby Gem 🥇
Expand Down
6 changes: 2 additions & 4 deletions scripts/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
gitlog.puts body
end
# Abort if there is no gem change
abort("No gem changes since version #{old_version}!") if gitlog.empty?
abort("No gem changes since version #{old_version}!") if gitlog.size.zero? # rubocop:disable Style/ZeroLengthPredicate (bug)

gitlog.close

Expand Down Expand Up @@ -81,9 +81,7 @@
end

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

# Build javascript files
system(Scripty::ROOT.join('src/build').to_s)
Expand Down
6 changes: 3 additions & 3 deletions scripts/scripty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ def edit_file?(filepath, caption = filepath)
system("nano #{filepath}") if gets.chomp.start_with?(/y/i)
end

# Substitute a string in filepth
# Replace a string in filepth
def replace_string_in_file(filepath, search, replace)
filepath = ROOT.join(filepath)
content = filepath.read
content.sub!(search, replace)
filepath.write(content)
end

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

# Substitute a tagged string in filepth
# Replace a section in filepth
def replace_section_in_file(filepath, section, new_content)
filepath = ROOT.join(filepath)
content = filepath.read
Expand Down

0 comments on commit eac7589

Please sign in to comment.