12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/motion-settings-bundle/generator.rb', line 12
def generate
directory @root_path
strings_path = File.join(@root_path, "en.lproj")
directory strings_path
strings_file_path = File.join(strings_path, "Root.strings")
file strings_file_path do |io|
io.write <<-EOF
/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */
"Group" = "Group";
"Name" = "Name";
"none given" = "none given";
"Enabled" = "Enabled";
EOF
end
plist_file_path = File.join(@root_path, "Root.plist")
file(plist_file_path, true) do |io|
io.write({
"Title" => "Settings",
"StringsTable" => "Root",
"PreferenceSpecifiers" => @configuration.preferences
}.to_plist)
end
generate_children(@configuration.children)
end
|