cr-exec 0.2.0 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd968a36e5410016ba0096851506880087f06d8897af1556ce87ccbaefb57d1e
4
- data.tar.gz: 704cd779c5d024cded3dbede5ba50161b5759322ce8f8a43f455f455f36d9f31
3
+ metadata.gz: 49e57011075a1a20fd3942ac28a9fba2f9007fea0d8e838953d9d3969fea8ac0
4
+ data.tar.gz: aab1ad2d7a458cf143e0c08c204b642f555df6e10326218c0d776d1e35d4057c
5
5
  SHA512:
6
- metadata.gz: 5a7fa4b05a00886462b9379b6a2d2d6eba4844f58cd64b4612f7a0225af30cd7f4e3490e0c8621c9d3acc51cef01a9c40404c0f6d0baaf22f21dfb8876c83123
7
- data.tar.gz: 2e41376a2224be79dee38f0d2c273c1fac2f8c51b254114a2a41aff1f7048ee96656f3b2fce6c4e2a47fc61860c758ad05dac09fcf7f9976f49095ea057daa13
6
+ metadata.gz: a2d25ed35e8848d7b960059c5da8bd7af37f0f06a09c6a51cc9814021fa16b14e6a8e0531097c8ed14e78f47f830b82498886e87b7cb34c7899e097ee5816fe4
7
+ data.tar.gz: 6aed02e36903c06280833669225451a4df158e07a240b1008534478f92b6b9325d4b9995d218161987cc9643b11f7fa72dcf5fdcee5b8124f9507dcc1fc40f76
data/.rubocop.yml CHANGED
@@ -1,14 +1,8 @@
1
- AllCops:
2
- TargetRubyVersion: 2.7
3
- DefaultFormatter: simple
1
+ inherit_gem:
2
+ rubocop-config-crystal: .rubocop.yml
4
3
 
5
- Style/StringLiterals:
6
- Enabled: true
7
- EnforcedStyle: double_quotes
4
+ Metrics/BlockLength:
5
+ Enabled: false
8
6
 
9
- Style/StringLiteralsInInterpolation:
10
- Enabled: true
11
- EnforcedStyle: double_quotes
12
-
13
- Layout/LineLength:
14
- Max: 120
7
+ Style/NonNilCheck:
8
+ Enabled: false
data/Gemfile CHANGED
@@ -5,8 +5,12 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in cr-exec.gemspec
6
6
  gemspec
7
7
 
8
+ gem "bundler", "~> 2.4"
9
+
8
10
  gem "rake", "~> 13.0"
9
11
 
10
12
  gem "rspec", "~> 3.0"
11
13
 
12
14
  gem "rubocop", "~> 1.21"
15
+
16
+ gem "rubocop-config-crystal"
data/Gemfile.lock CHANGED
@@ -1,63 +1,68 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cr-exec (0.2.0)
4
+ cr-exec (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.2)
10
- diff-lcs (1.5.1)
11
- json (2.7.2)
12
- language_server-protocol (3.17.0.3)
13
- parallel (1.25.1)
14
- parser (3.3.3.0)
9
+ ast (2.4.3)
10
+ diff-lcs (1.6.2)
11
+ json (2.15.2)
12
+ language_server-protocol (3.17.0.5)
13
+ lint_roller (1.1.0)
14
+ parallel (1.27.0)
15
+ parser (3.3.10.0)
15
16
  ast (~> 2.4.1)
16
17
  racc
17
- racc (1.8.0)
18
+ prism (1.6.0)
19
+ racc (1.8.1)
18
20
  rainbow (3.1.1)
19
- rake (13.2.1)
20
- regexp_parser (2.9.2)
21
- rexml (3.3.1)
22
- strscan
23
- rspec (3.13.0)
21
+ rake (13.3.1)
22
+ regexp_parser (2.11.3)
23
+ rspec (3.13.2)
24
24
  rspec-core (~> 3.13.0)
25
25
  rspec-expectations (~> 3.13.0)
26
26
  rspec-mocks (~> 3.13.0)
27
- rspec-core (3.13.0)
27
+ rspec-core (3.13.6)
28
28
  rspec-support (~> 3.13.0)
29
- rspec-expectations (3.13.1)
29
+ rspec-expectations (3.13.5)
30
30
  diff-lcs (>= 1.2.0, < 2.0)
31
31
  rspec-support (~> 3.13.0)
32
- rspec-mocks (3.13.1)
32
+ rspec-mocks (3.13.7)
33
33
  diff-lcs (>= 1.2.0, < 2.0)
34
34
  rspec-support (~> 3.13.0)
