document_generator 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6871a1067a242543d48a66cd7475e79ece9521d2
4
- data.tar.gz: 23a5d3e5ab9d5f8f57e3bac358082529f77b4dcf
3
+ metadata.gz: 6e1a30220973a3ce1fee7ada798bc6c8879c201e
4
+ data.tar.gz: f03e4a2935bbf25d255e66aa334d12a77dd76615
5
5
  SHA512:
6
- metadata.gz: d958dede20b91df5423a6ffe35243a30b52a498e02254737230ecb833ec2898322aa75165b0d5f41945f6fad4f7ebd17c97508e047c98110368fec0b18519f08
7
- data.tar.gz: 720106b2000cb8707243a9bbfae1291e9fba2919171989130d15fdc4f8a903418d90552c7d49cc345138ad5a7fc2857c0e373152b370dc15285da265fd84d45d
6
+ metadata.gz: e3b062f4a55ce16327f4eba5eeed89443552a368bbd4ac6a2d9c14a33bd8deb5d1f35ceb669b2b1af815c8f4fcfa098e33de94b5c18cb1b5d89ba2040adb261c
7
+ data.tar.gz: 51dd31fa042c3d48057cc561978f84a6657949b4ba6ebcae2bfa52f73f21076fed55abf4a6664573b03a08d0df985ade873d4cc0ac2313c2c9381f1baadaf04f
@@ -14,7 +14,6 @@
14
14
  body {
15
15
  padding-top: 0;
16
16
  }
17
-
18
17
  h1 {
19
18
  font-size: 22px;
20
19
  }
@@ -23,6 +22,11 @@
23
22
  }
24
23
  h3 {
25
24
  font-size: 16px;
25
+ margin-top: 30px;
26
+ }
27
+ h4 {
28
+ font-size: 14px;
29
+ margin-top: 25px;
26
30
  }
27
31
  h1, h2 {
28
32
  text-transform: uppercase;
@@ -40,6 +40,7 @@ title: #{first_line_of_commit_message}
40
40
  ---
41
41
 
42
42
  <h1 id="main">#{first_line_of_commit_message}</h1>
43
+
43
44
  HEADER
44
45
  end
45
46
 
@@ -39,14 +39,14 @@ module DocumentGenerator
39
39
  outputs.each do |output|
40
40
  if output.escaped_content.length > 0
41
41
  temp << "\n\n"
42
- temp << output.description
43
- temp << "\n<pre><code>"
42
+ temp << "#####{output.description}"
43
+ temp << "\n```\n"
44
44
  if output.description == "Becomes"
45
45
  temp << output.content.join("\n") + "\n"
46
46
  else
47
47
  temp << output.escaped_content
48
48
  end
49
- temp << "</code></pre>\n"
49
+ temp << "\n```\n"
50
50
  end
51
51
  end
52
52
 
@@ -62,7 +62,7 @@ module DocumentGenerator
62
62
  git_diff_file_hunks.each do |hunk|
63
63
  clean_hunks << ending_code_for(hunk).join("\n")
64
64
  end
65
- Output.no_really_escape(CGI.escapeHTML(clean_hunks.join("\n")))
65
+ clean_hunks.join("\n")
66
66
  end
67
67
 
68
68
  def ending_code_for(hunk) # The unescaped end result code for a particular hunk returned as array
@@ -76,7 +76,6 @@ module DocumentGenerator
76
76
  if (line[0]) == "+"
77
77
  line = remove_first_character(line)
78
78
  end
79
- line = CGI.unescapeHTML(line) # Shouldn't be necessary?
80
79
  clean_lines << line
81
80
  end
82
81
  clean_lines
@@ -2,22 +2,6 @@ module DocumentGenerator
2
2
  class Output
3
3
  attr_accessor :description, :content
4
4
 
5
- # TODO: This is due to a bug in maruku. We should create
6
- # an issue there--and possibly a PR to fix?
7
- def self.no_really_escape(value)
8
- value.split("\n").map do |line|
9
- if line.strip.size.zero?
10
- "&nbsp;"
11
- else
12
- line
13
- end
14
- end.join("\n")
15
- end
16
-
17
- def self.no_really_unescape(value)
18
- value.gsub('&nbsp;', ' ')
19
- end
20
-
21
5
  def escaped_content
22
6
  temp = []
23
7
  content.each do |line|
@@ -25,7 +9,7 @@ module DocumentGenerator
25
9
  temp << "\n"
26
10
  end
27
11
 
28
- Output.no_really_escape(CGI.escapeHTML(temp.join.rstrip))
12
+ temp.join.rstrip
29
13
  end
30
14
  end
31
15
  end
@@ -1,3 +1,3 @@
1
1
  module DocumentGenerator
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -72,6 +72,7 @@ title: first commit
72
72
 
73
73
  <h1 id="main">first commit</h1>
74
74
 
75
+
75
76
  ### Additional Resources
76
77
 
77
78
  * [Changes in this step in `diff` format](http://github.com/stevenhallen/commit/da39a3ee5e6b4b0d3255bfef95601890afd80709)
@@ -104,6 +105,7 @@ title: some commit message
104
105
  ---
105
106
 
106
107
  <h1 id="main">some commit message</h1>
108
+
107
109
  the diff_file content
108
110
  ### Additional Resources
109
111
 
@@ -130,6 +132,7 @@ title: This is one line
130
132
  ---
131
133
 
132
134
  <h1 id="main">This is one line</h1>
135
+
133
136
  EXPECTED
134
137
  end
135
138
 
@@ -148,6 +151,7 @@ title: This is one line
148
151
  ---
149
152
 
150
153
  <h1 id="main">This is one line</h1>
154
+
151
155
  EXPECTED
152
156
  end
153
157
 
@@ -31,8 +31,10 @@ EXPECTED
31
31
  <<-EXPECTED_CONTENT
32
32
  ###Create file `/spec/support/capybara.rb`
33
33
 
34
- Add
35
- <pre><code> Capybara.javascript_driver = :webkit</code></pre>
34
+ ####Add
35
+ ```
36
+ Capybara.javascript_driver = :webkit
37
+ ```
36
38
 
37
39
 
38
40
  EXPECTED_CONTENT
@@ -65,7 +67,7 @@ EXPECTED_CONTENT
65
67
  describe '#markdown_outputs' do
66
68
  it 'has correct markdown outputs' do
67
69
  expect(diff_file.markdown_outputs.first.description).to eq "Add"
68
- expect(diff_file.markdown_outputs.first.escaped_content).to eq CGI.escapeHTML(" Capybara.javascript_driver = :webkit")
70
+ expect(diff_file.markdown_outputs.first.escaped_content).to eq " Capybara.javascript_driver = :webkit"
69
71
  end
70
72
  end
71
73
  end
@@ -153,7 +155,7 @@ EXPECTED_CONTENT
153
155
 
154
156
  describe '#ending_code' do
155
157
  it 'contains the ending_code' do
156
- expect(diff_file.ending_code).to eq DocumentGenerator::Output.no_really_escape(CGI.escapeHTML(ending.strip))
158
+ expect(diff_file.ending_code).to eq ending.strip
157
159
  end
158
160
  end
159
161
 
@@ -166,10 +168,10 @@ EXPECTED_CONTENT
166
168
  describe '#markdown_outputs' do
167
169
  it 'has correct markdown outputs' do
168
170
  expect(diff_file.markdown_outputs.first.description).to eq "Change"
169
- expect(diff_file.markdown_outputs.first.escaped_content).to eq CGI.escapeHTML(" <%= form_for :post do |f| %>")
171
+ expect(diff_file.markdown_outputs.first.escaped_content).to eq " <%= form_for :post do |f| %>"
170
172
 
171
173
  expect(diff_file.markdown_outputs[1].description).to eq "To"
172
- expect(diff_file.markdown_outputs[1].escaped_content).to eq CGI.escapeHTML(" <%= form_for :post, url: posts_path do |f| %>")
174
+ expect(diff_file.markdown_outputs[1].escaped_content).to eq " <%= form_for :post, url: posts_path do |f| %>"
173
175
 
174
176
  expect(diff_file.markdown_outputs[2].description).to eq "Becomes"
175
177
  expect(diff_file.markdown_outputs[2].escaped_content).to eq diff_file.ending_code
@@ -236,41 +238,53 @@ ENDING
236
238
  <<-EXPECTED_CONTENT
237
239
  ###Update file `/spec/controllers/posts_controller_spec.rb`
238
240
 
239
- Change
240
- <pre><code> response.should be_success</code></pre>
241
+ ####Change
242
+ ```
243
+ response.should be_success
244
+ ```
241
245
 
242
246
 
243
- To
244
- <pre><code> expect(response).to be_success</code></pre>
247
+ ####To
248
+ ```
249
+ expect(response).to be_success
250
+ ```
245
251
 
246
252
 
247
- Becomes
248
- <pre><code> describe 'GET #new' do
253
+ ####Becomes
254
+ ```
255
+ describe 'GET #new' do
249
256
  it "returns http success" do
250
257
  get :new
251
258
  expect(response).to be_success
252
259
  end
253
260
  end
254
- </code></pre>
255
261
 
262
+ ```
256
263
 
257
- Change
258
- <pre><code> response.should be_success</code></pre>
259
264
 
265
+ ####Change
266
+ ```
267
+ response.should be_success
268
+ ```
260
269
 
261
- To
262
- <pre><code> expect(response).to be_success</code></pre>
270
+
271
+ ####To
272
+ ```
273
+ expect(response).to be_success
274
+ ```
263
275
 
264
276
 
265
- Becomes
266
- <pre><code> describe 'GET #index' do
277
+ ####Becomes
278
+ ```
279
+ describe 'GET #index' do
267
280
  it "returns http success" do
268
281
  get :index
269
282
  expect(response).to be_success
270
283
  end
271
284
  end
272
285
  end
273
- </code></pre>
286
+
287
+ ```
274
288
 
275
289
 
276
290
  EXPECTED_CONTENT
@@ -284,7 +298,7 @@ EXPECTED_CONTENT
284
298
 
285
299
  describe '#ending_code' do
286
300
  it 'contains the ending_code' do
287
- expect(diff_file.ending_code).to eq DocumentGenerator::Output.no_really_escape(CGI.escapeHTML(ending.rstrip))
301
+ expect(diff_file.ending_code).to eq ending.rstrip
288
302
  end
289
303
  end
290
304
 
@@ -358,24 +372,33 @@ ENDING
358
372
  <<-EXPECTED_CONTENT
359
373
  ###Update file `/spec/controllers/posts_controller_spec.rb`
360
374
 
361
- Change
362
- <pre><code> describe GET new do</code></pre>
375
+ ####Change
376
+ ```
377
+ describe GET new do
378
+ ```
363
379
 
364
380
 
365
- To
366
- <pre><code> describe GET new do</code></pre>
381
+ ####To
382
+ ```
383
+ describe GET new do
384
+ ```
367
385
 
368
386
 
369
- Change
370
- <pre><code> get new</code></pre>
387
+ ####Change
388
+ ```
389
+ get new
390
+ ```
371
391
 
372
392
 
373
- To
374
- <pre><code> get new</code></pre>
393
+ ####To
394
+ ```
395
+ get new
396
+ ```
375
397
 
376
398
 
377
- Becomes
378
- <pre><code>describe PostsController do
399
+ ####Becomes
400
+ ```
401
+ describe PostsController do
379
402
 
380
403
  describe GET new do
381
404
  it returns http success do
@@ -383,7 +406,8 @@ Becomes
383
406
  response.should be_success
384
407
  end
385
408
  end
386
- </code></pre>
409
+
410
+ ```
387
411
 
388
412
 
389
413
  EXPECTED_CONTENT
@@ -397,7 +421,7 @@ EXPECTED_CONTENT
397
421
 
398
422
  describe '#ending_code' do
399
423
  it 'contains the ending_code' do
400
- expect(diff_file.ending_code).to eq DocumentGenerator::Output.no_really_escape(CGI.escapeHTML(ending.strip))
424
+ expect(diff_file.ending_code).to eq ending.strip
401
425
  end
402
426
  end
403
427
 
@@ -455,7 +479,7 @@ EXPECTED
455
479
 
456
480
  describe '#ending_code' do
457
481
  it 'contains the ending_code' do
458
- expect(diff_file.ending_code).to eq CGI.escapeHTML(ending.strip)
482
+ expect(diff_file.ending_code).to eq ending.strip
459
483
  end
460
484
  end
461
485
 
@@ -493,8 +517,10 @@ PATCH
493
517
  <<-EXPECTED_CONTENT
494
518
  ###Create file `/spec/support/capybara.rb`
495
519
 
496
- Add
497
- <pre><code> Capybara.javascript_driver = :webkit</code></pre>
520
+ ####Add
521
+ ```
522
+ Capybara.javascript_driver = :webkit
523
+ ```
498
524
 
499
525
 
500
526
  EXPECTED_CONTENT
@@ -525,18 +551,6 @@ index 0000000..12cefac
525
551
  PATCH
526
552
  end
527
553
 
528
- let(:expected_content) do
529
- <<-EXPECTED_CONTENT
530
- Create file `/spec/support/capybara.rb`
531
-
532
- Add
533
-
534
- Capybara.javascript_driver = :webkit
535
-
536
-
537
- EXPECTED_CONTENT
538
- end
539
-
540
554
  describe '#markdown_outputs' do
541
555
  it 'has correct markdown outputs' do
542
556
  expect(diff_file.markdown_outputs.size).to eq 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: document_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - wiscoDude
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-05 00:00:00.000000000 Z
13
+ date: 2014-01-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable