Scaffold fiken gem: gemspec, dev tooling, rubocop, and CI

This commit is contained in:
2026-05-29 15:00:48 +02:00
commit 9eec49aec4
12 changed files with 155 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["3.1", "3.2", "3.3"]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rspec
- run: bundle exec rubocop
+8
View File
@@ -0,0 +1,8 @@
/.bundle/
/vendor/bundle/
/pkg/
/tmp/
/coverage/
*.gem
Gemfile.lock
.rspec_status
+3
View File
@@ -0,0 +1,3 @@
--require spec_helper
--format documentation
--color
+29
View File
@@ -0,0 +1,29 @@
AllCops:
TargetRubyVersion: 3.1
NewCops: enable
SuggestExtensions: false
Style/Documentation:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Metrics/MethodLength:
Max: 20
Metrics/BlockLength:
Exclude:
- "spec/**/*"
- "*.gemspec"
Metrics/AbcSize:
Max: 25
Metrics/ParameterLists:
CountKeywordArgs: false
Naming/PredicateMethod:
AllowedMethods:
- delete
- delete_path
+5
View File
@@ -0,0 +1,5 @@
# Changelog
## [Unreleased]
- Initial work toward a resource-oriented Ruby client for the Fiken API v2.
+13
View File
@@ -0,0 +1,13 @@
# frozen_string_literal: true
source "https://rubygems.org"
gemspec
group :development, :test do
gem "rake", "~> 13.0"
gem "rspec", "~> 3.13"
gem "rubocop", "~> 1.60"
gem "vcr", "~> 6.2"
gem "webmock", "~> 3.19"
end
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2026 Runar Ingebrigtsen
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.
+9
View File
@@ -0,0 +1,9 @@
# frozen_string_literal: true
require "rspec/core/rake_task"
require "rubocop/rake_task"
RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new
task default: %i[spec rubocop]
Executable
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "fiken"
require "irb"
IRB.start(__FILE__)
Executable
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
bundle install
+29
View File
@@ -0,0 +1,29 @@
# frozen_string_literal: true
require_relative "lib/fiken/version"
Gem::Specification.new do |spec|
spec.name = "fiken"
spec.version = Fiken::VERSION
spec.authors = ["Runar Ingebrigtsen"]
spec.email = ["runar@rin.no"]
spec.summary = "Ruby client for the Fiken API v2"
spec.description = "A resource-oriented Ruby client for the Fiken accounting API (v2), " \
"with personal-token and OAuth2 authentication, pagination, and error handling."
spec.homepage = "https://github.com/runari/fiken"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.1"
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
spec.metadata["rubygems_mfa_required"] = "true"
spec.files = Dir["lib/**/*.rb", "README.md", "CHANGELOG.md", "LICENSE.txt"]
spec.require_paths = ["lib"]
spec.add_dependency "faraday", "~> 2.0"
spec.add_dependency "faraday-multipart", "~> 1.0"
spec.add_dependency "faraday-retry", "~> 2.0"
end
+5
View File
@@ -0,0 +1,5 @@
# frozen_string_literal: true
module Fiken
VERSION = "0.1.0"
end