terminalwire 0.3.0.alpha1 → 0.3.0.alpha2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +70 -0
  3. metadata +6 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1937bd63daba6afa08a9fa2b8409bb857994435aaca41625478d1141e372c989
4
- data.tar.gz: 392a7a5abefa4f05a0c71c7f748845209cb580622900a692ccf65cb931756b43
3
+ metadata.gz: 62b9296fa5007675a2ef390fe027e147d641f4a986919f45e3eb0e2f5315248b
4
+ data.tar.gz: 01cc42157f5ad67ed74810e568ed6920f9b10fc73667cd3e082876da2f9d38bc
5
5
  SHA512:
6
- metadata.gz: 4af7d35e43e1b79dbf2fdac4b3d0215c2d54cb8732fe4693e6e549577962c2cb797a0296ab46fea4e8de39f98f9ac22536f61b550bf9ab36c116acafe477a740
7
- data.tar.gz: 4204aad1b0893dd3a926fda32cf7f7271823c6b9b9b08b5826a76c280c9b5cf407acb3d4c50ce10b07b4d2ba2925bac11a2f791ec2aef0cfc6793511f19232b6
6
+ metadata.gz: 8d533aee964375685b0730f98d2c333f4e68dd4ada66d190f1731a200f72ca95ecd3ca6477685eed3d9aa1af1da25987df1fef85d8d50f11f4080da361793152
7
+ data.tar.gz: '0720835165666367b1a0498465c3a2f134bc23e3e315e3feb9f187efc0fa1f0f04eaf6c7b0ae38cde067a1a839ee0d7edc28428834353d14bf6fbb51026caa3b'
data/Rakefile ADDED
@@ -0,0 +1,70 @@
1
+ require 'pathname'
2
+
3
+ task :default do
4
+ ruby_version = "3.3.6"
5
+ os = "osx"
6
+ platform = "arm64"
7
+ url = "https://github.com/YOU54F/traveling-ruby/releases/download/rel-20241122/traveling-ruby-20241122-#{ruby_version}-#{os}-#{platform}-full.tar.gz"
8
+ path = Pathname.new("package/#{os}-#{platform}")
9
+ gem = Gem::Specification.load("terminalwire.gemspec")
10
+
11
+ sh "mkdir -p #{path}"
12
+
13
+ # Don't bother downloading if we already have the file
14
+ unless File.exist? path.join("lib/ruby/info/RUBY_COMPAT_VERSION")
15
+ sh "mkdir -p #{path.join("lib/ruby")}"
16
+ sh "curl -L #{url} | tar -xzf - -C #{path.join("lib/ruby")}"
17
+ end
18
+
19
+ # Install the base gem and all of its dependencies in the vendor directory.
20
+ sh "gem install #{gem.name} --version '#{gem.version}' --install-dir #{path.join("lib/vendor")} --no-document --verbose"
21
+
22
+ # Remove caches to make package smaller
23
+ sh "rm -rf #{path.join("lib/vendor/cache")}"
24
+ sh "rm -rf #{path.join("lib/vendor/bin")}"
25
+ sh "rm -rf #{path.join("lib/vendor/doc")}"
26
+ sh "rm -rf #{path.join("lib/vendor/plugins")}"
27
+
28
+ File.write path.join("lib/boot.rb"), <<~RUBY
29
+ # Resolve the base directory
30
+ base_dir = File.expand_path("../..", __FILE__)
31
+
32
+ # Add all gem paths under lib/vendor to the load path
33
+ Dir.glob(File.join(base_dir, "lib/vendor/gems/*/lib")).each do |gem_path|
34
+ $LOAD_PATH.unshift gem_path
35
+ end
36
+ RUBY
37
+
38
+ gems = path.glob("lib/vendor/specifications/*.gemspec").each_with_object({}) do |spec_path, hash|
39
+ spec = Gem::Specification.load(spec_path.to_s)
40
+ hash[spec.name] = spec
41
+ end
42
+
43
+ terminalwire_gem = gems.fetch("terminalwire")
44
+
45
+ gem_path = Pathname.new(terminalwire_gem.full_gem_path).relative_path_from path.expand_path
46
+ exe_path = gem_path.join(terminalwire_gem.bindir, "terminalwire-exec")
47
+
48
+ # Let's write the executable path into the thing...'
49
+ File.write path.join("terminalwire-exec"), <<~RUBY
50
+ #!/bin/bash
51
+ # Resolve the directory of the current script
52
+ SELFDIR="$(cd "$(dirname "$0")" && pwd)"
53
+
54
+ # Path to the embedded Ruby executable
55
+ RUBY_EXEC="$SELFDIR/lib/ruby/bin/ruby"
56
+ BOOT_SCRIPT="$SELFDIR/lib/boot.rb"
57
+ PROGRAM="$SELFDIR/#{exe_path}"
58
+
59
+ # Pass the boot script and the main Ruby script to Ruby
60
+ exec "$RUBY_EXEC" -r"$BOOT_SCRIPT" "$PROGRAM" "$@"
61
+ RUBY
62
+
63
+ File.chmod 0755, path.join("terminalwire-exec")
64
+
65
+ # TODO: download and install each gem extension for its platform.
66
+ native_gems = gems.values.select{ _1.extensions.any? }
67
+ native_gems.each do |native_gem|
68
+ p native_gem
69
+ end
70
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminalwire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.alpha1
4
+ version: 0.3.0.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-05 00:00:00.000000000 Z
10
+ date: 2025-01-16 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: terminalwire-client
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - '='
18
17
  - !ruby/object:Gem::Version
19
- version: 0.3.0.alpha1
18
+ version: 0.3.0.alpha2
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - '='
25
24
  - !ruby/object:Gem::Version
26
- version: 0.3.0.alpha1
25
+ version: 0.3.0.alpha2
27
26
  description: Stream command-line apps from your server without a web API
28
27
  email:
29
28
  - brad@terminalwire.com
@@ -33,6 +32,7 @@ executables:
33
32
  extensions: []
34
33
  extra_rdoc_files: []
35
34
  files:
35
+ - Rakefile
36
36
  - exe/terminalwire
37
37
  - exe/terminalwire-exec
38
38
  homepage: https://terminalwire.com/ruby
@@ -44,7 +44,6 @@ metadata:
44
44
  source_code_uri: https://github.com/terminalwire/ruby/tree/main/terminalwire
45
45
  changelog_uri: https://github.com/terminalwire/ruby/tags
46
46
  funding_uri: https://terminalwire.com/funding
47
- post_install_message:
48
47
  rdoc_options: []
49
48
  require_paths:
50
49
  - lib
@@ -59,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
58
  - !ruby/object:Gem::Version
60
59
  version: '0'
61
60
  requirements: []
62
- rubygems_version: 3.5.9
63
- signing_key:
61
+ rubygems_version: 3.6.2
64
62
  specification_version: 4
65
63
  summary: Ship a CLI for your web app. No API required.
66
64
  test_files: []