epl 0.1.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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +21 -0
  4. data/lib/epl.rb +22 -0
  5. metadata +56 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 54559b69df8a82ab00bc7b2ec03f3988e5dab4562c5c6de37c136074b8c1d01b
4
+ data.tar.gz: 4d34140da6cc3dbe1adabe378153b42c5dc18d15c373cdca2869b2ba7dc35245
5
+ SHA512:
6
+ metadata.gz: bd95d9d684e54adc6e69cb53c6ee3809dcbf98d583acd9bebec38b5842ed359354518d30716db05c700c4e1fe5d2bacc26453de826315ccf46f6a4d50ed50fd0
7
+ data.tar.gz: 91c813e2d6bd41069c64d692456c60672508c72de08c243e8201068573b98a64a3bfd4dabeb7c76cb85ff94fe33281c959834329f36284fbf00c7060e1c08c1a
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John Hawthorn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # epl
2
+
3
+ ```
4
+ gem install epl
5
+ ```
6
+
7
+ ```
8
+ $ ruby -repl
9
+ irb(main):001>
10
+ ```
11
+
12
+ With a script (or `-e`), it runs the script and then starts IRB with its
13
+ top-level locals:
14
+
15
+ ```
16
+ $ ruby -repl -e 'x = 21'
17
+ irb(main):001> x * 2
18
+ => 42
19
+ ```
20
+
21
+ Inspired by `ruby -rubygems` (RIP ubygems.rb) and `ruby -run`.
data/lib/epl.rb ADDED
@@ -0,0 +1,22 @@
1
+ # ruby -repl start IRB
2
+ # ruby -repl script.rb run script.rb, then IRB with its top-level locals
3
+ # ruby -repl -e 'x=1' same, for -e
4
+ require "irb"
5
+
6
+ module EPL
7
+ def self.start
8
+ return unless $stdin.tty?
9
+ IRB.setup(nil, argv: [])
10
+ workspace = IRB::WorkSpace.new(TOPLEVEL_BINDING)
11
+ IRB::Irb.new(workspace).run(IRB.conf)
12
+ end
13
+ end
14
+
15
+ if $0 == "-" && $stdin.tty?
16
+ # No script was given, so Ruby is about to read one from stdin.
17
+ # Take over before it does.
18
+ EPL.start
19
+ exit
20
+ else
21
+ at_exit { EPL.start }
22
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: epl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - John Hawthorn
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: irb
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ email:
27
+ - john@hawthorn.email
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - LICENSE
33
+ - README.md
34
+ - lib/epl.rb
35
+ homepage: https://github.com/jhawthorn/epl
36
+ licenses:
37
+ - MIT
38
+ metadata: {}
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '3.0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubygems_version: 4.0.20
54
+ specification_version: 4
55
+ summary: ruby -repl
56
+ test_files: []