Class: GithubExporter::Exporter
- Inherits:
-
Object
- Object
- GithubExporter::Exporter
- Defined in:
- lib/github_exporter/exporter.rb
Overview
rubocop:disable ClassLength, MethodLength
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
readonly
Returns the value of attribute base_dir.
-
#exts ⇒ Object
readonly
Returns the value of attribute exts.
-
#non_exts ⇒ Object
readonly
Returns the value of attribute non_exts.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#repo_name ⇒ Object
readonly
Returns the value of attribute repo_name.
-
#theme ⇒ Object
readonly
Returns the value of attribute theme.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#export ⇒ Object
Print and export the source from a given URL to a pdf.
-
#initialize(url, opts = {}) ⇒ Exporter
constructor
Constructor for Executor.
- #to_s ⇒ Object
Constructor Details
#initialize(url, opts = {}) ⇒ Exporter
Constructor for Executor
25 26 27 28 29 30 31 32 33 |
# File 'lib/github_exporter/exporter.rb', line 25 def initialize(url, opts = {}) @url = url @base_dir = Dir.pwd @exts = opts[:exts] || [] @non_exts = opts[:non_exts] || [] @theme = opts[:theme] || "default" @repo_name = project_name(url) @output_path = File.([base_dir, repo_name].join(File::SEPARATOR)) end |
Instance Attribute Details
#base_dir ⇒ Object (readonly)
Returns the value of attribute base_dir.
13 14 15 |
# File 'lib/github_exporter/exporter.rb', line 13 def base_dir @base_dir end |
#exts ⇒ Object (readonly)
Returns the value of attribute exts.
9 10 11 |
# File 'lib/github_exporter/exporter.rb', line 9 def exts @exts end |
#non_exts ⇒ Object (readonly)
Returns the value of attribute non_exts.
9 10 11 |
# File 'lib/github_exporter/exporter.rb', line 9 def non_exts @non_exts end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
13 14 15 |
# File 'lib/github_exporter/exporter.rb', line 13 def output_path @output_path end |
#repo_name ⇒ Object (readonly)
Returns the value of attribute repo_name.
13 14 15 |
# File 'lib/github_exporter/exporter.rb', line 13 def repo_name @repo_name end |
#theme ⇒ Object (readonly)
Returns the value of attribute theme.
9 10 11 |
# File 'lib/github_exporter/exporter.rb', line 9 def theme @theme end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/github_exporter/exporter.rb', line 9 def url @url end |
Instance Method Details
#export ⇒ Object
Print and export the source from a given URL to a pdf
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/github_exporter/exporter.rb', line 36 def export clone puts "FYI: list of extensions: #{all_extensions}" puts "FYI: list of all files : #{all_files}" files2htmls htmls2pdfs pdfs2pdf copy_output cleanup end |
#to_s ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/github_exporter/exporter.rb', line 47 def to_s " url : \#{url}\n base_dir : \#{base_dir}\n exts : \#{exts}\n non_exts : \#{non_exts}\n repo_name : \#{repo_name}\n theme : \#{theme}\n output_path : \#{output_path}\n EOT\nend\n" |