lino 3.2.0.pre.6 → 3.2.0.pre.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/lino/builders/mixins/executor.rb +1 -1
- data/lib/lino/executors/childprocess.rb +1 -1
- data/lib/lino/executors/mock.rb +29 -0
- data/lib/lino/executors.rb +1 -0
- data/lib/lino/model/command_line.rb +1 -1
- data/lib/lino/version.rb +1 -1
- data/lib/lino.rb +24 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 316b2b5ecae6178261c4b76fedfe0c5797ae50355a94a939f02c115507ba2a37
|
4
|
+
data.tar.gz: 7ee4b662f7c3b1b5fa7ca3b6aca9d1e2597c5804d12732822bf766cfad2d228f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 152d8164ab1b7b00deaae2538d18559d872a5fb8800231728d238a34fa0393658134fc41244134288e7b2a6cff8b8962bb48bb5c151104a24aadb798da9149cd
|
7
|
+
data.tar.gz: b2549104ac5496bb688b3cb61c8b4229bc99af00be5071871dbabd018007603734940f610658f20a8c62a9bd0638d1923e0f3b8631dc873819c812de54084deb
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Lino
|
4
|
+
module Executors
|
5
|
+
class Mock
|
6
|
+
attr_reader :calls
|
7
|
+
attr_accessor :exit_code
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
reset
|
11
|
+
end
|
12
|
+
|
13
|
+
def execute(command_line, opts = {})
|
14
|
+
@calls << { command_line:, opts:, exit_code: @exit_code }
|
15
|
+
|
16
|
+
return if @exit_code.zero?
|
17
|
+
|
18
|
+
raise Lino::Errors::ExecutionError.new(
|
19
|
+
command_line.string, @exit_code
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def reset
|
24
|
+
@calls = []
|
25
|
+
@exit_code = 0
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/lino/executors.rb
CHANGED
@@ -85,7 +85,7 @@ module Lino
|
|
85
85
|
options: opts.fetch(:options, []),
|
86
86
|
arguments: opts.fetch(:arguments, []),
|
87
87
|
environment_variables: opts.fetch(:environment_variables, []),
|
88
|
-
executor: opts.fetch(:executor,
|
88
|
+
executor: opts.fetch(:executor, Lino.configuration.executor),
|
89
89
|
working_directory: opts.fetch(:working_directory, nil)
|
90
90
|
}
|
91
91
|
end
|
data/lib/lino/version.rb
CHANGED
data/lib/lino.rb
CHANGED
@@ -7,6 +7,30 @@ require 'lino/executors'
|
|
7
7
|
require 'lino/errors'
|
8
8
|
|
9
9
|
module Lino
|
10
|
+
class << self
|
11
|
+
attr_writer :configuration
|
12
|
+
|
13
|
+
def configuration
|
14
|
+
@configuration ||= Configuration.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def configure
|
18
|
+
yield(configuration)
|
19
|
+
end
|
20
|
+
|
21
|
+
def reset!
|
22
|
+
@configuration = nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Configuration
|
27
|
+
attr_accessor :executor
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
@executor = Executors::Childprocess.new
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
10
34
|
class CommandLineBuilder
|
11
35
|
class << self
|
12
36
|
def for_command(command)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.0.pre.
|
4
|
+
version: 3.2.0.pre.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InfraBlocks Maintainers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|
@@ -310,6 +310,7 @@ files:
|
|
310
310
|
- lib/lino/errors/execution_error.rb
|
311
311
|
- lib/lino/executors.rb
|
312
312
|
- lib/lino/executors/childprocess.rb
|
313
|
+
- lib/lino/executors/mock.rb
|
313
314
|
- lib/lino/executors/open4.rb
|
314
315
|
- lib/lino/model.rb
|
315
316
|
- lib/lino/model/argument.rb
|