sqlpkg 0.1.0-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 71c34670ae2f95a4e086684b141916e6fd6c454448cb05a7428d9e497a5d8e17
4
+ data.tar.gz: 90f8e64d5a2f15aebc350e7766048736675221d267c03063b72acbb9148bb90e
5
+ SHA512:
6
+ metadata.gz: e0623af2192f7d6362e2d18eb78f7decd64ab9a81a59da616e0a4631a5f9aa492c3f51709024e8a083935a9fbca68655fb79f8a67ff27e231a0b7e55a2c008db
7
+ data.tar.gz: aed5bc4743d91467d9bf80aa39607cfc0faa4b2172218f10b1544e640eecdbb8274a10ca0d9a8ab3cccdfabe749c009c0eda4dfe0b22756943f44387b91912dc
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Stephen Margheim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,25 @@
1
+ sqlpkg-ruby may redistribute executables from the https://github.com/nalgeon/sqlpkg project
2
+
3
+ The license for that software can be found at https://github.com/nalgeon/sqlpkg/blob/main/LICENSE which is reproduced here for your convenience:
4
+
5
+ MIT License
6
+
7
+ Copyright (c) 2023+ Anton Zhiyanov <https://github.com/nalgeon/sqlpkg-cli>
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # sqlpkg-ruby
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sqlpkg`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. For maintainers, to release a new version, run `bin/release $VERSION`, which will create a git tag for the version, push git commits and tags, and push all of the platform-specific `.gem` files to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/fractaledmind/sqlpkg-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/fractaledmind/sqlpkg-ruby/blob/main/CODE_OF_CONDUCT.md).
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
+
37
+ ## Code of Conduct
38
+
39
+ Everyone interacting in the Sqlpkg::Ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fractaledmind/sqlpkg-ruby/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[test standard]
Binary file
data/exe/sqlpkg ADDED
@@ -0,0 +1,13 @@
1
+ #! /usr/bin/env ruby
2
+ # because rubygems shims assume a gem's executables are Ruby
3
+
4
+ require "litestream/commands"
5
+
6
+ begin
7
+ command = [Litestream::Commands.executable, *ARGV]
8
+ puts command.inspect
9
+ exec(*command)
10
+ rescue Litestream::Commands::UnsupportedPlatformException, Litestream::Commands::ExecutableNotFoundException => e
11
+ warn("ERROR: " + e.message)
12
+ exit 1
13
+ end
@@ -0,0 +1,75 @@
1
+ require_relative "upstream"
2
+
3
+ module Sqlpkg
4
+ module Commands
5
+ DEFAULT_DIR = File.expand_path(File.join(__dir__, "..", "..", "exe"))
6
+ GEM_NAME = "sqlpkg"
7
+
8
+ # raised when the host platform is not supported by upstream sqlpkg's binary releases
9
+ class UnsupportedPlatformException < StandardError
10
+ end
11
+
12
+ # raised when the sqlpkg executable could not be found where we expected it to be
13
+ class ExecutableNotFoundException < StandardError
14
+ end
15
+
16
+ # raised when SQLPKG_INSTALL_DIR does not exist
17
+ class DirectoryNotFoundException < StandardError
18
+ end
19
+
20
+ def self.platform
21
+ [:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
22
+ end
23
+
24
+ def self.executable(exe_path: DEFAULT_DIR)
25
+ sqlpkg_install_dir = ENV["SQLPKG_INSTALL_DIR"]
26
+ if sqlpkg_install_dir
27
+ if File.directory?(sqlpkg_install_dir)
28
+ warn "NOTE: using SQLPKG_INSTALL_DIR to find sqlpkg executable: #{sqlpkg_install_dir}"
29
+ exe_path = sqlpkg_install_dir
30
+ exe_file = File.expand_path(File.join(sqlpkg_install_dir, "sqlpkg"))
31
+ else
32
+ raise DirectoryNotFoundException, <<~MESSAGE
33
+ SQLPKG_INSTALL_DIR is set to #{sqlpkg_install_dir}, but that directory does not exist.
34
+ MESSAGE
35
+ end
36
+ else
37
+ if Sqlpkg::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
38
+ raise UnsupportedPlatformException, <<~MESSAGE
39
+ sqlpkg-ruby does not support the #{platform} platform
40
+ Please install sqlpkg following instructions at https://github.com/nalgeon/sqlpkg-cli#download-and-install-preferred-method
41
+ MESSAGE
42
+ end
43
+
44
+ exe_file = Dir.glob(File.expand_path(File.join(exe_path, "*", "sqlpkg"))).find do |f|
45
+ Gem::Platform.match_gem?(Gem::Platform.new(File.basename(File.dirname(f))), GEM_NAME)
46
+ end
47
+ end
48
+
49
+ if exe_file.nil? || !File.exist?(exe_file)
50
+ raise ExecutableNotFoundException, <<~MESSAGE
51
+ Cannot find the sqlpkg executable for #{platform} in #{exe_path}
52
+
53
+ If you're using bundler, please make sure you're on the latest bundler version:
54
+
55
+ gem install bundler
56
+ bundle update --bundler
57
+
58
+ Then make sure your lock file includes this platform by running:
59
+
60
+ bundle lock --add-platform #{platform}
61
+ bundle install
62
+
63
+ See `bundle lock --help` output for details.
64
+
65
+ If you're still seeing this message after taking those steps, try running
66
+ `bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
67
+ https://github.com/fractaledmind/sqlpkg-ruby#check-bundle_force_ruby_platform
68
+ for more details.
69
+ MESSAGE
70
+ end
71
+
72
+ exe_file
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,14 @@
1
+ module Sqlpkg
2
+ # constants describing the upstream tailwindcss project
3
+ module Upstream
4
+ VERSION = "0.2.2"
5
+
6
+ # rubygems platform name => upstream release filename
7
+ NATIVE_PLATFORMS = {
8
+ "arm64-darwin" => "sqlpkg-cli_#{VERSION}_darwin_arm64.tar.gz",
9
+ "arm64-linux" => "sqlpkg-cli_#{VERSION}_linux_arm64.tar.gz",
10
+ "x86_64-darwin" => "sqlpkg-cli_#{VERSION}_darwin_amd64.tar.gz",
11
+ "x86_64-linux" => "sqlpkg-cli_#{VERSION}_linux_amd64.tar.gz"
12
+ }
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ module Sqlpkg
2
+ VERSION = "0.1.0"
3
+ end
data/lib/sqlpkg.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "sqlpkg/version"
4
+ require_relative "sqlpkg/upstream"
5
+
6
+ module Sqlpkg
7
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sqlpkg
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: arm64-darwin
6
+ authors:
7
+ - Stephen Margheim
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-12-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubyzip
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description:
28
+ email:
29
+ - stephen.margheim@gmail.com
30
+ executables:
31
+ - sqlpkg
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - LICENSE
36
+ - LICENSE-DEPENDENCIES
37
+ - README.md
38
+ - Rakefile
39
+ - exe/arm64-darwin/sqlpkg
40
+ - exe/sqlpkg
41
+ - lib/sqlpkg.rb
42
+ - lib/sqlpkg/commands.rb
43
+ - lib/sqlpkg/upstream.rb
44
+ - lib/sqlpkg/version.rb
45
+ homepage: https://github.com/fractaledmind/sqlpkg-ruby
46
+ licenses:
47
+ - MIT
48
+ metadata:
49
+ homepage_uri: https://github.com/fractaledmind/sqlpkg-ruby
50
+ rubygems_mfa_required: 'true'
51
+ source_code_uri: https://github.com/fractaledmind/sqlpkg-ruby
52
+ changelog_uri: https://github.com/fractaledmind/sqlpkg-ruby/CHANGELOG.md
53
+ post_install_message:
54
+ rdoc_options: []
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.0
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ requirements: []
68
+ rubygems_version: 3.5.1
69
+ signing_key:
70
+ specification_version: 4
71
+ summary: Integrate sqlpkg with the RubyGems infrastructure.
72
+ test_files: []