pg_tasks 1.3.1 → 1.3.2

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: 893c26064554332650a7bb7c47f7a1aa1d255c9d
4
- data.tar.gz: d2bf55001a410ae1e7eeb62e8bc52d5344107cd7
3
+ metadata.gz: 9840f1343dcb434383f6d5d41cf04e928ef19774
4
+ data.tar.gz: d9922d86b9b2b930655b22de3cd08dc64e7d2bc3
5
5
  SHA512:
6
- metadata.gz: 86422bcfec7f9164f63d46d0c0ecc683f6a969211dfc2b60dbb654fdd23a9998f5f69e58c9b71d34dbb52a968820cad7590d192db3bc98dbc3253275d3f68d52
7
- data.tar.gz: ed61d4d6700a4070485d7bb06096800f7fb4da8fe5043e25153d8ebb78477cbdc519b14988029a7719e5096c48453e4b0ceeb67be23037116747bff7aacf35fa
6
+ metadata.gz: f291b708f19c09670658191b7710ebd8d7eec1063d8dc0bb9870e595476dad3469c1508ff5a2b579c3dc7af8026f3a00a070cebb0d05ec2e368ba35cf9611d46
7
+ data.tar.gz: 073a5f05cb3035620284672825e9338bf1165946fb71353caa76857346b873f451e69fa0929e092e21ad6a823f4ffa948c4525a089284df264649cdc959ef9b7
@@ -7,5 +7,5 @@
7
7
  #++
8
8
 
9
9
  module PgTasks
10
- VERSION = '1.3.1'
10
+ VERSION = '1.3.2'
11
11
  end
data/lib/pg_tasks.rb CHANGED
@@ -17,16 +17,16 @@ module PgTasks
17
17
 
18
18
  class << self
19
19
  %w(data_dump data_restore).each do |method_name|
20
- define_method method_name do |filename = nil|
20
+ define_method method_name do |filename = nil|
21
21
  ActiveRecord::Tasks::DatabaseTasks \
22
22
  .perform_pg_db_task_for_config_and_filename \
23
- method_name, current_config,
23
+ method_name, current_config,
24
24
  filename_or_default_binary_data_file(filename)
25
25
  end
26
26
  end
27
27
 
28
28
  %w(structure_and_data_dump structure_and_data_restore).each do |method_name|
29
- define_method method_name do |filename = nil|
29
+ define_method method_name do |filename = nil|
30
30
  ActiveRecord::Tasks::DatabaseTasks \
31
31
  .perform_pg_db_task_for_config_and_filename \
32
32
  method_name, current_config,
@@ -10,29 +10,35 @@ require 'pg_tasks'
10
10
 
11
11
  namespace :db do
12
12
  namespace :pg do
13
+ desc 'Truncate all tables but schema_migrations'
13
14
  task truncate_tables: [:environment, :load_config] do
14
15
  PgTasks.truncate_tables
15
16
  end
16
17
 
18
+ desc 'Terminate forcefully all connections to the database'
17
19
  task terminate_connections: [:environment, :load_config] do
18
20
  PgTasks.terminate_connections
19
21
  end
20
22
 
21
23
  namespace :data do
24
+ desc "Call pg_dump to dump data without structure and without schema_migrations, honors ENV['FILE']"
22
25
  task dump: [:environment, :load_config] do
23
26
  PgTasks.data_dump ENV['FILE']
24
27
  end
25
28
 
29
+ desc "Call pg_restore with parameters apt to load dumps w.o. structure, honors ENV['FILE']"
26
30
  task restore: [:environment, :load_config] do
27
31
  PgTasks.data_restore ENV['FILE']
28
32
  end
29
33
  end
30
34
 
31
35
  namespace :structure_and_data do
36
+ desc "Call pg_dump to dump all data and structure, honors ENV['FILE']"
32
37
  task dump: [:environment, :load_config] do
33
38
  PgTasks.structure_and_data_dump ENV['FILE']
34
39
  end
35
40
 
41
+ desc "Call pg_restore with parameters apt to load data and structure, honors ENV['FILE']"
36
42
  task restore: [:environment, :load_config] do
37
43
  PgTasks.structure_and_data_restore ENV['FILE']
38
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Schank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-15 00:00:00.000000000 Z
11
+ date: 2015-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -96,3 +96,4 @@ signing_key:
96
96
  specification_version: 4
97
97
  summary: PostgreSQL Tasks and Functions for Ruby on Rails
98
98
  test_files: []
99
+ has_rdoc: