vim_printer 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/CHANGELOGS.md +5 -0
- data/README.md +9 -10
- data/lib/vim_printer/cli.rb +7 -5
- data/lib/vim_printer/version.rb +1 -1
- data/test/fixtures/inputs/vim_printer_output.tar.gz +0 -0
- data/vim_printer.gemspec +4 -4
- metadata +7 -6
- data/rubocop-todo.yml +0 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31111b39787fbc51d2bce77439289b11f19e6402
|
4
|
+
data.tar.gz: f3e90c822cb32f881defdb2a6029e57b0fbf3e20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b4458eb3c8bed8759f19ee28cd518ae9dda5bba401ab3e4649fc384d34f9c73339eb0d882529f8796b7d57aaffb3e9b4420724dccae6b02f0f21d4661f4beb
|
7
|
+
data.tar.gz: 1573880f53d74a4fb2f65a644e848fdc90c470cd3baaac9edc2f08494eaa28201b5153fdfbe8ed2fa2fff2edd8b95e5e81556c3d09ce79acacfd5469948adc00
|
data/.gitignore
CHANGED
data/CHANGELOGS.md
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/vim_printer.svg)](http://badge.fury.io/rb/vim_printer)
|
4
4
|
[![Dependency Status](https://gemnasium.com/agilecreativity/vim_printer.png)](https://gemnasium.com/agilecreativity/vim_printer)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/agilecreativity/vim_printer.png)](https://codeclimate.com/github/agilecreativity/vim_printer)
|
6
|
-
[![Endorse](https://api.coderwall.com/agilecreativity/endorsecount.png)](https://coderwall.com/agilecreativity)
|
7
6
|
|
8
7
|
Print any files to html using the power of Vim. Output will be saved to `vim_printer_output.tar.gz` and ready for
|
9
8
|
extract and viewing in your favourite browser.
|
@@ -65,15 +64,15 @@ vim_printer print -b test/fixtures/inputs -e rb java -r
|
|
65
64
|
Will produce the file `output.tar.gz` with the following result on the screen.
|
66
65
|
|
67
66
|
```
|
68
|
-
FYI: process file 1 of 8 :
|
69
|
-
FYI: process file 2 of 8 :
|
70
|
-
FYI: process file 3 of 8 :
|
71
|
-
FYI: process file 4 of 8 :
|
72
|
-
FYI: process file 5 of 8 :
|
73
|
-
FYI: process file 6 of 8 :
|
74
|
-
FYI: process file 7 of 8 :
|
75
|
-
FYI: process file 8 of 8 :
|
76
|
-
Your output file is
|
67
|
+
FYI: process file 1 of 8 : ./demo1.xxx.rb
|
68
|
+
FYI: process file 2 of 8 : ./demo1.yyy.rb
|
69
|
+
FYI: process file 3 of 8 : ./demo2.xxx.rb
|
70
|
+
FYI: process file 4 of 8 : ./demo2.yyy.rb
|
71
|
+
FYI: process file 5 of 8 : ./java/demo3.xxx.java
|
72
|
+
FYI: process file 6 of 8 : ./java/demo3.yyy.java
|
73
|
+
FYI: process file 7 of 8 : ./java/demo4.xxx.java
|
74
|
+
FYI: process file 8 of 8 : ./java/demo4.yyy.java
|
75
|
+
Your output file is ./test/fixtures/inputs/vim_printer_output.tar.gz
|
77
76
|
```
|
78
77
|
|
79
78
|
### Usage
|
data/lib/vim_printer/cli.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'agile_utils'
|
2
2
|
require 'code_lister'
|
3
3
|
require 'index_html'
|
4
|
+
require 'fileutils'
|
4
5
|
require_relative '../vim_printer'
|
5
6
|
|
6
7
|
module VimPrinter
|
@@ -73,11 +74,12 @@ Print the list of files
|
|
73
74
|
|
74
75
|
to_htmls(input_files, options)
|
75
76
|
|
76
|
-
#
|
77
|
-
|
78
|
-
|
77
|
+
# The generated files is the same as input file but with '.xhtml' appended
|
78
|
+
generated_files = input_files.map do |f|
|
79
|
+
"#{f}.xhtml"
|
80
|
+
end
|
79
81
|
|
80
|
-
index_file =
|
82
|
+
index_file = './index.html'
|
81
83
|
|
82
84
|
IndexHtml.htmlify generated_files,
|
83
85
|
base_dir: options[:base_dir],
|
@@ -98,6 +100,7 @@ Print the list of files
|
|
98
100
|
|
99
101
|
# convert multiple files to 'html'
|
100
102
|
def to_htmls(files, options = {})
|
103
|
+
FileUtils.chdir(File.expand_path(options[:base_dir]))
|
101
104
|
files.each_with_index do |file, index|
|
102
105
|
puts "FYI: process file #{index + 1} of #{files.size} : #{file}"
|
103
106
|
to_html(file, options)
|
@@ -132,7 +135,6 @@ Print the list of files
|
|
132
135
|
'> /dev/null'
|
133
136
|
]
|
134
137
|
|
135
|
-
# Note: have to run as system only
|
136
138
|
system(command.concat(args).join(' '))
|
137
139
|
end
|
138
140
|
end
|
data/lib/vim_printer/version.rb
CHANGED
Binary file
|
data/vim_printer.gemspec
CHANGED
@@ -8,8 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = VimPrinter::VERSION
|
9
9
|
spec.authors = ['Burin Choomnuan']
|
10
10
|
spec.email = ['agilecreativity@gmail.com']
|
11
|
-
spec.description = %q
|
12
|
-
spec.summary = %q
|
11
|
+
spec.description = %q(Batch convert multiple files to htmls using the power of Vim editor)
|
12
|
+
spec.summary = %q(Batch convert multiple files to htmls using the power of Vim.
|
13
|
+
Work will any languages that can be open with Vim e.g. any non-binary files.)
|
13
14
|
spec.homepage = 'https://github.com/agilecreativity/vim_printer'
|
14
15
|
spec.license = 'MIT'
|
15
16
|
spec.files = Dir.glob('{bin,lib}/**/*') + %w(Gemfile
|
@@ -19,8 +20,7 @@ Gem::Specification.new do |spec|
|
|
19
20
|
CHANGELOGS.md
|
20
21
|
LICENSE
|
21
22
|
.rubocop.yml
|
22
|
-
.gitignore
|
23
|
-
rubocop-todo.yml)
|
23
|
+
.gitignore)
|
24
24
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
25
25
|
spec.test_files = Dir.glob('{test}/**/*')
|
26
26
|
spec.require_paths = ['lib']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vim_printer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burin Choomnuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -220,8 +220,7 @@ dependencies:
|
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0.8'
|
223
|
-
description: Batch convert multiple
|
224
|
-
editor
|
223
|
+
description: Batch convert multiple files to htmls using the power of Vim editor
|
225
224
|
email:
|
226
225
|
- agilecreativity@gmail.com
|
227
226
|
executables:
|
@@ -241,7 +240,6 @@ files:
|
|
241
240
|
- lib/vim_printer/cli.rb
|
242
241
|
- lib/vim_printer/logger.rb
|
243
242
|
- lib/vim_printer/version.rb
|
244
|
-
- rubocop-todo.yml
|
245
243
|
- test/fixtures/inputs/demo1.xxx.rb
|
246
244
|
- test/fixtures/inputs/demo1.yyy.rb
|
247
245
|
- test/fixtures/inputs/demo2.xxx.rb
|
@@ -252,6 +250,7 @@ files:
|
|
252
250
|
- test/fixtures/inputs/java/demo4.yyy.java
|
253
251
|
- test/fixtures/inputs/noexts1_zzz
|
254
252
|
- test/fixtures/inputs/noexts2_zzz
|
253
|
+
- test/fixtures/inputs/vim_printer_output.tar.gz
|
255
254
|
- test/fixtures/outputs/demo1.xxx.rb.xhtml
|
256
255
|
- test/fixtures/outputs/demo1.yyy.rb.xhtml
|
257
256
|
- test/fixtures/outputs/demo2.xxx.rb.xhtml
|
@@ -286,7 +285,8 @@ rubyforge_project:
|
|
286
285
|
rubygems_version: 2.2.2
|
287
286
|
signing_key:
|
288
287
|
specification_version: 4
|
289
|
-
summary: Batch convert multiple
|
288
|
+
summary: Batch convert multiple files to htmls using the power of Vim. Work will any
|
289
|
+
languages that can be open with Vim e.g. any non-binary files.
|
290
290
|
test_files:
|
291
291
|
- test/fixtures/inputs/demo1.xxx.rb
|
292
292
|
- test/fixtures/inputs/demo1.yyy.rb
|
@@ -298,6 +298,7 @@ test_files:
|
|
298
298
|
- test/fixtures/inputs/java/demo4.yyy.java
|
299
299
|
- test/fixtures/inputs/noexts1_zzz
|
300
300
|
- test/fixtures/inputs/noexts2_zzz
|
301
|
+
- test/fixtures/inputs/vim_printer_output.tar.gz
|
301
302
|
- test/fixtures/outputs/demo1.xxx.rb.xhtml
|
302
303
|
- test/fixtures/outputs/demo1.yyy.rb.xhtml
|
303
304
|
- test/fixtures/outputs/demo2.xxx.rb.xhtml
|
data/rubocop-todo.yml
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
-
# on 2014-04-23 20:34:48 +1000 using RuboCop version 0.20.1.
|
3
|
-
# The point is for the user to remove these configuration records
|
4
|
-
# one by one as the offenses are removed from the code base.
|
5
|
-
# Note that changes in the inspected code, or installation of new
|
6
|
-
# versions of RuboCop, may require this file to be generated again.
|
7
|
-
|
8
|
-
# Offense count: 9
|
9
|
-
AmbiguousOperator:
|
10
|
-
Enabled: false
|
11
|
-
|
12
|
-
# Offense count: 1
|
13
|
-
# Cop supports --auto-correct.
|
14
|
-
# Configuration parameters: PreferredMethods.
|
15
|
-
CollectionMethods:
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
# Offense count: 1
|
19
|
-
CyclomaticComplexity:
|
20
|
-
Max: 7
|
21
|
-
|
22
|
-
# Offense count: 5
|
23
|
-
Documentation:
|
24
|
-
Enabled: false
|
25
|
-
|
26
|
-
# Offense count: 1
|
27
|
-
# Cop supports --auto-correct.
|
28
|
-
EmptyLinesAroundBody:
|
29
|
-
Enabled: true
|
30
|
-
|
31
|
-
# Offense count: 1
|
32
|
-
# Cop supports --auto-correct.
|
33
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
34
|
-
HashSyntax:
|
35
|
-
Enabled: true
|
36
|
-
|
37
|
-
# Offense count: 4
|
38
|
-
# Cop supports --auto-correct.
|
39
|
-
LeadingCommentSpace:
|
40
|
-
Enabled: true
|
41
|
-
|
42
|
-
# Offense count: 18
|
43
|
-
LineLength:
|
44
|
-
Max: 108
|
45
|
-
|
46
|
-
# Offense count: 8
|
47
|
-
# Configuration parameters: CountComments.
|
48
|
-
MethodLength:
|
49
|
-
Max: 30
|
50
|
-
|
51
|
-
# Offense count: 1
|
52
|
-
# Cop supports --auto-correct.
|
53
|
-
SpaceAfterComma:
|
54
|
-
Enabled: true
|
55
|
-
|
56
|
-
# Offense count: 1
|
57
|
-
# Cop supports --auto-correct.
|
58
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
59
|
-
SpaceInsideBlockBraces:
|
60
|
-
Enabled: true
|
61
|
-
|
62
|
-
# Offense count: 1
|
63
|
-
# Cop supports --auto-correct.
|
64
|
-
SpecialGlobalVars:
|
65
|
-
Enabled: true
|
66
|
-
|
67
|
-
# Offense count: 16
|
68
|
-
# Cop supports --auto-correct.
|
69
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
70
|
-
StringLiterals:
|
71
|
-
Enabled: false
|
72
|
-
|
73
|
-
# Offense count: 1
|
74
|
-
UnreachableCode:
|
75
|
-
Enabled: true
|
76
|
-
|
77
|
-
# Offense count: 1
|
78
|
-
UselessAssignment:
|
79
|
-
Enabled: false
|
80
|
-
|
81
|
-
# Offense count: 1
|
82
|
-
# Cop supports --auto-correct.
|
83
|
-
WordArray:
|
84
|
-
MinSize: 2
|