feat: first commit of basic bundle gem setup
Some checks failed
RuboCop / build (push) Failing after 3s

This commit is contained in:
David Bailey 2023-11-15 19:43:19 +01:00
parent 3951ab4c8b
commit b1de04fabb
14 changed files with 276 additions and 2 deletions

View file

@ -0,0 +1,28 @@
name: RuboCop
on: [push, pull_request]
jobs:
build:
runs-on: docker
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 2.7
uses: github.com/ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-rubocop-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set without 'default doc job cable storage ujs test db'
bundle install --jobs 4 --retry 3
- name: Run RuboCop
run: bundle exec rubocop --parallel

13
.rubocop.yml Normal file
View file

@ -0,0 +1,13 @@
AllCops:
TargetRubyVersion: 2.6
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes
Layout/LineLength:
Max: 120

14
Gemfile Normal file
View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in comfpile.gemspec
gemspec
gem "rake", "~> 13.0"
gem "minitest", "~> 5.0"
gem "rubocop", "~> 1.21"
gem "solargraph", "~> 0.49.0"

82
Gemfile.lock Normal file
View file

@ -0,0 +1,82 @@
PATH
remote: .
specs:
comfpile (0.1.0)
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
backport (1.2.0)
benchmark (0.3.0)
diff-lcs (1.5.0)
e2mmap (0.1.0)
jaro_winkler (1.5.6)
json (2.6.3)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
minitest (5.20.0)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rbs (2.8.4)
regexp_parser (2.8.2)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.6)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
solargraph (0.49.0)
backport (~> 1.2)
benchmark
bundler (~> 2.0)
diff-lcs (~> 1.4)
e2mmap
jaro_winkler (~> 1.5)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
parser (~> 3.0)
rbs (~> 2.0)
reverse_markdown (~> 2.0)
rubocop (~> 1.38)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
thor (1.3.0)
tilt (2.3.0)
unicode-display_width (2.5.0)
yard (0.9.34)
PLATFORMS
x86_64-linux
DEPENDENCIES
comfpile!
minitest (~> 5.0)
rake (~> 13.0)
rubocop (~> 1.21)
solargraph (~> 0.49.0)
BUNDLED WITH
2.4.17

View file

@ -1,3 +1,31 @@
# comfpile
# Comfpile
Comfortable compiling - in-source defs, no bloat, no mess
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/comfpile`. To experiment with that code, run `bin/console` for an interactive prompt.
## Installation
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_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_PRIOR_TO_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_PRIOR_TO_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 test` 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]/comfpile.

16
Rakefile Normal file
View file

@ -0,0 +1,16 @@
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/test_*.rb"]
end
require "rubocop/rake_task"
RuboCop::RakeTask.new
task default: %i[test rubocop]

11
bin/console Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "bundler/setup"
require "comfpile"
# 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
bin/setup Executable file
View file

@ -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

38
comfpile.gemspec Normal file
View file

@ -0,0 +1,38 @@
# frozen_string_literal: true
require_relative "lib/comfpile/version"
Gem::Specification.new do |spec|
spec.name = "comfpile"
spec.version = Comfpile::VERSION
spec.authors = ["Xasin, Neira & Mesh"]
spec.email = ["davidbailey.2889@gmail.com"]
spec.summary = "Comfy Compiling, language agnostic & flexible"
spec.description = ""
spec.homepage = "https://forgejo.lucidragons.de/lucidergs/comfpile"
spec.required_ruby_version = ">= 2.6.0"
spec.metadata["allowed_push_host"] = "https://forgejo.lucidragons.de/"
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://forgejo.lucidragons.de/lucidergs/comfpile"
# 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.
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(File.expand_path(f) == __FILE__) ||
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
end
end
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 "example-gem", "~> 1.0"
# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
end

8
lib/comfpile.rb Normal file
View file

@ -0,0 +1,8 @@
# frozen_string_literal: true
require_relative "comfpile/version"
module Comfpile
class Error < StandardError; end
# Your code goes here...
end

5
lib/comfpile/version.rb Normal file
View file

@ -0,0 +1,5 @@
# frozen_string_literal: true
module Comfpile
VERSION = "0.1.0"
end

4
sig/comfpile.rbs Normal file
View file

@ -0,0 +1,4 @@
module Comfpile
VERSION: String
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
end

13
test/test_comfpile.rb Normal file
View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
require "test_helper"
class TestComfpile < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Comfpile::VERSION
end
def test_it_does_something_useful
assert false
end
end

6
test/test_helper.rb Normal file
View file

@ -0,0 +1,6 @@
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "comfpile"
require "minitest/autorun"