88
88
"zh_TW" => "臺灣華語" # Chinese (Traditional, Taiwan)
89
89
]
90
90
91
- FileUtils ::rm_rf "#{ Paths . qt_gui_path } /help/"
92
- FileUtils ::mkdir "#{ Paths . qt_gui_path } /help/"
91
+ FileUtils ::rm_rf "#{ SonicPi :: Paths . qt_gui_path } /help/"
92
+ FileUtils ::mkdir "#{ SonicPi :: Paths . qt_gui_path } /help/"
93
93
94
- FileUtils ::rm_rf "#{ Paths . qt_gui_path } /info/"
95
- FileUtils ::mkdir "#{ Paths . qt_gui_path } /info/"
94
+ FileUtils ::rm_rf "#{ SonicPi :: Paths . qt_gui_path } /info/"
95
+ FileUtils ::mkdir "#{ SonicPi :: Paths . qt_gui_path } /info/"
96
96
97
- FileUtils ::rm_rf "#{ Paths . qt_gui_path } /book/"
98
- FileUtils ::mkdir "#{ Paths . qt_gui_path } /book/"
97
+ FileUtils ::rm_rf "#{ SonicPi :: Paths . qt_gui_path } /book/"
98
+ FileUtils ::mkdir "#{ SonicPi :: Paths . qt_gui_path } /book/"
99
99
100
100
docs = [ ]
101
101
filenames = [ ]
173
173
174
174
filenames << filename
175
175
176
- File . open ( "#{ Paths . qt_gui_path } /#{ filename } " , 'w' ) do |f |
176
+ File . open ( "#{ SonicPi :: Paths . qt_gui_path } /#{ filename } " , 'w' ) do |f |
177
177
f << "#{ doc } "
178
178
end
179
179
198
198
book_body = book [ /<body.*?>/ ]
199
199
book . gsub! ( /<\/ ?body.*?>/ , '' )
200
200
book . gsub! ( /<meta http-equiv.*?>/ , '' )
201
- File . open ( "#{ Paths . qt_gui_path } /book/Sonic Pi - #{ name . capitalize } " + ( lang != "en" ? " (#{ lang } )" : "" ) + ".html" , 'w' ) do |f |
201
+ File . open ( "#{ SonicPi :: Paths . qt_gui_path } /book/Sonic Pi - #{ name . capitalize } " + ( lang != "en" ? " (#{ lang } )" : "" ) + ".html" , 'w' ) do |f |
202
202
f << "<link rel=\" stylesheet\" href=\" ../theme/light/doc-styles.css\" type=\" text/css\" />\n "
203
203
f << "<meta http-equiv=\" Content-Type\" content=\" text/html; charset=utf-8\" />\n \n "
204
204
f << book_body << "\n "
219
219
docs << "\n // language #{ lang } \n "
220
220
tutorial_html_map = { }
221
221
if lang == "en" then
222
- markdown_path = Paths . tutorial_path
222
+ markdown_path = SonicPi :: Paths . tutorial_path
223
223
else
224
- markdown_path = File . expand_path ( "../generated/#{ lang } /tutorial" , Paths . tutorial_path )
224
+ markdown_path = File . expand_path ( "../generated/#{ lang } /tutorial" , SonicPi :: Paths . tutorial_path )
225
225
end
226
226
Dir [ "#{ markdown_path } /*.md" ] . sort . each do |path |
227
227
f = File . open ( path , 'r:UTF-8' )
242
242
example_html_map = { }
243
243
example_dirs = [ "Apprentice" , "Illusionist" , "Magician" , "Sorcerer" , "Wizard" , "Algomancer" ]
244
244
example_dirs . each do |ex_dir |
245
- Dir [ "#{ Paths . examples_path } /#{ ex_dir . downcase } /*.rb" ] . sort . each do |path |
245
+ Dir [ "#{ SonicPi :: Paths . examples_path } /#{ ex_dir . downcase } /*.rb" ] . sort . each do |path |
246
246
bname = File . basename ( path , ".rb" )
247
247
bname = ActiveSupport ::Inflector . titleize ( bname )
248
248
name = "[#{ ex_dir } ] #{ bname } "
270
270
# before the generic language code,
271
271
# e.g., "de_CH" should be handled before "de"
272
272
languages =
273
- Dir [ File . expand_path ( "../lang/sonic-pi-tutorial-*.po" , Paths . tutorial_path ) ] .
273
+ Dir [ File . expand_path ( "../lang/sonic-pi-tutorial-*.po" , SonicPi :: Paths . tutorial_path ) ] .
274
274
map { |p | File . basename ( p ) . gsub ( /sonic-pi-tutorial-(.*?).po/ , '\1' ) } .
275
275
sort_by { |n | [ -n . length , n ] }
276
276
@@ -339,7 +339,7 @@ def generate_ui_lang_names
339
339
locale_arrays << "\n };\n "
340
340
341
341
# Write the map to lang_list.h
342
- content = File . readlines ( "#{ Paths . qt_gui_path } /utils/lang_list.tmpl" )
342
+ content = File . readlines ( "#{ SonicPi :: Paths . qt_gui_path } /utils/lang_list.tmpl" )
343
343
lang_names_generated = content . take_while { |line | !line . start_with? ( "// AUTO-GENERATED" ) }
344
344
lang_names_generated << "// AUTO-GENERATED HEADER FILE\n "
345
345
lang_names_generated << "// Do not add any code to this file\n "
@@ -351,7 +351,7 @@ def generate_ui_lang_names
351
351
lang_names_generated << locale_arrays . join ( )
352
352
lang_names_generated << "#endif\n "
353
353
354
- File . open ( "#{ Paths . qt_gui_path } /utils/lang_list.h" , 'w' ) do |f |
354
+ File . open ( "#{ SonicPi :: Paths . qt_gui_path } /utils/lang_list.h" , 'w' ) do |f |
355
355
f << lang_names_generated . join ( )
356
356
end
357
357
end
@@ -361,7 +361,7 @@ def generate_ui_lang_names
361
361
if options [ :output_name ] then
362
362
cpp = options [ :output_name ]
363
363
else
364
- cpp = "#{ Paths . qt_gui_path } /ruby_help.h"
364
+ cpp = "#{ SonicPi :: Paths . qt_gui_path } /ruby_help.h"
365
365
end
366
366
367
367
content = File . readlines ( cpp )
@@ -378,7 +378,7 @@ def generate_ui_lang_names
378
378
f << new_content . join
379
379
end
380
380
381
- File . open ( "#{ Paths . qt_gui_path } /help_files.qrc" , 'w' ) do |f |
381
+ File . open ( "#{ SonicPi :: Paths . qt_gui_path } /help_files.qrc" , 'w' ) do |f |
382
382
f << "<RCC>\n <qresource prefix=\" /\" >\n "
383
383
f << filenames . map { |n | " <file>#{ n } </file>\n " } . join
384
384
f << " </qresource>\n </RCC>\n "
@@ -390,11 +390,11 @@ def generate_ui_lang_names
390
390
###
391
391
392
392
info_sources = [ "CHANGELOG.md" , "CONTRIBUTORS.md" , "COMMUNITY.md" , "CORETEAM.html" , "LICENSE.md" ]
393
- outputdir = "#{ Paths . qt_gui_path } /info"
393
+ outputdir = File . absolute_path ( "#{ SonicPi :: Paths . qt_gui_path } /info" )
394
394
395
395
info_sources . each do |src |
396
396
397
- input_path = "#{ root_path } /#{ src } "
397
+ input_path = File . absolute_path ( "#{ SonicPi :: Paths . root_path } /#{ src } " )
398
398
base = File . basename ( input_path )
399
399
m = base . match /(.*)\. (.*)/
400
400
bn = m [ 1 ]
0 commit comments