dbhijacker 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 42c96e0f9bdd1481601443661fbd447fc5497781
4
+ data.tar.gz: 6d7fc6562cd8728d7e2761a780484eddaa4159ea
5
+ SHA512:
6
+ metadata.gz: b37be81a3d4614e2a0463a445c4954e2c24147d35d3d802d6fcc1b5a5c0acfe384f20061a5d1f3a131453201918d218d872840b894f66340b57fad802a2830b3
7
+ data.tar.gz: b049707cff014ea72f16c5ec0809d621caace545a7ea7b266f10ec77d475bcd7f37d6a1873c103f3c61be3cf509d1ea8ffa000434ecc8f3465257f79951fcd93
data/dbhijacker.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{dbhijacker}
5
5
  s.homepage = "https://github.com/crystalcommerce/hijacker"
6
- s.version = "0.8.0"
6
+ s.version = "0.8.1"
7
7
 
8
8
  s.authors = ["Michael Xavier", "Donald Plummer", "Woody Peterson"]
9
9
  s.date = %q{2012-03-21}
@@ -120,16 +120,32 @@ class Hijacker::Database < ActiveRecord::Base
120
120
  end
121
121
  end
122
122
 
123
- def self.count_each(&blk)
123
+ def self.count_each(options = {}, &blk)
124
124
  acc = {}
125
- connect_each do |db|
126
- count = blk.call
127
- acc[db] = count if count > 0
125
+
126
+ if options.fetch(:progress, true)
127
+ require 'progress'
128
+ Progress.start("Counting...", count) do
129
+ connect_each do |db|
130
+ count = blk.call
131
+ acc[db] = count if count > 0
132
+ Progress.step
133
+ end
134
+ end
135
+ else
136
+ connect_each do |db|
137
+ count = blk.call
138
+ acc[db] = count if count > 0
139
+ end
128
140
  end
129
- width = acc.keys.map(&:length).max
130
- acc.sort_by(&:last).each do |db, count|
131
- puts("%#{width}s: %s" % [db, count])
141
+
142
+ if options.fetch(:print, true)
143
+ width = acc.keys.map(&:length).max
144
+ acc.sort_by(&:last).each do |db, count|
145
+ puts("%#{width}s: %s" % [db, count])
146
+ end
132
147
  end
148
+
133
149
  acc
134
150
  end
135
151
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbhijacker
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.8.0
4
+ version: 0.8.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael Xavier
@@ -14,113 +13,99 @@ cert_chain: []
14
13
  date: 2012-03-21 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
- prerelease: false
18
- type: :runtime
19
16
  name: rails
20
- version_requirements: !ruby/object:Gem::Requirement
21
- none: false
17
+ requirement: !ruby/object:Gem::Requirement
22
18
  requirements:
23
- - - ! '>='
19
+ - - '>='
24
20
  - !ruby/object:Gem::Version
25
21
  version: 2.3.14
26
- requirement: !ruby/object:Gem::Requirement
27
- none: false
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
28
25
  requirements:
29
- - - ! '>='
26
+ - - '>='
30
27
  - !ruby/object:Gem::Version
31
28
  version: 2.3.14
32
29
  - !ruby/object:Gem::Dependency
33
- prerelease: false
34
- type: :development
35
30
  name: bundler
36
- version_requirements: !ruby/object:Gem::Requirement
37
- none: false
31
+ requirement: !ruby/object:Gem::Requirement
38
32
  requirements:
39
33
  - - ~>
40
34
  - !ruby/object:Gem::Version
41
35
  version: '1.3'
42
- requirement: !ruby/object:Gem::Requirement
43
- none: false
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
44
39
  requirements:
45
40
  - - ~>
46
41
  - !ruby/object:Gem::Version
47
42
  version: '1.3'
48
43
  - !ruby/object:Gem::Dependency
49
- prerelease: false
50
- type: :development
51
44
  name: rake
52
- version_requirements: !ruby/object:Gem::Requirement
53
- none: false
45
+ requirement: !ruby/object:Gem::Requirement
54
46
  requirements:
