Skip to content

Commit 226ffda

Browse files
committed
0.5.0
1 parent 8e9f481 commit 226ffda

6 files changed

Lines changed: 58 additions & 6 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.0] - 2025-09-17
9+
10+
Programmatic Control:
11+
12+
config = DaggerRuby::Config.new(
13+
engine_log_level: "error", # Only errors
14+
progress: "plain" # Clean progress format
15+
)
16+
DaggerRuby.connection(config) do |client|
17+
# Your operations with clean output
18+
end
19+
20+
📋 Progress Options:
21+
22+
- plain - Simple text progress (no fancy symbols like ▶ ●)
23+
- dots - Just dots for progress
24+
- tty - Full fancy output (default)
25+
- auto - Auto-detect based on terminal
26+
27+
🎯 What This Eliminates:
28+
29+
- All the ▶ connect, ● container: symbols
30+
- Timing information like 0.7s, 3.6s CACHED
31+
- Complex tree-style progress display
32+
833
## [0.4.0] - 2025-09-17
934

1035
1. Environment Variable (Easiest)

‎Gemfile.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
dagger_ruby (0.4.0)
4+
dagger_ruby (0.5.0)
55
base64 (~> 0.1)
66
json (~> 2.6)
77
logger (~> 1.4)

‎lib/dagger_ruby.rb‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,14 @@ def connection(config = nil)
3434
# Get log level from config or environment
3535
log_level = config&.engine_log_level || ENV["DAGGER_LOG_LEVEL"] || "warn"
3636

37-
# Run dagger with our command and log level
38-
cmd = ["dagger", "--log-level", log_level, "run", ruby_cmd].join(" ")
37+
# Get progress format from config or environment
38+
progress = config&.progress || ENV.fetch("DAGGER_PROGRESS", nil)
39+
40+
# Build dagger command with options
41+
cmd_parts = ["dagger", "--log-level", log_level]
42+
cmd_parts += ["--progress", progress] if progress
43+
cmd_parts += ["run", ruby_cmd]
44+
cmd = cmd_parts.join(" ")
3945

4046
# Execute the command
4147
exec(cmd)

‎lib/dagger_ruby/config.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
module DaggerRuby
44
class Config
5-
attr_reader :log_output, :workdir, :timeout, :engine_log_level
5+
attr_reader :log_output, :workdir, :timeout, :engine_log_level, :progress
66

7-
def initialize(log_output: nil, workdir: nil, timeout: nil, engine_log_level: nil)
7+
def initialize(log_output: nil, workdir: nil, timeout: nil, engine_log_level: nil, progress: nil)
88
@log_output = log_output
99
@workdir = workdir
1010
@timeout = timeout || 600
1111
@engine_log_level = engine_log_level || ENV["DAGGER_LOG_LEVEL"] || "warn"
12+
@progress = progress || ENV.fetch("DAGGER_PROGRESS", nil)
1213
end
1314
end
1415
end

‎lib/dagger_ruby/version.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module DaggerRuby
4-
VERSION = "0.4.0"
4+
VERSION = "0.5.0"
55
end

‎test/unit/test_config.rb‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_config_default_values
1010
assert_nil config.workdir
1111
assert_equal 600, config.timeout
1212
assert_equal "warn", config.engine_log_level
13+
assert_nil config.progress
1314
end
1415

1516
def test_config_with_log_output
@@ -36,12 +37,14 @@ def test_config_with_all_options
3637
workdir: "/app",
3738
timeout: 120,
3839
engine_log_level: "error",
40+
progress: "plain",
3941
)
4042

4143
assert_equal $stderr, config.log_output
4244
assert_equal "/app", config.workdir
4345
assert_equal 120, config.timeout
4446
assert_equal "error", config.engine_log_level
47+
assert_equal "plain", config.progress
4548
end
4649

4750
def test_config_with_engine_log_level
@@ -60,4 +63,21 @@ def test_config_engine_log_level_from_env
6063
ensure
6164
ENV["DAGGER_LOG_LEVEL"] = original_env
6265
end
66+
67+
def test_config_with_progress
68+
config = DaggerRuby::Config.new(progress: "plain")
69+
70+
assert_equal "plain", config.progress
71+
end
72+
73+
def test_config_progress_from_env
74+
original_env = ENV.fetch("DAGGER_PROGRESS", nil)
75+
ENV["DAGGER_PROGRESS"] = "dots"
76+
77+
config = DaggerRuby::Config.new
78+
79+
assert_equal "dots", config.progress
80+
ensure
81+
ENV["DAGGER_PROGRESS"] = original_env
82+
end
6383
end

0 commit comments

Comments
 (0)