l42_my_ruby 0.1.2 → 0.1.3
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 +4 -4
- data/bin/mv_to_random +5 -2
- data/bin/mv_with_ts +5 -3
- data/bin/tx_send +8 -3
- data/lib/l42/interfaces/tx_send.rb +1 -2
- data/lib/l42/monad.rb +13 -0
- data/lib/l42/version.rb +1 -1
- metadata +1 -4
- data/bin/mv_to_random.rb +0 -8
- data/bin/mv_with_ts.rb +0 -8
- data/bin/tx_send.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb1c3756379e743210148854ee4eedb3e3a15e8d009051a5e1b43083fde80715
|
4
|
+
data.tar.gz: 668781958b9b1caf7721896b5e3a8f05a94e7409f259223db4fb8ae842f3c311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ca6caf9ffeb117ee01dcfca54072db7ea5e402be9d62e782abce90b3470bc4f8897e7bbf150f3afeaf09c0eaebc2fe4520b9be6e38180eb3eaa935534212b5c
|
7
|
+
data.tar.gz: 636cac32842376ad0cd33c1ad292e2aa8cff03a033379304f75931f11a01b42c4914636635aa97f8444a7589de6a427a3ff8fa18b6bc7639a2027667f3e8705c
|
data/bin/mv_to_random
CHANGED
data/bin/mv_with_ts
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#!/usr/bin/env
|
2
|
-
|
3
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require_relative '../lib/l42'
|
4
4
|
|
5
|
+
L42::Monad.functional_output(L42::Interfaces::WithTs, *ARGV)
|
6
|
+
# SPDX-License-Identifier: Apache-2.0
|
data/bin/tx_send
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
#!/usr/bin/env
|
2
|
-
|
3
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require_relative '../lib/l42'
|
4
4
|
|
5
|
+
output = L42::Monad.functional_input(L42::Interfaces::TxSend, ARGV.first)
|
6
|
+
output&.each do | line |
|
7
|
+
system(line)
|
8
|
+
end
|
9
|
+
# SPDX-License-Identifier: Apache-2.0
|
data/lib/l42/monad.rb
CHANGED
@@ -29,6 +29,19 @@ module L42
|
|
29
29
|
"a transformer needs to return a result of type `[:stderr|:stdout, anything]`, not #{x.inspect}"
|
30
30
|
end
|
31
31
|
end
|
32
|
+
|
33
|
+
def functional_input(transformer, *args)
|
34
|
+
case transformer.($stdin.readlines(chomp: true), *args)
|
35
|
+
in [:stdout, output]
|
36
|
+
output
|
37
|
+
in [:stderr, output]
|
38
|
+
$stderr.puts(output)
|
39
|
+
exit(-1)
|
40
|
+
in x
|
41
|
+
raise ContractViolation,
|
42
|
+
"a transformer needs to return a result of type `[:stderr|:stdout, anything]`, not #{x.inspect}"
|
43
|
+
end
|
44
|
+
end
|
32
45
|
end
|
33
46
|
end
|
34
47
|
# SPDX-License-Identifier: Apache-2.0
|
data/lib/l42/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: l42_my_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Dober
|
@@ -39,11 +39,8 @@ files:
|
|
39
39
|
- LICENSE
|
40
40
|
- README.md
|
41
41
|
- bin/mv_to_random
|
42
|
-
- bin/mv_to_random.rb
|
43
42
|
- bin/mv_with_ts
|
44
|
-
- bin/mv_with_ts.rb
|
45
43
|
- bin/tx_send
|
46
|
-
- bin/tx_send.rb
|
47
44
|
- lib/l42.rb
|
48
45
|
- lib/l42/data_class.rb
|
49
46
|
- lib/l42/interfaces/to_random.rb
|
data/bin/mv_to_random.rb
DELETED
data/bin/mv_with_ts.rb
DELETED