glom 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/glom.rb +7 -6
- data/lib/glom/terminal-table/table.rb +1 -1
- data/lib/glom/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40e1df85a6459c824a8afba0f1095b50fa208f74
|
4
|
+
data.tar.gz: f1f7c74b0e24a48e3ec26aacb9e8188d1cb518da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cf5c93354e357043aba881591ab9aac3f69244d5eb2757ab36d58bc6ea0a4b7babc527b563797019c93824559f001bddeb6be2dd76e96481c778ec1c827ac0e
|
7
|
+
data.tar.gz: 4047dabbb81f2f7e6aec3a0fe6f86392f0f5ebfa4865fede679de08631ff967a69d254b713f6bb095ee6592f07671d28dad9e05cf575e674e921a503fe5c32f4
|
data/lib/glom.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'glom/version'
|
2
|
+
require 'rubygems'
|
2
3
|
require 'net/http'
|
3
4
|
require 'json'
|
4
5
|
require 'tmpdir'
|
@@ -11,13 +12,13 @@ end
|
|
11
12
|
module Glom
|
12
13
|
self.constants.each do |constant|
|
13
14
|
constant = self.const_get constant
|
14
|
-
(
|
15
|
+
(@@registries_all ||= []) << constant if constant.is_a? Module
|
15
16
|
end
|
16
17
|
|
17
18
|
def detect(query)
|
18
19
|
@query = query.dup
|
19
|
-
|
20
|
-
|
20
|
+
|
21
|
+
@@registries_all.each do |registry|
|
21
22
|
registry::KEYWORDS.each do |keyword|
|
22
23
|
if query.include? keyword
|
23
24
|
(@registries ||= []) << registry
|
@@ -27,7 +28,7 @@ module Glom
|
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
30
|
-
@registries = REGISTRIES unless defined? @registries
|
31
|
+
@registries = Glom::REGISTRIES unless defined? @registries
|
31
32
|
end
|
32
33
|
|
33
34
|
def search
|
@@ -41,7 +42,7 @@ module Glom
|
|
41
42
|
end
|
42
43
|
|
43
44
|
def sort
|
44
|
-
@packages.sort_by
|
45
|
+
@packages = @packages.sort_by do |package|
|
45
46
|
-package[3]
|
46
47
|
end
|
47
48
|
end
|
@@ -94,4 +95,4 @@ module Glom
|
|
94
95
|
|
95
96
|
return json
|
96
97
|
end
|
97
|
-
end
|
98
|
+
end
|
@@ -175,7 +175,7 @@ module Terminal
|
|
175
175
|
# Make a column index to column size mapping, then sort it
|
176
176
|
current_index = -1
|
177
177
|
total_column_widths = @column_widths.map { |s| current_index +=1; [current_index, s + cell_spacing] }
|
178
|
-
total_column_widths.sort_by
|
178
|
+
total_column_widths = total_column_widths.sort_by { |a,b| b }
|
179
179
|
|
180
180
|
packed_length = 0
|
181
181
|
current_index = 0
|
data/lib/glom/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Glom
|
2
|
-
VERSION = "0.0.
|
3
|
-
end
|
2
|
+
VERSION = "0.0.5"
|
3
|
+
end
|