double_doc 1.0.10 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,14 +23,26 @@ module DoubleDoc
23
23
  generated_files = [@output_directory + File.basename(@stylesheet)]
24
24
 
25
25
  @sources.each do |src|
26
- path = File.basename(src).sub(/\.md$/, '.html')
26
+ from_markdown = src.to_s =~ /\.md$/
27
+ if from_markdown
28
+ path = File.basename(src).sub(/\.md$/, '.html')
29
+ else
30
+ path = File.basename(src)
31
+ end
32
+
27
33
  dst = @output_directory + path
28
34
  puts "#{src} -> #{dst}"
29
35
  FileUtils.mkdir_p(File.dirname(dst))
30
- File.open(dst, 'w') do |out|
31
- markdown = self.class.convert_links_to_html!(File.new(src).read)
32
36
 
37
+ if from_markdown
38
+ markdown = self.class.convert_links_to_html!(File.new(src).read)
33
39
  body = @html_renderer.render(markdown)
40
+ else
41
+ body = File.new(src).read
42
+ end
43
+
44
+ File.open(dst, 'w') do |out|
45
+
34
46
  html = template.result(
35
47
  :title => @title,
36
48
  :body => body,
@@ -64,9 +64,17 @@ module DoubleDoc
64
64
  sources.each do |src|
65
65
  dst = md_dst + File.basename(src)
66
66
  puts "#{src} -> #{dst}"
67
+
68
+ if src.to_s =~ /\.md$/
69
+ body = import_handler.resolve_imports(File.new(src))
70
+ else
71
+ body = File.new(src).read
72
+ end
73
+
67
74
  File.open(dst, 'w') do |out|
68
- out.write(import_handler.resolve_imports(File.new(src)))
75
+ out.write(body)
69
76
  end
77
+
70
78
  generated_md_files << dst
71
79
  end
72
80
 
@@ -1,4 +1,4 @@
1
1
  ## ## DoubleDoc 1.0
2
2
  module DoubleDoc
3
- VERSION = "1.0.10"
3
+ VERSION = "1.1.0"
4
4
  end
metadata CHANGED
@@ -1,90 +1,118 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: double_doc
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.10
3
+ version: !ruby/object:Gem::Version
4
+ hash: 19
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 0
10
+ version: 1.1.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Mick Staugaard
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-03-31 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-04-02 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: guard
16
- requirement: &70232471213320 !ruby/object:Gem::Requirement
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
17
23
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ hash: 3
28
+ segments:
29
+ - 0
30
+ version: "0"
22
31
  type: :development
23
32
  prerelease: false
24
- version_requirements: *70232471213320
25
- - !ruby/object:Gem::Dependency
33
+ requirement: *id001
34
+ - !ruby/object:Gem::Dependency
26
35
  name: minitest
27
- requirement: &70232471212880 !ruby/object:Gem::Requirement
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
28
37
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ hash: 3
42
+ segments:
43
+ - 0
44
+ version: "0"
33
45
  type: :development
34
46
  prerelease: false
35
- version_requirements: *70232471212880
36
- - !ruby/object:Gem::Dependency
47
+ requirement: *id002
48
+ - !ruby/object:Gem::Dependency
37
49
  name: rake
38
- requirement: &70232471212440 !ruby/object:Gem::Requirement
50
+ version_requirements: &id003 !ruby/object:Gem::Requirement
39
51
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 0
58
+ version: "0"
44
59
  type: :runtime
45
60
  prerelease: false
46
- version_requirements: *70232471212440
47
- - !ruby/object:Gem::Dependency
61
+ requirement: *id003
62
+ - !ruby/object:Gem::Dependency
48
63
  name: erubis
49
- requirement: &70232471212020 !ruby/object:Gem::Requirement
64
+ version_requirements: &id004 !ruby/object:Gem::Requirement
50
65
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ hash: 3
70
+ segments:
71
+ - 0
72
+ version: "0"
55
73
  type: :runtime
56
74
  prerelease: false
57
- version_requirements: *70232471212020
58
- - !ruby/object:Gem::Dependency
75
+ requirement: *id004
76
+ - !ruby/object:Gem::Dependency
59
77
  name: redcarpet
60
- requirement: &70232471211520 !ruby/object:Gem::Requirement
78
+ version_requirements: &id005 !ruby/object:Gem::Requirement
61
79
  none: false
62
- requirements:
80
+ requirements:
63
81
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: '2.1'
82
+ - !ruby/object:Gem::Version
83
+ hash: 1
84
+ segments:
85
+ - 2
86
+ - 1
87
+ version: "2.1"
66
88
  type: :runtime
67
89
  prerelease: false
68
- version_requirements: *70232471211520
69
- - !ruby/object:Gem::Dependency
90
+ requirement: *id005
91
+ - !ruby/object:Gem::Dependency
70
92
  name: pygments.rb
71
- requirement: &70232471211020 !ruby/object:Gem::Requirement
93
+ version_requirements: &id006 !ruby/object:Gem::Requirement
72
94
  none: false
73
- requirements:
95
+ requirements:
74
96
  - - ~>
75
- - !ruby/object:Gem::Version
76
- version: '0.2'
97
+ - !ruby/object:Gem::Version
98
+ hash: 15
99
+ segments:
100
+ - 0
101
+ - 2
102
+ version: "0.2"
77
103
  type: :runtime
78
104
  prerelease: false
79
- version_requirements: *70232471211020
80
- description: A simple framework for writing and generating beautiful documentation
81
- for your code
82
- email:
105
+ requirement: *id006
106
+ description: A simple framework for writing and generating beautiful documentation for your code
107
+ email:
83
108
  - mick@staugaard.com
84
109
  executables: []
110
+
85
111
  extensions: []
112
+
86
113
  extra_rdoc_files: []
87
- files:
114
+
115
+ files:
88
116
  - lib/double_doc/doc_extractor.rb
89
117
  - lib/double_doc/html_generator.rb
90
118
  - lib/double_doc/html_renderer.rb
@@ -102,30 +130,38 @@ files:
102
130
  - test/test_helper.rb
103
131
  homepage: http://staugaard.github.com/double_doc
104
132
  licenses: []
133
+
105
134
  post_install_message:
106
135
  rdoc_options: []
107
- require_paths:
136
+
137
+ require_paths:
108
138
  - lib
109
- required_ruby_version: !ruby/object:Gem::Requirement
139
+ required_ruby_version: !ruby/object:Gem::Requirement
110
140
  none: false
111
- requirements:
112
- - - ! '>='
113
- - !ruby/object:Gem::Version
114
- version: '0'
115
- required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ hash: 3
145
+ segments:
146
+ - 0
147
+ version: "0"
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
149
  none: false
117
- requirements:
118
- - - ! '>='
119
- - !ruby/object:Gem::Version
120
- version: '0'
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ hash: 3
154
+ segments:
155
+ - 0
156
+ version: "0"
121
157
  requirements: []
158
+
122
159
  rubyforge_project:
123
- rubygems_version: 1.8.16
160
+ rubygems_version: 1.8.21
124
161
  signing_key:
125
162
  specification_version: 3
126
163
  summary: Documentation right where you want it
127
- test_files:
164
+ test_files:
128
165
  - test/doc_extractor_test.rb
129
166
  - test/html_generator_test.rb
130
167
  - test/test_helper.rb
131
- has_rdoc: