10
0
Fork 0

updated 'require' statement to ruby's 2.0 'require_relative'

This commit is contained in:
Kevin Redon 2013-12-18 14:40:44 +01:00
parent fd6db3b79e
commit a771ba47bb
10 changed files with 17 additions and 21 deletions

View File

@ -19,7 +19,7 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this programm will forward APDU from an IO to a SAP server
require './sap/client.rb'
require_relative 'sap/client'
require 'socket'
SAP_HOST = "localhost"

View File

@ -18,8 +18,8 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this class copies all files from the SIM to an xml file
require './sap/client.rb'
require './lib/apdu.rb'
require_relative 'sap/client'
require_relative 'lib/apdu'
require 'xml'
class Copy

View File

@ -19,10 +19,10 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this programm will create a client which can be used to test servers
require './sap/client.rb'
require './lib/apdu.rb'
require './info_client.rb'
require './copy_client.rb'
require_relative 'sap/client'
require_relative 'lib/apdu'
require_relative 'info_client'
require_relative 'copy_client'
#=============
#== default ==
@ -131,7 +131,7 @@ when "bt"
if @bt then
io = SerialPort.new(@bt)
else
require './tools/bluetooth_sap_serial.rb'
require_relative 'tools/bluetooth_sap_serial'
bt = BluetoothSAPSerial.new
# using SerialPort because reading the File does not work (have to find right stty options)
io = SerialPort.new(bt.connect)

View File

@ -108,10 +108,10 @@ io = socket.accept
case @type
when "pcsc"
require './pcsc_server.rb'
require_relative 'pcsc_server'
server = PCSCServer.new(io)
when "sim"
require './simos_server.rb'
require_relative 'simos_server'
server = SIMServer.new(io)
else
raise "unkown server type"

View File

@ -19,8 +19,8 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this programm will display information stored in the SIM
require './sap/client.rb'
require './lib/apdu.rb'
require_relative 'sap/client'
require_relative 'lib/apdu'
#=============
#== methods ==

View File

@ -21,10 +21,6 @@ Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this librarie is to centralise the APDU related work
# required by ruby 1.8, but brakes by 1.9
#$KCODE = 'UTF8'
#require 'jcode'
# transform binary string into readable hex string
class String
def to_hex_disp

View File

@ -18,7 +18,7 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
require './sap/server.rb'
require_relative 'sap/server'
require 'rubygems'
require 'smartcard'
=begin

View File

@ -19,7 +19,7 @@ Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this is the client part of the SAP
# it implements the state machine for the client
require './sap/common.rb'
require_relative 'common'
# this is an abstract class
# TODO :

View File

@ -20,7 +20,7 @@ Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
# this is the server part of the SAP
# it implements the state machine for the server
# this is an abstract class
require './sap/common.rb'
require_relative 'common'
# this is an bastract class
# TODO (not implemented) :

View File

@ -18,8 +18,8 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
require './sap/server.rb'
require './lib/apdu.rb'
require_relative 'sap/server'
require_relative 'lib/apdu'
require 'socket'
require 'xml'