Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Specify files that shouldn't be modified by Fern
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish

on: [push]
jobs:
publish:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true

- name: Test gem
run: bundle install && bundle exec rake test

- name: Build and Push Gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
run: |
gem build monite.gemspec

gem push monite-*.gem --host https://rubygems.org/
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
*.gem
.env
36 changes: 36 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
AllCops:
TargetRubyVersion: 2.7

Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Layout/FirstHashElementLineBreak:
Enabled: true

Layout/MultilineHashKeyLineBreaks:
Enabled: true

# Generated files may be more complex than standard, disable
# these rules for now as a known limitation.
Metrics/ParameterLists:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/AbcSize:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec

gem "minitest", "~> 5.0"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.21"
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# monite-ruby-client
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true
require "rake/testtask"
require "rubocop/rake_task"

task default: %i[test rubocop]

Rake::TestTask.new do |t|
t.pattern = "./test/**/test_*.rb"
end

RuboCop::RakeTask.new
27 changes: 27 additions & 0 deletions lib/core/file_utilities.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true
require "faraday/multipart"
require "mini_mime"

module Monite
# Utility class for managing files.
class FileUtilities


# @param file_like [String, IO] The file to be uploaded, or a string path to the file.
# @return [Faraday::Multipart::FilePart]
def self.as_faraday_multipart(file_like:)
unless file_like.is_a?(String)
path = file_like.path
else
path = file_like
end
mime_type = MiniMime.lookup_by_filename(path)
unless mime_type.nil?
mime_type = mime_type.content_type
else
mime_type = "application/octet-stream"
end
Faraday::Multipart::FilePart.new(file_like, mime_type)
end
end
end
11 changes: 11 additions & 0 deletions lib/environment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Monite
class Environment

SANDBOX = "https://api.sandbox.monite.com/v1"
EU_PRODUCTION = "https://api.monite.com/v1"
NA_PRODUCTION = "https://us.api.monite.com/v1"

end
end
13 changes: 13 additions & 0 deletions lib/gemconfig.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true
module Monite
module Gemconfig
VERSION = ""
AUTHORS = [""].freeze
EMAIL = ""
SUMMARY = ""
DESCRIPTION = ""
HOMEPAGE = "https://github.com/team-monite/monite-ruby-client"
SOURCE_CODE_URI = "https://github.com/team-monite/monite-ruby-client"
CHANGELOG_URI = "https://github.com/team-monite/monite-ruby-client/blob/master/CHANGELOG.md"
end
end
Loading