Compare commits

..

No commits in common. "b60f03082448898e0be14ca7c0c908d9ce7aa905" and "d39d597128fa669199227b29f4dce9f3ed2233a9" have entirely different histories.

5 changed files with 20 additions and 25 deletions

View file

@ -12,11 +12,10 @@ ignore_list:
- complex/ignore2 - complex/ignore2
# Path to the output file (if null, output to STDOUT) # Path to the output file (if null, output to STDOUT)
output_path: complex_output.txt output_file_path: complex_output.txt
prompt: # Optional: Path to a file containing the header prompt
# Optional: Path to a file containing the header prompt header_prompt_file_path: null
header_path: null
# Optional: Path to a file containing the footer prompt # Optional: Path to a file containing the footer prompt
footer_path: null footer_prompt_file_path: null

View file

@ -11,11 +11,10 @@ ignore_list:
- simple/ignore - simple/ignore
# Path to the output file (if null, output to STDOUT) # Path to the output file (if null, output to STDOUT)
output_path: simple_output.txt output_file_path: simple_output.txt
prompt: # Optional: Path to a file containing the header prompt
# Optional: Path to a file containing the header prompt header_prompt_file_path: null
header_path: null
# Optional: Path to a file containing the footer prompt # Optional: Path to a file containing the footer prompt
footer_path: null footer_prompt_file_path: null

View file

@ -50,7 +50,7 @@ describe CodePreloader::Config do
config.subcommand.should eq(Config::Subcommand::Pack) config.subcommand.should eq(Config::Subcommand::Pack)
config.pack_options.should be_truthy config.pack_options.should be_truthy
config.pack_options.try do |opts| config.pack_options.try do |opts|
opts.source_list.should eq ["path/to/repo1", "path/to/repo2"] opts.repository_path_list.should eq ["path/to/repo1", "path/to/repo2"]
end end
end end
@ -72,7 +72,7 @@ describe CodePreloader::Config do
config.subcommand.should eq(Config::Subcommand::Pack) config.subcommand.should eq(Config::Subcommand::Pack)
config.pack_options.should be_truthy config.pack_options.should be_truthy
config.pack_options.try do |opts| config.pack_options.try do |opts|
opts.output_path.should eq "output.txt" opts.output_file_path.should eq "output.txt"
end end
end end
@ -88,9 +88,9 @@ describe CodePreloader::Config do
# Assuming the simple_config.yml has specific settings # Assuming the simple_config.yml has specific settings
config.pack_options.should be_truthy config.pack_options.should be_truthy
config.pack_options.try do |opts| config.pack_options.try do |opts|
opts.source_list.should eq ["path/to/repo"] opts.repository_path_list.should eq ["path/to/repo"]
opts.ignore_list.should eq ["simple/ignore"] opts.ignore_list.should eq ["simple/ignore"]
opts.output_path.should eq "simple_output.txt" opts.output_file_path.should eq "simple_output.txt"
end end
end end
@ -103,9 +103,9 @@ describe CodePreloader::Config do
# Assuming the complex_config.yml has specific settings # Assuming the complex_config.yml has specific settings
config.pack_options.should be_truthy config.pack_options.should be_truthy
config.pack_options.try do |opts| config.pack_options.try do |opts|
opts.source_list.should eq [repo_path] opts.repository_path_list.should eq [repo_path]
opts.ignore_list.should eq ["complex/ignore1", "complex/ignore2"] opts.ignore_list.should eq ["complex/ignore1", "complex/ignore2"]
opts.output_path.should eq "complex_output.txt" opts.output_file_path.should eq "complex_output.txt"
end end
end end

View file

@ -1,5 +1,4 @@
require "spec" require "spec"
ENV["CODE_PRELOADER_DETECT"] = "no" # require "../src/"

View file

@ -86,10 +86,8 @@ module CodePreloader
def parse_pack_options(parser) def parse_pack_options(parser)
@pack_options = PackOptions.new @pack_options = PackOptions.new
unless ENV["CODE_PRELOADER_DETECT"]? =~ /(no|false|0)/i config_file = detect_config_file
config_file = detect_config_file config_file.try { |path| load_pack_config(path) }
config_file.try { |path| load_pack_config(path) }
end
parser.banner = [ parser.banner = [
"Usage: code-preloader pack [options] DIR ...\n", "Usage: code-preloader pack [options] DIR ...\n",
@ -101,7 +99,7 @@ module CodePreloader
parser.on( parser.on(
"-c FILE", "-c FILE",
"--config=FILE", "--config=FILE",
"Load parameters from FILE\n(default: autodetect)" "Load parameters from FILE\n(default: \".code_preload.yml\", if present)"
) do |config_file| ) do |config_file|
@pack_options.try { |opt| load_pack_config(config_file) } @pack_options.try { |opt| load_pack_config(config_file) }
end end