xcode_template_maker 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- <key>{{INPUT_PATH}}</key>
1
+ <key>{{OUTPUT_PATH}}</key>
2
2
  <dict>
3
3
  <key>Group</key>
4
4
  <array>
5
5
  {{GROUP_PATH}}
6
6
  </array>
7
7
  <key>Path</key>
8
- <string>{{OUTPUT_PATH}}</string>
8
+ <string>{{INPUT_PATH}}</string>
9
9
  {{EXCLUDE_FROM_TARGET}}
10
10
  </dict>
@@ -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 = !relative_file_path.match(/\.[cm]$/).nil?
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.input_path}</string>"
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/>\n"
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.2
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-13 00:00:00.000000000 Z
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: