mvcgen 0.1.26 → 0.1.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d973719d9574f3ee9d8d446bbfe4248683e2f0d1
4
- data.tar.gz: 811de4c60f452e53cc28ff9fd6f83616499cae6d
3
+ metadata.gz: 4fb6f71d6bf04c240281b752fecb498064ef979c
4
+ data.tar.gz: b013c7c2d61a6a8c2347b26bea5a51d477e930c0
5
5
  SHA512:
6
- metadata.gz: 124958a9f1bd009694ccc9e3c5c2d68ce26bab4dab0bb842bd8ea8e82a61286bcae98dc7b3e27fdd27374a5ab261213b3bb19661e3e07f064a88d4b42ebac44c
7
- data.tar.gz: def52e3c375985097027af805bdfddb8ee2698ef6153be05d35f29730cb4180b52eb60c6a95a14f2085a6f7497d174231cb4223e5d84887fbaaac621d59795c4
6
+ metadata.gz: 6bd58a456f9cf05363b0408b4407866c5b3b57b6631a0c124ab726562e312f7dd02ffe3a2fedce7d0e4651f2f005f7a1e7cc2889c193db7e9635bf9743ae3725
7
+ data.tar.gz: 9aee4de9a80fa9ad74e65e5674162fb96cca76d5c65cceb8090e3847df1d260da4aeedc912659a7987eff0ee71adbaa83620892197745b3581b32f18712b699e
@@ -18,85 +18,88 @@ module MVCgen
18
18
  proj = Xcodeproj::Project.open(project_file)
19
19
 
20
20
  # TODO: view this to improve path files: allowable_project_paths
21
- self.add_files_togroup(proj, proj.main_group, proj.targets.first)
22
- # self.addxcodefiles(filespath,proj.main_group,proj.targets.first)
21
+ # self.add_files_togroup(filespath, proj, proj.main_group, proj.targets.first)
22
+ self.addxcodefiles(filespath,proj.main_group,proj.targets.first)
23
23
 
24
24
  proj.save
25
25
  puts "Finish adding files"
26
26
  end
27
27
 
28
28
  def self.is_resource_group(file)
29
- extname= file[/\.[^\.]+$/]
29
+ extname = file[/\.[^\.]+$/]
30
30
  if extname == '.bundle' || extname == '.xcassets' then
31
31
  return true
32
32
  end
33
33
  return false
34
34
  end
35
35
 
36
- def self.add_files_togroup(project, group, target)
36
+ # def self.add_files_togroup(direc, project, group, target)
37
+ # if File.exist?(Dir.glob(direc))
37
38
 
38
- if File.exist?(File.realpath(group.path))
39
+ # Dir.glob(direc) do |entry|
40
+ # filePath = File.join(group.path, entry)
39
41
 
40
- Dir.foreach(group.path) do |entry|
41
- filePath = File.join(group.path, entry)
42
+ # # puts filePath
42
43
 
43
- # puts filePath
44
+ # if filePath.to_s.end_with?(".DS_Store", ".xcconfig") then
45
+ # # ignore
44
46
 
45
- if filePath.to_s.end_with?(".DS_Store", ".xcconfig") then
46
- # ignore
47
+ # elsif filePath.to_s.end_with?(".lproj") then
48
+ # if @variant_group.nil?
49
+ # @variant_group = group.new_variant_group("Localizable.strings");
50
+ # end
51
+ # string_file = File.join(filePath, "Localizable.strings")
52
+ # fileReference = @variant_group.new_reference(string_file)
53
+ # target.add_resources([fileReference])
47
54
 
48
- elsif filePath.to_s.end_with?(".lproj") then
49
- if @variant_group.nil?
50
- @variant_group = group.new_variant_group("Localizable.strings");
51
- end
52
- string_file = File.join(filePath, "Localizable.strings")
53
- fileReference = @variant_group.new_reference(string_file)
54
- target.add_resources([fileReference])
55
+ # elsif self.is_resource_group(entry) then
56
+ # fileReference = group.new_reference(filePath)
57
+ # target.add_resources([fileReference])
58
+ # elsif !File.directory?(filePath) then
55
59
 
