pry-less-source 0.1.0
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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +41 -0
- data/README.md +49 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/pry-less-source.rb +38 -0
- data/lib/pry-less-source/version.rb +3 -0
- data/pry-less-source.gemspec +29 -0
- metadata +114 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3482241c4b41e4e5532ee575ec3ed962d549ed25b5c97fd613c6591df8dcfac7
|
4
|
+
data.tar.gz: 1c147c7f57eade0bb0273bd7bfcef57b369fe9a73b90769427e430b09f82d1e1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9a033441ef6c10273bf9512f211343d47c7616112b3393cdab2f820d3112fbc73a6ba3ec93c6c5b41051f0251e303331a08c030372d9f60bcea626e247651105
|
7
|
+
data.tar.gz: d9d78f6bbd8227511e7ed1fbc416ac76d40ceb3a51a6c3fbcdae17980b28376724a5d0a8e491fa266db9bf14a975e89dd4bc64156e9c6561906b6382ddcfb82c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pry-less-source (0.1.0)
|
5
|
+
pry (>= 0.9.8)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
coderay (1.1.2)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
method_source (0.9.0)
|
13
|
+
pry (0.11.3)
|
14
|
+
coderay (~> 1.1.0)
|
15
|
+
method_source (~> 0.9.0)
|
16
|
+
rake (10.5.0)
|
17
|
+
rspec (3.8.0)
|
18
|
+
rspec-core (~> 3.8.0)
|
19
|
+
rspec-expectations (~> 3.8.0)
|
20
|
+
rspec-mocks (~> 3.8.0)
|
21
|
+
rspec-core (3.8.0)
|
22
|
+
rspec-support (~> 3.8.0)
|
23
|
+
rspec-expectations (3.8.1)
|
24
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
+
rspec-support (~> 3.8.0)
|
26
|
+
rspec-mocks (3.8.0)
|
27
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
+
rspec-support (~> 3.8.0)
|
29
|
+
rspec-support (3.8.0)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
ruby
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
bundler (~> 1.16)
|
36
|
+
pry-less-source!
|
37
|
+
rake (~> 10.0)
|
38
|
+
rspec (~> 3.0)
|
39
|
+
|
40
|
+
BUNDLED WITH
|
41
|
+
1.16.4
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# pry-less-source
|
2
|
+
|
3
|
+
Provides less-source command support for Pry.
|
4
|
+
This is only for Unix-like OS.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
```bash
|
9
|
+
$ vi Gemfile
|
10
|
+
```
|
11
|
+
|
12
|
+
```Gemfile
|
13
|
+
gem 'pry'
|
14
|
+
gem 'pry-rails'
|
15
|
+
gem 'pry-less-source'
|
16
|
+
```
|
17
|
+
|
18
|
+
```bash
|
19
|
+
$ bundle
|
20
|
+
```
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
Start Pry
|
24
|
+
```bash
|
25
|
+
$ pry
|
26
|
+
```
|
27
|
+
|
28
|
+
Or
|
29
|
+
|
30
|
+
```bash
|
31
|
+
$ rails c
|
32
|
+
pry(main)> less-source Book.all
|
33
|
+
```
|
34
|
+

|
35
|
+

|
36
|
+
|
37
|
+
## Difference of show-source command
|
38
|
+
show-source command output like this:
|
39
|
+

|
40
|
+
|
41
|
+
## Contributing
|
42
|
+
1. Fork this repository. And clone it.
|
43
|
+
2. Create your feature branch (git checkout -b my-new-feature)
|
44
|
+
3. Commit your changes (git commit -am 'Add some feature')
|
45
|
+
4. Push your branch to GitHub (git push origin my-new-feature)
|
46
|
+
5. Create a new Pull Request
|
47
|
+
|
48
|
+
## License
|
49
|
+
MIT
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "less_source"
|
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(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "pry"
|
2
|
+
|
3
|
+
module PryLessSource
|
4
|
+
Pry::Commands.create_command 'less-source' do
|
5
|
+
banner <<-'BANNER'
|
6
|
+
Usage: less-source [METH]
|
7
|
+
Alias: less [METH]
|
8
|
+
|
9
|
+
Description:
|
10
|
+
Call less command for method with line number.
|
11
|
+
So this command is only for UNIX-like OS.
|
12
|
+
|
13
|
+
Example:
|
14
|
+
less-source Pry.main
|
15
|
+
less-source Pry::Commands.find_command
|
16
|
+
|
17
|
+
About options:
|
18
|
+
Option is not need.
|
19
|
+
But it was needed for error escaping to create this command.
|
20
|
+
BANNER
|
21
|
+
|
22
|
+
# If this method is none, error occur!
|
23
|
+
def options(opt)
|
24
|
+
method_options(opt)
|
25
|
+
end
|
26
|
+
|
27
|
+
def process
|
28
|
+
meth = method_object
|
29
|
+
|
30
|
+
ENV["METH_FILE_PATH"] = meth.source_location[0]
|
31
|
+
ENV["METH_LINE_NUM"] = meth.source_location[1].to_s
|
32
|
+
|
33
|
+
system('less +$METH_LINE_NUM -N $METH_FILE_PATH')
|
34
|
+
end
|
35
|
+
|
36
|
+
Pry::Commands.alias_command 'less', 'less-source'
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "pry-less-source/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "pry-less-source"
|
8
|
+
spec.version = PryLessSource::VERSION
|
9
|
+
spec.authors = ["Shinichi Matsumoto"]
|
10
|
+
spec.email = ["sugarandsalt89@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{less-source command use less for Pry as pager. This is only for Unix-like OS.}
|
13
|
+
spec.description = %q{less-source command use less for Pry as pager. This is only for Unix-like OS.}
|
14
|
+
spec.homepage = "https://github.com/matt-note/pry-less-source"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "pry", ">= 0.9.8"
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pry-less-source
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shinichi Matsumoto
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-08-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.9.8
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.8
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.16'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
description: less-source command use less for Pry as pager. This is only for Unix-like
|
70
|
+
OS.
|
71
|
+
email:
|
72
|
+
- sugarandsalt89@gmail.com
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".travis.yml"
|
80
|
+
- Gemfile
|
81
|
+
- Gemfile.lock
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/console
|
85
|
+
- bin/setup
|
86
|
+
- lib/pry-less-source.rb
|
87
|
+
- lib/pry-less-source/version.rb
|
88
|
+
- pry-less-source.gemspec
|
89
|
+
homepage: https://github.com/matt-note/pry-less-source
|
90
|
+
licenses:
|
91
|
+
- MIT
|
92
|
+
metadata: {}
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 2.7.7
|
110
|
+
signing_key:
|
111
|
+
specification_version: 4
|
112
|
+
summary: less-source command use less for Pry as pager. This is only for Unix-like
|
113
|
+
OS.
|
114
|
+
test_files: []
|