raicoto 0.0.6 → 0.0.7

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: 1c331e96d238e14af25cb75f653102e5f116d806
4
- data.tar.gz: b444cdb3e01ee46989f623e5e63074420f4e021f
3
+ metadata.gz: 069716009fdfb9b3ef716db5b537074813ac8726
4
+ data.tar.gz: d6955113daa67b0cf231e92fa9fc2526ca86c6ee
5
5
  SHA512:
6
- metadata.gz: 444f30e987f03a2e32e10fb408d1d4e621938f304b206a4436546553541b28dbffd2ec9a5b59f9f51184f5556f338d9d072176bca049e914e164096ec114255f
7
- data.tar.gz: 1cbf80383c8e497bfb084ce99d8eb1bd4648d1492e1bd8c7af8f73ee85a928dab6854fb273de9827d8af3aa1cd3ffd8d1cc8214bdae4d3d99aa3c533e3a8df7c
6
+ metadata.gz: 4531e873f9824ca20c872c2a8ec8cdf429dc90bb2ec32dc0cb8ba74d5a4f8dd7474b0d5a5d5789f1b42fac20a53ec62125e0928defeb4b59c59e038bd8d3615f
7
+ data.tar.gz: 15a76095300651e29a36d1f39e89f5903870d3c7edadaade710117f4eefe1b6327d91e0bb20638938e1d4b0ca8b8cb4d6c254dc03bdec3bbf7baa1e46d53a9a1
@@ -1,43 +1,6 @@
1
1
  class ::Array
2
2
  include Raicoto::Inspection
3
3
 
4
- def ls(*attrs)
5
- ActiveRecord.without_logging do
6
- attrs.map!(&:to_s)
7
- attrs.unshift('id')
8
- attrs << 'name' if self._attribute_names.include?('name')
9
- attrs << 'title' if self._attribute_names.include?('title')
10
- attrs.uniq!
11
- lengths = {}
12
- records = self._all_for_ls
13
- if records.count < 1
14
- puts "No Records."
15
- return
16
- end
17
- records.each do |r|
18
- attrs.each do |a|
19
- val = r
20
- a.split('.').map{|path| val = val.send(path)}
21
- len = val.to_s.length
22
- lengths[a] ||= a.length
23
- lengths[a] = [lengths[a], len].max
24
- end
25
- end
26
- out = [attrs.map{|a| a.rjust(lengths[a]+1)}.join]
27
- out += records.map { |r|
28
- line = ""
29
- attrs.each do |a|
30
- val = r
31
- a.split('.').map{|path| val = val.send(path)}
32
- line << val.to_s.rjust(lengths[a]+1)
33
- end
34
- line
35
- }
36
- out.each{|s| puts s }
37
- out.length - 1
38
- end
39
- end
40
-
41
4
  def _all_for_ls
42
5
  self
43
6
  end
@@ -1,3 +1,3 @@
1
1
  module Raicoto
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  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.6
4
+ version: 0.0.7
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-05-09 00:00:00.000000000 Z
11
+ date: 2014-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler