This repository was archived by the owner on Jun 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # 0.2.0
2+ - [ FIX] Resolve File.exists? deprecation removal in latest Ruby.
3+ - Bump upstream biscuit binary dependency to latest 0.1.4 release.
4+ - Adds diagnostic logging to install task.
5+
16# 0.1.4
27- [ FIX] ` open() ` is deprecated for URIs. Uses ` URI.open() `
38- Bumps bundler version
Original file line number Diff line number Diff line change 11require 'open-uri'
22require 'bundler/gem_tasks'
33
4- UPSTREAM_VERSION = '0.1.3 '
4+ UPSTREAM_VERSION = '0.1.4 '
55
66def fetch ( release_url )
7+ puts "Fetching native biscuit executable: #{ release_url } "
78 tgz_path = download_file ( release_url )
89
910 system ( "tar -xzf #{ tgz_path } -C #{ File . dirname ( tgz_path ) } " ) || raise
1011 system ( "mv #{ File . dirname ( tgz_path ) } /biscuit #{ __dir__ } /bin/_biscuit" ) || raise
12+ puts "Successfully fetched native biscuit executable"
1113end
1214
1315def download_file ( url )
2022
2123task :default do
2224 platform = Gem ::Platform . local
23- base_release_url = "https://github.com/dcoker/biscuit/releases/download/v#{ UPSTREAM_VERSION } /biscuit"
25+ base_release_url =
26+ "https://github.com/dcoker/biscuit/releases/download/v#{ UPSTREAM_VERSION } /biscuit_#{ UPSTREAM_VERSION } _"
2427
25- if platform . os == 'darwin' && platform . cpu == 'x86_64'
26- fetch ( "#{ base_release_url } -darwin_amd64.tgz " )
28+ if platform . os == 'darwin'
29+ fetch ( "#{ base_release_url } MacOS-all.tar.gz " )
2730 elsif platform . os == 'linux' && platform . cpu == 'x86_64'
28- fetch ( "#{ base_release_url } -linux_amd64.tgz " )
31+ fetch ( "#{ base_release_url } Linux-64bit.tar.gz " )
2932 else
3033 puts "Unsupported platform #{ platform } "
3134 end
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class SecretsDecrypter
55 attr_reader :secrets_file
66
77 def initialize ( secrets_file )
8- fail "#{ secrets_file } is not found" unless File . exists ? secrets_file
8+ fail "#{ secrets_file } is not found" unless File . exist ? secrets_file
99
1010 @secrets_file = secrets_file
1111 end
Original file line number Diff line number Diff line change 11module Biscuit
2- VERSION = "0.1.4 "
2+ VERSION = "0.2.0 "
33end
Original file line number Diff line number Diff line change 99 subject ( :decrypter ) { -> { described_class . new ( secret_file ) } }
1010
1111 context "when the file exists" do
12- before { allow ( File ) . to receive ( :exists ? ) . and_return ( true ) }
12+ before { allow ( File ) . to receive ( :exist ? ) . and_return ( true ) }
1313 it { is_expected . not_to raise_error }
1414 end
1515
1616 context "when the file doesn't exist" do
17- before { allow ( File ) . to receive ( :exists ? ) . and_return ( false ) }
17+ before { allow ( File ) . to receive ( :exist ? ) . and_return ( false ) }
1818 it { is_expected . to raise_error ( StandardError , /is not found/ ) }
1919 end
2020 end
2121
2222 describe ".load" do
2323 shared_examples "translates exported data correctly" do
2424 let ( :decrypter ) { described_class . new ( secret_file ) }
25- before { allow ( File ) . to receive ( :exists ? ) . and_return ( true ) }
25+ before { allow ( File ) . to receive ( :exist ? ) . and_return ( true ) }
2626 before { allow ( Biscuit ) . to receive ( :run! ) . and_return ( exported_data ) }
2727
2828 it "executes the correct biscuit command" do
You can’t perform that action at this time.
0 commit comments