pry-pipeline 0.0.1 → 0.0.2

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.
data/README.md CHANGED
@@ -28,6 +28,7 @@ $ gem install pry-pipeline
28
28
 
29
29
  This usage is simple but unuseful.
30
30
 
31
+ ### Pipeline to pry's command
31
32
  ```
32
33
  $ pry
33
34
  [1] pry(main)> 'Pry.run_command' | '$'
@@ -52,6 +53,17 @@ end
52
53
  => nil
53
54
  ```
54
55
 
56
+ ### Pipeline to ruby method pry's command
57
+
58
+ ```
59
+ $ pry
60
+ [1] pry(main)> 'foo' | -> o { o.class }
61
+ => String
62
+ [1] pry(main)> 'foo' | -> o { puts o }
63
+ foo
64
+ => nil
65
+ ```
66
+
55
67
  ## Useful usage(with [ruby-anything](https://github.com/ToQoz/ruby-anything))
56
68
 
57
69
  *You can select method interactively and see its source!!!*
@@ -106,7 +118,7 @@ Start pry.
106
118
 
107
119
  ```
108
120
  $ pry
109
- [1] pry(main)> ams Pry
121
+ [1] pry(main)> method_source Pry
110
122
  >>>>>>> select method with anything interface >>>>>>>
111
123
  >>>>>>> select `run_command` >>>>>>>
112
124
  From: /Users/toqoz/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_class.rb @ line 217:
@@ -1,7 +1,14 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  class String
4
- def _pipe_(cmd); Pry.run_command("#{cmd} #{self}") end
4
+ def _pipe_(cmd);
5
+ case cmd
6
+ when Proc
7
+ cmd.call self.to_s
8
+ when String
9
+ Pry.run_command("#{cmd} #{self}")
10
+ end
11
+ end
5
12
  alias_method :|, :_pipe_
6
13
  end
7
14
 
@@ -1,3 +1,3 @@
1
1
  module PryPipeline
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/pry-pipeline.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["toqoz403@gmail.com"]
11
11
  gem.description = %q{Pipeline for pry}
12
12
  gem.summary = %q{Pipeline for pry. This adds `_pipe_` and `|` methods to String and Symbol}
13
- gem.homepage = ""
13
+ gem.homepage = "https://github.com/ToQoz/pry-pipeline"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: pry-pipeline
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Takatoshi Matsumoto
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  prerelease: false
@@ -43,7 +43,7 @@ files:
43
43
  - lib/pry-pipeline/ext.rb
44
44
  - lib/pry-pipeline/version.rb
45
45
  - pry-pipeline.gemspec
46
- homepage: ''
46
+ homepage: https://github.com/ToQoz/pry-pipeline
47
47
  licenses: []
48
48
  post_install_message:
49
49
  rdoc_options: []