pry-try 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: 42dc31f96ce666efa506a7d4eb1818c962517547
4
- data.tar.gz: aa56f8839c0a5230092967144e31ef8c930f873b
3
+ metadata.gz: eb3a1cff65259eb8f5139dbf5f96c2c7d49fea65
4
+ data.tar.gz: 9920060648bb293ea23dfb7979be94d1d4f7b595
5
5
  SHA512:
6
- metadata.gz: ab07fa47a0def00a6674df5e061a7434d48f49528d52be5da56258703e81fd606f7f9a6155e5dc70cd5a9214d52b90b94073771d87dbf6bb536e0d8e1b9b3eae
7
- data.tar.gz: 83cfcbd300813197a593310db9c4f73bf335d0294d094237c35fcb02c6acc90c0fa4d10d4347d752d0729b7ec821faebbd0c31243352ae8a548eae7ddb8c4e0d
6
+ metadata.gz: 4a55804801f3d858a7634042a15dabd97ce5f34e23a7da8f3c84919a3b3b8e9b012ad4c554a4ce13938ee9f02664ae2bf316e69f7013279386998383b7f0b610
7
+ data.tar.gz: 3554b3ccb80b6bfc4de7b79e48d5e22830edc3db3b717ed1d10c516cca07389a484709640e881d6b7fa5681fb748e652ce23e1cd35d9c3579ca012179348c05f
data/README.md CHANGED
@@ -1,89 +1,121 @@
1
1
  # pry-try
2
2
 
3
- Start a pry-session with specific gems or a (remote) script loaded.
3
+ Start a pry-session with specific gems or a (remote) script preloaded.
4
4
 
5
5
  ## Usage
6
6
 
