nazar 0.0.5 → 0.0.6

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
  SHA256:
3
- metadata.gz: 2c111b062edbb87fb756c39dcdf5628c7a71459a0f5cc98b9ae69f41894271e4
4
- data.tar.gz: 7979ca6f048af4bd2d52ad55b62c630bbdffe570ec127bd761243c9ce88c6770
3
+ metadata.gz: caea3f0827d9d39e782cf749a4e4d1d4828ef5e6c0fc1293eceb4aa084ea77c7
4
+ data.tar.gz: 3dcb286c61452847f5c5d0d6aa8ea03d36943ba76c322cf0c09995cb6655efe5
5
5
  SHA512:
6
- metadata.gz: 37cb2ef5920b6ee84296494e7f2c6e1f13fb0f3b6736ada3eb983933d9fc7384521c4fecf9328978fd6f94a778218541b7a21e35b45df6e426374bdb7be03d6a
7
- data.tar.gz: 85047535269ef0c782451c7c3d1c04a63f99ee4a412a1f34e557c6b951f72d54088191a7cf324eac82866c0c327f2fdb3277a8f7d2921dd43f31fb25206f63a1
6
+ metadata.gz: 66df708fe14e78480c65ef01f1353e0454b4f423aa2a47888c6b9ce3c19a2ddec26d53ce64f18d4b6339eaaa64c4ae5591e2d680e5e90721f86ac50baf932658
7
+ data.tar.gz: 79976a910bf1bd58c8a0b60bbe9d50d4c0a24d61d2dcc756f5fe3404e672263e332ea5feeae1f20631addc0c991c216b6e93d84e03d34b02a37e613883418495
checksums.yaml.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Nazar [![Build Status](https://github.com/krzyzak/nazar/actions/workflows/main.yml/badge.svg)](https://github.com/krzyzak/nazar/actions) [![Code Climate](https://codeclimate.com/github/krzyzak/nazar/badges/gpa.svg)](https://codeclimate.com/github/krzyzak/nazar)
1
+ # Nazar [![Build Status](https://github.com/krzyzak/nazar/actions/workflows/main.yml/badge.svg)](https://github.com/krzyzak/nazar/actions) [![Gem Version](https://badge.fury.io/rb/nazar.svg)](https://badge.fury.io/rb/nazar) [![Code Climate](https://codeclimate.com/github/krzyzak/nazar/badges/gpa.svg)](https://codeclimate.com/github/krzyzak/nazar)
2
2
 
3
3
  Nazar improves defvault inspect output for console applications (supports IRB and Pry).
4
4
 
@@ -7,7 +7,12 @@ module Nazar
7
7
  end
8
8
 
9
9
  def render
10
- pager.page(view.render) if view.supported_data?
10
+ pager.page(view.render)
11
+ nil
12
+ end
13
+
14
+ def valid?
15
+ view.supported_data?
11
16
  end
12
17
 
13
18
  def pager
data/lib/nazar/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nazar
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
data/lib/nazar.rb CHANGED
@@ -60,7 +60,8 @@ module Nazar
60
60
  ::IRB::Irb.class_eval do
61
61
  alias_method :__original_output_value__, :output_value
62
62
  def output_value(omit = false) # rubocop:disable Style/OptionalBooleanParameter
63
- ::Nazar::Renderer.new(@context.last_value).render || __original_output_value__(omit)
63
+ renderer = Nazar::Renderer.new(@context.last_value)
64
+ renderer.valid? ? renderer.render : __original_output_value__(omit)
64
65
  end
65
66
  end
66
67
  end
@@ -68,7 +69,8 @@ module Nazar
68
69
  def enable_for_pry!
69
70
  @__original_pry_print = Pry.config.print
70
71
  Pry.config.print = proc do |output, value, instance|
71
- output.puts Nazar::Renderer.new(value).render || @__original_pry_print.call(output, value, instance)
72
+ renderer = Nazar::Renderer.new(value)
73
+ renderer.valid? ? renderer.render : @__original_pry_print.call(output, value, instance)
72
74
  end
73
75
  end
74
76
 
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Krzyżanowski
metadata.gz.sig CHANGED
Binary file