From b700c1bef89a67a64f1040fb6bb03c0320eefe91 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 29 Apr 2017 21:55:48 +0200 Subject: Rename database client files to put them in a `Client` module Will be modifying the class names in the next commit. Here we change the file names & locations of the database client files. The format changes thusly: _client.rb -> client/.rb This organisation feels cleaner to me. Wasn't liking the previous structure. --- lib/dbshell/postgres_client.rb | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 lib/dbshell/postgres_client.rb (limited to 'lib/dbshell/postgres_client.rb') diff --git a/lib/dbshell/postgres_client.rb b/lib/dbshell/postgres_client.rb deleted file mode 100644 index 1c1c663..0000000 --- a/lib/dbshell/postgres_client.rb +++ /dev/null @@ -1,23 +0,0 @@ -class DBShell::PostgresClient - EXECUTABLE_NAME = 'psql' - - def self.runshell(db_info) - args = self.build_command(db_info) - exec(*args) - end - - def self.build_command(db_info) - args = [EXECUTABLE_NAME] - - host = db_info['host'] - port = db_info['port'] - db_name = db_info['database'] - user = db_info['username'] - password = db_info['password'] - - args.push('-U', user) if user - args.push('-h', host) if host - args.push('-p', port) if port - args.push(db_name) - end -end -- cgit v1.2.3