nazar 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/nazar/formatter/csv_table.rb +1 -1
- data/lib/nazar/version.rb +1 -1
- data/lib/nazar/view.rb +6 -0
- data/lib/nazar.rb +5 -4
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c111b062edbb87fb756c39dcdf5628c7a71459a0f5cc98b9ae69f41894271e4
|
4
|
+
data.tar.gz: 7979ca6f048af4bd2d52ad55b62c630bbdffe570ec127bd761243c9ce88c6770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37cb2ef5920b6ee84296494e7f2c6e1f13fb0f3b6736ada3eb983933d9fc7384521c4fecf9328978fd6f94a778218541b7a21e35b45df6e426374bdb7be03d6a
|
7
|
+
data.tar.gz: 85047535269ef0c782451c7c3d1c04a63f99ee4a412a1f34e557c6b951f72d54088191a7cf324eac82866c0c327f2fdb3277a8f7d2921dd43f31fb25206f63a1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/nazar/version.rb
CHANGED
data/lib/nazar/view.rb
CHANGED
@@ -28,6 +28,8 @@ module Nazar
|
|
28
28
|
|
29
29
|
def formatter_klass
|
30
30
|
@formatter_klass ||= case data
|
31
|
+
when boolean?
|
32
|
+
nil
|
31
33
|
when acttive_record_collection?
|
32
34
|
Formatter::ActiveRecordCollection
|
33
35
|
when active_record_item?
|
@@ -41,6 +43,10 @@ module Nazar
|
|
41
43
|
@formatter ||= formatter_klass.new(data)
|
42
44
|
end
|
43
45
|
|
46
|
+
def boolean?
|
47
|
+
proc { data === true || data === false } # rubocop:disable Style/CaseEquality
|
48
|
+
end
|
49
|
+
|
44
50
|
def acttive_record_collection?
|
45
51
|
return false unless Nazar.extensions.include?(:active_record)
|
46
52
|
|
data/lib/nazar.rb
CHANGED
@@ -32,7 +32,8 @@ module Nazar
|
|
32
32
|
def enable!(extensions: [:active_record, :csv])
|
33
33
|
return if @enabled
|
34
34
|
|
35
|
-
load_active_record! if extensions.include?(:active_record)
|
35
|
+
load_active_record! if extensions.include?(:active_record)
|
36
|
+
load_csv! if extensions.include?(:csv)
|
36
37
|
|
37
38
|
enable_for_irb! if defined?(IRB)
|
38
39
|
enable_for_pry! if defined?(Pry)
|
@@ -44,15 +45,15 @@ module Nazar
|
|
44
45
|
extensions << :csv
|
45
46
|
|
46
47
|
require 'csv'
|
47
|
-
|
48
|
+
load 'nazar/formatter/csv_table.rb'
|
48
49
|
end
|
49
50
|
|
50
51
|
def load_active_record!
|
51
52
|
extensions << :active_record
|
52
53
|
|
53
54
|
require 'active_record'
|
54
|
-
|
55
|
-
|
55
|
+
load 'nazar/formatter/active_record_collection.rb'
|
56
|
+
load 'nazar/formatter/active_record_item.rb'
|
56
57
|
end
|
57
58
|
|
58
59
|
def enable_for_irb!
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nazar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Krzyżanowski
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FlwFUDGjWAe8lcsjyGp1dox0FK91TAHdZW1op8LYnOcO2DM8Mgzu4Gp7mibATEnx
|
37
37
|
ooN2pwmH
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2021-09-
|
39
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activerecord
|
metadata.gz.sig
CHANGED
Binary file
|