Skip to content

Commit 79a7114

Browse files
committed
Get rid of "data" subdirectory for input data
1 parent c6e3a25 commit 79a7114

File tree

169 files changed

+6
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+6
-21
lines changed
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.

generate_styles.rb

+6-21
Original file line numberDiff line numberDiff line change
@@ -84,37 +84,22 @@ def title_to_styleID(title)
8484

8585
parser.parse!
8686

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

91-
# the 'data' directory contains info for each group of journals
92-
# for instance:
93-
# data/bmc
94-
# data/bmc/_template.csl --> template for those journals
95-
# data/bmc/_journals.tab --> tab-delimited list of journals + info
96-
# data/bmc/_skip.txt --> journals to skip
97-
# data/bmc/_rename.tab --> journal identifiers to rename
98-
# data/bmc/_extra.tab --> as _journals.tab; add or overwrite journals
99-
Data_dir_path = "#{This_script_dir}/data"
100-
$stderr.puts "Input:\t#{Data_dir_path}"
101-
if not File.exist? Data_dir_path
102-
$stderr.puts "WARNING: no 'data' directory found at '#{Data_dir_path}'"
103-
abort "Failed"
104-
end
105-
106-
# determine directories to parse
91+
# Determine directories to parse
10792
data_subdir_paths = []
10893
if options[:directory] != nil
109-
if File.directory? "#{Data_dir_path}/#{options[:directory]}"
94+
if File.directory? "#{This_script_dir}/#{options[:directory]}"
11095
data_subdir_paths.push("#{options[:directory]}")
11196
else
11297
$stderr.puts "WARNING: subdirectory '#{options[:directory]}' does not exist"
11398
abort "Failed"
11499
end
115100
else
116-
Dir.foreach(Data_dir_path) do |data_subdir|
117-
if File.directory? "#{Data_dir_path}/#{data_subdir}"
101+
Dir.foreach(This_script_dir) do |data_subdir|
102+
if File.file? "#{This_script_dir}/#{data_subdir}/_template.csl"
118103
data_subdir_paths.push(data_subdir)
119104
end
120105
end
@@ -168,7 +153,7 @@ def title_to_styleID(title)
168153

169154
# skip invalid entries
170155
next if data_subdir =~ /^\./
171-
data_subdir_path = "#{Data_dir_path}/#{data_subdir}"
156+
data_subdir_path = "#{This_script_dir}/#{data_subdir}"
172157
template_path = "#{data_subdir_path}/_template.csl"
173158
journals_path = "#{data_subdir_path}/_journals.tab"
174159
skip_path = "#{data_subdir_path}/_skip.txt"
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 commit comments

Comments
 (0)