raintron 0.1.0
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.
- checksums.yaml +7 -0
- data/bin/bump +30 -0
- data/bin/raintron +6 -0
- data/lib/app_config/app_config.rb +33 -0
- data/lib/cli/cli.rb +69 -0
- data/lib/commands/doctor.rb +39 -0
- data/lib/commands/icons.rb +34 -0
- data/lib/commands/install.rb +153 -0
- data/lib/commands/press.rb +105 -0
- data/lib/generator/generator.rb +39 -0
- data/lib/icons/icns_writer.rb +42 -0
- data/lib/icons/ico_writer.rb +29 -0
- data/lib/icons/icon_generator.rb +66 -0
- data/lib/icons/png_decoder.rb +138 -0
- data/lib/icons/png_writer.rb +37 -0
- data/lib/icons/renderer.rb +39 -0
- data/lib/icons/resampler.rb +39 -0
- data/lib/launcher/launcher.rb +98 -0
- data/lib/launcher/loading.html +323 -0
- data/lib/preflight/preflight.rb +43 -0
- data/lib/raintron.rb +24 -0
- data/lib/shims/console_shim.rb +19 -0
- data/lib/shims/packed_fs_shim.rb +65 -0
- data/lib/shims/shims.rb +34 -0
- data/lib/version.rb +5 -0
- data/lib/window_chrome/window_chrome.rb +60 -0
- data/templates/app/Contents/Info.plist.erb +24 -0
- data/templates/app/Contents/MacOS/launch.erb +6 -0
- data/templates/bin/desktop.erb +22 -0
- data/templates/github/workflows/build.yml.erb +100 -0
- data/templates/icons/app.desktop.erb +10 -0
- metadata +118 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'raintron'
|
|
5
|
+
|
|
6
|
+
# This file is deliberately thin -- all reusable logic (fork/webview lifecycle, the
|
|
7
|
+
# tty/Tebako compatibility shims) lives in the raintron gem, so fixes ship via
|
|
8
|
+
# `bundle update` rather than by regenerating this file. host/port are read live from
|
|
9
|
+
# config/config.yaml on every run (not baked in at generation time), so they always
|
|
10
|
+
# match whatever `rain server` actually uses.
|
|
11
|
+
app_root = File.expand_path('..', __dir__)
|
|
12
|
+
|
|
13
|
+
Raintron.launch(
|
|
14
|
+
title: '<%= app_name %>',
|
|
15
|
+
size: [<%= width %>, <%= height %>],
|
|
16
|
+
host: Raintron::AppConfig.host(app_root:),
|
|
17
|
+
port: Raintron::AppConfig.port(app_root:),
|
|
18
|
+
app_root:
|
|
19
|
+
) do
|
|
20
|
+
require_relative '../config/boot'
|
|
21
|
+
Providers['low.loop'].start
|
|
22
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
name: Build cross-platform executables
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
RUBY_VERSION: "<%= ruby_version %>"
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
press:
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
include:
|
|
17
|
+
- os: macos-latest
|
|
18
|
+
name: macos
|
|
19
|
+
# Not ubuntu-latest: Ubuntu 24.04 dropped the libwebkit2gtk-4.0-dev
|
|
20
|
+
# package entirely (only 4.1 dev headers ship now), and webview_ruby's
|
|
21
|
+
# own native extension Rakefile hardcodes a `pkg-config ... webkit2gtk-4.0`
|
|
22
|
+
# query -- verified directly against a real failed CI run and the gem's
|
|
23
|
+
# upstream source. 22.04 is still a supported LTS (through 2027) and still
|
|
24
|
+
# has the 4.0 package, so pin to it until webview_ruby targets 4.1.
|
|
25
|
+
- os: ubuntu-22.04
|
|
26
|
+
name: linux
|
|
27
|
+
- os: windows-latest
|
|
28
|
+
name: windows
|
|
29
|
+
runs-on: ${{ matrix.os }}
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
|
|
33
|
+
# webview_ruby's Windows build attempts to compile via ffi-compiler's generic
|
|
34
|
+
# MinGW path, but fails -- confirmed via a real CI run, not assumed:
|
|
35
|
+
# webview.h's Windows/Edge backend #includes winrt/Windows.Foundation.Collections.h,
|
|
36
|
+
# a C++/WinRT header the MinGW toolchain RubyInstaller for Windows ships
|
|
37
|
+
# doesn't provide (needs MSVC + the Windows SDK instead). Tebako's Windows
|
|
38
|
+
# release leg is also still "in flight" upstream, independently.
|
|
39
|
+
# Both remaining steps on this leg are best-effort so the workflow doesn't
|
|
40
|
+
# block on a combination nobody currently ships, but starts passing on its
|
|
41
|
+
# own the moment either upstream gap closes.
|
|
42
|
+
|
|
43
|
+
- name: Install Linux build prerequisites
|
|
44
|
+
if: matrix.name == 'linux'
|
|
45
|
+
run: |
|
|
46
|
+
sudo apt-get update
|
|
47
|
+
sudo apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.0-dev
|
|
48
|
+
|
|
49
|
+
- name: Install Tebako
|
|
50
|
+
if: matrix.name != 'windows'
|
|
51
|
+
shell: bash
|
|
52
|
+
run: |
|
|
53
|
+
curl -fsSL https://tebako.org/install.sh -o /tmp/tebako_install.sh
|
|
54
|
+
# Not `sh`: macOS's /bin/sh is an ancient bash (3.2) that mis-parses a
|
|
55
|
+
# multibyte character in the installer's own output strings. dash (present
|
|
56
|
+
# on macOS and Linux runners) doesn't have that bug; see install.sh's own
|
|
57
|
+
# shebang note if this ever needs revisiting.
|
|
58
|
+
dash /tmp/tebako_install.sh
|
|
59
|
+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
60
|
+
|
|
61
|
+
- name: Install Tebako (Windows, best-effort)
|
|
62
|
+
if: matrix.name == 'windows'
|
|
63
|
+
shell: bash
|
|
64
|
+
continue-on-error: true
|
|
65
|
+
run: |
|
|
66
|
+
curl -fsSL https://tebako.org/install.sh -o /tmp/tebako_install.sh
|
|
67
|
+
bash /tmp/tebako_install.sh
|
|
68
|
+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
69
|
+
|
|
70
|
+
- name: Press
|
|
71
|
+
if: matrix.name != 'windows'
|
|
72
|
+
shell: bash
|
|
73
|
+
run: |
|
|
74
|
+
mkdir -p dist
|
|
75
|
+
tebako press -r . -e bin/desktop -o "dist/<%= app_name %>-${{ matrix.name }}" -R "$RUBY_VERSION" --format dwarfs
|
|
76
|
+
|
|
77
|
+
- name: Press (Windows, best-effort)
|
|
78
|
+
if: matrix.name == 'windows'
|
|
79
|
+
shell: bash
|
|
80
|
+
continue-on-error: true
|
|
81
|
+
run: |
|
|
82
|
+
mkdir -p dist
|
|
83
|
+
tebako press -r . -e bin/desktop -o "dist/<%= app_name %>-windows.exe" -R "$RUBY_VERSION" --format dwarfs
|
|
84
|
+
|
|
85
|
+
- name: Upload artifact
|
|
86
|
+
if: matrix.name != 'windows'
|
|
87
|
+
uses: actions/upload-artifact@v4
|
|
88
|
+
with:
|
|
89
|
+
name: <%= app_name %>-${{ matrix.name }}
|
|
90
|
+
path: dist/<%= app_name %>-${{ matrix.name }}*
|
|
91
|
+
if-no-files-found: error
|
|
92
|
+
|
|
93
|
+
- name: Upload artifact (Windows, best-effort)
|
|
94
|
+
if: matrix.name == 'windows'
|
|
95
|
+
continue-on-error: true
|
|
96
|
+
uses: actions/upload-artifact@v4
|
|
97
|
+
with:
|
|
98
|
+
name: <%= app_name %>-windows
|
|
99
|
+
path: dist/<%= app_name %>-windows.exe
|
|
100
|
+
if-no-files-found: ignore
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[Desktop Entry]
|
|
2
|
+
Type=Application
|
|
3
|
+
Name=<%= app_name %>
|
|
4
|
+
Comment=<%= app_name %> desktop app
|
|
5
|
+
# Update this to wherever the packed executable actually gets installed
|
|
6
|
+
# (e.g. /usr/local/bin/<%= app_name %> or ~/.local/bin/<%= app_name %>).
|
|
7
|
+
Exec=/usr/local/bin/<%= app_name %>
|
|
8
|
+
Icon=/usr/local/share/icons/<%= app_name %>.png
|
|
9
|
+
Terminal=false
|
|
10
|
+
Categories=Utility;
|
metadata
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: raintron
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- maedi
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: raindeer
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: trees
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: webview_ruby
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
description: "Raintron wraps a Raindeer web app in a native desktop window (via webview_ruby)
|
|
55
|
+
and \npackages it into a single cross-platform executable (via Tebako). Add it to
|
|
56
|
+
an existing \nRaindeer app's Gemfile, run `raintron install`, and `bin/desktop`
|
|
57
|
+
opens your app in a \nwindow instead of a browser tab.\n"
|
|
58
|
+
email:
|
|
59
|
+
- maediprichard@gmail.com
|
|
60
|
+
executables:
|
|
61
|
+
- raintron
|
|
62
|
+
extensions: []
|
|
63
|
+
extra_rdoc_files: []
|
|
64
|
+
files:
|
|
65
|
+
- bin/bump
|
|
66
|
+
- bin/raintron
|
|
67
|
+
- lib/app_config/app_config.rb
|
|
68
|
+
- lib/cli/cli.rb
|
|
69
|
+
- lib/commands/doctor.rb
|
|
70
|
+
- lib/commands/icons.rb
|
|
71
|
+
- lib/commands/install.rb
|
|
72
|
+
- lib/commands/press.rb
|
|
73
|
+
- lib/generator/generator.rb
|
|
74
|
+
- lib/icons/icns_writer.rb
|
|
75
|
+
- lib/icons/ico_writer.rb
|
|
76
|
+
- lib/icons/icon_generator.rb
|
|
77
|
+
- lib/icons/png_decoder.rb
|
|
78
|
+
- lib/icons/png_writer.rb
|
|
79
|
+
- lib/icons/renderer.rb
|
|
80
|
+
- lib/icons/resampler.rb
|
|
81
|
+
- lib/launcher/launcher.rb
|
|
82
|
+
- lib/launcher/loading.html
|
|
83
|
+
- lib/preflight/preflight.rb
|
|
84
|
+
- lib/raintron.rb
|
|
85
|
+
- lib/shims/console_shim.rb
|
|
86
|
+
- lib/shims/packed_fs_shim.rb
|
|
87
|
+
- lib/shims/shims.rb
|
|
88
|
+
- lib/version.rb
|
|
89
|
+
- lib/window_chrome/window_chrome.rb
|
|
90
|
+
- templates/app/Contents/Info.plist.erb
|
|
91
|
+
- templates/app/Contents/MacOS/launch.erb
|
|
92
|
+
- templates/bin/desktop.erb
|
|
93
|
+
- templates/github/workflows/build.yml.erb
|
|
94
|
+
- templates/icons/app.desktop.erb
|
|
95
|
+
homepage: https://github.com/raindeer-rb/raintron
|
|
96
|
+
licenses:
|
|
97
|
+
- MPL-2.0
|
|
98
|
+
metadata:
|
|
99
|
+
homepage_uri: https://github.com/raindeer-rb/raintron
|
|
100
|
+
source_code_uri: https://github.com/raindeer-rb/raintron
|
|
101
|
+
rdoc_options: []
|
|
102
|
+
require_paths:
|
|
103
|
+
- lib
|
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
|
+
requirements:
|
|
106
|
+
- - ">="
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: 3.3.0
|
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
|
+
requirements:
|
|
111
|
+
- - ">="
|
|
112
|
+
- !ruby/object:Gem::Version
|
|
113
|
+
version: '0'
|
|
114
|
+
requirements: []
|
|
115
|
+
rubygems_version: 4.0.6
|
|
116
|
+
specification_version: 4
|
|
117
|
+
summary: 'Electron for Ruby: ship a Raindeer app as a native desktop app.'
|
|
118
|
+
test_files: []
|