code2pdf 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile.lock +35 -18
- data/README.md +50 -0
- data/Rakefile +6 -1
- data/bin/code2pdf +7 -13
- data/code2pdf.gemspec +18 -21
- data/lib/code2pdf/convert_to_pdf.rb +34 -23
- data/lib/code2pdf/version.rb +1 -1
- data/spec/code2pdf/convert_to_pdf_spec.rb +13 -10
- data/spec/fixtures/hello_world/lib/goodbye.rb +1 -1
- data/spec/fixtures/hello_world/tmp.txt +1 -1
- metadata +95 -143
- data/README.textile +0 -64
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4941f0a5f601ad6095ff1974786411e65b1a77cc
|
4
|
+
data.tar.gz: 61cde353d6a96c7181475fc1ad065660b0ade4e8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ebb4244b65d10af3ae6f7e9ed142f66f8fa7df8922a41a673c5252c27656e3ad9bb63c3e1a235a95f9b0ea81f3dd6a4848e2721cead6d7e2e55c905c19d4c297
|
7
|
+
data.tar.gz: fd7fa00878664bc894745801f962ca868cefa9f6c7a718aaac0d2c15f669fec3c17d7ee02fe674617146ffb7a128cf4c90c70a5d1a2da08a7610caef0b5c3693
|
data/Gemfile.lock
CHANGED
@@ -1,32 +1,49 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
code2pdf (0.
|
5
|
-
prawn
|
4
|
+
code2pdf (0.3.1)
|
5
|
+
prawn
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
diff-lcs (1.
|
12
|
-
|
13
|
-
|
14
|
-
prawn (
|
15
|
-
pdf-
|
16
|
-
ttfunk (~> 1.0
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
rspec
|
23
|
-
|
24
|
-
|
25
|
-
|
10
|
+
coderay (1.1.1)
|
11
|
+
diff-lcs (1.2.5)
|
12
|
+
method_source (0.8.2)
|
13
|
+
pdf-core (0.6.1)
|
14
|
+
prawn (2.1.0)
|
15
|
+
pdf-core (~> 0.6.1)
|
16
|
+
ttfunk (~> 1.4.0)
|
17
|
+
pry (0.10.4)
|
18
|
+
coderay (~> 1.1.0)
|
19
|
+
method_source (~> 0.8.1)
|
20
|
+
slop (~> 3.4)
|
21
|
+
rake (11.2.2)
|
22
|
+
rspec (3.5.0)
|
23
|
+
rspec-core (~> 3.5.0)
|
24
|
+
rspec-expectations (~> 3.5.0)
|
25
|
+
rspec-mocks (~> 3.5.0)
|
26
|
+
rspec-core (3.5.3)
|
27
|
+
rspec-support (~> 3.5.0)
|
28
|
+
rspec-expectations (3.5.0)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.5.0)
|
31
|
+
rspec-mocks (3.5.0)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.5.0)
|
34
|
+
rspec-support (3.5.0)
|
35
|
+
slop (3.6.0)
|
36
|
+
ttfunk (1.4.0)
|
26
37
|
|
27
38
|
PLATFORMS
|
28
39
|
ruby
|
29
40
|
|
30
41
|
DEPENDENCIES
|
42
|
+
bundler
|
31
43
|
code2pdf!
|
44
|
+
pry
|
45
|
+
rake
|
32
46
|
rspec
|
47
|
+
|
48
|
+
BUNDLED WITH
|
49
|
+
1.12.5
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# code2pdf
|
2
|
+
|
3
|
+
**code2pdf** is a simple tool for convert your source code to a PDF file.
|
4
|
+
|
5
|
+
It can be useful if you need to licence you software.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
gem install code2pdf
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
Open a terminal and run:
|
14
|
+
|
15
|
+
code2pdf
|
16
|
+
|
17
|
+
## BlackList file example:
|
18
|
+
|
19
|
+
The blacklist file must be a yaml file named `.code2pdf`, placed in project root path, containing a list of ignored files and/or directories, such as:
|
20
|
+
|
21
|
+
```yaml
|
22
|
+
:directories:
|
23
|
+
- .git
|
24
|
+
- log
|
25
|
+
- public/system
|
26
|
+
- tmp
|
27
|
+
- vendor
|
28
|
+
:files:
|
29
|
+
- .DS_Store
|
30
|
+
- database.yml
|
31
|
+
- favicon.ico
|
32
|
+
```
|
33
|
+
|
34
|
+
## PDF output example
|
35
|
+
|
36
|
+
[example.pdf](https://github.com/lucascaton/code2pdf/raw/master/examples/example.pdf)
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
* Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet
|
41
|
+
* Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it
|
42
|
+
* Fork the project
|
43
|
+
* Start a feature/bugfix branch
|
44
|
+
* Commit and push until you are happy with your contribution
|
45
|
+
* Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
|
46
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
47
|
+
|
48
|
+
## Copyright
|
49
|
+
|
50
|
+
Copyright © 2011 Lucas Caton. See LICENSE.txt for further details.
|
data/Rakefile
CHANGED
data/bin/code2pdf
CHANGED
@@ -1,16 +1,10 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
|
-
#
|
3
|
-
# code2pdf
|
4
|
-
# Created by Lucas Caton at 2011, may 31
|
5
|
-
#
|
6
2
|
|
7
3
|
require 'rubygems'
|
8
4
|
require 'optparse'
|
9
5
|
$:.push File.expand_path('../../lib', __FILE__)
|
10
6
|
require 'code2pdf'
|
11
7
|
|
12
|
-
options = {}
|
13
|
-
|
14
8
|
optparse = OptionParser.new do |opts|
|
15
9
|
opts.banner = "Usage: code2pdf <project path>\n\nYou can use flags as such:"
|
16
10
|
|
@@ -21,19 +15,19 @@ optparse = OptionParser.new do |opts|
|
|
21
15
|
|
22
16
|
if ARGV.size < 1
|
23
17
|
puts opts
|
24
|
-
exit
|
18
|
+
exit 1
|
25
19
|
end
|
26
20
|
end
|
27
21
|
|
28
22
|
begin
|
29
23
|
optparse.parse!
|
30
|
-
rescue OptionParser::InvalidOption =>
|
31
|
-
puts
|
32
|
-
exit
|
24
|
+
rescue OptionParser::InvalidOption => exception
|
25
|
+
puts exception
|
26
|
+
exit 1
|
33
27
|
end
|
34
28
|
|
35
29
|
PATH = ARGV[0].gsub(/\/$/, '')
|
36
|
-
|
37
|
-
|
30
|
+
BLACK_LIST_YAML_FILE = "#{PATH}/.code2pdf"
|
31
|
+
|
38
32
|
filename = "#{PATH.gsub(/(\.|\/)/, '_')}.pdf"
|
39
|
-
ConvertToPDF.new :
|
33
|
+
ConvertToPDF.new from: PATH, to: filename, except: BLACK_LIST_YAML_FILE
|
data/code2pdf.gemspec
CHANGED
@@ -1,24 +1,21 @@
|
|
1
|
-
|
2
|
-
$:.push File.expand_path('../lib', __FILE__)
|
3
|
-
require "code2pdf/version"
|
1
|
+
require File.expand_path('../lib/code2pdf/version', __FILE__)
|
4
2
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'code2pdf'
|
5
|
+
gem.summary = 'Convert your source code to PDF'
|
6
|
+
gem.description = 'Convert your source code to PDF'
|
7
|
+
gem.authors = %w(Lucas Caton)
|
8
|
+
gem.platform = Gem::Platform::RUBY
|
9
|
+
gem.version = Code2pdf::VERSION
|
10
|
+
gem.required_ruby_version = '>= 2.0.0'
|
11
|
+
gem.files = `git ls-files`.split("\n")
|
12
|
+
gem.test_files = `git ls-files -- {spec}/*`.split("\n")
|
13
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
|
+
gem.require_paths = %w(lib)
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
s.files = `git ls-files`.split("\n")
|
21
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
-
s.require_paths = ['lib']
|
16
|
+
gem.add_dependency 'prawn'
|
17
|
+
gem.add_development_dependency 'bundler'
|
18
|
+
gem.add_development_dependency 'pry'
|
19
|
+
gem.add_development_dependency 'rake'
|
20
|
+
gem.add_development_dependency 'rspec'
|
24
21
|
end
|
@@ -1,21 +1,23 @@
|
|
1
1
|
class ConvertToPDF
|
2
2
|
PDF_OPTIONS = {
|
3
|
-
:
|
3
|
+
page_size: 'A4'
|
4
4
|
}
|
5
5
|
|
6
6
|
def initialize(params={})
|
7
|
-
if
|
8
|
-
raise ArgumentError.new 'where
|
9
|
-
elsif
|
7
|
+
if !params.has_key?(:from) || params[:from].nil?
|
8
|
+
raise ArgumentError.new 'where is the codebase you want to convert to PDF?'
|
9
|
+
elsif !valid_directory?(params[:from])
|
10
10
|
raise LoadError.new "#{params[:from]} not found"
|
11
|
-
elsif
|
11
|
+
elsif !params.has_key?(:to) || params[:to].nil?
|
12
12
|
raise ArgumentError.new 'where should I save the generated pdf file?'
|
13
13
|
else
|
14
14
|
@from, @to = params[:from], params[:to]
|
15
|
+
|
15
16
|
if params.has_key?(:except)
|
16
17
|
@except = params[:except]
|
17
|
-
raise LoadError.new "#{@except} is not a valid blacklist
|
18
|
+
raise LoadError.new "#{@except} is not a valid blacklist YAML file" unless valid_blacklist?
|
18
19
|
end
|
20
|
+
|
19
21
|
save
|
20
22
|
end
|
21
23
|
end
|
@@ -25,11 +27,12 @@ class ConvertToPDF
|
|
25
27
|
def pdf
|
26
28
|
Prawn::Document.new PDF_OPTIONS do |pdf|
|
27
29
|
read_files.each do |file|
|
28
|
-
puts "Converting to PDF
|
30
|
+
puts "Converting to PDF: #{file.first}"
|
31
|
+
|
29
32
|
pdf.font 'Courier' do
|
30
|
-
pdf.text "<strong>File: #{file.first}</strong>", :
|
33
|
+
pdf.text "<strong>File: #{file.first}</strong>", size: 12, inline_format: true
|
31
34
|
pdf.move_down 20
|
32
|
-
pdf.text file.last, :
|
35
|
+
pdf.text file.last, size: 12, inline_format: true
|
33
36
|
pdf.move_down 40
|
34
37
|
end
|
35
38
|
end
|
@@ -41,9 +44,12 @@ class ConvertToPDF
|
|
41
44
|
end
|
42
45
|
|
43
46
|
def valid_blacklist?
|
44
|
-
return false if
|
47
|
+
return false if FileTest.directory?(@except)
|
48
|
+
|
49
|
+
return true unless File.exists?(@except)
|
50
|
+
|
45
51
|
@blacklist = YAML.load(File.read(@except))
|
46
|
-
@blacklist.has_key?(:directories)
|
52
|
+
@blacklist.has_key?(:directories) && @blacklist.has_key?(:files)
|
47
53
|
end
|
48
54
|
|
49
55
|
def in_directory_blacklist?(item_path)
|
@@ -64,32 +70,37 @@ class ConvertToPDF
|
|
64
70
|
File.exists?(file) && FileTest.file?(file)
|
65
71
|
end
|
66
72
|
|
67
|
-
def read_files(path=nil)
|
73
|
+
def read_files(path = nil)
|
68
74
|
@files ||= []
|
69
|
-
path
|
75
|
+
path ||= @from
|
76
|
+
|
70
77
|
Dir.foreach(path) do |item|
|
71
78
|
item_path = "#{path}/#{item}"
|
72
79
|
|
73
|
-
if valid_directory?(item_path)
|
74
|
-
unless in_directory_blacklist?(item_path)
|
75
|
-
read_files(item_path)
|
76
|
-
end
|
80
|
+
if valid_directory?(item_path) && !['.', '..'].include?(item)
|
81
|
+
read_files(item_path) unless in_directory_blacklist?(item_path)
|
77
82
|
elsif valid_file?(item_path)
|
78
83
|
unless in_file_blacklist?(item_path)
|
79
|
-
content =
|
84
|
+
content = process_file(item_path)
|
80
85
|
@files << [item_path, content]
|
81
86
|
end
|
82
87
|
end
|
83
88
|
end
|
89
|
+
|
84
90
|
@files
|
85
91
|
end
|
86
92
|
|
87
|
-
def
|
93
|
+
def process_file(file)
|
94
|
+
puts "Reading file #{file}"
|
95
|
+
|
88
96
|
content = ''
|
89
|
-
File.open(file,'r') do |f|
|
90
|
-
|
91
|
-
|
92
|
-
|
97
|
+
File.open(file, 'r') do |f|
|
98
|
+
if %x(file #{file}) !~ /text/
|
99
|
+
content << "<color rgb='777777'>[binary]</color>"
|
100
|
+
else
|
101
|
+
f.each_line.with_index do |line_content, line_number|
|
102
|
+
content << line_content.gsub(/</,'<').gsub(/^/, "<color rgb='AAAAAA'>#{line_number + 1}</color> ")
|
103
|
+
end
|
93
104
|
end
|
94
105
|
end
|
95
106
|
content
|
data/lib/code2pdf/version.rb
CHANGED
@@ -3,30 +3,33 @@ require 'digest/md5'
|
|
3
3
|
|
4
4
|
describe ConvertToPDF do
|
5
5
|
describe '#pdf' do
|
6
|
-
it '
|
6
|
+
it 'creates a PDF file containing all desired source code' do
|
7
7
|
path = 'spec/fixtures/hello_world'
|
8
8
|
pdf = 'spec/fixtures/hello_world.pdf'
|
9
9
|
blacklist = 'spec/fixtures/hello_world/.code2pdf'
|
10
|
-
|
11
|
-
|
12
|
-
File.
|
10
|
+
|
11
|
+
ConvertToPDF.new from: path, to: pdf, except: blacklist
|
12
|
+
expect(Digest::MD5.hexdigest(File.read(pdf))).to eq('e8c7066d59eb2097fc8900d1a8bc386b')
|
13
|
+
File.delete(pdf)
|
13
14
|
end
|
14
15
|
|
15
|
-
it '
|
16
|
-
expect{ConvertToPDF.new(:
|
16
|
+
it 'raises an error if required params are not present' do
|
17
|
+
expect { ConvertToPDF.new(foo: 'bar') }.to raise_error(ArgumentError)
|
17
18
|
end
|
18
19
|
|
19
|
-
it '
|
20
|
+
it 'raises an error if path does not exist' do
|
20
21
|
path = 'spec/fixtures/isto_non_existe_quevedo'
|
21
22
|
pdf = 'spec/fixtures/isto_non_existe_quevedo.pdf'
|
22
|
-
|
23
|
+
|
24
|
+
expect { ConvertToPDF.new(from: path, to: pdf) }.to raise_error(LoadError)
|
23
25
|
end
|
24
26
|
|
25
|
-
it '
|
27
|
+
it 'raises an error if blacklist file is not valid' do
|
26
28
|
path = 'spec/fixtures/hello_world'
|
27
29
|
pdf = 'spec/fixtures/hello_world.pdf'
|
28
30
|
blacklist = 'spec/fixtures/purplelist.yml'
|
29
|
-
|
31
|
+
|
32
|
+
expect { ConvertToPDF.new from: path, to: pdf, except: blacklist }.to raise_error(LoadError)
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
sample content which should not be included in the generated PDF file
|
metadata
CHANGED
@@ -1,194 +1,146 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code2pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
|
-
- Lucas
|
7
|
+
- Lucas
|
8
|
+
- Caton
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-09-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: prawn
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
17
|
requirements:
|
19
|
-
- -
|
18
|
+
- - ">="
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0
|
20
|
+
version: '0'
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
|
-
- -
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: bundler
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: pry
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
28
68
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0
|
69
|
+
version: '0'
|
30
70
|
- !ruby/object:Gem::Dependency
|
31
71
|
name: rspec
|
32
72
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
73
|
requirements:
|
35
|
-
- -
|
74
|
+
- - ">="
|
36
75
|
- !ruby/object:Gem::Version
|
37
76
|
version: '0'
|
38
77
|
type: :development
|
39
78
|
prerelease: false
|
40
79
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
80
|
requirements:
|
43
|
-
- -
|
81
|
+
- - ">="
|
44
82
|
- !ruby/object:Gem::Version
|
45
83
|
version: '0'
|
46
84
|
description: Convert your source code to PDF
|
47
|
-
email:
|
48
|
-
- lucascaton@gmail.com
|
85
|
+
email:
|
49
86
|
executables:
|
50
|
-
-
|
51
|
-
Y29kZTJwZGY=
|
87
|
+
- code2pdf
|
52
88
|
extensions: []
|
53
89
|
extra_rdoc_files: []
|
54
90
|
files:
|
55
|
-
-
|
56
|
-
|
57
|
-
-
|
58
|
-
|
59
|
-
-
|
60
|
-
|
61
|
-
-
|
62
|
-
|
63
|
-
-
|
64
|
-
|
65
|
-
-
|
66
|
-
|
67
|
-
-
|
68
|
-
|
69
|
-
-
|
70
|
-
|
71
|
-
-
|
72
|
-
|
73
|
-
-
|
74
|
-
|
75
|
-
-
|
76
|
-
|
77
|
-
-
|
78
|
-
|
79
|
-
-
|
80
|
-
|
81
|
-
-
|
82
|
-
|
83
|
-
-
|
84
|
-
|
85
|
-
-
|
86
|
-
|
87
|
-
|
88
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvSGVsbG9Xb3JsZC9HYW1i
|
89
|
-
aS5odG1s
|
90
|
-
- !binary |-
|
91
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvSGVsbG9Xb3JsZC9Hb29k
|
92
|
-
YnllLmh0bWw=
|
93
|
-
- !binary |-
|
94
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvSGVsbG9Xb3JsZC9IZWxv
|
95
|
-
Lmh0bWw=
|
96
|
-
- !binary |-
|
97
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvY3JlYXRlZC5yaWQ=
|
98
|
-
- !binary |-
|
99
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvaW5kZXguaHRtbA==
|
100
|
-
- !binary |-
|
101
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvbGliL2dhbWJpX3JiLmh0
|
102
|
-
bWw=
|
103
|
-
- !binary |-
|
104
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvbGliL2dvb2RieWVfcmIu
|
105
|
-
aHRtbA==
|
106
|
-
- !binary |-
|
107
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvbGliL2hlbGxvX3JiLmh0
|
108
|
-
bWw=
|
109
|
-
- !binary |-
|
110
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvcmRvYy5jc3M=
|
111
|
-
- !binary |-
|
112
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvdG1wX3R4dC5odG1s
|
113
|
-
- !binary |-
|
114
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9saWIvZ2FtYmkucmI=
|
115
|
-
- !binary |-
|
116
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9saWIvZ29vZGJ5ZS5yYg==
|
117
|
-
- !binary |-
|
118
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9saWIvaGVsbG8ucmI=
|
119
|
-
- !binary |-
|
120
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC90bXAudHh0
|
121
|
-
- !binary |-
|
122
|
-
c3BlYy9maXh0dXJlcy9wdXJwbGVsaXN0LnltbA==
|
123
|
-
- !binary |-
|
124
|
-
c3BlYy9zcGVjX2hlbHBlci5yYg==
|
125
|
-
homepage: http://blog.lucascaton.com.br/
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/code2pdf
|
99
|
+
- code2pdf.gemspec
|
100
|
+
- examples/example.pdf
|
101
|
+
- lib/code2pdf.rb
|
102
|
+
- lib/code2pdf/convert_to_pdf.rb
|
103
|
+
- lib/code2pdf/version.rb
|
104
|
+
- spec/code2pdf/convert_to_pdf_spec.rb
|
105
|
+
- spec/fixtures/hello_world/.code2pdf
|
106
|
+
- spec/fixtures/hello_world/doc/HelloWorld.html
|
107
|
+
- spec/fixtures/hello_world/doc/HelloWorld/Gambi.html
|
108
|
+
- spec/fixtures/hello_world/doc/HelloWorld/Goodbye.html
|
109
|
+
- spec/fixtures/hello_world/doc/HelloWorld/Helo.html
|
110
|
+
- spec/fixtures/hello_world/doc/created.rid
|
111
|
+
- spec/fixtures/hello_world/doc/index.html
|
112
|
+
- spec/fixtures/hello_world/doc/lib/gambi_rb.html
|
113
|
+
- spec/fixtures/hello_world/doc/lib/goodbye_rb.html
|
114
|
+
- spec/fixtures/hello_world/doc/lib/hello_rb.html
|
115
|
+
- spec/fixtures/hello_world/doc/rdoc.css
|
116
|
+
- spec/fixtures/hello_world/doc/tmp_txt.html
|
117
|
+
- spec/fixtures/hello_world/lib/gambi.rb
|
118
|
+
- spec/fixtures/hello_world/lib/goodbye.rb
|
119
|
+
- spec/fixtures/hello_world/lib/hello.rb
|
120
|
+
- spec/fixtures/hello_world/tmp.txt
|
121
|
+
- spec/fixtures/purplelist.yml
|
122
|
+
- spec/spec_helper.rb
|
123
|
+
homepage:
|
126
124
|
licenses: []
|
125
|
+
metadata: {}
|
127
126
|
post_install_message:
|
128
127
|
rdoc_options: []
|
129
128
|
require_paths:
|
130
129
|
- lib
|
131
130
|
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
-
none: false
|
133
131
|
requirements:
|
134
|
-
- -
|
132
|
+
- - ">="
|
135
133
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
134
|
+
version: 2.0.0
|
137
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
136
|
requirements:
|
140
|
-
- -
|
137
|
+
- - ">="
|
141
138
|
- !ruby/object:Gem::Version
|
142
139
|
version: '0'
|
143
140
|
requirements: []
|
144
|
-
rubyforge_project:
|
145
|
-
rubygems_version:
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 2.6.6
|
146
143
|
signing_key:
|
147
|
-
specification_version:
|
144
|
+
specification_version: 4
|
148
145
|
summary: Convert your source code to PDF
|
149
|
-
test_files:
|
150
|
-
- !binary |-
|
151
|
-
c3BlYy9jb2RlMnBkZi9jb252ZXJ0X3RvX3BkZl9zcGVjLnJi
|
152
|
-
- !binary |-
|
153
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC8uY29kZTJwZGY=
|
154
|
-
- !binary |-
|
155
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvSGVsbG9Xb3JsZC5odG1s
|
156
|
-
- !binary |-
|
157
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvSGVsbG9Xb3JsZC9HYW1i
|
158
|
-
aS5odG1s
|
159
|
-
- !binary |-
|
160
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvSGVsbG9Xb3JsZC9Hb29k
|
161
|
-
YnllLmh0bWw=
|
162
|
-
- !binary |-
|
163
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvSGVsbG9Xb3JsZC9IZWxv
|
164
|
-
Lmh0bWw=
|
165
|
-
- !binary |-
|
166
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvY3JlYXRlZC5yaWQ=
|
167
|
-
- !binary |-
|
168
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvaW5kZXguaHRtbA==
|
169
|
-
- !binary |-
|
170
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvbGliL2dhbWJpX3JiLmh0
|
171
|
-
bWw=
|
172
|
-
- !binary |-
|
173
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvbGliL2dvb2RieWVfcmIu
|
174
|
-
aHRtbA==
|
175
|
-
- !binary |-
|
176
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvbGliL2hlbGxvX3JiLmh0
|
177
|
-
bWw=
|
178
|
-
- !binary |-
|
179
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvcmRvYy5jc3M=
|
180
|
-
- !binary |-
|
181
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9kb2MvdG1wX3R4dC5odG1s
|
182
|
-
- !binary |-
|
183
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9saWIvZ2FtYmkucmI=
|
184
|
-
- !binary |-
|
185
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9saWIvZ29vZGJ5ZS5yYg==
|
186
|
-
- !binary |-
|
187
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC9saWIvaGVsbG8ucmI=
|
188
|
-
- !binary |-
|
189
|
-
c3BlYy9maXh0dXJlcy9oZWxsb193b3JsZC90bXAudHh0
|
190
|
-
- !binary |-
|
191
|
-
c3BlYy9maXh0dXJlcy9wdXJwbGVsaXN0LnltbA==
|
192
|
-
- !binary |-
|
193
|
-
c3BlYy9zcGVjX2hlbHBlci5yYg==
|
194
|
-
has_rdoc:
|
146
|
+
test_files: []
|
data/README.textile
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
h1. About
|
2
|
-
|
3
|
-
code2pdf is a simple tool for convert your source code to a PDF file.
|
4
|
-
|
5
|
-
It can be useful if you need to licence you software.
|
6
|
-
|
7
|
-
h1. Installation
|
8
|
-
|
9
|
-
<pre><code>gem install code2pdf</code></pre>
|
10
|
-
|
11
|
-
h1. Usage
|
12
|
-
|
13
|
-
Open a terminal and run:
|
14
|
-
|
15
|
-
<pre><code>code2pdf <project path></code></pre>
|
16
|
-
|
17
|
-
h2. BlackList file example:
|
18
|
-
|
19
|
-
The blacklist file must be a yaml file, named .code2pdf and it should be located in <project path> root, containing a list of ignored files and/or directories, such as:
|
20
|
-
<pre><code>:directories:
|
21
|
-
- .git
|
22
|
-
- db/migrate
|
23
|
-
- doc
|
24
|
-
- log
|
25
|
-
- public/images
|
26
|
-
- public/system
|
27
|
-
- script
|
28
|
-
- spec
|
29
|
-
- test
|
30
|
-
- tmp
|
31
|
-
- vendor
|
32
|
-
:files:
|
33
|
-
- .DS_Store
|
34
|
-
- .eprj
|
35
|
-
- .gitignore
|
36
|
-
- .rspec
|
37
|
-
- .rvmrc
|
38
|
-
- database.yml
|
39
|
-
- development.sqlite3
|
40
|
-
- application.yml
|
41
|
-
- favicon.ico
|
42
|
-
- controls.js
|
43
|
-
- dragdrop.js
|
44
|
-
- effects.js
|
45
|
-
- prototype.js
|
46
|
-
- rails.js</code></pre>
|
47
|
-
|
48
|
-
h1. PDF output example
|
49
|
-
|
50
|
-
"example.pdf":https://github.com/lucascaton/code2pdf/raw/master/examples/example.pdf
|
51
|
-
|
52
|
-
h1. Contributing to Lucas Caton
|
53
|
-
|
54
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
55
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
56
|
-
* Fork the project
|
57
|
-
* Start a feature/bugfix branch
|
58
|
-
* Commit and push until you are happy with your contribution
|
59
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
60
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
61
|
-
|
62
|
-
h2. Copyright
|
63
|
-
|
64
|
-
Copyright (c) 2011 Lucas Caton. See LICENSE.txt for further details.
|