Module: Marquetapage
- Defined in:
- lib/marquetapage.rb,
lib/marquetapage/runner.rb,
lib/marquetapage/version.rb
Overview
Version file
Defined Under Namespace
Classes: Runner
Constant Summary collapse
- VERSION =
Version constant
'0.1.0'.freeze
Class Method Summary collapse
-
.db ⇒ Object
Use DATABASE_URL env var or return sqlite connection string.
-
.db_path ⇒ Object
Get places.sqlite from current env production will search first ‘.mozilla/firefox/xxx.default/places.sqlite` other environment will search current directory for `places.ENV.sqlite`.
-
.env ⇒ Object
Get current environment from MARQUETAPAGE_ENV Default: production.
-
.sequel_connect ⇒ Object
Sequel connect.
Class Method Details
.db ⇒ Object
Use DATABASE_URL env var or return sqlite connection string
27 28 29 |
# File 'lib/marquetapage.rb', line 27 def self.db ENV['DATABASE_URL'] || "sqlite://#{db_path}" end |
.db_path ⇒ Object
Get places.sqlite from current env production will search first ‘.mozilla/firefox/xxx.default/places.sqlite` other environment will search current directory for `places.ENV.sqlite`
16 17 18 19 20 21 22 23 |
# File 'lib/marquetapage.rb', line 16 def self.db_path if env == 'production' mozilla_path = "#{ENV['HOME']}/.mozilla/firefox/*.default/places.sqlite" Dir.glob(mozilla_path).first else File.("../../places.#{env}.sqlite", __FILE__) end end |
.env ⇒ Object
Get current environment from MARQUETAPAGE_ENV Default: production
8 9 10 |
# File 'lib/marquetapage.rb', line 8 def self.env ENV['MARQUETAPAGE_ENV'] || 'production' end |
.sequel_connect ⇒ Object
Sequel connect
33 34 35 |
# File 'lib/marquetapage.rb', line 33 def self.sequel_connect @sequel_connect ||= Sequel.connect(db) end |