Skip to content

Commit 00103af

Browse files
committed
ruby4.0-*: New packages
Changes: - Ruby 4.0 incorporated the following gems: `benchmark`, `logger` and `reline`. This means that we don't need to create separate packages for them. - Several of our Ruby module packages had a hardcoded `rubyMM` variable set to 3.4. They now use `var-transforms` to derive the Ruby version from the package name. - ruby4.0-octokit: Cherry-pick fix to bump octokit requirement - ruby4.0-jruby-openssl: Remove. Upstream said on jruby/jruby-openssl#337 that it doesn't make sense to ship this module for Ruby as it is a JRuby specific project. There are no recent reverse deps for jruby-openssl either, so let's remove it. - ruby4.0-rails-8.1: Add `ruby${{vars.rubyMM}}-psych` and `pkgconf` to test dependencies. Test by installing `sidekiq` instead of `bcrypt` (the latter fails to build with Ruby 4.0). Signed-off-by: Sergio Durigan Junior <sergiodj@chainguard.dev>
1 parent 4a5b76e commit 00103af

177 files changed

Lines changed: 14243 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ruby4.0-activemodel.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package:
2+
name: ruby4.0-activemodel
3+
version: "8.1.1" # !!! Update activesupport at the same time
4+
epoch: 0
5+
description: A toolkit for building modeling frameworks like Active Record. Rich support for attributes, callbacks, validations, serialization, internationalization, and testing.
6+
copyright:
7+
- license: MIT
8+
dependencies:
9+
runtime:
10+
- ruby${{vars.rubyMM}}-activesupport
11+
12+
environment:
13+
contents:
14+
packages:
15+
- build-base
16+
- busybox
17+
- ca-certificates-bundle
18+
- git
19+
- ruby-${{vars.rubyMM}}
20+
- ruby-${{vars.rubyMM}}-dev
21+
22+
pipeline:
23+
- uses: git-checkout
24+
with:
25+
repository: https://github.com/rails/rails
26+
tag: v${{package.version}}
27+
expected-commit: 90a1eaa1b30ba1f2d524e197460e549c03cf5698
28+
29+
- uses: ruby/build
30+
with:
31+
gem: ${{vars.gem}}
32+
dir: activemodel
33+
34+
- uses: ruby/install
35+
with:
36+
gem: ${{vars.gem}}
37+
version: ${{package.version}}
38+
dir: activemodel
39+
40+
- uses: ruby/clean
41+
42+
vars:
43+
gem: activemodel
44+
45+
test:
46+
pipeline:
47+
- name: Validate import
48+
runs: ruby -e "require 'active_model'"
49+
- name: Basic example
50+
runs: |
51+
cat > example.rb <<EOF
52+
require 'active_model'
53+
class Person
54+
include ActiveModel::Model
55+
attr_accessor :name, :age
56+
validates :name, presence: true
57+
end
58+
person = Person.new(name: 'bob')
59+
puts person.valid?
60+
EOF
61+
62+
ruby example.rb
63+
64+
update:
65+
enabled: true
66+
github:
67+
identifier: rails/rails
68+
strip-prefix: v
69+
70+
var-transforms:
71+
- from: ${{package.name}}
72+
match: ^ruby(\d\.\d+)-.*
73+
replace: $1
74+
to: rubyMM

ruby4.0-activerecord.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
package:
2+
name: ruby4.0-activerecord
3+
version: "8.1.1"
4+
epoch: 0
5+
description: Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in.
6+
copyright:
7+
- license: MIT
8+
dependencies:
9+
runtime:
10+
- ruby${{vars.rubyMM}}-activemodel
11+
- ruby${{vars.rubyMM}}-activesupport
12+
- ruby${{vars.rubyMM}}-timeout
13+
- ruby-${{vars.rubyMM}}
14+
15+
environment:
16+
contents:
17+
packages:
18+
- ruby-${{vars.rubyMM}}
19+
- ruby-${{vars.rubyMM}}-dev
20+
21+
pipeline:
22+
- uses: git-checkout
23+
with:
24+
repository: https://github.com/rails/rails
25+
tag: v${{package.version}}
26+
expected-commit: 90a1eaa1b30ba1f2d524e197460e549c03cf5698
27+
28+
- uses: ruby/build
29+
with:
30+
gem: ${{vars.gem}}
31+
dir: activerecord
32+
33+
- uses: ruby/install
34+
with:
35+
gem: ${{vars.gem}}
36+
version: ${{package.version}}
37+
dir: activerecord
38+
39+
- uses: ruby/clean
40+
41+
vars:
42+
gem: activerecord
43+
44+
test:
45+
pipeline:
46+
- name: Validate import
47+
runs: ruby -e "require 'active_record'"
48+
- name: Basic example
49+
runs: |
50+
gem install sqlite3
51+
52+
cat > example.rb <<EOF
53+
# Test db CRUD operations
54+
55+
require 'active_record'
56+
57+
ActiveRecord::Base.establish_connection(
58+
:adapter => "sqlite3",
59+
:database => ":memory:"
60+
)
61+
62+
ActiveRecord::Schema.define do
63+
create_table :tests do |table|
64+
table.column :name, :string
65+
table.column :foo, :string
66+
end
67+
end
68+
69+
class Test < ActiveRecord::Base
70+
end
71+
72+
# Test record creation / reading
73+
test_thing = Test.new(name: "Linky", foo: "bar")
74+
id = test_thing.save
75+
76+
test_thing = Test.find(id)
77+
raise 'ActiveRecord#new failed' unless test_thing.name == "Linky"
78+
79+
# Test record updating
80+
test_thing.foo = "baz"
81+
id = test_thing.save
82+
83+
test_thing = Test.find(id)
84+
raise 'ActiveRecord#exec_update failed' unless test_thing.foo == "baz"
85+
86+
# Test record deletion
87+
test_thing.destroy
88+
89+
begin
90+
test_thing = Test.find(id)
91+
rescue ActiveRecord::RecordNotFound
92+
test_thing = nil
93+
end
94+
95+
raise 'ActiveRecord#destroy failed' unless test_thing.nil?
96+
97+
puts 'ActiveRecord tests passed.'
98+
EOF
99+
100+
ruby example.rb
101+
102+
update:
103+
enabled: true
104+
github:
105+
identifier: rails/rails
106+
strip-prefix: v
107+
108+
var-transforms:
109+
- from: ${{package.name}}
110+
match: ^ruby(\d\.\d+)-.*
111+
replace: $1
112+
to: rubyMM

ruby4.0-activesupport.yaml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
package:
2+
name: ruby4.0-activesupport
3+
version: "8.1.1" # !!! Update activesupport at the same time
4+
epoch: 0
5+
description: A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing.
6+
copyright:
7+
- license: MIT
8+
dependencies:
9+
runtime:
10+
- ruby${{vars.rubyMM}}-concurrent-ruby
11+
- ruby${{vars.rubyMM}}-connection_pool
12+
- ruby${{vars.rubyMM}}-i18n
13+
- ruby${{vars.rubyMM}}-securerandom
14+
- ruby${{vars.rubyMM}}-tzinfo
15+
- ruby${{vars.rubyMM}}-uri
16+
17+
environment:
18+
contents:
19+
packages:
20+
- build-base
21+
- busybox
22+
- ca-certificates-bundle
23+
- git
24+
- ruby-${{vars.rubyMM}}
25+
- ruby-${{vars.rubyMM}}-dev
26+
27+
pipeline:
28+
- uses: git-checkout
29+
with:
30+
repository: https://github.com/rails/rails
31+
tag: v${{package.version}}
32+
expected-commit: 90a1eaa1b30ba1f2d524e197460e549c03cf5698
33+
34+
- uses: ruby/build
35+
with:
36+
gem: ${{vars.gem}}
37+
dir: activesupport
38+
39+
- uses: ruby/install
40+
with:
41+
gem: ${{vars.gem}}
42+
version: ${{package.version}}
43+
dir: activesupport
44+
45+
- uses: ruby/clean
46+
47+
vars:
48+
gem: activesupport
49+
50+
update:
51+
enabled: true
52+
github:
53+
identifier: rails/rails
54+
strip-prefix: v
55+
56+
test:
57+
pipeline:
58+
- name: Basic require test
59+
runs: |
60+
ruby -e "require 'active_support'"
61+
- name: Test core extensions
62+
runs: |
63+
ruby <<EOF-
64+
require 'active_support'
65+
require 'active_support/core_ext'
66+
67+
# Test Array extensions
68+
raise 'Array#to_sentence failed' unless ['one', 'two'].to_sentence == 'one and two'
69+
70+
# Test Hash extensions
71+
raise 'Hash#deep_merge failed' unless {a: {b: 1}}.deep_merge(a: {c: 2}) == {a: {b: 1, c: 2}}
72+
73+
# Test String extensions
74+
raise 'String#pluralize failed' unless 'octopus'.pluralize == 'octopi'
75+
76+
# Test Numeric extensions
77+
raise 'Numeric#megabytes failed' unless 5.megabytes == 5_242_880
78+
79+
# Test Date/Time extensions
80+
require 'active_support/time'
81+
raise 'Time.current failed' unless Time.respond_to?(:current)
82+
83+
puts 'ActiveSupport core extensions tests passed'
84+
EOF-
85+
- name: Test JSON support
86+
runs: |
87+
ruby <<EOF-
88+
require 'active_support'
89+
require 'active_support/json'
90+
91+
data = ActiveSupport::JSON.decode('"hello"') # Changed this line
92+
raise 'JSON decode failed' unless data == 'hello'
93+
94+
puts 'ActiveSupport JSON tests passed'
95+
EOF-
96+
- name: Test inflector
97+
runs: |
98+
ruby <<EOF-
99+
require 'active_support'
100+
require 'active_support/inflector'
101+
102+
raise 'Inflector failed' unless 'person'.pluralize == 'people'
103+
raise 'Inflector failed' unless 'octopi'.singularize == 'octopus'
104+
raise 'Inflector failed' unless 'post'.classify == 'Post'
105+
106+
puts 'ActiveSupport Inflector tests passed'
107+
EOF-
108+
109+
var-transforms:
110+
- from: ${{package.name}}
111+
match: ^ruby(\d\.\d+)-.*
112+
replace: $1
113+
to: rubyMM

