nkpart-dget 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+
2
+ (The MIT License)
3
+
4
+ Copyright (c) 2009 Nick Partridge
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ 'Software'), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,18 @@
1
+ = dget
2
+
3
+ dget - a tool borne by my long commute. Create local copies of the wiki of a project on github, and read those docs when you're offline!
4
+
5
+ The wiki is stored in a single html file.
6
+
7
+ Examples!
8
+
9
+ $ dget github dpp/liftweb
10
+ $ dget github tenderlove/nokogiri
11
+
12
+ == Todo
13
+
14
+ * Google code support
15
+
16
+ == Install
17
+
18
+ $ gem install nkpart-dget
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "dget"
8
+ gem.summary = %Q{get local copies of github project wikis}
9
+ gem.description = gem.summary
10
+ gem.email = "nkpart@gmail.com"
11
+ gem.homepage = "http://github.com/nkpart/dget"
12
+ gem.authors = ["Nick Partridge"]
13
+ gem.add_development_dependency "rspec"
14
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
+ end
16
+ rescue LoadError
17
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
18
+ end
19
+
20
+ require 'spec/rake/spectask'
21
+ Spec::Rake::SpecTask.new(:spec) do |spec|
22
+ spec.libs << 'lib' << 'spec'
23
+ spec.spec_files = FileList['spec/**/*_spec.rb']
24
+ end
25
+
26
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
27
+ spec.libs << 'lib' << 'spec'
28
+ spec.pattern = 'spec/**/*_spec.rb'
29
+ spec.rcov = true
30
+ end
31
+
32
+ task :spec => :check_dependencies
33
+
34
+ task :default => :spec
35
+
36
+ require 'rake/rdoctask'
37
+ Rake::RDocTask.new do |rdoc|
38
+ if File.exist?('VERSION')
39
+ version = File.read('VERSION')
40
+ else
41
+ version = ""
42
+ end
43
+
44
+ rdoc.rdoc_dir = 'rdoc'
45
+ rdoc.title = "dget #{version}"
46
+ rdoc.rdoc_files.include('README*')
47
+ rdoc.rdoc_files.include('lib/**/*.rb')
48
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/bin/dget ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created on 2009-8-26.
4
+ # Copyright (c) Nick Partridge 2009. All rights reserved.
5
+
6
+ require 'rubygems'
7
+ require File.expand_path(File.dirname(__FILE__) + "/../lib/dget")
8
+
9
+ DGet.cli($stdin, $stdout, ARGV)
data/dget.gemspec ADDED
@@ -0,0 +1,65 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{dget}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Nick Partridge"]
12
+ s.date = %q{2009-09-08}
13
+ s.default_executable = %q{dget}
14
+ s.description = %q{get local copies of github project wikis}
15
+ s.email = %q{nkpart@gmail.com}
16
+ s.executables = ["dget"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/dget",
29
+ "dget.gemspec",
30
+ "lib/dget.rb",
31
+ "lib/dget/github.html",
32
+ "lib/dget/github.rb",
33
+ "lib/dget/googlecode.rb",
34
+ "lib/dget/utils.rb",
35
+ "lib/googlecode.html",
36
+ "spec/dget_spec.rb",
37
+ "spec/spec_helper.rb",
38
+ "test/test_gh-wiki.rb",
39
+ "test/test_helper.rb"
40
+ ]
41
+ s.homepage = %q{http://github.com/nkpart/dget}
42
+ s.rdoc_options = ["--charset=UTF-8"]
43
+ s.require_paths = ["lib"]
44
+ s.rubygems_version = %q{1.3.5}
45
+ s.summary = %q{get local copies of github project wikis}
46
+ s.test_files = [
47
+ "spec/dget_spec.rb",
48
+ "spec/spec_helper.rb",
49
+ "test/test_gh-wiki.rb",
50
+ "test/test_helper.rb"
51
+ ]
52
+
53
+ if s.respond_to? :specification_version then
54
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
55
+ s.specification_version = 3
56
+
57
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
58
+ s.add_development_dependency(%q<rspec>, [">= 0"])
59
+ else
60
+ s.add_dependency(%q<rspec>, [">= 0"])
61
+ end
62
+ else
63
+ s.add_dependency(%q<rspec>, [">= 0"])
64
+ end
65
+ end
@@ -0,0 +1,376 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7
+ <title>Local GH Wiki - <%= project_name %></title>
8
+ <link href="bundle.css" media="screen" rel="stylesheet" type="text/css" />
9
+ <style type="text/css" media="screen">
10
+ ul.jq-ui-autocomplete{position:absolute;overflow:hidden;background-color:#fff;border:1px solid #aaa;margin:0;padding:0;list-style:none;font:normal .75em/.75em Verdana,Arial,sans-serif;color:#333;}
11
+ ul.jq-ui-autocomplete li{display:block;padding:.3em .5em .3em .3em;overflow:hidden;width:100%;}
12
+ ul.jq-ui-autocomplete li.active{background-color:#3875d7;color:#fff;}
13
+
14
+ div.dp-popup{position:relative;background:#ccc;font-size:10px;font-family:arial,sans-serif;padding:2px;width:171px;line-height:1.2em;}
15
+ div#dp-popup{position:absolute;z-index:199;}
16
+ div.dp-popup h2{font-size:12px;text-align:center;margin:2px 0;padding:0;}
17
+ a#dp-close{font-size:11px;padding:4px 0;text-align:center;display:block;}
18
+ a#dp-close:hover{text-decoration:underline;}
19
+ div.dp-popup a{color:#000;text-decoration:none;padding:3px 2px 0;}
20
+ div.dp-popup div.dp-nav-prev{position:absolute;top:2px;left:4px;width:100px;}
21
+ div.dp-popup div.dp-nav-prev a{float:left;}
22
+ div.dp-popup div.dp-nav-prev a,div.dp-popup div.dp-nav-next a{cursor:pointer;}
23
+ div.dp-popup div.dp-nav-prev a.disabled,div.dp-popup div.dp-nav-next a.disabled{cursor:default;}
24
+ div.dp-popup div.dp-nav-next{position:absolute;top:2px;right:4px;width:100px;}
25
+ div.dp-popup div.dp-nav-next a{float:right;}
26
+ div.dp-popup a.disabled{cursor:default;color:#aaa;}
27
+ div.dp-popup td{cursor:pointer;}
28
+ div.dp-popup td.disabled{cursor:default;}
29
+ .syntax{background:#fff;}
30
+ .syntax .c{color:#998;font-style:italic;}
31
+ .syntax .err{color:#a61717;background-color:#e3d2d2;}
32
+ .syntax .k{font-weight:bold;}
33
+ .syntax .o{font-weight:bold;}
34
+ .syntax .cm{color:#998;font-style:italic;}
35
+ .syntax .cp{color:#999;font-weight:bold;}
36
+ .syntax .c1{color:#998;font-style:italic;}
37
+ .syntax .cs{color:#999;font-weight:bold;font-style:italic;}
38
+ .syntax .gd{color:#000;background-color:#fdd;}
39
+ .syntax .gd .x{color:#000;background-color:#faa;}
40
+ .syntax .ge{font-style:italic;}
41
+ .syntax .gr{color:#a00;}
42
+ .syntax .gh{color:#999;}
43
+ .syntax .gi{color:#000;background-color:#dfd;}
44
+ .syntax .gi .x{color:#000;background-color:#afa;}
45
+ .syntax .go{color:#888;}
46
+ .syntax .gp{color:#555;}
47
+ .syntax .gs{font-weight:bold;}
48
+ .syntax .gu{color:#aaa;}
49
+ .syntax .gt{color:#a00;}
50
+ .syntax .kc{font-weight:bold;}
51
+ .syntax .kd{font-weight:bold;}
52
+ .syntax .kp{font-weight:bold;}
53
+ .syntax .kr{font-weight:bold;}
54
+ .syntax .kt{color:#458;font-weight:bold;}
55
+ .syntax .m{color:#099;}
56
+ .syntax .s{color:#d14;}
57
+ .syntax .na{color:#008080;}
58
+ .syntax .nb{color:#0086B3;}
59
+ .syntax .nc{color:#458;font-weight:bold;}
60
+ .syntax .no{color:#008080;}
61
+ .syntax .ni{color:#800080;}
62
+ .syntax .ne{color:#900;font-weight:bold;}
63
+ .syntax .nf{color:#900;font-weight:bold;}
64
+ .syntax .nn{color:#555;}
65
+ .syntax .nt{color:#000080;}
66
+ .syntax .nv{color:#008080;}
67
+ .syntax .ow{font-weight:bold;}
68
+ .syntax .w{color:#bbb;}
69
+ .syntax .mf{color:#099;}
70
+ .syntax .mh{color:#099;}
71
+ .syntax .mi{color:#099;}
72
+ .syntax .mo{color:#099;}
73
+ .syntax .sb{color:#d14;}
74
+ .syntax .sc{color:#d14;}
75
+ .syntax .sd{color:#d14;}
76
+ .syntax .s2{color:#d14;}
77
+ .syntax .se{color:#d14;}
78
+ .syntax .sh{color:#d14;}
79
+ .syntax .si{color:#d14;}
80
+ .syntax .sx{color:#d14;}
81
+ .syntax .sr{color:#009926;}
82
+ .syntax .s1{color:#d14;}
83
+ .syntax .ss{color:#990073;}
84
+ .syntax .bp{color:#999;}
85
+ .syntax .vc{color:#008080;}
86
+ .syntax .vg{color:#008080;}
87
+ .syntax .vi{color:#008080;}
88
+ .syntax .il{color:#099;}
89
+ *{margin:0;padding:0;}
90
+ html,body{height:100%;}
91
+ body{background-color:white;font:13.34px helvetica,arial,freesans,clean,sans-serif;*font-size:small;text-align:center;}
92
+ table{font-size:inherit;font:100%;}
93
+ select,input[type=text],input[type=password],input[type=image],textarea{font:99% helvetica,arial,freesans,sans-serif;}
94
+ select,option{padding:0 .25em;}
95
+ input.text{padding:1px 0;}
96
+ optgroup{margin-top:.5em;}
97
+ pre,code{font:115% Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;*font-size:100%;}
98
+ body *{line-height:1.4em;}
99
+ img{border:0;}
100
+ a{color:#4183c4;text-decoration:none;}
101
+ a.action{color:#d00;text-decoration:underline;}
102
+ a.action span{text-decoration:none;}
103
+ a:hover{text-decoration:underline;}
104
+ .clear{clear:both;}
105
+ .sparkline{display:none;}
106
+ .right{float:right;}
107
+ .left{float:left;}
108
+ .hidden{display:none;}
109
+ img.help{vertical-align:middle;}
110
+ .notification{background:#FFFBE2 none repeat scroll 0;border:1px solid #FFE222;padding:1em;margin:1em 0;font-weight:bold;}
111
+ .warning{background:#fffccc;font-weight:bold;padding:.5em;margin-bottom:.8em;}
112
+ .error_box{background:#FFEBE8 none repeat scroll 0;border:1px solid #DD3C10;padding:1em;font-weight:bold;}
113
+ abbr{border-bottom:none;}
114
+ .flash{color:green;}
115
+ .corner{-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;padding:3px;}
116
+ body{text-align:center;}
117
+ .site{width:69em;margin:0 auto;padding:0 3em;text-align:left;}
118
+ .syntax .gc{color:#999;background-color:#EAF2F5;}
119
+ #site_alert{margin-bottom:1em;}
120
+ #site_alert p{margin:0 auto;width:85%;text-align:center;font-weight:bold;color:#fff;background:#000;padding-top:.3em;}
121
+ /* #header{background:#fcfcfc url(/images/modules/header/header_bg.png) 0 100% repeat-x;height:6.82em;min-width:75em;}*/
122
+ #header a{color:#fff;}
123
+ #header a:hover{text-decoration:none;}
124
+ #header .logo{padding-top:1.2em;float:left;}
125
+ #header .actions{float:right;color:#444;font-size:110%;margin-top:2.3em;}
126
+ #header .actions a{color:#444;margin-left:1.5em;padding:.4em;}
127
+ #header .actions a:hover{text-decoration:none;background-color:#dcdcdc;}
128
+ #header.basic{border-bottom:5px solid #ddd;margin-bottom:1em;}
129
+ #header .userbox{background:#EAF2F5;border:1px solid #ddd;float:right;margin-top:1.6em;width:25em;color:#aac;}
130
+ #header .userbox .box{margin:.25em .5em;}
131
+ #header .userbox .gravatar{float:left;}
132
+ #header .userbox .gravatar img{border:1px solid #d0d0d0;padding:2px;background-color:white;margin-right:.7em;}
133
+ #header .userbox .top{overflow:hidden;}
134
+ #header .userbox .top .name{float:left;overflow:hidden;font-weight:bold;width:10em;}
135
+ #header .userbox .top .name a{color:#000;}
136
+ #header .userbox .top .links{font-size:85%;margin-top:.2em;float:right;text-align:right;}
137
+ #header .userbox .top .links a{color:#4183c4;}
138
+ #header .userbox .top .links a:hover{text-decoration:underline;}
139
+ #header .userbox .bottom{overflow:hidden;}
140
+ #header .userbox .inbox{float:left;margin-top:.7em;background:url('/images/modules/inbox/message.png') 0 .1em no-repeat;}
141
+ #header .userbox .inbox a{padding-left:20px;display:block;}
142
+ #header .userbox a{color:#4183c4;}
143
+ #header .userbox .bottom .select{float:right;margin-top:.5em;}
144
+ #header .topsearch{float:left;width:19em;margin:2.05em 0 0 1em;color:#bbb;}
145
+ #header .topsearch a{color:#666;font-size:80%;}
146
+ #header .topsearch a:hover{color:black;text-decoration:underline;}
147
+ #header .topsearch form{padding-top:.4em;}
148
+ #header .topsearch input{vertical-align:middle;}
149
+ body:first-of-type#header .topsearch input{font-size:110%;}
150
+ #header .topsearch input.search{padding-top:1px;width:12em;}
151
+ body:first-of-type #header .topsearch input.search{padding-top:0;font-size:120%;width:9em;}
152
+ #header .topsearch input[type=submit]{position:relative;top:1px;}
153
+ body:first-of-type #header .topsearch input[type=submit]{top:0;}
154
+ #header .topsearch .links span{float:right;}
155
+ #main{min-height:100%;height:auto!important;height:100%;margin:0 auto -8.6em;}
156
+ .push{height:8.6em;padding-bottom:4em;}
157
+ #footer{height:8.6em;background:#bbccd9 url(/images/modules/footer/bg.png) 0 0 repeat-x;overflow:hidden;color:#cadcea;min-width:75em;}
158
+ #footer a{color:white;text-decoration:underline;}
159
+ #footer .info{padding:2.9em 0 3.3em 0;float:left;}
160
+ #footer .info .links{padding-bottom:.4em;border-bottom:3px solid #5c8ab3;}
161
+ #footer .info .company{padding-top:.4em;}
162
+ #footer .sponsor{padding:2.75em 0 1em 0;float:right;width:20em;}
163
+ #footer .sponsor img{float:right;margin:.4em 0 0 .75em;}
164
+ #footer .sponsor a{text-decoration:none;}
165
+ #footer .sponsor div{text-align:right;font-size:.9em;margin-top:.7em;}
166
+ #int-info img{position:relative;top:-.1em;}
167
+ #path{font-size:140%;padding:.8em 0;}
168
+ #toc{padding:1.5em 0;font-family:Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;font-size:90%;}
169
+ #toc ul{border-top:1px solid #eee;}
170
+ #toc ul li{list-style-type:none;padding:.4em 0 .4em 20px;border-bottom:1px solid #eee;}
171
+ #toc ul li.added{background:white url(/images/modules/toc/added.png) 0 50% no-repeat;}
172
+ #toc ul li.removed{background:white url(/images/modules/toc/removed.png) 0 50% no-repeat;}
173
+ #toc ul li.modified{background:white url(/images/modules/toc/modified.png) 0 50% no-repeat;}
174
+ #repos{margin-bottom:1em;}
175
+ #repos h1{font-size:160%;}
176
+ #repos h1 a{font-size:70%;font-weight:normal;}
177
+ #repos .hint{font-style:italic;color:#888;margin:.3em 0;}
178
+ #repos .repo{margin:1em 0;padding:.1em .5em .1em .5em;}
179
+ #repos .public{border:1px solid #d8d8d8;background-color:#f0f0f0;}
180
+ #repos .private{border:1px solid #f7ca75;background-color:#fffeeb;}
181
+ #repos .repo .title{overflow:hidden;}
182
+ #repos .repo .title .path{float:left;font-size:140%;}
183
+ #repos .repo .title .path img{vertical-align:middle;}
184
+ #repos .repo .title .path .button{margin-left:.25em;vertical-align:-12%;}
185
+ #repos .repo .title .path span a{font-size:75%;font-weight:normal;}
186
+ #repos .repo .title .security{float:right;text-align:right;font-weight:bold;padding-top:.5em;}
187
+ #repos .repo .title .security *{vertical-align:middle;}
188
+ #repos .repo .title .security img{position:relative;top:-1px;}
189
+ #repos .repo .title .flexipill{float:right;padding-top:.3em;margin-right:.5em;}
190
+ #repos .repo .title .flexipill a{color:black;}
191
+ #repos .repo .title .flexipill .middle{background:url(/images/modules/repos/pills/middle.png) 0 0 repeat-x;padding:0 0 0 .3em;}
192
+ #repos .repo .title .flexipill .middle span{position:relative;top:.1em;font-size:95%;}
193
+ #repos .repo .meta{margin:.2em 0 0 0;overflow:hidden;}
194
+ #repos .repo .meta table{float:left;max-width:48em;}
195
+ #repos .repo .meta table td *{vertical-align:middle;}
196
+ #repos .repo .meta table td.label{color:#888;padding-right:.25em;vertical-align:bottom;}
197
+ #repos .repo .meta table td span.editarea input{margin-top:.5em;margin-right:.5em;}
198
+ #repos .repo .meta table td textarea{display:block;clear:right;}
199
+ #repos .repo .meta table td.url{color:#4183c4;}
200
+ #repos .repo .meta table td.blank{color:#bbb;}
201
+ #repos .repo .pledgie{float:right;}
202
+ #repos .repo .commit{border:1px solid #bedce7;margin-top:.5em;padding:0 .5em .5em .5em;background:#eaf2f5 url(/images/modules/commit/bg_gradient.gif) 0 100% repeat-x;overflow:hidden;}
203
+ #repos .repo .commit .actor{float:left;margin-top:.5em;}
204
+ #repos .repo .commit .actor .gravatar{border:1px solid #d0d0d0;padding:2px;background-color:white;float:left;margin-right:.7em;}
205
+ #repos .repo .commit .actor .name{line-height:1.5em;}
206
+ #repos .repo .commit .actor .name span{color:#888;font-size:90%;}
207
+ #repos .repo .commit .actor .date{color:#888;font-size:90%;line-height:1em;}
208
+ #repos .repo .commit .message{float:left;padding:.5em 0 .5em .5em;margin-left:2em;border-left:1px solid #bedce7;}
209
+ #repos .repo .commit .machine{float:right;width:30em;padding:.5em 0 .5em .5em;border-left:1px solid #bedce7;color:#808080;font-family:Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;font-size:85%;line-height:1.5em;}
210
+ #repos .repo .diffs{margin-top:.5em;}
211
+ #repos .repo .diffs .diff *{vertical-align:middle;}
212
+ #repos .repo .diffs .diff img{position:relative;top:-1px;}
213
+ #guides h1{margin-bottom:.5em;}
214
+ #guides .index ul{list-style-type:none;font-size:120%;}
215
+ #guides .index ul li{padding-left:1.5em;background:white url(/images/modules/guides/book.png) no-repeat;}
216
+ #guides .index .new{margin-top:1em;border-top:1px solid #ccc;padding-top:.5em;}
217
+ #guides .index .new ul li{background:white url(/images/modules/guides/book_add.png) no-repeat;}
218
+ #guides .index .new ul li a{color:#c00;}
219
+ #guides .write .delete_page{float:right;}
220
+ #guides .guide{overflow:hidden;}
221
+ #guides .guide .main{float:left;width:50em;}
222
+ #guides .guide .sidebar{float:right;width:15em;border-left:4px solid #e6e6e6;margin:2.1em 0 0 0;padding-left:1em;}
223
+ #guides .guide .sidebar h3{margin:0 0 .5em 0;}
224
+ #guides .guide .sidebar ul{list-style-type:none;margin:0;color:#888;}
225
+ #guides .guide .sidebar ul li{padding-left:12px;background:white url(/images/modules/guides/sidebar/bullet_blue.png) -4px 0 no-repeat;margin:.2em 0;}
226
+ #guides .admin{clear:both;margin-top:3em;border-top:4px solid #e6e6e6;padding-top:.3em;overflow:hidden;}
227
+ #guides .write label{font-size:110%;color:#666;display:block;margin:1em 0;}
228
+ #guides .write input.text,#guides .write textarea{padding:5px;border:1px solid #888;}
229
+ #guides .write input.text{width:40em;}
230
+ #guides .write textarea{width:100%;height:25em;}
231
+ #guides .write label span.title{color:black;font-weight:bold;}
232
+ #guides .write .actions input{margin-right:1em;}
233
+ .wikistyle h1,h2,h3,h4,h5,h6{border:0!important;}
234
+ .wikistyle h1{font-size:170%!important;border-top:4px solid #aaa!important;padding-top:.5em!important;margin-top:1.5em!important;}
235
+ .wikistyle h1:first-child{margin-top:0!important;padding-top:.25em!important;border-top:none!important;}
236
+ .wikistyle h2{font-size:150%!important;margin-top:1.5em!important;border-top:4px solid #e0e0e0!important;padding-top:.5em!important;}
237
+ .wikistyle h3{margin-top:1em!important;}
238
+ .wikistyle p{margin:1em 0!important;line-height:1.5em!important;}
239
+ .wikistyle ul{margin:1em 0 1em 1.3em!important;}
240
+ .wikistyle ul{margin-top:0!important;margin-bottom:0!important;}
241
+ .wikistyle ol{margin:1em 0 1em 1.5em!important;}
242
+ .wikistyle ol ol{margin-top:0!important;margin-bottom:0!important;}
243
+ .wikistyle blockquote{margin:1em 0!important;border-left:5px solid #ddd!important;padding-left:.6em!important;color:#555!important;}
244
+ .wikistyle dt{font-weight:bold!important;margin-left:1em!important;}
245
+ .wikistyle dd{margin-left:2em!important;margin-bottom:1em!important;}
246
+ .wikistyle table{margin:1em 0!important;}
247
+ .wikistyle table th{border-bottom:1px solid #bbb!important;padding:.2em 1em!important;}
248
+ .wikistyle table td{border-bottom:1px solid #ddd!important;padding:.2em 1em!important;}
249
+ .wikistyle pre{margin:1em 0!important;font-size:90%!important;background-color:#f8f8ff!important;border:1px solid #dedede!important;padding:.5em!important;line-height:1.5em!important;color:#444!important;overflow:auto!important;}
250
+ .wikistyle pre code{padding:0!important;font-size:100%!important;background-color:#f8f8ff!important;border:none!important;}
251
+ .wikistyle code{font-size:90%!important;background-color:#f8f8ff!important;color:#444!important;padding:0 .2em!important;border:1px solid #dedede!important;}
252
+ .wikistyle pre.console{margin:1em 0!important;font-size:90%!important;background-color:black!important;padding:.5em!important;line-height:1.5em!important;color:white!important;}
253
+ .wikistyle pre.console code{padding:0!important;font-size:100%!important;background-color:black!important;border:none!important;color:white!important;}
254
+ .wikistyle pre.console span{color:#888!important;}
255
+ .wikistyle pre.console span.command{color:yellow!important;}
256
+ ul#archive{list-style-type:none;text-align:center;}
257
+ ul#archive li{display:inline;}
258
+ #other_archives{border-top:1px solid #ddd;padding-top:.5em;}
259
+ #other_archives ul{list-style-type:none;width:8em;float:left;clear:right;}
260
+ #archives .wait{padding:2em 0 3em 0;}
261
+ #archives .wait h2,#archives .wait p{text-align:center;}
262
+ .tool-tip{color:#fff;width:350px;z-index:13000;}
263
+ .tool-title{font-weight:bold;font-size:11px;margin:0;color:#9FD4FF;padding:8px 8px 4px;background:url(/images/modules/tooltip/bubble.png) top left;}
264
+ .tool-text{font-size:11px;padding:4px 8px 8px;background:url(/images/modules/tooltip/bubble.png) bottom right;}
265
+ .custom-tip{color:#000;width:130px;z-index:13000;}
266
+ .custom-title{font-weight:bold;font-size:11px;margin:0;color:#3E4F14;padding:8px 8px 4px;background:#C3DF7D;border-bottom:1px solid #B5CF74;}
267
+ .custom-text{font-size:11px;padding:4px 8px 8px;background:#CFDFA7;}
268
+ #services .test_hook{margin-top:.5em;}
269
+ #privacy_terms h1{margin-bottom:.3em;}
270
+ #privacy_terms h2{margin-top:1em;}
271
+ #privacy_terms ul,#privacy_terms ol{margin-left:1.4em;}
272
+ #privacy_terms p{margin-bottom:1em;}
273
+ #languages .popular{border-top:5px solid #f4f4f4;background-color:#fdfdfd;overflow:hidden;margin-top:2.4em;margin-bottom:1em;padding-top:1em;}
274
+ #languages .popular.compact{margin-top:0;}
275
+ #languages .popular h3{font-size:105%;color:#aaa;margin-bottom:.5em;}
276
+ #languages .popular .site .left img{border:1px solid #d0d0d0;padding:1px;background-color:white;margin-right:.1em;position:absolute;top:.25em;left:0;}
277
+ #languages .popular a{color:black;}
278
+ #languages .popular ul{list-style-type:none;}
279
+ #languages .popular ul li{line-height:1.6em!important;font-size:125%;color:#888;padding-left:1.6em;position:relative;}
280
+ #languages .popular ul li a.repo{font-weight:bold;}
281
+ #languages .popular .left{margin-left:14em;float:left;width:27em;}
282
+ #languages .popular.compact .left{margin-left:0;float:left;width:25em;padding-bottom:2em;}
283
+ #languages .popular.compact .left.row{clear:left;}
284
+ #languages .all_languages{padding-right:3em;text-align:right;}
285
+ #language_table{border:1px solid #eee;}
286
+ #language_table th{background:#f0f0f0;padding:.5em;}
287
+ #language_table td{padding:.5em;}
288
+ #language_table tr.dark{background:#fafafa;}
289
+
290
+
291
+ .actions { display: none; }
292
+ </style>
293
+ <script type="text/javascript" charset="utf-8">
294
+ function go(id) {
295
+ var content = document.getElementById(id)
296
+ var mc = document.getElementById("main_content")
297
+ mc.innerHTML = content.innerHTML
298
+ }
299
+ </script>
300
+ </head>
301
+
302
+ <body>
303
+ <div id="main">
304
+ <div id="header" class="">
305
+ <div class="site">
306
+ <div class="logo">
307
+ <!-- <a href="http://github.com"><img src="/images/modules/header/logov3.png" alt="github" /></a> -->
308
+ </div>
309
+ </div>
310
+ </div>
311
+
312
+ <div class="site">
313
+
314
+ <div id="repos">
315
+ <div class="repo public" id="repo_details">
316
+ <div class="title">
317
+ <div class="path">
318
+ <a href="#/home"><%= user %></a> / <b><a href="#/home"><%= project_name %></a></b>
319
+ </div>
320
+
321
+ </div>
322
+
323
+ <div class="meta">
324
+ <table>
325
+ <tr>
326
+ <td class="label">Description:</td>
327
+ <td>
328
+ <span id="repository_description"><%= project_description %></span>
329
+ </td>
330
+ </tr>
331
+ </table>
332
+ </div>
333
+ </div>
334
+
335
+ </div>
336
+
337
+ <div id="guides">
338
+ <div class="guide">
339
+ <!-- main content -->
340
+
341
+ <div class="main" id="main_content">
342
+ <%= main_content %>
343
+ </div>
344
+
345
+ <!-- sidebar -->
346
+
347
+ <div class="sidebar">
348
+ <h3>
349
+ Pages
350
+ </h3>
351
+ <%= page_list %>
352
+ <hr/>
353
+ <ul><li><b><a href="javascript:go('all_pages')">All Pages</a></b></li><ul>
354
+ </div>
355
+
356
+ </div>
357
+
358
+ <!-- admin -->
359
+ <div class="admin">
360
+ </div>
361
+ </div>
362
+
363
+ </div>
364
+
365
+ <div class="push"></div>
366
+ </div>
367
+ <div id="footer">
368
+ </div>
369
+
370
+ <div id="all_pages" style="display: none;">
371
+ <%= page_content %>
372
+ </div>
373
+
374
+ </body>
375
+ </html>
376
+
@@ -0,0 +1,98 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ require 'dget'
5
+ module DGet
6
+
7
+ class GitHubDoc
8
+ include DGet
9
+ attr_reader :user, :project_name, :pages, :root_doc
10
+
11
+ def initialize user, project_name
12
+ @user = user
13
+ @project_name = project_name
14
+ end
15
+
16
+ def root_doc
17
+ @root_doc ||= proc {
18
+ doc = N('http://wiki.github.com/%s/%s' % [@user, @project_name])
19
+ doc.css('.main').first.fmap { |c| clean_links c }
20
+ doc
21
+ }.call
22
+ end
23
+
24
+ def pages
25
+ @pages ||= root_doc.css(".sidebar ul li b a").map do |link|
26
+ [
27
+ link.content,
28
+ link['href'][/#{@project_name}\/(.*)/, 1] || "home",
29
+ proc {
30
+ content = N(link['href']).css('.main').first
31
+ clean_links content
32
+ content
33
+ }
34
+ ]
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ def clean_links doc
41
+ # rewrites internal links to use the local navigation
42
+ doc.css('a').each do |some_a|
43
+ some_a['href'][/#{@project_name}\/(.*)/, 1].fmap { |id|
44
+ some_a['href'] = "javascript:go(\'#{id}\')"
45
+ }
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ class GitHubEngine
52
+ def do project_spec, file = nil
53
+ user, project_name = *project_spec.split('/')
54
+
55
+ gh_doc = GitHubDoc.new(user, project_name)
56
+ file ||= file_for(user, project_name)
57
+
58
+ content = build_content gh_doc
59
+ File.open(file, 'w') { |f| f.puts content }
60
+ end
61
+
62
+ private
63
+
64
+ def build_content gh_doc
65
+ build_doc(gh_doc.root_doc, gh_doc.pages, gh_doc.project_name, gh_doc.user)
66
+ end
67
+
68
+ def file_for user, project_name
69
+ "#{project_name}_#{user}.html"
70
+ end
71
+
72
+ def template
73
+ IO.read(File.dirname(__FILE__) / 'github.html')
74
+ end
75
+
76
+ def build_doc root, pages, project_name, user
77
+ # Template variables, note: project_name and user are also used in the template
78
+ project_description = root.css("#repository_description").first.fmap(&:content)
79
+ main_content = root.css('.main').first.fmap(&:inner_html)
80
+ page_list = sidebar(pages)
81
+ page_content = pages.map { |title, id, content_f|
82
+ "<div id=\"#{id}\">#{content_f[]}</div>"
83
+ }.join
84
+
85
+ ERB.new(template()).result(binding)
86
+ end
87
+
88
+ def sidebar pages
89
+ "<ul>" +
90
+ pages.map { |title, id, _|
91
+ "<li><b><a href=\"javascript:go(\'#{id}\')\""">#{title}</a></b></li>"
92
+ }.join +
93
+ "</ul>"
94
+ end
95
+
96
+ end
97
+
98
+ end