tidy_reset 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +6 -14
  2. data/VERSION +1 -1
  3. data/lib/tidy_reset.rb +8 -2
  4. data/tidy_reset.gemspec +5 -4
  5. metadata +18 -18
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZmMwMGNmNGFmZThiNGUxODViYjU0YWNjODE4NWViZmFkYmE2MTQ2MQ==
5
- data.tar.gz: !binary |-
6
- N2FjZDQ5MmZmNzU4OGIzZjdlOTM1YWNmYzBlMjhjOGY0MDNjMzc5NQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZWU2ZDk5MjIwNDdjNmIxN2YwNDMzYTAyMjFiOTYzZjQ1ZTY0YzcyNzcyODUy
10
- MTg0NmEwNjdmODAxOTc1N2Y5ZWQ2YjEwODEwN2NhMjdhYmM1MGMzMzQ0NjEy
11
- NmNkZWI0MTU5MzFiM2Q5YmFmNzljMTViYzUyOGQ2YWJkMTI1MzA=
12
- data.tar.gz: !binary |-
13
- NTY0M2EyODQxZGE4YWM3NzVhOTAzYTc4MjA1M2UxZWZlYjI5ODUyMTQzNDk0
14
- NjQ1NjJkNTg2Y2UwNGFkYjM2MjU1ZDQwMmM3M2M4ZjkwNjcyNmU3Nzg1NjRi
15
- NGFlYmRjN2JlZDQxZTA4YWUxNDJmOTI3ZTY4MTc0YzNjNTg0YjA=
2
+ SHA1:
3
+ metadata.gz: 838edc3a1df0b67c4bbfe25332da8b75f82ccbce
4
+ data.tar.gz: e098706a63c5f3703c731967c4ab158eef9aa541
5
+ SHA512:
6
+ metadata.gz: d1345f0323367d325f3761f1f60971b6818d7143f1071c9c6c5bde783002fc7eeba80f68340d2a3f8e582657d21fdb2d27209e5a65b1705951bc8ea9bd32c03d
7
+ data.tar.gz: 9390ec3bb82d590493e71589840f2afbb51a541e5a6d10f1f83158700c5f420979d00cd7bd20145eb2fdbc0ff922c8a26a0e1f3a4bf61e88dcfa22d3881b32f2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.5
data/lib/tidy_reset.rb CHANGED
@@ -29,13 +29,19 @@ module TidyReset
29
29
  def database_purge(db_config)
30
30
  begin
31
31
  encoding = configuration.database_encoding
32
- master_connection = ActiveRecord::Base.establish_connection(db_config.merge(
32
+ ActiveRecord::Base.remove_connection
33
+ pool = ActiveRecord::Base.establish_connection(db_config.merge(
33
34
  'database' => 'postgres',
34
35
  'schema_search_path' => 'public'
35
- )).connection
36
+ ))
37
+ if pool.is_a?(Array)
38
+ raise RuntimeError, "Pool an array size #{pool.size}. First: #{pool.first}"
39
+ end
40
+ master_connection = pool.connection
36
41
  master_connection.select_all("SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE datname='#{db_config['database']}' AND state='idle';")
37
42
  master_connection.drop_database(db_config['database'])
38
43
  master_connection.create_database(db_config['database'], db_config.merge('encoding' => encoding))
44
+ ActiveRecord::Base.remove_connection
39
45
  ActiveRecord::Base.establish_connection(db_config).connection.execute("CREATE EXTENSION IF NOT EXISTS postgis")
40
46
  rescue ActiveRecord::StatementInvalid => error
41
47
  if /database .* already exists/ === error.message
data/tidy_reset.gemspec CHANGED
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: tidy_reset 0.1.5 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "tidy_reset"
8
- s.version = "0.1.2"
9
+ s.version = "0.1.5"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Thinknear"]
12
- s.date = "2014-07-22"
14
+ s.date = "2014-07-24"
13
15
  s.description = "Reset dynos, environment variables, deploys master git branch, and purges the database."
14
16
  s.email = "software@thinknear.com"
15
17
  s.extra_rdoc_files = [
@@ -33,8 +35,7 @@ Gem::Specification.new do |s|
33
35
  "tidy_reset.gemspec"
34
36
  ]
35
37
  s.homepage = "http://github.com/ThinkNear/tidy"
36
- s.require_paths = ["lib"]
37
- s.rubygems_version = "2.0.5"
38
+ s.rubygems_version = "2.2.2"
38
39
  s.summary = "Resets Heroku applications"
39
40
 
40
41
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tidy_reset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thinknear
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-22 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 4.0.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.0.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: shoulda
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.12'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.12'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.0.1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.0.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Reset dynos, environment variables, deploys master git branch, and purges
@@ -103,7 +103,7 @@ extra_rdoc_files:
103
103
  - LICENSE.txt
104
104
  - README.md
105
105
  files:
106
- - .document
106
+ - ".document"
107
107
  - Gemfile
108
108
  - Gemfile.lock
109
109
  - LICENSE.txt
@@ -126,17 +126,17 @@ require_paths:
126
126
  - lib
127
127
  required_ruby_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - ! '>='
134
+ - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.0.5
139
+ rubygems_version: 2.2.2
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Resets Heroku applications