ruby4.0-addressable.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package:
2+
name: ruby4.0-addressable
3+
version: "2.8.8"
4+
epoch: 0
5+
description: Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. It is flexible, offers heuristic parsing, and additionally provides extensive support for IRIs and URI templates.
6+
copyright:
7+
- license: Apache-2.0
8+
dependencies:
9+
runtime:
10+
- ruby${{vars.rubyMM}}-public_suffix
11+
12+
environment:
13+
contents:
14+
packages:
15+
- build-base
16+
- busybox
17+
- ca-certificates-bundle
18+
- git
19+
- ruby-${{vars.rubyMM}}
20+
- ruby-${{vars.rubyMM}}-dev
21+
22+
vars:
23+
gem: addressable
24+
25+
pipeline:
26+
- uses: git-checkout
27+
with:
28+
repository: https://github.com/sporkmonger/addressable
29+
tag: addressable-${{package.version}}
30+
expected-commit: 111af8e8d3260dbd5b10a2dfec42a4e129d18705
31+
32+
# see https://github.com/sporkmonger/addressable/issues/565
33+
- name: "remove wrong reference to a file"
34+
runs: |
35+
sed -i 's/"data\/unicode\.data"\.freeze, //g' addressable.gemspec
36+
37+
- uses: ruby/build
38+
with:
39+
gem: ${{vars.gem}}
40+
41+
- uses: ruby/install
42+
with:
43+
gem: ${{vars.gem}}
44+
version: ${{package.version}}
45+
46+
- uses: ruby/clean
47+
48+
- name: "remove unused /usr/bin/ directory"
49+
runs: rm -r ${{targets.destdir}}/usr/bin
50+
51+
test:
52+
pipeline:
53+
- runs: ruby -e "require 'addressable'"
54+
- name: Parse URI
55+
runs: |
56+
cat <<EOF > /tmp/test.rb
57+
require 'addressable/uri'
58+
uri = Addressable::URI.parse("https://edu.chainguard.dev/open-source/wolfi/overview/")
59+
uri.scheme
60+
uri.host
61+
uri.path
62+
uri.normalize
63+
EOF
64+
ruby /tmp/test.rb
65+
66+
update:
67+
enabled: true
68+
github:
69+
identifier: sporkmonger/addressable
70+
strip-prefix: addressable-
71+
use-tag: true
72+
73+
var-transforms:
74+
- from: ${{package.name}}
75+
match: ^ruby(\d\.\d+)-.*
76+
replace: $1
77+
to: rubyMM

0 commit comments

Comments
 (0)