35
- rspec-support (3.13.1)
36
- rubocop (1.64.1)
35
+ rspec-support (3.13.6)
36
+ rubocop (1.81.7)
37
37
  json (~> 2.3)
38
- language_server-protocol (>= 3.17.0)
38
+ language_server-protocol (~> 3.17.0.2)
39
+ lint_roller (~> 1.1.0)
39
40
  parallel (~> 1.10)
40
41
  parser (>= 3.3.0.2)
41
42
  rainbow (>= 2.2.2, < 4.0)
42
- regexp_parser (>= 1.8, < 3.0)
43
- rexml (>= 3.2.5, < 4.0)
44
- rubocop-ast (>= 1.31.1, < 2.0)
43
+ regexp_parser (>= 2.9.3, < 3.0)
44
+ rubocop-ast (>= 1.47.1, < 2.0)
45
45
  ruby-progressbar (~> 1.7)
46
- unicode-display_width (>= 2.4.0, < 3.0)
47
- rubocop-ast (1.31.3)
48
- parser (>= 3.3.1.0)
46
+ unicode-display_width (>= 2.4.0, < 4.0)
47
+ rubocop-ast (1.47.1)
48
+ parser (>= 3.3.7.2)
49
+ prism (~> 1.4)
50
+ rubocop-config-crystal (0.0.1)
49
51
  ruby-progressbar (1.13.0)
50
- strscan (3.1.0)
51
- unicode-display_width (2.5.0)
52
+ unicode-display_width (3.2.0)
53
+ unicode-emoji (~> 4.1)
54
+ unicode-emoji (4.1.0)
52
55
 
53
56
  PLATFORMS
54
57
  x86_64-linux
55
58
 
56
59
  DEPENDENCIES
60
+ bundler (~> 2.4)
57
61
  cr-exec!
58
62
  rake (~> 13.0)
59
63
  rspec (~> 3.0)
60
64
  rubocop (~> 1.21)
65
+ rubocop-config-crystal
61
66
 
62
67
  BUNDLED WITH
63
- 2.3.5
68
+ 2.4.22
data/Rakefile CHANGED
@@ -9,4 +9,4 @@ require "rubocop/rake_task"
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
12
- task default: %i[spec]
12
+ task default: [:spec, :rubocop]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cr
4
4
  module Exec
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
data/lib/cr/exec.rb CHANGED
@@ -21,16 +21,15 @@ module Cr
21
21
  127
22
22
  end
23
23
 
24
- def output(*args, chomp: true)
25
- command = args.join(" ")
26
- output = `#{command}`
24
+ def output(*args, chomp: true, **options)
25
+ output = IO.popen(*args, **options).read
27
26
  return output.chomp if chomp
28
27
 
29
28
  output
30
29
  end
31
30
 
32
31
  def each_line(*args, chomp: false, **options, &block)
33
- if block
32
+ if block_given?
34
33
  IO.popen(*args, **options) do |pipe|
35
34
  pipe.each_line(chomp: chomp, &block)
36
35
  end
@@ -41,10 +40,10 @@ module Cr
41
40
 
42
41
  def answer(*args, input: nil, **options)
43
42
  IO.popen(*args, **options) do |pipe|
44
- if input.is_a? Array
43
+ if input.is_a?(Array)
45
44
  input.each { |cmd| pipe.puts(cmd) }
46
- else
47
- pipe.puts(input)
45
+ elsif input != nil
46
+ pipe.puts(input)
48
47
  end
49
48
  pipe.close_write
50
49
  pipe.read
@@ -54,5 +53,9 @@ module Cr
54
53
  def system?(...)
55
54
  system(...) ? true : false
56
55
  end
56
+
57
+ def system!(*args, **options)
58
+ system(*args, exception: true, **options)
59
+ end
57
60
  end
58
61
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cr-exec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - initdc
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-09-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: The improved exec lib inspired from Crystal
13
13
  email:
@@ -34,7 +34,7 @@ metadata:
34
34
  allowed_push_host: https://rubygems.org
35
35
  homepage_uri: https://github.com/initdc/cr-exec
36
36
  source_code_uri: https://github.com/initdc/cr-exec.git
37
- changelog_uri: https://github.com/initdc/cr-exec/blob/wip/CHANGELOG.md
37
+ changelog_uri: https://github.com/initdc/cr-exec/blob/master/CHANGELOG.md
38
38
  rdoc_options: []
39
39
  require_paths:
40
40
  - lib
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubygems_version: 3.6.2
52
+ rubygems_version: 3.6.9
53
53
  specification_version: 4
54
54
  summary: Wrapper for ruby exec
55
55
  test_files: []