Skip to content

Commit 9490563

Browse files
authored
Merge pull request #1 from ArkieCoder/upgrade-ruby-3.2
Upgrade to Ruby 3.2
2 parents 78162a7 + bbcd588 commit 9490563

24 files changed

Lines changed: 605 additions & 505 deletions

.github/workflows/json-syntax.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: JSON Syntax Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.json'
7+
8+
jobs:
9+
json-syntax:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Check JSON syntax
14+
run: |
15+
find . -name '*.json' | xargs -I {} jq . {} > /dev/null

.github/workflows/ruby-syntax.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Ruby Syntax Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.rb'
7+
8+
jobs:
9+
ruby-syntax:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: '3.2'
17+
- name: Check Ruby syntax
18+
run: |
19+
find . -name '*.rb' -exec ruby -c {} \;

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.0

AGENTS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Ruby Primer Agent Instructions
2+
3+
### Build, Lint, and Test
4+
5+
- **Testing**: This project uses RSpec.
6+
- Run all tests: `bundle exec rspec`
7+
- Run a single test file: `bundle exec rspec examples_spec/0.0.2.rb`
8+
- **Linting**: There is no linting configuration. Please adhere to the style of existing code.
9+
10+
### Code Style
11+
12+
- **Formatting**: Use 2-space indentation.
13+
- **Naming**: Use `snake_case` for variables and methods.
14+
- **Strings**: Use double quotes for strings, especially with interpolation. Use single quotes for `require` statements.
15+
- **Methods**: Use parentheses for method definitions with arguments.
16+
- **Error Handling**: Not specified.
17+
- **Imports**: Use `require`.
18+
- **Types**: Not specified.
19+
- **General**: Follow existing patterns in the code. Explicit `return` is preferred.

Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
source 'https://rubygems.org'
2-
gem 'colorize'
3-
gem 'figlet'
4-
gem 'rspec'
5-
gem 'json'
2+
gem 'colorize', '~> 1.1.0'
3+
gem 'ruby_figlet', '~> 0.6'
4+
gem 'rspec', '~> 3.13.0'

examples_spec/0.0.2.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'rspec'
22

33
describe "example code" do
4-
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
4+
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
55

6-
it "results in 3" do
7-
expect(output).to eq("3")
8-
end
6+
it "results in 3" do
7+
expect(output).to eq("3")
8+
end
99
end

examples_spec/0.1.2.rb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33

44
describe "example code" do
5-
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
6-
let(:rspec_methods) { [
7-
:as_null_object,
8-
:null_object?,
9-
:pretty_inspect,
10-
:pretty_print,
11-
:pretty_print_cycle,
12-
:pretty_print_inspect,
13-
:pretty_print_instance_variables,
14-
:received_message?,
15-
:should,
16-
:should_not,
17-
:should_not_receive,
18-
:should_receive,
19-
:stub,
20-
:stub_chain,
5+
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
6+
let(:rspec_methods) { [
7+
:as_null_object,
8+
:null_object?,
9+
:pretty_inspect,
10+
:pretty_print,
11+
:pretty_print_cycle,
12+
:pretty_print_inspect,
13+
:pretty_print_instance_variables,
14+
:received_message?,
15+
:should,
16+
:should_not,
17+
:should_not_receive,
18+
:should_receive,
19+
:stub,
20+
:stub_chain,
2121
:to_json,
22-
:unstub,
23-
]
24-
}
25-
let(:sorted_methods) { 1.methods.sort - rspec_methods }
22+
:unstub,
23+
]
24+
}
25+
let(:sorted_methods) { 1.methods.sort - rspec_methods }
2626

27-
it "should sort the method list" do
28-
expect(eval(output)).to eq(sorted_methods)
29-
end
27+
it "should sort the method list" do
28+
expect(eval(output)).to eq(sorted_methods)
29+
end
3030
end

examples_spec/0.1.4.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'rspec'
22

33
describe "example code" do
4-
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
4+
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
55

6-
it "should check if two is between one and three" do
7-
expect(eval(output)).to eq(2.between?(1,3))
8-
end
6+
it "should check if two is between one and three" do
7+
expect(eval(output)).to eq(2.between?(1,3))
8+
end
99
end

examples_spec/0.2.1.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'rspec'
22

33
describe "example code" do
4-
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
4+
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
55

6-
it "should evaluate to seven" do
7-
expect(output).to eq("7")
8-
end
6+
it "should evaluate to seven" do
7+
expect(output).to eq("7")
8+
end
99
end

examples_spec/1.0.0.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
require 'rspec'
22

33
describe "example code" do
4-
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
4+
let(:output) { `#{RbConfig.ruby} __TMPFILE__`.chomp }
55

6-
it "should be a string" do
7-
expect(output.is_a?(String)).to be(true)
8-
end
6+
it "should be a string" do
7+
expect(output.is_a?(String)).to be(true)
8+
end
99

10-
it "should equal 'RubyMonk'" do
11-
expect(output).to eq("RubyMonk")
12-
end
10+
it "should equal 'RubyMonk'" do
11+
expect(output).to eq("RubyMonk")
12+
end
1313
end

0 commit comments

Comments
 (0)