56
- elsif self.is_resource_group(entry) then
57
- fileReference = group.new_reference(filePath)
58
- target.add_resources([fileReference])
59
- elsif !File.directory?(filePath) then
60
+ # fileReference = group.new_reference(filePath)
61
+ # if filePath.to_s.end_with?(".swift", ".mm", ".m", ".cpp") then
62
+ # target.add_file_references([fileReference])
63
+ # elsif filePath.to_s.end_with?(".pch") then
60
64
 
61
- fileReference = group.new_reference(filePath)
62
- if filePath.to_s.end_with?(".swift", ".mm", ".m", ".cpp") then
63
- target.add_file_references([fileReference])
64
- elsif filePath.to_s.end_with?(".pch") then
65
+ # elsif filePath.to_s.end_with?("Info.plist") && entry == "Info.plist" then
65
66
 
66
- elsif filePath.to_s.end_with?("Info.plist") && entry == "Info.plist" then
67
+ # elsif filePath.to_s.end_with?(".h") then
68
+ # # target.headers_build_phase.add_file_reference(fileReference)
69
+ # elsif filePath.to_s.end_with?(".framework") || filePath.to_s.end_with?(".a") then
70
+ # target.frameworks_build_phases.add_file_reference(fileReference)
71
+ # elsif
72
+ # target.add_resources([fileReference])
73
+ # end
74
+ # elsif File.directory?(filePath) && entry != '.' && entry != '..' then
67
75
 
68
- elsif filePath.to_s.end_with?(".h") then
69
- # target.headers_build_phase.add_file_reference(fileReference)
70
- elsif filePath.to_s.end_with?(".framework") || filePath.to_s.end_with?(".a") then
71
- target.frameworks_build_phases.add_file_reference(fileReference)
72
- elsif
73
- target.add_resources([fileReference])
74
- end
75
- elsif File.directory?(filePath) && entry != '.' && entry != '..' then
76
+ # subGroup = group.find_subpath(entry, true)
77
+ # subGroup.set_source_tree(group.source_tree)
78
+ # subGroup.set_path(File.join(group.path, entry))
79
+ # add_files_togroup(project, target, subGroup)
76
80
 
77
- subGroup = group.find_subpath(entry, true)
78
- subGroup.set_source_tree(group.source_tree)
79
- subGroup.set_path(File.join(group.path, entry))
80
- add_files_togroup(project, target, subGroup)
81
-
82
- end
83
- end
84
- end
85
- end
81
+ # end
82
+ # end
83
+ # end
84
+ # end
86
85
 
87
86
  def self.addxcodefiles(direc, current_group, main_target)
88
87
  Dir.glob(direc) do |item|
89
88
  next if item == '.' or item == '.DS_Store'
90
89
  if File.directory?(item)
91
- new_folder = File.basename(item)
92
- created_group = current_group.new_group(new_folder)
93
- self.addxcodefiles("#{item}/*", created_group, main_target)
94
- elsif item == "Assets.xcassets"
95
- main_target.add_frameworks_bundles([item])
96
- break
97
- else
98
- i = current_group.new_file(item)
99
- main_target.add_file_references([i])
90
+ new_folder = File.basename(item)
91
+ created_group = current_group.new_group(new_folder)
92
+ self.addxcodefiles("#{item}/*", created_group, main_target)
93
+ elsif self.is_resource_group(item) then
94
+ fileReference = current_group.new_reference(filePath)
95
+ main_target.add_resources([fileReference])
96
+ # elsif item == "Assets.xcassets"
97
+ # main_target.add_frameworks_bundles([item])
98
+ # break
99
+ else
100
+ i = current_group.new_reference(filePath)
101
+ # i = current_group.new_file(item)
102
+ main_target.add_file_references([i])
100
103
  end
101
104
  end
102
105
  end
@@ -1,4 +1,4 @@
1
1
  module MVCgen
2
2
  NAME = "mvcgen"
3
- VERSION = "0.1.26"
3
+ VERSION = "0.1.27"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mvcgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martinez