clockwork_database_events 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef01f2cca8b630b9b2fb6d67eaae2f6bcd859646
4
- data.tar.gz: e892d27471c4b84b5f8988ce921032dd29e80b88
3
+ metadata.gz: 1f44c4fc8fe2401f87d818212eb6c14b19285747
4
+ data.tar.gz: 371c4cc5b31e9a8da638643e410471edd119d0ca
5
5
  SHA512:
6
- metadata.gz: 3f28fcd8c845bf75c16a377a31bc1474eb343c3ff44921cde6a4e734f8fdf21a6d4d2002f49b58a1f54fc39ab267d89614b120908b6ed5d6372a0f7485abeeb1
7
- data.tar.gz: 8b98fc469376c089c357880809921b0a51280f6f3def04e8570b424c535adc29d90908b97180d43d75386bce2aaca1b1eeb29aed176c2e6343b9b090857b8cf4
6
+ metadata.gz: e69885939ff7abcfb1f7502e1fce39835004d1f9562ab613b876ef88315450e970f5e9d6e5ba0ebbc891d82d483a6293188cb44b38fa935c354eb90fbbfc47c2
7
+ data.tar.gz: 32346a0c9e27ce6e6de6e386601532897a4b49580722ef0a8ee51646b8d6a246bc000cdc1bde13555bfe44ab81617de9195562a78cf3424e1ce058cae4a64722
@@ -14,36 +14,4 @@ module ClockworkDatabaseEvents
14
14
  end
15
15
 
16
16
  module_function :migrate
17
-
18
- def connect(db_url=url)
19
- Sequel.connect(db_url)
20
- end
21
-
22
- module_function :connect
23
-
24
- def url
25
- if ENV['SKALERA_DB_URL']
26
- ENV['SKALERA_DB_URL']
27
- elsif ENV['JENKINS_HOME']
28
- 'sqlite:/' # for running tests in jenkins
29
- else
30
- # TODO: user, password & db should be retrieved from consul
31
- "postgres://skalera:skalera@#{host}/events"
32
- end
33
- end
34
-
35
- module_function :url
36
-
37
- def host
38
- consul = ENV['CONSUL'] || 'consul'
39
- Diplomat.configuration.url = "http://#{consul}:8500"
40
-
41
- postgres_config = Diplomat::Service.get('postgres')
42
- postgres_config.Address
43
- rescue Faraday::ConnectionFailed => e
44
- puts "unable to lookup '#{consul}': #{e.message}"
45
- raise e
46
- end
47
-
48
- module_function :host
49
17
  end
@@ -1,3 +1,4 @@
1
+ require 'logger'
1
2
  require 'active_support/time'
2
3
 
3
4
  Sequel::Model.plugin :timestamps, update_on_create: true
@@ -8,10 +9,11 @@ require 'clockwork_database_events/models/frequency_period'
8
9
  # clockwork database events
9
10
  module ClockworkDatabaseEvents
10
11
  def seed
11
- puts 'seeding frequecy table...'
12
+ logger = Logger.new(ENV['LOGGER'] || STDOUT)
13
+ logger.debug('seeding frequency table')
12
14
  %w(second minute hour day week month).each do |period|
13
15
  FrequencyPeriod.find_or_create(name: period) do
14
- puts "created #{period}"
16
+ logger.info("created #{period}")
15
17
  end
16
18
  end
17
19
  end
@@ -1,4 +1,4 @@
1
1
  # version
2
2
  module ClockworkDatabaseEvents
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.6'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clockwork_database_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Englund