aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Redon <kevredon@mail.tsaitgaist.info>2013-12-18 14:40:44 +0100
committerKevin Redon <kevredon@mail.tsaitgaist.info>2013-12-18 14:40:44 +0100
commita771ba47bb6da1b1249c4b61ecbd06e44b54c474 (patch)
tree42748cdc9ce60c60f761c102637f02d95452e47b
parentfd6db3b79e4a7c5a99e49097d5e68b93f15e921e (diff)
updated 'require' statement to ruby's 2.0 'require_relative'
-rwxr-xr-xsrc/apdu_forward.rb2
-rw-r--r--src/copy_client.rb4
-rwxr-xr-xsrc/demo_client.rb10
-rwxr-xr-xsrc/demo_server.rb4
-rw-r--r--src/info_client.rb4
-rw-r--r--src/lib/apdu.rb4
-rw-r--r--src/pcsc_server.rb2
-rw-r--r--src/sap/client.rb2
-rw-r--r--src/sap/server.rb2
-rw-r--r--src/simos_server.rb4
10 files changed, 17 insertions, 21 deletions
diff --git a/src/apdu_forward.rb b/src/apdu_forward.rb
index 83974ec..d6c71e4 100755
--- a/src/apdu_forward.rb
+++ b/src/apdu_forward.rb
@@ -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"
diff --git a/src/copy_client.rb b/src/copy_client.rb
index 528849f..4119e0f 100644
--- a/src/copy_client.rb
+++ b/src/copy_client.rb
@@ -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
diff --git a/src/demo_client.rb b/src/demo_client.rb
index 40cb1f3..c8c8911 100755
--- a/src/demo_client.rb
+++ b/src/demo_client.rb
@@ -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)
diff --git a/src/demo_server.rb b/src/demo_server.rb
index 207c804..a5c49db 100755
--- a/src/demo_server.rb
+++ b/src/demo_server.rb
@@ -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"
diff --git a/src/info_client.rb b/src/info_client.rb
index b1cda86..9a7ba2a 100644
--- a/src/info_client.rb
+++ b/src/info_client.rb
@@ -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 ==
diff --git a/src/lib/apdu.rb b/src/lib/apdu.rb
index 750e6ff..fcaa0a2 100644
--- a/src/lib/apdu.rb
+++ b/src/lib/apdu.rb
@@ -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
diff --git a/src/pcsc_server.rb b/src/pcsc_server.rb
index 4a802e9..ab3820d 100644
--- a/src/pcsc_server.rb
+++ b/src/pcsc_server.rb
@@ -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
diff --git a/src/sap/client.rb b/src/sap/client.rb
index e89cc07..9eaed0a 100644
--- a/src/sap/client.rb
+++ b/src/sap/client.rb
@@ -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 :
diff --git a/src/sap/server.rb b/src/sap/server.rb
index f93ac5a..cebdbda 100644
--- a/src/sap/server.rb
+++ b/src/sap/server.rb
@@ -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) :
diff --git a/src/simos_server.rb b/src/simos_server.rb
index 34c1117..07e9ddd 100644
--- a/src/simos_server.rb
+++ b/src/simos_server.rb
@@ -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'