55
47
  - - ~>
56
48
  - !ruby/object:Gem::Version
57
49
  version: 0.9.2
58
- requirement: !ruby/object:Gem::Requirement
59
- none: false
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
60
53
  requirements:
61
54
  - - ~>
62
55
  - !ruby/object:Gem::Version
63
56
  version: 0.9.2
64
57
  - !ruby/object:Gem::Dependency
65
- prerelease: false
66
- type: :development
67
58
  name: rack-test
68
- version_requirements: !ruby/object:Gem::Requirement
69
- none: false
59
+ requirement: !ruby/object:Gem::Requirement
70
60
  requirements:
71
61
  - - ~>
72
62
  - !ruby/object:Gem::Version
73
63
  version: 0.6.1
74
- requirement: !ruby/object:Gem::Requirement
75
- none: false
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
76
67
  requirements:
77
68
  - - ~>
78
69
  - !ruby/object:Gem::Version
79
70
  version: 0.6.1
80
71
  - !ruby/object:Gem::Dependency
81
- prerelease: false
82
- type: :development
83
72
  name: rack
84
- version_requirements: !ruby/object:Gem::Requirement
85
- none: false
73
+ requirement: !ruby/object:Gem::Requirement
86
74
  requirements:
87
75
  - - ~>
88
76
  - !ruby/object:Gem::Version
89
77
  version: 1.1.0
90
- requirement: !ruby/object:Gem::Requirement
91
- none: false
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
92
81
  requirements:
93
82
  - - ~>
94
83
  - !ruby/object:Gem::Version
95
84
  version: 1.1.0
96
85
  - !ruby/object:Gem::Dependency
97
- prerelease: false
98
- type: :development
99
86
  name: rspec
100
- version_requirements: !ruby/object:Gem::Requirement
101
- none: false
87
+ requirement: !ruby/object:Gem::Requirement
102
88
  requirements:
103
89
  - - ~>
104
90
  - !ruby/object:Gem::Version
105
91
  version: '2.8'
106
- requirement: !ruby/object:Gem::Requirement
107
- none: false
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
108
95
  requirements:
109
96
  - - ~>
110
97
  - !ruby/object:Gem::Version
111
98
  version: '2.8'
112
99
  - !ruby/object:Gem::Dependency
113
- prerelease: false
114
- type: :development
115
100
  name: sqlite3
116
- version_requirements: !ruby/object:Gem::Requirement
117
- none: false
101
+ requirement: !ruby/object:Gem::Requirement
118
102
  requirements:
119
103
  - - ~>
120
104
  - !ruby/object:Gem::Version
121
105
  version: 1.3.5
122
- requirement: !ruby/object:Gem::Requirement
123
- none: false
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
124
109
  requirements:
125
110
  - - ~>
126
111
  - !ruby/object:Gem::Version
@@ -156,28 +141,27 @@ files:
156
141
  - tasks/hijacker_tasks.rake
157
142
  homepage: https://github.com/crystalcommerce/hijacker
158
143
  licenses: []
144
+ metadata: {}
159
145
  post_install_message:
160
146
  rdoc_options:
161
147
  - --charset=UTF-8
162
148
  require_paths:
163
149
  - lib
164
150
  required_ruby_version: !ruby/object:Gem::Requirement
165
- none: false
166
151
  requirements:
167
- - - ! '>='
152
+ - - '>='
168
153
  - !ruby/object:Gem::Version
169
154
  version: '0'
170
155
  required_rubygems_version: !ruby/object:Gem::Requirement
171
- none: false
172
156
  requirements:
173
- - - ! '>='
157
+ - - '>='
174
158
  - !ruby/object:Gem::Version
175
159
  version: '0'
176
160
  requirements: []
177
161
  rubyforge_project:
178
- rubygems_version: 1.8.25
162
+ rubygems_version: 2.0.3
179
163
  signing_key:
180
- specification_version: 3
164
+ specification_version: 4
181
165
  summary: One application, multiple client databases
182
166
  test_files:
183
167
  - spec/hijacker/alias_spec.rb