ladder-gem 11.test
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 +7 -0
- data/lib/ladder.rb +65 -0
- metadata +43 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: e36933f7ecad92442a8a83ca2f2017487a8e865d6e49229b062ee7b51dc64024
|
|
4
|
+
data.tar.gz: d070df9001899c79403c561484a096453512d19730edde67932b69dc6052b163
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5e862acf6e74fecf84365bb375af9f1cbad0b77a6d1ef954583378b395e76b3b47bc8f2eff3fb1f200627aa2cd591cf59424fad45f6b122589e07f37ec6184b7
|
|
7
|
+
data.tar.gz: 668a7aa63e8e97934e72fc7e94af72b28f8c6230c3c690bf800a19714e316901bd1bfe55ec217da4e3baba9204e5811d9bda7800fb00df4d029131a5093c4786
|
data/lib/ladder.rb
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
RUBY_MAIN_OBJECT = self
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Ladder
|
|
5
|
+
module FOR_RUBY_MAIN_OBJECT
|
|
6
|
+
attr_accessor :singleton_ladder_instance
|
|
7
|
+
def ladder(arg = nil, &block)
|
|
8
|
+
self.singleton_ladder_instance ||= Ladder.new
|
|
9
|
+
|
|
10
|
+
self.singleton_ladder_instance.ladder(arg, &block)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
module FOR_RUBY_OBJECT
|
|
15
|
+
def ladder(arg = nil, &block)
|
|
16
|
+
RUBY_MAIN_OBJECT.singleton_ladder_instance.ladder(arg, &block)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
begin
|
|
22
|
+
require 'byebug'
|
|
23
|
+
rescue LoadError => e
|
|
24
|
+
fail "Please install byebug via `gem install byebug` or add `byebug` to the Gemfile/gems.rb file. Error: #{e}"
|
|
25
|
+
end
|
|
26
|
+
def ladder(arg = nil, &block)
|
|
27
|
+
|
|
28
|
+
if arg.is_a?(Hash) && arg[:stop]
|
|
29
|
+
@saved_blocks.each.with_index do |block, i|
|
|
30
|
+
# byebug
|
|
31
|
+
@saved_blocks.delete_at(i) if arg[:stop] == block
|
|
32
|
+
end
|
|
33
|
+
else
|
|
34
|
+
if !arg.nil?
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
#- 1
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@saved_blocks.each { |block| block.call(arg) }
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
elsif block_given?
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
#- 2
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@saved_blocks ||= []
|
|
50
|
+
@saved_blocks.push(block)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
return block
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
class Object
|
|
60
|
+
include Ladder::FOR_RUBY_OBJECT
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
extend Ladder::FOR_RUBY_MAIN_OBJECT
|
|
64
|
+
|
|
65
|
+
ladder
|
metadata
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ladder-gem
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 11.test
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Manuel Arno Korfmann
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-10-22 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Call ladder everywhere (even bundled gems) and feel like it's GOTO-2019
|
|
14
|
+
email: manu@korfmann.info
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/ladder.rb
|
|
20
|
+
homepage: https://medium.com/@manu_78098/tutorial-for-monkey-patching-ladder-3fc1f976b56
|
|
21
|
+
licenses:
|
|
22
|
+
- MIT
|
|
23
|
+
metadata: {}
|
|
24
|
+
post_install_message:
|
|
25
|
+
rdoc_options: []
|
|
26
|
+
require_paths:
|
|
27
|
+
- lib
|
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - ">"
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: 1.3.1
|
|
38
|
+
requirements: []
|
|
39
|
+
rubygems_version: 3.0.3
|
|
40
|
+
signing_key:
|
|
41
|
+
specification_version: 4
|
|
42
|
+
summary: Ladder RB
|
|
43
|
+
test_files: []
|