cr-exec 0.2.1 → 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: 17993a044cc569cf2ebc754e62e2594da48716a22fe07de6620248948e60dff9
4
- data.tar.gz: bf5a863b6a8f47365657dd267c05d669c22d4b0c172b99b7e2738a994ef5d7f6
3
+ metadata.gz: 49e57011075a1a20fd3942ac28a9fba2f9007fea0d8e838953d9d3969fea8ac0
4
+ data.tar.gz: aab1ad2d7a458cf143e0c08c204b642f555df6e10326218c0d776d1e35d4057c
5
5
  SHA512:
6
- metadata.gz: ef665ce1fb2d6f9068cdd4bf6ac630c8a1613b5932115a0fa1ac7a401d098287f7d1328e89d7fdc614740655228851f0463ea6ee386446b042e6ca95744f0ca4
7
- data.tar.gz: 5098427b1fb946f8a1b8856d45440a36fc12c0ec1af6cc43d921263e443f429f3cc51d28d9dc64e2b40a1fb5ee3632ceec2b7efd5709258c162e079d894ea738
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.1)
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.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
data/lib/cr/exec.rb CHANGED
@@ -29,7 +29,7 @@ module Cr
29
29
  end
30
30
 
31
31
  def each_line(*args, chomp: false, **options, &block)
32
- if block
32
+ if block_given?
33
33
  IO.popen(*args, **options) do |pipe|
34
34
  pipe.each_line(chomp: chomp, &block)
35
35
  end
@@ -40,10 +40,10 @@ module Cr
40
40
 
41
41
  def answer(*args, input: nil, **options)
42
42
  IO.popen(*args, **options) do |pipe|
43
- if input.is_a? Array
43
+ if input.is_a?(Array)
44
44
  input.each { |cmd| pipe.puts(cmd) }
45
- else
46
- pipe.puts(input)
45
+ elsif input != nil
46
+ pipe.puts(input)
47
47
  end
48
48
  pipe.close_write
49
49
  pipe.read
@@ -53,5 +53,9 @@ module Cr
53
53
  def system?(...)
54
54
  system(...) ? true : false
55
55
  end
56
+
57
+ def system!(*args, **options)
58
+ system(*args, exception: true, **options)
59
+ end
56
60
  end
57
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.1
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-10-21 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: []