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/client/sqlite3.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/dbshell/client/sqlite3.rb (limited to 'lib/dbshell/client/sqlite3.rb') diff --git a/lib/dbshell/client/sqlite3.rb b/lib/dbshell/client/sqlite3.rb new file mode 100644 index 0000000..adc71ef --- /dev/null +++ b/lib/dbshell/client/sqlite3.rb @@ -0,0 +1,15 @@ +class DBShell::Sqlite3Client + EXECUTABLE_NAME = 'sqlite3' + + def self.runshell(db_info) + args = self.build_command(db_info) + exec(*args) + end + + def self.build_command(db_info) + args = [ + EXECUTABLE_NAME, + db_info['database'] + ] + end +end -- cgit v1.2.3