githelp 0.2.16 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -1
- data/exe/githelp +9 -34
- data/githelp.gemspec +1 -0
- data/lib/githelp/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3bfb96933272505bb5115d478479ffddc11dfe774e1a5ebe29fd3bb654c5759
|
4
|
+
data.tar.gz: fdc29f2a8653af0c840aa012d11c2498a2b74b14f9b95e5f9a4f436fe08b4dab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ccc19ef69c5fa8b87a1056b0a4e6e55c82d492f633dcc69012051f83d6259382808f8ab3634e2cd237f84be55b8fc6e7ea645f66dd25db3ed85f56940200174
|
7
|
+
data.tar.gz: db455bb525f4c0ea01e3b19cdc6c5ba1f3ec993a6d75a76357ed0b860f4e24daa9d15cb34adeb0bc6dc30d7e822ee9301dcf17fff5f91cab956512102be2b329
|
data/Gemfile
CHANGED
data/exe/githelp
CHANGED
@@ -7,11 +7,8 @@ require 'uri'
|
|
7
7
|
require 'cgi'
|
8
8
|
require 'optparse'
|
9
9
|
|
10
|
+
require 'scrapbox'
|
10
11
|
require 're_expand'
|
11
|
-
#require '/Users/masui/expand_ruby/lib/re_expand.rb'
|
12
|
-
#require '/Users/masui/expand_ruby/lib/re_expand/Generator'
|
13
|
-
#require '/Users/masui/expand_ruby/lib/re_expand/Node'
|
14
|
-
#require '/Users/masui/expand_ruby/lib/re_expand/Scanner'
|
15
12
|
|
16
13
|
class GitHelp
|
17
14
|
def datafile
|
@@ -20,30 +17,7 @@ class GitHelp
|
|
20
17
|
|
21
18
|
def initialize
|
22
19
|
@pagedata = {}
|
23
|
-
|
24
|
-
|
25
|
-
def getsbdata(api)
|
26
|
-
uri = URI.parse("https://scrapbox.io/api#{api}")
|
27
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
28
|
-
http.use_ssl = true
|
29
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
30
|
-
req = Net::HTTP::Get.new(uri.path)
|
31
|
-
res = http.request(req)
|
32
|
-
res.body.force_encoding("utf-8")
|
33
|
-
end
|
34
|
-
|
35
|
-
# ページタイトルのリストを取得
|
36
|
-
def gettitles
|
37
|
-
data = getsbdata("/pages/GitHelp")
|
38
|
-
JSON.parse(data)['pages'].collect { |page|
|
39
|
-
page['title']
|
40
|
-
}
|
41
|
-
end
|
42
|
-
|
43
|
-
# それぞれのページに対して処理
|
44
|
-
def getpage(title)
|
45
|
-
text = getsbdata("/pages/GitHelp/#{URI.encode(title).gsub(/\//,'%2f')}/text")
|
46
|
-
@pagedata[title] = text.split(/\n/)
|
20
|
+
@project = Scrapbox::Project.new("GitHelp")
|
47
21
|
end
|
48
22
|
|
49
23
|
def getdata
|
@@ -51,9 +25,9 @@ class GitHelp
|
|
51
25
|
# ページデータ取得
|
52
26
|
#
|
53
27
|
puts "-----------------ページデータを取得"
|
54
|
-
|
28
|
+
@project.pages.each { |title,page|
|
55
29
|
puts "...#{title}"
|
56
|
-
|
30
|
+
@pagedata[title] = page.text.split(/\n/)
|
57
31
|
}
|
58
32
|
|
59
33
|
dumpdata = {}
|
@@ -67,10 +41,11 @@ class GitHelp
|
|
67
41
|
@pagedata.each { |title,pagedata|
|
68
42
|
puts "...#{title}"
|
69
43
|
pagedata. each { |line|
|
70
|
-
if line =~ /code:(
|
71
|
-
|
72
|
-
|
73
|
-
|
44
|
+
if line =~ /code:(.*\.rb)$/ then
|
45
|
+
src = $1
|
46
|
+
puts "=========== #{src}"
|
47
|
+
page = Scrapbox::Page.new(@project,title)
|
48
|
+
dumpdata['codes'] << page.code(src)
|
74
49
|
end
|
75
50
|
}
|
76
51
|
}
|
data/githelp.gemspec
CHANGED
data/lib/githelp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githelp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Masui
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: scrapbox
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: GitHelp - lists git commands from user's vague query strings
|
70
84
|
email:
|
71
85
|
- masui@pitecan.com
|