xcode_template_maker 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/file_definition.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
class FileDefinition
|
2
2
|
attr_accessor :input_path, :group_path, :output_path, :include_in_target
|
3
3
|
|
4
|
+
@@extensions_to_include_in_target = ["c", "m", "sh"]
|
5
|
+
|
4
6
|
def self.build(project_root, file_path)
|
5
7
|
relative_file_path = file_path.gsub("#{File.expand_path(project_root)}/", "")
|
6
|
-
include_in_target =
|
8
|
+
include_in_target = @@extensions_to_include_in_target.any? {|ext| relative_file_path.end_with?(ext)}
|
7
9
|
FileDefinition.new({
|
8
10
|
:input_path => relative_file_path,
|
9
11
|
:group_path => File.dirname(relative_file_path),
|
@@ -23,7 +23,7 @@ class FileTemplateExporter
|
|
23
23
|
|
24
24
|
def file_definition_list_as_xml
|
25
25
|
file_definitions.collect do |file_definition|
|
26
|
-
"<string>#{file_definition.
|
26
|
+
"<string>#{file_definition.output_path}</string>"
|
27
27
|
end.join("\n")
|
28
28
|
end
|
29
29
|
|
@@ -37,7 +37,7 @@ class FileTemplateExporter
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def include_in_target_string(file_definition)
|
40
|
-
file_definition.include_in_target? ? "" : "<key>TargetIndices</key>\n<array
|
40
|
+
file_definition.include_in_target? ? "" : "<key>TargetIndices</key>\n<array/>"
|
41
41
|
end
|
42
42
|
|
43
43
|
def group_path_to_xml(group_path)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcode_template_maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Much easier way to create templates for Xcode than editing the xml
|
15
15
|
email:
|