Skip to content

Commit

Permalink
Swap to using bundle for building
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Feb 19, 2024
1 parent 9edfdef commit 55dd4bd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions languages/ruby/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.lock
*.gem
bitwarden_sdk_secrets/lib/schemas.rb
bitwarden_sdk_secrets/pkg
8 changes: 6 additions & 2 deletions languages/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,16 @@ puts response
## Development

```bash
# Build and copy the bitwarden-c library
cargo build --package bitwarden-c
cp ../../target/debug/libbitwarden_c.dylib ./bitwarden_sdk_secrets/lib/macos-arm64/libbitwarden_c.dylib

# Install ruby dependencies
cd ./bitwarden_sdk_secrets
gem build bitwarden-sdk-secrets.gemspec
gem install ./bitwarden-sdk-secrets-0.0.0.gem
bundle install

# Install the gem
bundle exec rake install

## Run example tests
cd ..
Expand Down
10 changes: 10 additions & 0 deletions languages/ruby/bitwarden_sdk_secrets/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source "https://rubygems.org"

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

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "rubocop", "~> 1.21"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
# 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])
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git Gemfile])
end
end

Expand Down
2 changes: 1 addition & 1 deletion languages/ruby/examples/example.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE - for example purpose only - import gem instead
require 'bitwarden-sdk'
require 'bitwarden-sdk-secrets'

token = ENV['ACCESS_TOKEN']
organization_id = ENV['ORGANIZATION_ID']
Expand Down

0 comments on commit 55dd4bd

Please sign in to comment.