pry-objects 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjA0MTJjZTAyZjE4NjhiNGFjZTEwZDVlMWYzOGVlN2YyMTkyZDkwZQ==
5
+ data.tar.gz: !binary |-
6
+ YWVlZDAwNWJjMzVmNjg1ZWVlNmExMTQyMDQ5Zjk3MTIxZDRjMWRmNg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZTBlNTA1Zjk3YTE4MzMzMGE4NWQwYWFjMzFhZGRjNTg0NzFmZTU5NDE3YTIz
10
+ Y2U2NGNkZjBjZmZlZmE1YWYzNmQwZjkzMWQ5M2U5NzIyOTdjYmNkNjQwZDZl
11
+ ODJkMGYzMzg3NjkwODVkOWViNWFkMmQzNDMyZWE3Y2I1ZWQ1YWE=
12
+ data.tar.gz: !binary |-
13
+ MGM3OTMzODljYmM1YmNjYzRmYjc3NTg0ZTY3YzE3Nzg5YTNlMWZhMGI0OWNh
14
+ NjI0ZGRkNGMxY2I4ZDhjM2JlZWZjYjU1YmUyMjRlYWFmZmVjNTY3YWU0Mjhl
15
+ NjE1ODY2ZjBmMDFhZDhhMzViMmIxZWVmNWFiMjg0ZGI0MTk1NmU=
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pry-objects.gemspec
4
+ gemspec
5
+
6
+ group :development, :test do
7
+ gem "bundler", "~> 1.10"
8
+ gem "rake", "~> 10.0"
9
+ gem "rspec"
10
+ gem "pry"
11
+ end
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Pry::Objects
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pry/objects`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'pry-objects'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install pry-objects
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pry-objects.
36
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "pry-objects"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ module PryObjects
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,33 @@
1
+ require 'pry-objects/version'
2
+
3
+ module PryObjects
4
+
5
+ def self.call(filter)
6
+ GC.disable
7
+ enum = ObjectSpace.each_object(filter)
8
+ before = enum.entries
9
+ yield rescue nil
10
+ after = enum.entries
11
+ GC.enable
12
+
13
+ hash = {}
14
+ after.each { |each| hash[each.object_id] = each }
15
+ before.each { |each| hash.delete(each.object_id) }
16
+ hash.delete(after.object_id)
17
+ hash.delete(before.object_id)
18
+ hash.values
19
+ end
20
+
21
+ end
22
+
23
+ Pry::Commands.create_command 'objects' do
24
+
25
+ group 'Debug'
26
+ description 'Evaluate expression and print created objects.'
27
+ command_options argument_required: true, keep_retval: true
28
+
29
+ def process
30
+ target.eval "objects = PryObjects.call(false) { #{arg_string} }"
31
+ end
32
+
33
+ end
@@ -0,0 +1,19 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pry-objects/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "pry-objects"
8
+ spec.version = PryObjects::VERSION
9
+ spec.authors = ["Adrian Kuhn"]
10
+ spec.email = ["adrian.kuhn@airbnb.com"]
11
+
12
+ spec.summary = %q{Evaluate expression and print created objects.}
13
+ spec.homepage = "https://github.com/akuhn/pry-tree"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.bindir = "exe"
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pry-objects
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Adrian Kuhn
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - adrian.kuhn@airbnb.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - .gitignore
21
+ - .rspec
22
+ - Gemfile
23
+ - README.md
24
+ - Rakefile
25
+ - bin/console
26
+ - bin/setup
27
+ - lib/pry-objects.rb
28
+ - lib/pry-objects/version.rb
29
+ - pry-objects.gemspec
30
+ homepage: https://github.com/akuhn/pry-tree
31
+ licenses: []
32
+ metadata: {}
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubyforge_project:
49
+ rubygems_version: 2.4.8
50
+ signing_key:
51
+ specification_version: 4
52
+ summary: Evaluate expression and print created objects.
53
+ test_files: []
54
+ has_rdoc: