explain_shell 1.0.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 +1 -0
- data/bin/explain +17 -0
- data/explain_shell.gemspec +17 -0
- data/readme.md +61 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 54c60e41d3c44ab082ff294249f2af6701c7919f
|
4
|
+
data.tar.gz: ff2947ce5b102b7d57a1b9919d0f48411089b1f0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9553c723ef8ec5a17a91ee488f04d672cdf45b580542bd6a34f9d840cd5a485892de817a08d0a3ce35416b54bc9ada9d010e5dc43ca9ffdcfa8b5202bd48b599
|
7
|
+
data.tar.gz: 34e69f497d7f8f49f44f3bb2f05772c59fe31d151b5704361bf2c113ea2147f0236c449e78328cf84b37f249e16f58112b2042a05622a6791b860dec8353cf0e
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/bin/explain
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env sh
|
2
|
+
|
3
|
+
# base url with first command already injected
|
4
|
+
# $ explain tar
|
5
|
+
# => http://explainshel.com/explain/tar?args=
|
6
|
+
URL="http://explainshell.com/explain/$1?args="
|
7
|
+
|
8
|
+
# removes $1 (tar) from arguments ($@)
|
9
|
+
shift;
|
10
|
+
|
11
|
+
# iterates over remaining args and adds builds the rest of the url
|
12
|
+
for i in "$@"; do
|
13
|
+
URL=$URL"$i""+"
|
14
|
+
done
|
15
|
+
|
16
|
+
# opens url in browser
|
17
|
+
open $URL
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = "explain_shell"
|
5
|
+
gem.version = "1.0.0"
|
6
|
+
gem.authors = ["Richard Schneeman"]
|
7
|
+
gem.email = ["richard.schneeman+rubygems@gmail.com"]
|
8
|
+
gem.description = %q{ Bash interface to http://explainshell.com/ }
|
9
|
+
gem.summary = %q{ explain your bash commands with ease }
|
10
|
+
gem.homepage = "https://github.com/schneems/explain_shell"
|
11
|
+
gem.license = "MIT"
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($/)
|
14
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
# gem.require_paths = ["lib"]
|
17
|
+
end
|
data/readme.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Explain Shell
|
2
|
+
|
3
|
+
An awesometastic way to open http://explainshell.com/ from your command line
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
```sh
|
8
|
+
$ gem install explain_shell
|
9
|
+
```
|
10
|
+
|
11
|
+
## Use
|
12
|
+
|
13
|
+
The explain_shell gem gives you an `explain` function in bash.
|
14
|
+
|
15
|
+
```sh
|
16
|
+
$ explain tar xzvf archive.tar.gz
|
17
|
+
```
|
18
|
+
|
19
|
+
Will open up http://explainshell.com/explain/tar?args=xzvf+archive.tar.gz in your browser!
|
20
|
+
|
21
|
+
Use it with any unix command!
|
22
|
+
|
23
|
+
```sh
|
24
|
+
$ explain find . -type f -print0
|
25
|
+
$ explain ssh -i keyfile -f -N -L 1234:www.google.com:80 host
|
26
|
+
$ explain lsof -c python -u user
|
27
|
+
$ explain mysql -u root -p -h 192.168.1.2
|
28
|
+
$ explain iptables -A INPUT -i eth0 -s ip-to-block -j DROP
|
29
|
+
$ explain git log --graph --abbrev-commit --pretty=oneline origin..mybranch
|
30
|
+
```
|
31
|
+
|
32
|
+
It's super annoying that it's a slightly different name ah-la bundle/bundler, but the [explain](http://rubygems.org/gems/explain) gem name was already taken.
|
33
|
+
|
34
|
+
## Without Rubygems
|
35
|
+
|
36
|
+
If you don't have Rubygems on your system (`$ which gem` returns nothing). You can add a simple script to your startup enviornment instead:
|
37
|
+
|
38
|
+
```sh
|
39
|
+
function explain {
|
40
|
+
# base url with first command already injected
|
41
|
+
# $ explain tar
|
42
|
+
# => http://explainshel.com/explain/tar?args=
|
43
|
+
URL="http://explainshell.com/explain/$1?args="
|
44
|
+
|
45
|
+
# removes $1 (tar) from arguments ($@)
|
46
|
+
shift;
|
47
|
+
|
48
|
+
# iterates over remaining args and adds builds the rest of the url
|
49
|
+
for i in "$@"; do
|
50
|
+
URL=$URL"$i""+"
|
51
|
+
done
|
52
|
+
|
53
|
+
# opens url in browser
|
54
|
+
open $URL
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
58
|
+
## License
|
59
|
+
|
60
|
+
MIT
|
61
|
+
|
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: explain_shell
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Richard Schneeman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: ' Bash interface to http://explainshell.com/ '
|
14
|
+
email:
|
15
|
+
- richard.schneeman+rubygems@gmail.com
|
16
|
+
executables:
|
17
|
+
- explain
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- bin/explain
|
23
|
+
- explain_shell.gemspec
|
24
|
+
- readme.md
|
25
|
+
homepage: https://github.com/schneems/explain_shell
|
26
|
+
licenses:
|
27
|
+
- MIT
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 2.0.3
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: explain your bash commands with ease
|
49
|
+
test_files: []
|