Skip to content

Commit

Permalink
Get rid of "data" subdirectory for input data
Browse files Browse the repository at this point in the history
  • Loading branch information
rmzelle committed Dec 29, 2015
1 parent c6e3a25 commit 79a7114
Show file tree
Hide file tree
Showing 169 changed files with 6 additions and 21 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 6 additions & 21 deletions generate_styles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,37 +84,22 @@ def title_to_styleID(title)

parser.parse!

# where are we?
# Print current directory
This_script_dir = File.dirname(File.expand_path(__FILE__))
$stderr.puts "Script:\t#{This_script_dir}"

# the 'data' directory contains info for each group of journals
# for instance:
# data/bmc
# data/bmc/_template.csl --> template for those journals
# data/bmc/_journals.tab --> tab-delimited list of journals + info
# data/bmc/_skip.txt --> journals to skip
# data/bmc/_rename.tab --> journal identifiers to rename
# data/bmc/_extra.tab --> as _journals.tab; add or overwrite journals
Data_dir_path = "#{This_script_dir}/data"
$stderr.puts "Input:\t#{Data_dir_path}"
if not File.exist? Data_dir_path
$stderr.puts "WARNING: no 'data' directory found at '#{Data_dir_path}'"
abort "Failed"
end

# determine directories to parse
# Determine directories to parse
data_subdir_paths = []
if options[:directory] != nil
if File.directory? "#{Data_dir_path}/#{options[:directory]}"
if File.directory? "#{This_script_dir}/#{options[:directory]}"
data_subdir_paths.push("#{options[:directory]}")
else
$stderr.puts "WARNING: subdirectory '#{options[:directory]}' does not exist"
abort "Failed"
end
else
Dir.foreach(Data_dir_path) do |data_subdir|
if File.directory? "#{Data_dir_path}/#{data_subdir}"
Dir.foreach(This_script_dir) do |data_subdir|
if File.file? "#{This_script_dir}/#{data_subdir}/_template.csl"
data_subdir_paths.push(data_subdir)
end
end
Expand Down Expand Up @@ -168,7 +153,7 @@ def title_to_styleID(title)

# skip invalid entries
next if data_subdir =~ /^\./
data_subdir_path = "#{Data_dir_path}/#{data_subdir}"
data_subdir_path = "#{This_script_dir}/#{data_subdir}"
template_path = "#{data_subdir_path}/_template.csl"
journals_path = "#{data_subdir_path}/_journals.tab"
skip_path = "#{data_subdir_path}/_skip.txt"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 79a7114

Please sign in to comment.