cr-exec 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 263ebccf035f6a1997df8d73f831930d46118a8dc063ca2cb342e91c6937fc12
4
- data.tar.gz: c02060a43886373e9a746e2e8cc10b805eb33d00589b5f4ea9ee1cfda462348f
3
+ metadata.gz: dd968a36e5410016ba0096851506880087f06d8897af1556ce87ccbaefb57d1e
4
+ data.tar.gz: 704cd779c5d024cded3dbede5ba50161b5759322ce8f8a43f455f455f36d9f31
5
5
  SHA512:
6
- metadata.gz: 3ea0a8f9a776b6c529f602c1d89df9f74066e4c4983d17771914c879627309e8c7fcf1a030ac6bb73ae6eac93893e065e82537d84c8b6329845f271354b16200
7
- data.tar.gz: a79e4576121497336b24edae3e9df5ce79129a123a8d95ef4e0072d854c3a49d56310a811cb4036701aa611abc6bd63f7bcb60b3b8fe983bc094fd0a6d34fee9
6
+ metadata.gz: 5a7fa4b05a00886462b9379b6a2d2d6eba4844f58cd64b4612f7a0225af30cd7f4e3490e0c8621c9d3acc51cef01a9c40404c0f6d0baaf22f21dfb8876c83123
7
+ data.tar.gz: 2e41376a2224be79dee38f0d2c273c1fac2f8c51b254114a2a41aff1f7048ee96656f3b2fce6c4e2a47fc61860c758ad05dac09fcf7f9976f49095ea057daa13
data/.rspec CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/CHANGELOG.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cr-exec (0.1.0)
4
+ cr-exec (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -17,7 +17,8 @@ If bundler is not being used to manage dependencies, install the gem by executin
17
17
  ## Usage
18
18
 
19
19
  ```ruby
20
- require "cr-exec"
20
+ # Mind Please !!!
21
+ require "cr/exec"
21
22
 
22
23
  class MyClass
23
24
  extend Cr::Exec
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 rubocop]
12
+ task default: %i[spec]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cr
4
4
  module Exec
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
data/lib/cr/exec.rb CHANGED
@@ -30,13 +30,24 @@ module Cr
30
30
  end
31
31
 
32
32
  def each_line(*args, chomp: false, **options, &block)
33
- command = args.join(" ")
34
33
  if block
35
- IO.popen(command, options) do |pipe|
34
+ IO.popen(*args, **options) do |pipe|
36
35
  pipe.each_line(chomp: chomp, &block)
37
36
  end
38
37
  else
39
- IO.popen(command, options).readlines(chomp: chomp)
38
+ IO.popen(*args, **options).readlines(chomp: chomp)
39
+ end
40
+ end
41
+
42
+ def answer(*args, input: nil, **options)
43
+ IO.popen(*args, **options) do |pipe|
44
+ if input.is_a? Array
45
+ input.each { |cmd| pipe.puts(cmd) }
46
+ else
47
+ pipe.puts(input)
48
+ end
49
+ pipe.close_write
50
+ pipe.read
40
51
  end
41
52
  end
42
53
 
data/lib/cr.rb CHANGED
File without changes
data/sig/cr/exec.rbs CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cr-exec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - initdc
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
10
+ date: 2025-09-25 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: The improved exec lib inspired from Crystal
14
13
  email:
@@ -36,7 +35,6 @@ metadata:
36
35
  homepage_uri: https://github.com/initdc/cr-exec
37
36
  source_code_uri: https://github.com/initdc/cr-exec.git
38
37
  changelog_uri: https://github.com/initdc/cr-exec/blob/wip/CHANGELOG.md
39
- post_install_message:
40
38
  rdoc_options: []
41
39
  require_paths:
42
40
  - lib
@@ -51,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
49
  - !ruby/object:Gem::Version
52
50
  version: '0'
53
51
  requirements: []
54
- rubygems_version: 3.3.5
55
- signing_key:
52
+ rubygems_version: 3.6.2
56
53
  specification_version: 4
57
54
  summary: Wrapper for ruby exec
58
55
  test_files: []