vim_printer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/01-seoul256-input.png +0 -0
- data/01-seoul256-output.png +0 -0
- data/02-Tomorrow-Night-input.png +0 -0
- data/02-Tomorrow-Night-output.png +0 -0
- data/README.md +6 -0
- data/lib/vim_printer/cli.rb +18 -4
- data/lib/vim_printer/utility.rb +3 -2
- data/lib/vim_printer/version.rb +1 -1
- data/vim_printer.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 627dd0639342f4d39918630c32d8071d23428011
|
4
|
+
data.tar.gz: d4aeddd9698d21abcd92411c47fa46a3da0ce6f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52f8a0c49c1cbc6db7d9fb3de4b024bc261b41b443be37a09736170083e0647f59a65d468377501bbbc029e911ca61c3780e0fbb38fe7eb49813b2fc8d4a5fba
|
7
|
+
data.tar.gz: 084e97a8ad34092e53547d4a3728a0c6f7a22f1d4e036447971ec1bd7fd8270d745833e48e938faf7cb98265f43683d046af22acc6a4a33e0b8cbb43dfe6dd2b
|
data/01-seoul256-input.png
CHANGED
Binary file
|
data/01-seoul256-output.png
CHANGED
Binary file
|
data/02-Tomorrow-Night-input.png
CHANGED
Binary file
|
Binary file
|
data/README.md
CHANGED
data/lib/vim_printer/cli.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'code_lister'
|
2
|
+
require 'index_html'
|
2
3
|
require_relative '../vim_printer'
|
3
4
|
|
4
5
|
module VimPrinter
|
@@ -52,7 +53,8 @@ Print the list of files
|
|
52
53
|
|
53
54
|
private
|
54
55
|
|
55
|
-
#
|
56
|
+
#
|
57
|
+
# @param [Hash<Symbol, Object>] options the options argument
|
56
58
|
def execute(options = {})
|
57
59
|
|
58
60
|
input_files = CodeLister.files(options)
|
@@ -61,17 +63,29 @@ Print the list of files
|
|
61
63
|
puts "No file found for your option: #{options}"
|
62
64
|
return
|
63
65
|
end
|
66
|
+
|
64
67
|
to_htmls(input_files, options)
|
65
68
|
|
66
|
-
#
|
69
|
+
# Search for files that we created
|
67
70
|
generated_files = VimPrinter::Utility.find(options[:base_dir])
|
68
71
|
|
69
|
-
#
|
72
|
+
# Generate the 'index.html' file
|
73
|
+
index_file = "#{options[:base_dir]}/index.html"
|
74
|
+
IndexHtml.htmlify generated_files,
|
75
|
+
base_dir: options[:base_dir],
|
76
|
+
output: index_file
|
77
|
+
|
78
|
+
# We add the missing index file
|
79
|
+
generated_files << index_file
|
80
|
+
|
70
81
|
VimPrinter::Utility.tar_gzip_files(generated_files, 'output.tar.gz')
|
71
82
|
|
72
|
-
#
|
83
|
+
# Cleanup after ourself
|
73
84
|
VimPrinter::Utility.delete(generated_files)
|
74
85
|
|
86
|
+
# Remove the extra index.html file as well
|
87
|
+
FileUtils.rm_rf(index_file)
|
88
|
+
|
75
89
|
# report the result
|
76
90
|
puts "Your result should be available at `output.tar.gz`"
|
77
91
|
end
|
data/lib/vim_printer/utility.rb
CHANGED
@@ -17,7 +17,8 @@ module VimPrinter
|
|
17
17
|
class << self
|
18
18
|
|
19
19
|
# Find list of files based on certain extension
|
20
|
-
#
|
20
|
+
#
|
21
|
+
# @param [String] base_dir the starting directory
|
21
22
|
# @param [String] extension the file extension to search for
|
22
23
|
#
|
23
24
|
# @return [Array<String>] list of matching files or empty list
|
@@ -58,7 +59,7 @@ module VimPrinter
|
|
58
59
|
|
59
60
|
# Add suffix to each extensions
|
60
61
|
#
|
61
|
-
# @param [Array<String>]
|
62
|
+
# @param [Array<String>] extensions list of extension
|
62
63
|
# @param [String] suffix the suffix string
|
63
64
|
#
|
64
65
|
# @return [Array<String>] new list with the suffix added to each element
|
data/lib/vim_printer/version.rb
CHANGED
data/vim_printer.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_runtime_dependency "thor", "~> 0.18"
|
21
21
|
spec.add_runtime_dependency "code_lister", "~> 0.0.6"
|
22
|
+
spec.add_runtime_dependency "index_html", "~> 0.0.5"
|
22
23
|
spec.add_runtime_dependency "minitar", "~> 0.5.4"
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
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.0.2
|
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-04-
|
11
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.0.6
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: index_html
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.0.5
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.0.5
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: minitar
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|