Skip to content

Commit 0c24930

Browse files
committed
Add GitHub Actions CI and changelog without version bump.
Switch CI badge and workflow to GitHub Actions, make Coveralls submission CI-only, and include CHANGELOG.md in gem metadata while keeping the gem at 2.4.0. Made-with: Cursor
1 parent f409ca6 commit 0c24930

File tree

5 files changed

+88
-5
lines changed

5 files changed

+88
-5
lines changed

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
name: Ruby ${{ matrix.ruby }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
ruby: [ "3.0", "3.1", "3.2", "3.3" ]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Ruby
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: ${{ matrix.ruby }}
25+
bundler-cache: true
26+
27+
- name: Run specs
28+
run: bundle exec rake spec
29+
30+
coverage:
31+
name: Coverage (Coveralls)
32+
runs-on: ubuntu-latest
33+
needs: test
34+
if: github.event_name == 'push'
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Set up Ruby
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
ruby-version: "3.2"
43+
bundler-cache: true
44+
45+
- name: Run specs with Coveralls
46+
env:
47+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
48+
run: bundle exec rake spec

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6+
7+
## [2.4.0] - 2026-02-11
8+
9+
### Added
10+
- Added `StringPattern.valid_email?` helper and centralized email format checks.
11+
- Added `StringPattern.valid?(text:, pattern:)` for boolean validation.
12+
- Added `StringPattern.sample(pattern, n)` for batch generation of distinct values.
13+
- Added `StringPattern.uuid` and `StringPattern.valid_uuid?`.
14+
- Added support for `seed:` in generation for reproducible outputs.
15+
- Added support for `block_list` as a `Proc`.
16+
- Added `StringPattern::InvalidPatternError` and `StringPattern::GenerationImpossibleError`.
17+
- Added `StringPattern.logger` and `StringPattern.raise_on_error` configuration.
18+
- Added `spec/string/pattern/analyze_spec.rb`.
19+
- Added GitHub Actions CI workflow.
20+
21+
### Changed
22+
- Fixed email-domain comparison bug in email validation/generation paths.
23+
- Replaced internal direct `puts` calls with centralized logging (`StringPattern.log_message`).
24+
- Updated README with analyze/validation/error-handling/new-features documentation.
25+
- Updated CI target Ruby versions (3.0, 3.1, 3.2, 3.3).
26+
27+
## [2.3.0] - 2025-xx-xx
28+
29+
### Changed
30+
- Previous release notes not yet backfilled.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# StringPattern
22

33
[![Gem Version](https://badge.fury.io/rb/string_pattern.svg)](https://rubygems.org/gems/string_pattern)
4-
[![Build Status](https://travis-ci.com/MarioRuiz/string_pattern.svg?branch=master)](https://github.com/MarioRuiz/string_pattern)
4+
[![CI](https://github.com/MarioRuiz/string_pattern/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/MarioRuiz/string_pattern/actions/workflows/ci.yml)
55
[![Coverage Status](https://coveralls.io/repos/github/MarioRuiz/string_pattern/badge.svg?branch=master)](https://coveralls.io/github/MarioRuiz/string_pattern?branch=master)
66
![Gem](https://img.shields.io/gem/dt/string_pattern)
77
![GitHub commit activity](https://img.shields.io/github/commit-activity/y/MarioRuiz/string_pattern)

spec/spec_helper.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
require "coveralls"
2-
Coveralls.wear!
1+
if ENV["CI"] && ENV["COVERALLS_REPO_TOKEN"] && !ENV["COVERALLS_REPO_TOKEN"].empty?
2+
require "coveralls"
3+
Coveralls.wear!
4+
else
5+
require "simplecov"
6+
SimpleCov.start
7+
end
38

49
# This file was generated by the `rspec --init` command. Conventionally, all
510
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.

string_pattern.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ Gem::Specification.new do |s|
77
s.email = 'marioruizs@gmail.com'
88
s.files = ["lib/string_pattern.rb","lib/string/pattern/add_to_ruby.rb", "lib/string/pattern/analyze.rb",
99
"lib/string/pattern/email.rb", "lib/string/pattern/generate.rb", "lib/string/pattern/validate.rb",
10-
"LICENSE","README.md",".yardopts",
10+
"LICENSE","README.md","CHANGELOG.md",".yardopts",
1111
'data/english/adjs.json', 'data/english/nouns.json', 'data/spanish/palabras0.json',
1212
'data/spanish/palabras1.json','data/spanish/palabras2.json','data/spanish/palabras3.json',
1313
'data/spanish/palabras4.json','data/spanish/palabras5.json','data/spanish/palabras6.json',
1414
'data/spanish/palabras7.json','data/spanish/palabras8.json','data/spanish/palabras9.json',
1515
'data/spanish/palabras10.json','data/spanish/palabras11.json',]
16-
s.extra_rdoc_files = ["LICENSE","README.md"]
16+
s.extra_rdoc_files = ["LICENSE","README.md","CHANGELOG.md"]
1717
s.homepage = 'https://github.com/MarioRuiz/string_pattern'
1818
s.license = 'MIT'
1919
s.add_runtime_dependency 'regexp_parser', '~> 2.5', '>= 2.5.0'

0 commit comments

Comments
 (0)