rack-app-sequel 0.1.0 → 0.2.0

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: 79413e5a30d09c7693e05d5871cebdc14c0a7065
4
- data.tar.gz: d007a46258e90f37c4c7146cebda129d90f512dd
3
+ metadata.gz: bd00123af00c6e2fdcf4d50c826d8a526eb14dd6
4
+ data.tar.gz: 4d051b528a10285bc32665c28b5b974a54c6c2f1
5
5
  SHA512:
6
- metadata.gz: 83c625abfcee3f7e1a125fe466c05e88ed0684d69264db366ef227043a9a225dff4906ffba3070e0ef55330c839f294ca4d47a8af8683a76e32f8d1bf95f7cae
7
- data.tar.gz: 815de997be8de022d9cc90d1f1bb46036b5ebabe0c89712446c274c6469618ef09296abb8d76e47bf1ba0285d3664b68ab33fcdd1c15d3725f52acd668ddb974
6
+ metadata.gz: 9987c2c2b3622d5b004f7a7279d038f901eda502727e5f403608de94ae184f08e55d5df520073d718aeb8ded52694c9bcc6b7a5b07c9fe998787351c66aa8c79
7
+ data.tar.gz: bf63f57b9ab0430adde9982169d16855bdea8e7b971863887a0cd9c269b81343a4e7f1d46af5fa3b90bf3a4dca292db27ff9e5fbcb9c541e046e5e5905bf46e1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -15,6 +15,10 @@ Rack::App::SeQueL::Migration::CLI = lambda do
15
15
  options[:migration_directory] = string
16
16
  end
17
17
 
18
+ option '--verbose', 'set migration to be verbose instead of silent' do
19
+ options[:verbose] = true
20
+ end
21
+
18
22
  action do
19
23
 
20
24
  options[:migration_directory] ||= Rack::App::SeQueL::Migration::DEFAULT_DIRECTORY
@@ -23,19 +27,23 @@ Rack::App::SeQueL::Migration::CLI = lambda do
23
27
  db = Rack::App::SeQueL.open_connection
24
28
  db = Sequel.connect(ENV.fetch('DATABASE_URL'))
25
29
 
30
+ logger = Logger.new(options[:verbose] ? ::STDOUT : ::IO::NULL)
31
+ db.loggers << logger
32
+
26
33
  migration_config = {}
27
34
  if options[:allow_missing_migration_files]
28
35
  migration_config[:allow_missing_migration_files]= true
29
36
  end
30
37
 
31
38
  if options[:version]
32
- STDOUT.puts "Migrating to version #{options[:version]}"
39
+ logger.info("Migrating to version #{options[:version]}")
40
+
33
41
  migration_config[:target]= options[:version].to_i
34
42
  end
35
43
 
36
44
  Sequel::Migrator.run(db, options[:migration_directory], migration_config)
37
45
 
38
- STDOUT.puts('Migration completed')
46
+ logger.info('Migration completed')
39
47
  end
40
48
 
41
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-app-sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler