useless-doc 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 08391b79217100e97d2a5e4d59a9d619eec4f799
4
+ data.tar.gz: 32654945d643cec747b14153f8da51d619649808
5
+ SHA512:
6
+ metadata.gz: b439531e48110984bcd19754e9200df22fe819b82de8f4c95812f9668ef202188b321fc2ba06a2a46de18a04944b451db11e489575563a8685cc0b30bf395eb7
7
+ data.tar.gz: f05312bbe2e9a044f286376db0d0558596af57ea7d5bb2692f93339246a497050f37b2e23e638f1a48d09771f9e3f3ef41fef78b17b528448263963f7ed1cf53
@@ -1 +1 @@
1
- 1.9.3-p327
1
+ 2.0.0-p0
@@ -25,6 +25,11 @@ module Useless
25
25
  :superscript => true)
26
26
  end
27
27
 
28
+ def self.strip_heredoc(string)
29
+ indent = string.scan(/^[ \t]*(?=\S)/).min.size
30
+ string.gsub(/^[ \t]{#{indent}}/, '')
31
+ end
32
+
28
33
  def initialize(router)
29
34
  @router = router
30
35
  end
@@ -58,7 +63,8 @@ module Useless
58
63
  end
59
64
 
60
65
  def description
61
- Godel.markdown.render(@domain.description)
66
+ description = Godel.strip_heredoc(@domain.description)
67
+ Godel.markdown.render(description)
62
68
  end
63
69
 
64
70
  def apis
@@ -83,13 +89,18 @@ module Useless
83
89
  end
84
90
 
85
91
  def description
86
- Godel.markdown.render(@api.description)
92
+ description = Godel.strip_heredoc(@api.description)
93
+ Godel.markdown.render(description)
87
94
  end
88
95
 
89
96
  def resources
90
97
  @api.resources.map{ |resource| Godel::Resource.new(resource, @router) }
91
98
  end
92
99
 
100
+ def show_stages?
101
+ @api.concept || @api.specification || @api.implementation
102
+ end
103
+
93
104
  def concept
94
105
  if @api.concept
95
106
  Godel::Stage.new(@api.concept)
@@ -33,44 +33,46 @@
33
33
  <article class="description api">
34
34
  {{{description}}}
35
35
 
36
- <table class="stages">
37
- <thead>
38
- <th>Specification</th>
39
- <th>Implementation</th>
40
- <th>Concept</th>
41
- <tbody>
42
- <tr>
43
- <td>
44
- {{#specification}}
45
- {{progress}}
46
- {{/specification}}
47
- </td>
48
- <td>
49
- {{#implementation}}
50
- {{progress}}
51
- {{/implementation}}
52
- </td>
53
- <td class="concept-credit" rowspan=2>
54
- {{#concept}}
55
- {{credit}}
56
- {{/concept}}
57
- </td>
58
- </tr>
36
+ {{#show_stages?}}
37
+ <table class="stages">
38
+ <thead>
39
+ <th>Specification</th>
40
+ <th>Implementation</th>
41
+ <th>Concept</th>
42
+ <tbody>
43
+ <tr>
44
+ <td>
45
+ {{#specification}}
46
+ {{progress}}
47
+ {{/specification}}
48
+ </td>
49
+ <td>
50
+ {{#implementation}}
51
+ {{progress}}
52
+ {{/implementation}}
53
+ </td>
54
+ <td class="concept-credit" rowspan=2>
55
+ {{#concept}}
56
+ {{credit}}
57
+ {{/concept}}
58
+ </td>
59
+ </tr>
59
60
 
60
- <tr>
61
- <td>
62
- {{#specification}}
63
- {{credit}}
64
- {{/specification}}
65
- </td>
66
- <td class="implementation-credit">
67
- {{#implementation}}
68
- {{credit}}
69
- {{/implementation}}
70
- </td>
71
- </tr>
72
- </tbody>
73
- </table>
61
+ <tr>
62
+ <td>
63
+ {{#specification}}
64
+ {{credit}}
65
+ {{/specification}}
66
+ </td>
67
+ <td class="implementation-credit">
68
+ {{#implementation}}
69
+ {{credit}}
70
+ {{/implementation}}
71
+ </td>
72
+ </tr>
73
+ </tbody>
74
+ </table>
75
+ {{/show_stages?}}
74
76
  </article>
75
77
  </section>
76
78
 
@@ -1,5 +1,5 @@
1
1
  module Useless
2
2
  module Doc
3
- VERSION = '0.6.2'
3
+ VERSION = '0.6.3'
4
4
  end
5
5
  end
@@ -212,4 +212,16 @@ describe Useless::Doc::UI::Godel do
212
212
  end
213
213
  end
214
214
  end
215
+
216
+ describe '.strip_heredoc' do
217
+ it 'should strip non-significant whitespace from a heredoc' do
218
+ string = <<-HEREDOC
219
+ This is a heredoc
220
+ This is indented
221
+ HEREDOC
222
+
223
+ Useless::Doc::UI::Godel.strip_heredoc(string).should ==
224
+ "This is a heredoc\n This is indented\n"
225
+ end
226
+ end
215
227
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: useless-doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
5
- prerelease:
4
+ version: 0.6.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kevin Hyland
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
11
+ date: 2013-04-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: oj
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rack
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: typhoeus
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: low
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: sinatra
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: mustache
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: redcarpet
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: rspec
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ~>
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ~>
140
123
  - !ruby/object:Gem::Version
@@ -142,7 +125,6 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: rack-test
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ~>
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ~>
156
137
  - !ruby/object:Gem::Version
@@ -158,7 +139,6 @@ dependencies:
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: nokogiri
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
143
  - - ~>
164
144
  - !ruby/object:Gem::Version
@@ -166,7 +146,6 @@ dependencies:
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
150
  - - ~>
172
151
  - !ruby/object:Gem::Version
@@ -232,27 +211,26 @@ files:
232
211
  - useless-doc.gemspec
233
212
  homepage:
234
213
  licenses: []
214
+ metadata: {}
235
215
  post_install_message:
236
216
  rdoc_options: []
237
217
  require_paths:
238
218
  - lib
239
219
  required_ruby_version: !ruby/object:Gem::Requirement
240
- none: false
241
220
  requirements:
242
- - - ! '>='
221
+ - - '>='
243
222
  - !ruby/object:Gem::Version
244
223
  version: '0'
245
224
  required_rubygems_version: !ruby/object:Gem::Requirement
246
- none: false
247
225
  requirements:
248
- - - ! '>='
226
+ - - '>='
249
227
  - !ruby/object:Gem::Version
250
228
  version: '0'
251
229
  requirements: []
252
230
  rubyforge_project:
253
- rubygems_version: 1.8.23
231
+ rubygems_version: 2.0.0
254
232
  signing_key:
255
- specification_version: 3
233
+ specification_version: 4
256
234
  summary: For parsing and serving Useless documentation.
257
235
  test_files:
258
236
  - spec/config.ru