shell_explain 0.0.3 → 0.0.4

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: b8e8d3c9ae3d9607d72f9b2e64baa52a903d9e3c
4
- data.tar.gz: 51be4927f7c36a90da016d1a9fc0ea053192ffa8
3
+ metadata.gz: 39bb0e5dc5c40e4be6ba70b0c4412b448784475e
4
+ data.tar.gz: 8b3c498fce196440f0597ebda869238b16e2670f
5
5
  SHA512:
6
- metadata.gz: 8c4ceaf31c50b143994cf4b86424c23fe6b9e8b964353131b24ba992db6eb7a8c68ab2b37226cae58e3ed37f6c3d3d2c9a24e3a982f527c440db692cb6912002
7
- data.tar.gz: 01e23d45ba538d953ac22fdfc6d62f478fc6a7df49008919f0243cef8816db77584db058f10d04c6803a86c67031427052d50db384e4c0ec79e6291e9028cb6e
6
+ metadata.gz: a30cba41daf2223002ffb44a354d6c1ddf297094b75e079f6ab5314ffe00e98c02756d69e1c9d035f197ea779db507f57563bc7724c91f2f1f0938b6f070c319
7
+ data.tar.gz: 8c2fc79e0bc4c4f6e2d4d948b44c6d01a1b6929724476f07c9b49eaba3aa3a047162509a52989567cf6ad2e6d2266e1ea129fb8c2ac6669407544846816c1700
@@ -1,3 +1,3 @@
1
1
  module ShellExplain
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/shell_explain.rb CHANGED
@@ -7,28 +7,28 @@ module ShellExplain
7
7
  class Site
8
8
 
9
9
  class << self
10
- def get_data(cmd)
11
- explain_shell_url = "http://explainshell.com/explain?cmd="
12
- uri = URI("#{explain_shell_url}#{CGI.escape(cmd)}")
13
- html = Net::HTTP.get_response(uri).body
14
- Nokogiri::HTML(html)
15
- end
10
+ def get_data(cmd)
11
+ explain_shell_url = "http://explainshell.com/explain?cmd="
12
+ uri = URI("#{explain_shell_url}#{CGI.escape(cmd)}")
13
+ html = Net::HTTP.get_response(uri).body
14
+ Nokogiri::HTML(html)
15
+ end
16
16
 
17
- #{command: help-num}
18
- def get_command(doc)
19
- doc.xpath("//span[@helpref]").inject({}) do|cmds, node|
20
- cmds[node.text] = node.attributes["helpref"].value
21
- cmds
22
- end
23
- end
17
+ #{command: help-num}
18
+ def get_command(doc)
19
+ doc.xpath("//span[@helpref]").inject({}) do|cmds, node|
20
+ cmds[node.text] = node.attributes["helpref"].value
21
+ cmds
22
+ end
23
+ end
24
24
 
25
- def get_explain(doc)
26
- data = doc.xpath("//table[@id='help']//pre").inject([]) do|exps, node|
27
- exps << node.children.text
25
+ def get_explain(doc)
26
+ data = doc.xpath("//table[@id='help']//pre").inject([]) do|exps, node|
27
+ exps << node.children.text
28
+ end
29
+ data
28
30
  end
29
- data
30
- end
31
- end
31
+ end
32
32
 
33
33
  end
34
34
  end
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pry'
4
+
5
+
6
+ $: << "../../lib" << "./lib"
7
+ require "shell_explain"
8
+
9
+
10
+ puts "Loading SE environment ... "
11
+
12
+ Pry.start
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.email = ["blackanger.z@gmail.com"]
12
12
  spec.description = %q{explainshell.com input from terminal}
13
13
  spec.summary = %q{explainshell.com for terminal}
14
- spec.homepage = ""
14
+ spec.homepage = "https://github.com/ZhangHanDong/shell_explain"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shell_explain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - blackanger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-24 00:00:00.000000000 Z
11
+ date: 2013-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi
@@ -85,8 +85,9 @@ files:
85
85
  - img/explain_shell2.png
86
86
  - lib/shell_explain.rb
87
87
  - lib/shell_explain/version.rb
88
+ - scripts/console.rb
88
89
  - shell_explain.gemspec
89
- homepage: ''
90
+ homepage: https://github.com/ZhangHanDong/shell_explain
90
91
  licenses:
91
92
  - MIT
92
93
  metadata: {}