ronin-core 0.1.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 632034dea1307157efadc601fa99bfb2b1eaf3cf81506392f2a68733d68645d4
4
- data.tar.gz: 32f82f08f6692163e22f55ecc37666e2cc1655e37127bd578009fed61a3b4cbe
3
+ metadata.gz: 2e61fdc08b8e215624863cd59c443f5b5e41c25d8cf6427df9b903aa2458fcb3
4
+ data.tar.gz: b2598fe308eeb283bbcfd6ec817bfb3c3c94f34e3d1fb93aac98d345078c1129
5
5
  SHA512:
6
- metadata.gz: cba7b2829ba506c61c028d6961a5040b026640a3f60d46f2cdbf96649b6de4385a07d171835ab19e687837e9936bc757a832cd58ca71217e2d186433fdfcb3ab
7
- data.tar.gz: 64684f9aa1a7e46348b1596ed941b2056c0262806c5310a17991f6e2e43de179dd9d9988315f55a03be079f26b3f8452ec3f009ef09a3f58d236f9b4e8a238f0
6
+ metadata.gz: 73d16460be02608e46d22de62311f45d1fc4b01c40fac304222fc90ae321a7cf57ff5a29663eee49ae0ea84c8106e3fd548db65d3b48b9879f445e7aaf597094
7
+ data.tar.gz: 8c6f88d8caac5a0f6af9a2838cae33a97a7796b66872c17dde4a225e9e2195451637d553db349a3eab3a16c238621b7c069f5a4f7cd1ce092250490785f2bdc6
@@ -12,11 +12,12 @@ jobs:
12
12
  - '3.0'
13
13
  - '3.1'
14
14
  - '3.2'
15
+ - '3.3'
15
16
  - jruby
16
17
  - truffleruby
17
18
  name: Ruby ${{ matrix.ruby }}
18
19
  steps:
19
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v4
20
21
  - name: Set up Ruby
21
22
  uses: ruby/setup-ruby@v1
22
23
  with:
@@ -31,7 +32,7 @@ jobs:
31
32
  rubocop:
32
33
  runs-on: ubuntu-latest
33
34
  steps:
34
- - uses: actions/checkout@v2
35
+ - uses: actions/checkout@v4
35
36
  - name: Set up Ruby
36
37
  uses: ruby/setup-ruby@v1
37
38
  with:
data/ChangeLog.md CHANGED
@@ -1,3 +1,17 @@
1
+ ### 0.1.3 / 2024-06-19
2
+
3
+ * Improved {Ronin::Core::ClassRegistry::ClassMethods#load_class_from_file}
4
+ to handle returning the class when the file has already been loaded.
5
+
6
+ ### 0.1.2 / 2023-07-18
7
+
8
+ #### CLI
9
+
10
+ * Changed {Ronin::Core::CLI::RubyShell#initialize} to wrap a `Module` `context:`
11
+ value in an `Object` instance which includes the module. This allows the
12
+ IRB session to gain access to the module's constants and instances methods,
13
+ as well as correctly define and call instance methods in the IRB session.
14
+
1
15
  ### 0.1.1 / 2023-03-01
2
16
 
3
17
  #### CLI
data/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  * [Issues](https://github.com/ronin-rb/ronin-core/issues)
10
10
  * [Documentation](https://ronin-rb.dev/docs/ronin-core/frames)
11
11
  * [Discord](https://discord.gg/6WAb3PsVX9) |
12
- [Twitter](https://twitter.com/ronin_rb) |
13
12
  [Mastodon](https://infosec.exchange/@ronin_rb)
14
13
 
15
14
  ## Description
@@ -190,17 +190,15 @@ module Ronin
190
190
  raise(ClassNotFound,"no such file or directory: #{file.inspect}")
191
191
  end
192
192
 
193
- previous_entries = registry.keys
194
-
195
193
  require(file)
196
194
 
197
- new_entries = registry.keys - previous_entries
195
+ registry.each_value do |worker_class|
196
+ class_file, = worker_class.const_source_location(worker_class.name)
198
197
 
199
- if new_entries.empty?
200
- raise(ClassNotFound,"file did not register a class: #{file.inspect}")
198
+ return worker_class if class_file == file
201
199
  end
202
200
 
203
- return registry[new_entries.last]
201
+ raise(ClassNotFound,"file did not register a class: #{file.inspect}")
204
202
  end
205
203
 
206
204
  #
@@ -231,6 +229,7 @@ module Ronin
231
229
  end
232
230
 
233
231
  previous_entries = registry.keys
232
+
234
233
  require(path)
235
234
 
236
235
  unless (klass = registry[id])
@@ -48,7 +48,7 @@ module Ronin
48
48
  # @param [String] name
49
49
  # The name of the IRB console.
50
50
  #
51
- # @param [Object] context
51
+ # @param [Object, Module] context
52
52
  # Custom context to launch IRB from within.
53
53
  #
54
54
  # @param [Hash{Symbol => Object}] kwargs
@@ -58,7 +58,18 @@ module Ronin
58
58
  super(**kwargs)
59
59
 
60
60
  @name = name
61
- @context = context
61
+ @context = case context
62
+ when Module
63
+ Object.new.tap do |obj|
64
+ obj.singleton_class.include(context)
65
+ obj.singleton_class.define_singleton_method(:const_missing,&context.method(:const_missing))
66
+ obj.define_singleton_method(:inspect) do
67
+ "#<#{context}>"
68
+ end
69
+ end
70
+ else
71
+ context
72
+ end
62
73
  end
63
74
 
64
75
  #
@@ -29,7 +29,7 @@ module Ronin
29
29
  module Core
30
30
  module Params
31
31
  #
32
- # Contains all {Param::Type} classes.
32
+ # Contains all {Types} classes.
33
33
  #
34
34
  module Types
35
35
  # Mapping of ruby core classes to param types.
@@ -19,6 +19,6 @@
19
19
  module Ronin
20
20
  module Core
21
21
  # ronin-core version
22
- VERSION = '0.1.1'
22
+ VERSION = '0.1.3'
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-02 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reline
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.3.26
163
+ rubygems_version: 3.3.27
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: A core library for all ronin libraries.