# HG changeset patch # User Mahlon E. Smith # Date 1484599670 28800 # Node ID b1f97f6063a37575d6d6048488b51a1954df326b # Parent 8388c2d1d7afc1a8c56a026495aa30b5ac2bbec7 Update for Configurability 3.x. diff -r 8388c2d1d7af -r b1f97f6063a3 History.md --- a/History.md Mon Nov 14 15:17:46 2016 -0800 +++ b/History.md Mon Jan 16 12:47:50 2017 -0800 @@ -1,3 +1,8 @@ +## v0.2.0 [2017-01-16] Mahlon E. Smith + +Update for Configurability 3.x. + + ## v0.1.3 [2016-11-14] Mahlon E. Smith Various bugfixes, first public release. diff -r 8388c2d1d7af -r b1f97f6063a3 LICENSE.rdoc --- a/LICENSE.rdoc Mon Nov 14 15:17:46 2016 -0800 +++ b/LICENSE.rdoc Mon Jan 16 12:47:50 2017 -0800 @@ -1,4 +1,4 @@ -Copyright (c) 2007-2016, Michael Granger and Mahlon E. Smith. +Copyright (c) 2007-2017, Michael Granger and Mahlon E. Smith. All rights reserved. diff -r 8388c2d1d7af -r b1f97f6063a3 README.md --- a/README.md Mon Nov 14 15:17:46 2016 -0800 +++ b/README.md Mon Jan 16 12:47:50 2017 -0800 @@ -35,8 +35,8 @@ thingfish: metastore: pggraph - pggraph_metastore: - uri: postgres://thingfish:password@db.example.com/database + pggraph_metastore: + uri: postgres://thingfish:password@db.example.com/database When Thingfish starts, it will install the necessary database schema @@ -44,7 +44,7 @@ ## License -Copyright (c) 2014-2016, Michael Granger and Mahlon E. Smith. +Copyright (c) 2014-2017, Michael Granger and Mahlon E. Smith. All rights reserved. diff -r 8388c2d1d7af -r b1f97f6063a3 Rakefile --- a/Rakefile Mon Nov 14 15:17:46 2016 -0800 +++ b/Rakefile Mon Jan 16 12:47:50 2017 -0800 @@ -50,9 +50,8 @@ EOF s.required_ruby_version = '>= 2.3' - s.add_dependency 'thingfish', '~> 0.5' + s.add_dependency 'thingfish', '~> 0.6' s.add_dependency 'loggability', '~> 0.11' - s.add_dependency 'configurability', '~> 2.2' s.add_dependency 'sequel', '~> 4.35' s.add_dependency 'pg', '~> 0.19' end diff -r 8388c2d1d7af -r b1f97f6063a3 lib/thingfish/metastore/pggraph.rb --- a/lib/thingfish/metastore/pggraph.rb Mon Nov 14 15:17:46 2016 -0800 +++ b/lib/thingfish/metastore/pggraph.rb Mon Jan 16 12:47:50 2017 -0800 @@ -24,7 +24,7 @@ # Package version - VERSION = '0.1.3' + VERSION = '0.2.0' # Version control revision REVISION = %q$Revision$ @@ -40,31 +40,21 @@ 'data' + 'thingfish-metastore-pggraph' end - # The default config values - DEFAULT_CONFIG = { - uri: 'postgres:/thingfish', - slow_query_seconds: 0.01, - } - - - # Loggability API -- use a separate logger log_as :thingfish_metastore_pggraph # Configurability API -- load the `pg_metastore` - config_key :pggraph_metastore + configurability 'thingfish.pggraph_metastore' do + + # The Sequel::Database that's used to access the metastore tables + setting :uri, default: 'postgres:/thingfish' - ## - # The URI of the database to use for the metastore - singleton_attr_accessor :uri + # The number of seconds to consider a "slow" query + setting :slow_query_seconds, default: 0.01 + end - ## # The Sequel::Database that's used to access the metastore tables singleton_attr_accessor :db - ## - # The number of seconds to consider a "slow" query - singleton_attr_accessor :slow_query_seconds - ### Set up the metastore database and migrate to the latest version. def self::setup_database @@ -104,12 +94,8 @@ ### Configurability API -- set up the metastore with the `pg_metastore` section of ### the config file. def self::configure( config=nil ) - config = self.defaults.merge( config || {} ) - - self.uri = config[:uri] - self.slow_query_seconds = config[:slow_query_seconds] - - self.setup_database + super + self.setup_database if self.uri end