raicoto 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTQyODE4YmY4NDVkMTdmZWExZjRjZTE3MzI3NDhhNGE4M2IxYmVkMg==
4
+ ZDllMzI2MTRhZGNjZDM4Nzk0OTRjOTg2ZTE0YTUyOTcyOTIzM2U3OA==
5
5
  data.tar.gz: !binary |-
6
- NDVmMTc4YzU1NWU5MDc1NDljMWEzZWEzYTIzMGRkMTlhNTUzMGVhYg==
6
+ YTFmMmQxNTgwODY2OTIxNDI3MTFlOTA4N2EzOTQwNjhkNjRjODk2Mw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTM0ZjFjMjcwOGVhZmU0NDI0MzlkZmNiYjM2OWJhMDk3ZmRhNDk5ODUyMzgw
10
- NDY1MjNjODAzN2U0OGZkZGNjNmRjODc0NmUwZTkyODZjYmIwYzY0NmY1MzNh
11
- MTI3MDU3MWZkMzQ1YTQ2Y2I4YmU1NmYyYTRkMmFiZDMwOTQ3Nzg=
9
+ Zjk1M2EwMzRlZDdjOTNjOTgxZmYzY2I5YzU0MTdjMTM2NDA1NjY0YWIyZTA4
10
+ NjNiYmMxNTM2Mjg0MmIwMWE5ZDlmNDg0YTgzYjgxYjU1MTNiNWY0NzdmZTkw
11
+ ODg5MTMxNDhiODM0NjljYmExNGRmMDBhM2I5NmI3OGJiMmJiMWY=
12
12
  data.tar.gz: !binary |-
13
- Yzk1MTljZTI1OTYwY2M5MDg4ZGVlNjBkZDdjNzBjM2YzZWU1M2Y0MTVmNzQy
14
- ZmNlMGYwYmM5YWIxNzFiNjNjNTFhODI2MjdlYTU4OGFmMGI0MjJhMDk3YTk5
15
- YTY2OTU4ODc3MGM3ZjQ2MGFmYjkzZWQ1MWE4NTA3MzhjZmMyZWQ=
13
+ NTYwOGY2MjkxYzljZDcxYjQ2YmQ5OTAxMjZmMDUzYjc1YjI2ZjZiMWFhZWYw
14
+ MDI4YjRmZmViODc3NDBjZDlhZTFmNDlmMzdmYjNiYmE2YTNlZGQwM2QzNjk3
15
+ MmJlMWIzMTFiMzQyNGI3OGUyY2IzMjU2ZDU5OTQzOWZjYjQ5YzI=
@@ -7,6 +7,9 @@ class ActiveRecord::Base
7
7
  attrs.uniq!
8
8
  lengths = {}
9
9
  records = self.all
10
+ if records.count < 1
11
+ return
12
+ end
10
13
  records.each do |r|
11
14
  attrs.each do |a|
12
15
  val = r
@@ -16,7 +19,6 @@ class ActiveRecord::Base
16
19
  lengths[a] = [lengths[a], len].max
17
20
  end
18
21
  end
19
-
20
22
  out = [attrs.map{|a| a.rjust(lengths[a]+1)}.join]
21
23
  out += records.map { |r|
22
24
  line = ""
@@ -0,0 +1,9 @@
1
+ # encoding: UTF-8
2
+
3
+ module Raicoto
4
+ class Railtie < Rails::Railtie
5
+ console do
6
+ require 'raicoto/activerecord/inspection'
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Raicoto
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/raicoto.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "raicoto/version"
2
2
 
3
- module Raicoto
4
- # Your code goes here...
5
- end
3
+ if defined?(Rails)
4
+ require 'raicoto/railtie'
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raicoto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Johnston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,7 @@ files:
52
52
  - Rakefile
53
53
  - lib/raicoto.rb
54
54
  - lib/raicoto/activerecord/inspection.rb
55
+ - lib/raicoto/railtie.rb
55
56
  - lib/raicoto/version.rb
56
57
  - raicoto.gemspec
57
58
  homepage: ''