7
- * start a pry-session with one or more gems loaded:
8
-
9
- ```bash
10
- $ pry-try activesupport
11
- Fetching gem metadata from https://rubygems.org/.........
12
- Fetching version metadata from https://rubygems.org/.
13
- Resolving dependencies...
14
- Using concurrent-ruby 1.0.5
15
- Using i18n 0.8.1
16
- Using minitest 5.10.1
17
- Using thread_safe 0.3.6
18
- Using coderay 1.1.1
19
- Using method_source 0.8.2
20
- Using slop 3.6.0
21
- Using bundler 1.14.5
22
- Using tzinfo 1.2.2
23
- Using pry 0.10.4
24
- Using activesupport 5.0.2
25
- [2] pry(main)> 1.second
26
- => 1 second
27
- ```
7
+ This gem allows you to get a pry-session with either...
8
+
9
+ 1. gems preloaded
10
+ 2. a script preloaded
11
+
12
+ ### pry-session with gems pre-loaded
13
+
14
+ This requires pry-try to be [installed system-wide](#system-wide).
15
+
16
+ ```bash
17
+ $ pry-try activesupport
18
+ Fetching gem metadata from https://rubygems.org/.........
19
+ Fetching version metadata from https://rubygems.org/.
20
+ Resolving dependencies...
21
+ Using concurrent-ruby 1.0.5
22
+ Using i18n 0.8.1
23
+ Using minitest 5.10.1
24
+ Using thread_safe 0.3.6
25
+ Using coderay 1.1.1
26
+ Using method_source 0.8.2
27
+ Using slop 3.6.0
28
+ Using bundler 1.14.5
29
+ Using tzinfo 1.2.2
30
+ Using pry 0.10.4
31
+ Using activesupport 5.0.2
32
+ [2] pry(main)> 1.second
33
+ => 1 second
34
+ ```
28
35
 
29
- Use a specific version:
30
-
31
- ```bash
32
- $ pry-try activesupport '~>4.2'
33
- ...
34
- [2] pry(main)>
35
- ```
36
+ Use a specific version:
37
+
38
+ ```bash
39
+ # any version notation that is accepted in a Gemfile will work
40
+ $ pry-try activesupport '~> 4.2'
41
+ ...
42
+ [2] pry(main)>
43
+ ```
36
44
 
37
- Multiple gems:
38
-
39
- ```bash
40
- $ pry-try activesupport '~>4.2' redis
41
- ...
42
- [2] pry(main)>
43
- ```
44
-
45
- * start pry-session from within pry:
46
-
47
- ```bash
48
- $ pry
49
- [1] pry(main)> .pry-try activesupport
50
- ...
51
- [2] pry(main)>
52
- This session is isolated from the initial session.
53
- ^d to return to initial session
54
- ```
45
+ Multiple gems:
55
46
 
56
- * pipe-in script and start a pry-session:
47
+ ```bash
48
+ $ pry-try activesupport '~> 4.2' redis
49
+ ...
50
+ [2] pry(main)>
51
+ ```
57
52
 
58
- ```bash
59
- $ echo '@a = 1' | pry-try
60
- [1] pry(main)> @a
61
- => 1
62
- [2] pry(main)>
63
-
64
- # handy when sharing code with others:
65
- $ curl https://gist.githubusercontent.com/eval/76955c57512c1e4ac01cdd913b76c92d/raw/bf714a15789eca3e968c3544f85b9b786b8eae8f/hello.rb | pry-try
66
-
67
- # or via the gist command:
68
- $ gist -r 76955c57512c1e4ac01cdd913b76c92d | pry-try
69
- ```
53
+ ### pry-session with script preloaded
54
+
55
+ Anything piped to pry-try will be evaluated before the pry-session starts:
56
+
57
+ ```bash
58
+ $ echo '@a = 1' | pry-try
59
+ [1] pry(main)> @a
60
+ => 1
61
+ ```
62
+
63
+ ```bash
64
+ # handy when sharing code with others:
65
+ $ curl https://gist.githubusercontent.com/eval/76955c57512c1e4ac01cdd913b76c92d/raw/bf714a15789eca3e968c3544f85b9b786b8eae8f/hello.rb | pry-try
66
+
67
+ # or via the gist command:
68
+ $ gist -r 76955c57512c1e4ac01cdd913b76c92d | pry-try
69
+ ```
70
70
 
71
- **NOTE:** curl-pipe-runtime is [not without risk](https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/). A tool like [vipe](https://github.com/madx/moreutils/blob/master/vipe) ([npm variant](https://github.com/juliangruber/vipe#vipe)) allows you to inspect the fetched script before handing it over to pry-try.
71
+ **NOTE:** curl-pipe-runtime is [not without risk](https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/). A tool like [vipe](https://github.com/madx/moreutils/blob/master/vipe) ([npm variant](https://github.com/juliangruber/vipe#vipe)) allows you to inspect the fetched script before handing it over to pry-try.
72
72
 
73
+ #### within a (Rails-)project
74
+
75
+ When the script needs to be evaluated within a project (i.e. use the gems of your project), make sure pry-try is [part of your project](#within-project).
76
+
77
+ A script for a Rails project would typically look like this:
78
+
79
+ ```ruby
80
+ # script.rb
81
+ require './config/environment' # load Rails-application
82
+ @user = User.first
83
+ ```
84
+
85
+ Evaluate via:
86
+ ```
87
+ cat script.rb | bundle exec pry-try
88
+ ...
89
+ [1] pry(main)> @user
90
+ #<User id: 1, username: ...
91
+ ```
73
92
 
74
93
  ## Installation
75
94
 
76
- Install system-wide:
95
+ ### System-wide
77
96
 
78
- $ gem install pry-try
97
+ ```bash
98
+ $ gem install pry-try
99
+ ```
79
100
 
101
+ ### Within project
80
102
 
81
- ## Development
103
+ Add the following to `Gemfile`:
104
+
105
+ ```ruby
106
+ # Gemfile
107
+ gem 'pry-try', group: :development
108
+ ```
82
109
 
83
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
84
110
 
85
- 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).
111
+ ## Development
112
+
113
+ After checking out the repo, run `bin/setup` to install dependencies.
114
+ Then run the tool via:
86
115
 
116
+ ```
117
+ $ ruby -Ilib exe/pry-try activesupport
118
+ ```
87
119
 
88
120
  ## License
89
121
 
@@ -1,3 +1,3 @@
1
1
  module PryTry
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/pry-try.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_dependency "pry", "~>0.10"
25
- spec.add_development_dependency "bundler", "~> 1.14"
25
+ spec.add_dependency "bundler", "~> 1.10"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "rspec", "~> 3.0"
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-try
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gert Goet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-20 00:00:00.000000000 Z
11
+ date: 2017-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.14'
34
- type: :development
33
+ version: '1.10'
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.14'
40
+ version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement