pryx 0.8.4 → 0.8.7
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/README.md +0 -1
 - data/bin/pryx +1 -0
 - data/lib/pry-state/hook_action.rb +6 -0
 - data/lib/pryx/pry_hack.rb +6 -14
 - data/lib/pryx/pry_plugins.rb +15 -9
 - data/lib/pryx/version.rb +1 -1
 - metadata +2 -16
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 21ef7733a26e73d29f2b967c8f1aa997a93a8aa0ada5b523380bbb611d124857
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: fb57517c9c3f1fb4e0b28134e084ca9ac0d9372ccf142f8755d7b1684f50de03
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: c347c7fa051a6c19f3c00ea12dd8e2965ad4d9881aa24c394da7d0c213251bd2c118fec08e1f24e0d48d606861fcdb165e1ff71eac56132857271466592627cc
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 873ac59fee702003cb843a298f45c5db17af92be0a90fa1d5e768ab96a93dc62d0d9116e4ab6ed9336ed0babfedda9e83dbc9beab6693f1514a018250ab87307
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -98,7 +98,6 @@ Following is pry command available only after start a Pry session: 
     | 
|
| 
       98 
98 
     | 
    
         
             
            5.  Add `pry-aa_ancestors` command for print the class hierarchy, see [pry-aa_ancestors](https://github.com/tbpgr/pry-aa_ancestors)
         
     | 
| 
       99 
99 
     | 
    
         
             
            6.  Add `up/down/frame/stack` command, see [pry-stack_explorer](https://github.com/pry/pry-stack_explorer)
         
     | 
| 
       100 
100 
     | 
    
         
             
            7.  Add `yes` or `y` command, see [pry-yes](https://github.com/christofferh/pry-yes)
         
     | 
| 
       101 
     | 
    
         
            -
            8.  Add `reload!` command , see [pry-reload](https://github.com/runa/pry-reload)
         
     | 
| 
       102 
101 
     | 
    
         
             
            9.  Add `pry-disam`, Check following screenshot for a example:
         
     | 
| 
       103 
102 
     | 
    
         | 
| 
       104 
103 
     | 
    
         
             
            
         
     | 
    
        data/bin/pryx
    CHANGED
    
    
| 
         @@ -13,6 +13,12 @@ class HookAction 
     | 
|
| 
       13 
13 
     | 
    
         
             
              end
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
              def act
         
     | 
| 
      
 16 
     | 
    
         
            +
                # when using guard, locals :e, :lib, :pry_state_prev get printed.
         
     | 
| 
      
 17 
     | 
    
         
            +
                # this 'if' cuts them off.
         
     | 
| 
      
 18 
     | 
    
         
            +
                if @binding.eval("self.class") == Object
         
     | 
| 
      
 19 
     | 
    
         
            +
                  return
         
     | 
| 
      
 20 
     | 
    
         
            +
                end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
       16 
22 
     | 
    
         
             
                if ENV['SHOW_GLOBAL_VARIABLES']
         
     | 
| 
       17 
23 
     | 
    
         
             
                  (binding.eval('global_variables').sort - IGNORABLE_GLOBAL_VARS).each do |var|
         
     | 
| 
       18 
24 
     | 
    
         
             
                    eval_and_print var, var_color: 'white', value_colore: 'yellow'
         
     | 
    
        data/lib/pryx/pry_hack.rb
    CHANGED
    
    | 
         @@ -24,7 +24,12 @@ end 
     | 
|
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
            module Kernel
         
     | 
| 
       26 
26 
     | 
    
         
             
              # 运行 pry! 会被拦截, 且只会被拦截一次.
         
     | 
| 
       27 
     | 
    
         
            -
              def pry!(host: nil, port: 9876)
         
     | 
| 
      
 27 
     | 
    
         
            +
              def pry!(host: nil, port: 9876, state: false)
         
     | 
| 
      
 28 
     | 
    
         
            +
                # You can use environment variables SHOW_GLOBAL_VARIABLES,
         
     | 
| 
      
 29 
     | 
    
         
            +
                # HIDE_INSTANCE_VARIABLES and HIDE_LOCAL_VARIABLES
         
     | 
| 
      
 30 
     | 
    
         
            +
                # to customise the kind of variables shown.
         
     | 
| 
      
 31 
     | 
    
         
            +
                require_relative '../pry-state' if state
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
       28 
33 
     | 
    
         
             
                if Pryx::Background.foreground? and host.nil?
         
     | 
| 
       29 
34 
     | 
    
         
             
                  return unless ENV['Pry_was_started'].nil?
         
     | 
| 
       30 
35 
     | 
    
         | 
| 
         @@ -41,19 +46,6 @@ module Kernel 
     | 
|
| 
       41 
46 
     | 
    
         
             
                ENV['Pry_was_started'] = nil
         
     | 
| 
       42 
47 
     | 
    
         
             
              end
         
     | 
| 
       43 
48 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
              # 和 pry! 的差别就是,pry? 使用 pry-state 插件输出当前 context 的很多变量内容。
         
     | 
| 
       45 
     | 
    
         
            -
              # 注意:不需要总是开启 pry-state,因为有时候会输出太多内容,造成刷屏。
         
     | 
| 
       46 
     | 
    
         
            -
              def pry?(host: nil, port: 9876)
         
     | 
| 
       47 
     | 
    
         
            -
                return unless ENV['Pry_was_started'].nil?
         
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
                require 'pry-state'
         
     | 
| 
       50 
     | 
    
         
            -
                ENV['Pry_was_started'] = 'true'
         
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
                pry3(2, host: host, port: port)
         
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
                # 这里如果有代码, 将会让 pry! 进入这个方法, 因此保持为空.
         
     | 
| 
       55 
     | 
    
         
            -
              end
         
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
49 
     | 
    
         
             
              def pry1
         
     | 
| 
       58 
50 
     | 
    
         
             
                ENV['Pry2_should_start'] = 'true'
         
     | 
| 
       59 
51 
     | 
    
         
             
              end
         
     | 
    
        data/lib/pryx/pry_plugins.rb
    CHANGED
    
    | 
         @@ -1,26 +1,32 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # power_assert is ruby 3 builtin gem
         
     | 
| 
       2 
     | 
    
         
            -
            require 'pry-power_assert'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'pry-power_assert' # Add command `pa`
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
            require 'pry-doc'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'pry-doc' # Add two commands, `$` for show source, `?` for show documentation.
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
            require 'pry-yes'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'pry-yes' # Add command `yes`
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
            require 'pry-hier'
         
     | 
| 
      
 8 
     | 
    
         
            +
            require 'pry-hier' # Add command `hier`
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
            require 'pry-disasm'
         
     | 
| 
      
 10 
     | 
    
         
            +
            require 'pry-disasm' # Add command `disasm`
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            require 'pry-aa_ancestors'
         
     | 
| 
      
 12 
     | 
    
         
            +
            require 'pry-aa_ancestors' # Add command `aa`
         
     | 
| 
       13 
13 
     | 
    
         
             
            Pry::Commands.alias_command 'aa', 'aa_ancestors'
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
            # stack 显示 stack 的列表,
         
     | 
| 
       16 
16 
     | 
    
         
             
            # frame 显示当前所在 stack, frame N 也可以根据数字跳转到 N
         
     | 
| 
       17 
     | 
    
         
            -
            require 'pry-stack_explorer'
         
     | 
| 
      
 17 
     | 
    
         
            +
            require 'pry-stack_explorer' # Add command `up/down/frame[n]/stack`
         
     | 
| 
       18 
18 
     | 
    
         
             
            require 'pryx/pry-stack_explorer_hack'
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
      
 20 
     | 
    
         
            +
            # Add command `cc`
         
     | 
| 
       22 
21 
     | 
    
         
             
            Pry::Commands.block_command 'cc', 'Continue, but stop in pry! breakpoint' do
         
     | 
| 
       23 
22 
     | 
    
         
             
              Pry.instance_variable_set(:@initial_session, true)
         
     | 
| 
       24 
23 
     | 
    
         
             
              ENV['Pry_was_started'] = nil
         
     | 
| 
       25 
24 
     | 
    
         
             
              throw(:breakout)
         
     | 
| 
       26 
25 
     | 
    
         
             
            end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            Pry.commands.alias_command 'wai', 'whereami' # Add command alias `wai`
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            # Hit Enter repeat last command
         
     | 
| 
      
 30 
     | 
    
         
            +
            Pry::Commands.command(/^$/, 'repeat last command') do
         
     | 
| 
      
 31 
     | 
    
         
            +
              pry_instance.run_command Pry.history.to_a.last
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/pryx/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: pryx
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.8. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.8.7
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Billy.Zheng(zw963)
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-07-08 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: awesome_print
         
     | 
| 
         @@ -136,20 +136,6 @@ dependencies: 
     | 
|
| 
       136 
136 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       137 
137 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       138 
138 
     | 
    
         
             
                    version: 0.0.2
         
     | 
| 
       139 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       140 
     | 
    
         
            -
              name: pry-reload
         
     | 
| 
       141 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       142 
     | 
    
         
            -
                requirements:
         
     | 
| 
       143 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       144 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       145 
     | 
    
         
            -
                    version: '0.3'
         
     | 
| 
       146 
     | 
    
         
            -
              type: :runtime
         
     | 
| 
       147 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       148 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       149 
     | 
    
         
            -
                requirements:
         
     | 
| 
       150 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       151 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       152 
     | 
    
         
            -
                    version: '0.3'
         
     | 
| 
       153 
139 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       154 
140 
     | 
    
         
             
              name: pry-rescue
         
     | 
| 
       155 
141 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     |