Skip to content

Commit

Permalink
Merge pull request #3 from rinsed-org/feat/create-gem
Browse files Browse the repository at this point in the history
feat/create gem
  • Loading branch information
alexstoick authored Nov 21, 2023
2 parents 4b6d1bc + f3e41e1 commit 69cadbe
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: "*"
pull_request:
branches: "*"

jobs:
test:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@904f3fef85a9c80a3750cbe7d5159268fd5caa9f
with:
ruby-version: '3.0.6'
- name: Install dependencies
run: bundle install
- name: Build gem
run: rake build
# Enable this section to allow debugging via SSH
#- name: Setup upterm session
#uses: lhotari/action-upterm@v1
#with:
### limits ssh access and adds the ssh public key for the user which triggered the workflow
#limit-access-to-actor: true
- name: Install gem
run: cd pkg && gem install --local *.gem
- name: Run tests
run: ruby -rrb_snowflake_client spec/test.rb
env: # Or as an environment variable
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release
on:
push:
branches:
- "master"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@904f3fef85a9c80a3750cbe7d5159268fd5caa9f
with:
ruby-version: '3.0.6'
- name: Install dependencies
run: bundle install
- name: Build gem
run: rake build
- name: Build and publish to GitHub Package
uses: actionshub/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: rinsed-org
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/.project
/.rakeTasks
.idea/*

# ruby gems
*.gem
/.DS_Store
.env

5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

source "https://rubygems.org"

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

gem "bundler"
gem "rake"
gem "concurrent-ruby"
gem "connection_pool"
gem "jwt"
Expand Down
12 changes: 11 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
PATH
remote: .
specs:
rb_snowflake_client (0.0.1)

GEM
remote: https://rubygems.org/
specs:
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
jwt (2.7.1)
oj (3.16.1)
rake (13.1.0)

PLATFORMS
arm64-darwin-21
arm64-darwin-22

DEPENDENCIES
bundler
concurrent-ruby
connection_pool
jwt
oj
rake
rb_snowflake_client!

BUNDLED WITH
2.4.14
2.4.19
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Dotan Nahum

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.
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true

require 'bundler/gem_tasks'
6 changes: 6 additions & 0 deletions lib/rb_snowflake_client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

require "rb_snowflake_client/snowflake_client"

module RbSnowflakeClient
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions lib/rb_snowflake_client/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module RbSnowflakeClient
VERSION = '0.0.2'
end
21 changes: 21 additions & 0 deletions rb_snowflake_client.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require_relative "lib/rb_snowflake_client/version"

Gem::Specification.new do |s|
s.name = "rb_snowflake_client"
s.version = RbSnowflakeClient::VERSION
s.summary = "Snowflake connector for Ruby"
s.author = "Rinsed"
s.email = ["[email protected]", "[email protected]"]
s.description = <<~DESC
Using the HTTP V2 Api for Snowflake runs queries & creates native Ruby objects.
DESC
s.license = "MIT" # TODO: double check

s.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features|vendor)/}) }
end

s.require_paths = ["lib"]
end
2 changes: 1 addition & 1 deletion test.rb → spec/test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "benchmark"
require_relative "snowflake_client"
require "rb_snowflake_client"


def new_client
Expand Down

0 comments on commit 69cadbe

Please sign in to comment.