crazy_db 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +2 -2
- data/crazy_db.gemspec +4 -4
- data/lib/crazy_db.rb +15 -13
- data/lib/crazy_db/version.rb +1 -1
- metadata +33 -5
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDY5NjE4OGEyYzQxNDVlOWZkYjRkNDNlZGQzZWI5MjhkNDQ5YjIwNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjRiMzA0ZjA5ZjQ0ZTJhZGNhYzJlZGFkN2Q2OTQzMjQ4NDhkYTM4OQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmY4Y2M1NDk5NjQzZjkzMTRmOTljZmU0YmIyMDkyY2EzMGI4YTYxM2YzZmNi
|
10
|
+
MDI4ZDkxNWRiYjFmNGMzYWFkOGNiYTY2ZWFhYmFhOWExODM2YzhmOWFmY2Q4
|
11
|
+
ZjBhMGFhMGRkOGJmNDc2MDViZDgxOWU4NWQyOTE3NmU4YTg5N2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGI0YTA4NmZlN2UwYzkxZWUwYTMwMjRmY2VkMjVjMWYzM2MxODQ2OTQwOWYw
|
14
|
+
YTM5OTBhZjRmZTVmY2UyZDg3YjhhYWIyMTA5ZGYzNTA4OTJlNzM0MWI4N2U2
|
15
|
+
NTFhZDdiNWU5YmNkZmY5MzgxZmI4ZGQwZjFiZWU2YzhlYjQ4ZTE=
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# CrazyDb
|
2
2
|
|
3
|
-
|
3
|
+
Crazy db provides rails application Database Information like database name, total number of tables, table names with records count in html format.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,7 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
In your view file write: <%= CrazyDb::db_statistics %>
|
22
22
|
|
23
23
|
## Contributing
|
24
24
|
|
data/crazy_db.gemspec
CHANGED
@@ -6,11 +6,11 @@ require 'crazy_db/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "crazy_db"
|
8
8
|
spec.version = CrazyDb::VERSION
|
9
|
-
spec.authors = ["Naveen"]
|
9
|
+
spec.authors = ["Naveen Kumar"]
|
10
10
|
spec.email = ["hcnaveenkumar@gmail.com"]
|
11
11
|
spec.description = "Rails database information"
|
12
12
|
spec.summary = "Crazy DB"
|
13
|
-
spec.homepage = "http://rubygems.org/gems/crazy_db
|
13
|
+
spec.homepage = "http://rubygems.org/gems/crazy_db"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split("\n")
|
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
23
|
end
|
data/lib/crazy_db.rb
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
require "crazy_db/version"
|
2
2
|
module CrazyDb
|
3
|
-
class CrazyDbOne
|
4
3
|
# Your code goes here...
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
def self.db_statistics
|
5
|
+
db_instance = ActiveRecord::Base.connection.tables
|
6
|
+
html = ""
|
7
|
+
html = html + "DATABASE NAME - #{Rails.configuration.database_configuration[Rails.env]["database"]}<br /><br />"
|
8
|
+
html = html + "TOTAL NUMBER OF TABLES - #{db_instance.count}<br /><br />"
|
9
|
+
html = html + "TABLE NAMES WITH TOTAL RECORDS COUNT<br />"
|
10
|
+
count = 1
|
11
|
+
db_instance.each do |table|
|
12
|
+
begin
|
13
|
+
html = html + "#{count}. <b>#{table}:</b> <i>#{table.classify.constantize.count} Records</i><br />"
|
14
|
+
count+=1
|
15
|
+
rescue
|
15
16
|
end
|
16
|
-
|
17
|
-
|
17
|
+
end
|
18
|
+
return html.html_safe
|
19
|
+
end
|
18
20
|
end
|
data/lib/crazy_db/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crazy_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Naveen
|
7
|
+
- Naveen Kumar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
12
|
-
dependencies:
|
11
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
description: Rails database information
|
14
42
|
email:
|
15
43
|
- hcnaveenkumar@gmail.com
|
@@ -25,7 +53,7 @@ files:
|
|
25
53
|
- crazy_db.gemspec
|
26
54
|
- lib/crazy_db.rb
|
27
55
|
- lib/crazy_db/version.rb
|
28
|
-
homepage: http://rubygems.org/gems/crazy_db
|
56
|
+
homepage: http://rubygems.org/gems/crazy_db
|
29
57
|
licenses:
|
30
58
|
- MIT
|
31
59
|
metadata: {}
|