Skip to content
Open

GEM #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Ruby

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: macos-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.1.2'

steps:
- uses: actions/checkout@v4
- name: Print Environment Variables
run: printenv
- name: List directory contents
run: ls -R codemonkey/
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Verify Ruby version
run: ruby -v
- name: Install dependencies
run: bundle install --gemfile=codemonkey/Gemfile
- name: Run the default task
working-directory: codemonkey/
env:
BUNDLE_GEMFILE: Gemfile
run: bundle exec rake --rakefile=Rakefile

13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,16 @@ build-iPhoneSimulator/
# .rubocop-https?--*

# End of https://www.toptal.com/developers/gitignore/api/ruby,macos

condemonkey/.bundle/
condemonkey/.yardoc
condemonkey/_yardoc/
condemonkey/coverage/
condemonkey/doc/
condemonkey/pkg/
condemonkey/spec/reports/
condemonkey/tmp/

# rspec failure tracking
.rspec_status

1 change: 0 additions & 1 deletion .rspec

This file was deleted.

14 changes: 0 additions & 14 deletions Gemfile

This file was deleted.

133 changes: 0 additions & 133 deletions codemonkey.rb

This file was deleted.

3 changes: 3 additions & 0 deletions codemonkey/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
7 changes: 7 additions & 0 deletions .rubocop.yml → codemonkey/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
AllCops:
TargetRubyVersion: 3.0
NewCops: enable

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

Metrics/ClassLength:
Max: 150
Enabled: true
Expand Down
19 changes: 19 additions & 0 deletions codemonkey/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Specify your gem's dependencies in codemonkey.gemspec
gemspec

gem "dotenv"
gem "pry-byebug"
gem "pry-rails"
gem "rake", "~> 13.0"
gem "rdoc"
gem "rubocop"

group :test do
gem "rspec"
gem "vcr"
gem "webmock"
end
21 changes: 21 additions & 0 deletions codemonkey/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 lmoreira-runtime

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
35 changes: 35 additions & 0 deletions codemonkey/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Codemonkey

TODO: Delete this and the text below, and describe your gem

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/codemonkey`. To experiment with that code, run `bin/console` for an interactive prompt.

## Installation

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.

Install the gem and add to the application's Gemfile by executing:

$ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG

## Usage

TODO: Write usage instructions here

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

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).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/codemonkey.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
12 changes: 12 additions & 0 deletions codemonkey/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"

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

require "rubocop/rake_task"

RuboCop::RakeTask.new

task default: %i[spec rubocop]
11 changes: 11 additions & 0 deletions codemonkey/bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "codemonkey"

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

require "irb"
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions codemonkey/bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
47 changes: 47 additions & 0 deletions codemonkey/codemonkey.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# frozen_string_literal: true

require_relative "lib/codemonkey/version"

Gem::Specification.new do |spec|
spec.name = "codemonkey"
spec.version = Codemonkey::VERSION
spec.authors = ["Luis Moreira"]
spec.email = ["[email protected]"]

spec.summary = "A Ruby interface for the CodeMonkey API"
spec.description = "Codemonkey is a class that interfaces with CodeMonkey API, from Runtime Labs. It provides methods to manage GitHub issues, branches, and pull requests, and to interact with an LLM API for resolving issues autonomously."
spec.homepage = "https://www.runtime-revolution.com/"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.0.0"

# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"

spec.metadata["homepage_uri"] = spec.homepage
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
# gemspec = File.basename(__FILE__)
# spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
# ls.readlines("\x0", chomp: true).reject do |f|
# (f == gemspec) ||
# f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
# end
# end
spec.files = Dir["lib/**/*.rb"]
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

# Uncomment to register a new dependency of your gem
spec.add_dependency "dotenv", "~> 3.1"
spec.add_dependency "rspec", "~> 3.13"
spec.add_dependency "rubocop", "~> 1.65"
spec.add_dependency "vcr", "~> 6.2"
spec.add_dependency "webmock", "~> 3.23"

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
spec.metadata["rubygems_mfa_required"] = "true"
end
Loading