Skip to content

Commit 6b407c6

Browse files
committed
Renamed Ronin::ASM::OS to Ronin::ASM::Syscalls (closes #50).
1 parent 1e6e160 commit 6b407c6

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

lib/ronin/asm/program.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
require_relative 'x86'
2222
require_relative 'x86_64'
23-
require_relative 'os'
23+
require_relative 'syscalls'
2424
require_relative 'register'
2525
require_relative 'instruction'
2626
require_relative 'immediate'
@@ -51,9 +51,9 @@ class Program
5151
}
5252

5353
# Mapping of Operating System names and modules.
54-
OSES = {
55-
linux: OS::Linux,
56-
freebsd: OS::FreeBSD
54+
SYSCALLS = {
55+
linux: Syscalls::Linux,
56+
freebsd: Syscalls::FreeBSD
5757
}
5858

5959
# The Assembly Parsers
@@ -179,13 +179,13 @@ def initialize_arch(arch)
179179
def initialize_os(os)
180180
@os = os
181181

182-
os_module = OSES.fetch(os) do
182+
syscall_module = SYSCALLS.fetch(os) do
183183
raise(ArgumentError,"unknown OS: #{os.inspect}")
184184
end
185185

186-
@syscalls = os_module::SYSCALLS
186+
@syscalls = syscall_module::SYSCALLS
187187

188-
extend os_module
188+
extend syscall_module
189189
end
190190

191191
public

lib/ronin/asm/os.rb renamed to lib/ronin/asm/syscalls.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
# along with ronin-asm. If not, see <https://www.gnu.org/licenses/>.
1919
#
2020

21-
require_relative 'os/freebsd'
22-
require_relative 'os/linux'
21+
require_relative 'syscalls/freebsd'
22+
require_relative 'syscalls/linux'
2323

2424
module Ronin
2525
module ASM
26-
module OS
26+
module Syscalls
2727
# The mapping of OS names to modules.
28-
NAMES = {
28+
OSES = {
2929
linux: Linux,
3030
freebsd: FreeBSD
3131
}
@@ -45,7 +45,7 @@ module OS
4545
# @since 1.0.0
4646
#
4747
def self.[](name)
48-
NAMES.fetch(name) do
48+
OSES.fetch(name) do
4949
raise(ArgumentError,"unknown OS name: #{name.inspect}")
5050
end
5151
end

lib/ronin/asm/os/freebsd.rb renamed to lib/ronin/asm/syscalls/freebsd.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
module Ronin
2424
module ASM
25-
module OS
25+
module Syscalls
2626
#
27-
# Contains FreeBSD specific helper methods.
27+
# Contains FreeBSD syscall numbers.
2828
#
2929
module FreeBSD
3030
# System call numbers for FreeBSD.

lib/ronin/asm/os/linux.rb renamed to lib/ronin/asm/syscalls/linux.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
module Ronin
2424
module ASM
25-
module OS
25+
module Syscalls
2626
#
27-
# Contains Linux specific helper methods.
27+
# Contains Linux syscall numbers.
2828
#
2929
module Linux
3030
# System call numbers for Linux.

spec/os_spec.rb renamed to spec/syscalls_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
2-
require 'ronin/asm/os'
2+
require 'ronin/asm/syscalls'
33

4-
describe Ronin::ASM::OS do
4+
describe Ronin::ASM::Syscalls do
55
describe ".[]" do
66
context "when given :linux" do
77
it "must return #{described_class}::Linux" do

0 commit comments

Comments
 (0)