doc 0.2.8 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'doc'
5
- s.version = '0.2.8'
5
+ s.version = '0.3.0'
6
6
  s.summary = %q{Get all ruby documentation in one place}
7
7
  s.description = %Q{Generate `Rakefile` with `docr` and get searchable documentation for ruby, rails, gems, plugins and all other ruby code in one place}
8
8
  s.homepage = "http://github.com/toy/#{s.name}"
@@ -70,6 +70,10 @@ module Doc
70
70
  @state = :failed
71
71
  end
72
72
 
73
+ def symlink_to(path)
74
+ (path / doc_dir.basename).make_symlink(doc_dir.relative_path_from(path))
75
+ end
76
+
73
77
  def succeeded?
74
78
  @state == :succeeded
75
79
  end
@@ -34,7 +34,7 @@ module Doc
34
34
 
35
35
  succeded_tasks = tasks.reject(&:failed?)
36
36
  task_titles = succeded_tasks.map{ |task| task.title.gsub(',', '_') }.join(',')
37
- task_urls = succeded_tasks.map{ |task| task.doc_dir.relative_path_from(doc_dir).to_s.strip }.join(' ')
37
+ task_urls = succeded_tasks.map{ |task| task.doc_dir.relative_path_from(doc_dir) }.join(' ')
38
38
 
39
39
  cmd = Command.new('sdoc-merge', "_#{loaded_gem_version('sdoc')}_")
40
40
  cmd.add "--op=#{doc_dir}"
@@ -45,5 +45,16 @@ module Doc
45
45
 
46
46
  cmd.run
47
47
  end
48
+
49
+ def symlink_children_to(path)
50
+ tasks.reject(&:failed?).each do |task|
51
+ task.symlink_to(path)
52
+ end
53
+ end
54
+
55
+ def symlink_to(path)
56
+ symlink_children_to(path)
57
+ super
58
+ end
48
59
  end
49
60
  end
@@ -11,7 +11,9 @@ module Doc
11
11
  def run
12
12
  super
13
13
  if succeeded?
14
- (doc_dir / documentor.docs_dir.basename).make_symlink(documentor.docs_dir.relative_path_from(doc_dir))
14
+ public_doc_dir = doc_dir / documentor.docs_dir.basename
15
+ public_doc_dir.mkpath
16
+ symlink_children_to(public_doc_dir)
15
17
  end
16
18
  end
17
19
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 8
10
- version: 0.2.8
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ivan Kuchin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-14 00:00:00 Z
18
+ date: 2012-01-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: sdoc