aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dbshell/client/sqlite3.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-04-29 22:21:01 +0200
committerTeddy Wing2017-04-29 22:21:01 +0200
commit46b019abd520870ab159b60c03c45675f64dd88a (patch)
tree7204226a8129cf40a4723c9def1a4e01c6e663fb /lib/dbshell/client/sqlite3.rb
parent6f4057392857313355769de7fea293b5e50f0779 (diff)
downloaddbshell-rails-46b019abd520870ab159b60c03c45675f64dd88a.tar.bz2
Rename database client classes
Update our class names to reflect the new file structure introduced in b700c1bef89a67a64f1040fb6bb03c0320eefe91. Use the module DBShell module Client end end syntax intead of `DBShell::Client` so that we don't have to define the `Client` module in a separate file and require it. Otherwise we'd get an error: lib/dbshell/client/sqlite3.rb:1:in `<top (required)>': uninitialized constant DBShell::Client (NameError)
Diffstat (limited to 'lib/dbshell/client/sqlite3.rb')
-rw-r--r--lib/dbshell/client/sqlite3.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/dbshell/client/sqlite3.rb b/lib/dbshell/client/sqlite3.rb
index adc71ef..09b44f9 100644
--- a/lib/dbshell/client/sqlite3.rb
+++ b/lib/dbshell/client/sqlite3.rb
@@ -1,15 +1,19 @@
-class DBShell::Sqlite3Client
- EXECUTABLE_NAME = 'sqlite3'
+module DBShell
+ module Client
+ class Sqlite3
+ EXECUTABLE_NAME = 'sqlite3'
- def self.runshell(db_info)
- args = self.build_command(db_info)
- exec(*args)
- end
+ 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']
- ]
+ def self.build_command(db_info)
+ args = [
+ EXECUTABLE_NAME,
+ db_info['database']
+ ]
+ end
+ end
end
end