Skip to content

Commit 5374275

Browse files
committed
Initial commit
0 parents  commit 5374275

22 files changed

Lines changed: 398 additions & 0 deletions

.github/workflows/build-gems.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: Build gems
3+
4+
on:
5+
push:
6+
tags:
7+
- "v*"
8+
- "cross-gem/*"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
jobs:
16+
ci-data:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
result: ${{ steps.fetch.outputs.result }}
20+
steps:
21+
- uses: oxidize-rb/actions/fetch-ci-data@v1
22+
id: fetch
23+
with:
24+
supported-ruby-platforms: |
25+
exclude: ["arm-linux", "x64-mingw32"]
26+
stable-ruby-versions: |
27+
exclude: ["head"]
28+
29+
source-gem:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
34+
- uses: ruby/setup-ruby@v1
35+
with:
36+
bundler-cache: true
37+
38+
- name: Build gem
39+
run: bundle exec rake build
40+
41+
- uses: actions/upload-artifact@v7
42+
with:
43+
name: source-gem
44+
path: pkg/*.gem
45+
46+
cross-gem:
47+
name: Compile native gem for ${{ matrix.platform }}
48+
runs-on: ubuntu-latest
49+
needs: ci-data
50+
strategy:
51+
matrix:
52+
platform: ${{ fromJSON(needs.ci-data.outputs.result).supported-ruby-platforms }}
53+
steps:
54+
- uses: actions/checkout@v6
55+
56+
- uses: ruby/setup-ruby@v1
57+
with:
58+
bundler-cache: true
59+
60+
- uses: oxidize-rb/actions/cross-gem@v1
61+
id: cross-gem
62+
with:
63+
platform: ${{ matrix.platform }}
64+
ruby-versions: ${{ join(fromJSON(needs.ci-data.outputs.result).stable-ruby-versions, ',') }}
65+
66+
- uses: actions/upload-artifact@v7
67+
with:
68+
name: cross-gem
69+
path: ${{ steps.cross-gem.outputs.gem-path }}

.github/workflows/main.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Ruby
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
name: Ruby ${{ matrix.ruby }}
17+
strategy:
18+
matrix:
19+
ruby:
20+
- '4.0.2'
21+
22+
steps:
23+
- uses: actions/checkout@v6
24+
with:
25+
persist-credentials: false
26+
- name: Set up Ruby & Rust
27+
uses: oxidize-rb/actions/setup-ruby-and-rust@v1
28+
with:
29+
ruby-version: ${{ matrix.ruby }}
30+
bundler-cache: true
31+
cargo-cache: true
32+
rubygems: '4.0.8'
33+
- name: Run the default task
34+
run: bundle exec rake

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/
9+
*.bundle
10+
*.so
11+
*.o
12+
*.a
13+
mkmf.log
14+
target/

.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
AllCops:
2+
TargetRubyVersion: 3.2
3+
4+
Style/StringLiterals:
5+
EnforcedStyle: double_quotes
6+
7+
Style/StringLiteralsInInterpolation:
8+
EnforcedStyle: double_quotes

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Code of Conduct
2+
3+
"urlpattern" follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
4+
5+
* Participants will be tolerant of opposing views.
6+
* Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
7+
* When interpreting the words and actions of others, participants should always assume good intentions.
8+
* Behaviour which can be reasonably considered harassment will not be tolerated.
9+
10+
If you have any concerns about behaviour within this project, please contact us at ["bangseongbeom@gmail.com"](mailto:"bangseongbeom@gmail.com").

Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This Cargo.toml is here to let externals tools (IDEs, etc.) know that this is
2+
# a Rust project. Your extensions dependencies should be added to the Cargo.toml
3+
# in the ext/ directory.
4+
5+
[workspace]
6+
members = ["./ext/urlpattern"]
7+
resolver = "2"
8+
9+
[profile.release]
10+
# By default, debug symbols are stripped from the final binary which makes it
11+
# harder to debug if something goes wrong. It's recommended to keep debug
12+
# symbols in the release build so that you can debug the final binary if needed.
13+
debug = true

Gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
# Specify your gem's dependencies in urlpattern.gemspec
6+
gemspec
7+
8+
gem "irb"
9+
gem "rake", "~> 13.0"
10+
11+
gem "rake-compiler"
12+
13+
gem "minitest", "~> 5.16"
14+
15+
gem "rubocop", "~> 1.21"

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2026 방성범 (Bang Seongbeom)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Urlpattern
2+
3+
TODO: Delete this and the text below, and describe your gem
4+
5+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/urlpattern`. To experiment with that code, run `bin/console` for an interactive prompt.
6+
7+
## Installation
8+
9+
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10+
11+
Install the gem and add to the application's Gemfile by executing:
12+
13+
```bash
14+
bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
15+
```
16+
17+
If bundler is not being used to manage dependencies, install the gem by executing:
18+
19+
```bash
20+
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
21+
```
22+
23+
## Usage
24+
25+
TODO: Write usage instructions here
26+
27+
## Development
28+
29+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30+
31+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32+
33+
## Contributing
34+
35+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/urlpattern. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/urlpattern/blob/main/CODE_OF_CONDUCT.md).
36+
37+
## License
38+
39+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40+
41+
## Code of Conduct
42+
43+
Everyone interacting in the Urlpattern project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/urlpattern/blob/main/CODE_OF_CONDUCT.md).

Rakefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
require "bundler/gem_tasks"
4+
require "minitest/test_task"
5+
6+
Minitest::TestTask.create
7+
8+
require "rubocop/rake_task"
9+
10+
RuboCop::RakeTask.new
11+
12+
require "rb_sys/extensiontask"
13+
14+
task build: :compile
15+
16+
GEMSPEC = Gem::Specification.load("urlpattern.gemspec")
17+
18+
RbSys::ExtensionTask.new("urlpattern", GEMSPEC) do |ext|
19+
ext.lib_dir = "lib/urlpattern"
20+
end
21+
22+
task default: %i[compile test rubocop]

0 commit comments

Comments
 (0)