Skip to content

Commit 98605b1

Browse files
committed
Rubocop etc
1 parent 7fe90c8 commit 98605b1

9 files changed

Lines changed: 71 additions & 42 deletions

File tree

.rubocop.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1+
plugins:
2+
- rubocop-rake
3+
- rubocop-rspec
4+
15
AllCops:
26
TargetRubyVersion: 3.2
7+
NewCops: enable
8+
9+
Lint/UnusedMethodArgument:
10+
AllowUnusedKeywordArguments: true
11+
12+
Metrics/AbcSize:
13+
Enabled: false
14+
15+
Metrics/CyclomaticComplexity:
16+
Enabled: false
17+
18+
Metrics/PerceivedComplexity:
19+
Enabled: false
320

4-
Style/StringLiterals:
5-
EnforcedStyle: double_quotes
21+
Metrics/MethodLength:
22+
Enabled: false
623

7-
Style/StringLiteralsInInterpolation:
8-
EnforcedStyle: double_quotes
24+
Metrics/ParameterLists:
25+
Enabled: false

Gemfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# frozen_string_literal: true
22

3-
source "https://rubygems.org"
3+
source 'https://rubygems.org'
44

5-
# Specify your gem's dependencies in tool_forge.gemspec
5+
# Specify your gem's dependencies in docker_mcp.gemspec
66
gemspec
77

8-
gem "irb"
9-
gem "rake", "~> 13.0"
10-
11-
gem "rspec", "~> 3.0"
12-
13-
gem "rubocop", "~> 1.21"
8+
gem 'irb'
9+
gem 'rake'
10+
gem 'rspec'
11+
gem 'rubocop'
12+
gem 'rubocop-rake'
13+
gem 'rubocop-rspec'
14+
gem 'simplecov'

Rakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# frozen_string_literal: true
22

3-
require "bundler/gem_tasks"
4-
require "rspec/core/rake_task"
3+
require 'bundler/gem_tasks'
4+
require 'rspec/core/rake_task'
55

66
RSpec::Core::RakeTask.new(:spec)
77

8-
require "rubocop/rake_task"
8+
require 'rubocop/rake_task'
99

1010
RuboCop::RakeTask.new
1111

bin/console

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4-
require "bundler/setup"
5-
require "tool_forge"
4+
require 'bundler/setup'
5+
require 'tool_forge'
66

77
# You can add fixtures and/or initialization code here to make experimenting
88
# with your gem easier. You can also use a different console, if you like.
99

10-
require "irb"
10+
require 'irb'
1111
IRB.start(__FILE__)

lib/tool_forge.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# frozen_string_literal: true
22

3-
require_relative "tool_forge/version"
3+
require 'zeitwerk'
4+
5+
loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
6+
loader.setup # ready!
7+
8+
require_relative 'tool_forge/version'
49

510
module ToolForge
611
class Error < StandardError; end

lib/tool_forge/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module ToolForge
4-
VERSION = "0.0.1"
4+
VERSION = '0.0.1'
55
end

spec/spec_helper.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# frozen_string_literal: true
22

3-
require "tool_forge"
3+
require 'simplecov'
4+
5+
SimpleCov.start do
6+
enable_coverage :branch
7+
end
8+
9+
require 'tool_forge'
410

511
RSpec.configure do |config|
612
# Enable flags like --only-failures and --next-failure
7-
config.example_status_persistence_file_path = ".rspec_status"
13+
config.example_status_persistence_file_path = '.rspec_status'
814

915
# Disable RSpec exposing methods globally on `Module` and `main`
1016
config.disable_monkey_patching!

spec/tool_forge_spec.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# frozen_string_literal: true
22

33
RSpec.describe ToolForge do
4-
it "has a version number" do
5-
expect(ToolForge::VERSION).not_to be nil
6-
end
7-
8-
it "does something useful" do
9-
expect(false).to eq(true)
4+
it 'has a version number' do
5+
expect(ToolForge::VERSION).not_to be_nil
106
end
117
end

tool_forge.gemspec

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# frozen_string_literal: true
22

3-
require_relative "lib/tool_forge/version"
3+
require_relative 'lib/tool_forge/version'
44

55
Gem::Specification.new do |spec|
6-
spec.name = "tool_forge"
6+
spec.name = 'tool_forge'
77
spec.version = ToolForge::VERSION
8-
spec.authors = ["Aaron F Stanton"]
9-
spec.email = ["afstanton@gmail.com"]
8+
spec.authors = ['Aaron F Stanton']
9+
spec.email = ['afstanton@gmail.com']
1010

11-
spec.summary = "Build AI tools for LLMs with a single DSL"
12-
spec.description = "A Ruby gem for building AI tools for large language models using a simple domain-specific language."
13-
spec.homepage = "https://github.com/afstanton/tool_forge"
14-
spec.license = "MIT"
15-
spec.required_ruby_version = ">= 3.2.0"
11+
spec.summary = 'Build AI tools for LLMs with a single DSL'
12+
spec.description = 'A Ruby gem for building AI tools for large language models using a simple ' \
13+
'domain-specific language.'
14+
spec.homepage = 'https://github.com/afstanton/tool_forge'
15+
spec.license = 'MIT'
16+
spec.required_ruby_version = '>= 3.2.0'
1617

17-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
18-
spec.metadata["homepage_uri"] = spec.homepage
19-
spec.metadata["source_code_uri"] = spec.homepage
18+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
19+
spec.metadata['homepage_uri'] = spec.homepage
20+
spec.metadata['source_code_uri'] = spec.homepage
21+
spec.metadata['rubygems_mfa_required'] = 'true'
2022

2123
# Specify which files should be added to the gem when it is released.
2224
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -27,13 +29,15 @@ Gem::Specification.new do |spec|
2729
f.start_with?(*%w[bin/ Gemfile .gitignore .rspec spec/ .github/ .rubocop.yml])
2830
end
2931
end
30-
spec.bindir = "exe"
32+
spec.bindir = 'exe'
3133
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32-
spec.require_paths = ["lib"]
34+
spec.require_paths = ['lib']
3335

3436
# Uncomment to register a new dependency of your gem
3537
# spec.add_dependency "example-gem", "~> 1.0"
3638

39+
spec.add_dependency 'zeitwerk'
40+
3741
# For more information and examples about making a new gem, check out our
3842
# guide at: https://bundler.io/guides/creating_gem.html
3943
end

0 commit comments

Comments
 (0)