|
1 | 1 | #!/usr/bin/ruby |
2 | | -#exec 'export LANG="en_US.UTF-8"' |
3 | | -#exec 'export LC_ALL="en_US.UTF-8"' |
4 | | -#exec 'export LANGUAGE="en_US.UTF-8' |
5 | | -#if RUBY_VERSION =~ /1.9/ |
6 | | -# Encoding.default_external = Encoding::UTF_8 |
7 | | -# Encoding.default_internal = Encoding::UTF_8 |
8 | | -#end |
| 2 | +exec 'export LANG="en_US.UTF-8"' |
| 3 | +exec 'export LC_ALL="en_US.UTF-8"' |
| 4 | +exec 'export LANGUAGE="en_US.UTF-8' |
| 5 | +if RUBY_VERSION =~ /1.9/ |
| 6 | + Encoding.default_external = Encoding::UTF_8 |
| 7 | + Encoding.default_internal = Encoding::UTF_8 |
| 8 | +end |
9 | 9 |
|
10 | 10 | require 'pathname' |
11 | 11 | require 'xcodeproj' |
@@ -63,7 +63,7 @@ def file (name) |
63 | 63 | txtM = "-(NSString*)"+name+" { return @\""+name+"\"; } |
64 | 64 | -(NSString*)"+name+" { return [[NSBundle "+@CURRENT_BUNDLE+"] pathForResource:@\""+name+"\" ofType:@\""+suffix+"\"]; } |
65 | 65 | " |
66 | | - |
| 66 | + |
67 | 67 | writeOCFile(fph,txtH,fpm,txtM) |
68 | 68 | end |
69 | 69 | def storyboard (name) |
@@ -166,7 +166,7 @@ def newRFileFile () |
166 | 166 | fpm = File.dirname(__FILE__) + "/RFile.m" |
167 | 167 | txtH = "#import <Foundation/Foundation.h> |
168 | 168 | #import <UIKit/UIKit.h> |
169 | | - |
| 169 | +
|
170 | 170 | @interface RFile : NSObject |
171 | 171 | "+@NORMAN_XCODE_TAG+" |
172 | 172 | @end" |
@@ -256,14 +256,14 @@ def traverse_xcasssets_dir(file_path) |
256 | 256 | else |
257 | 257 | end |
258 | 258 | end |
259 | | - |
| 259 | + |
260 | 260 | end |
261 | 261 | #写文件 |
262 | 262 | @AllResource.each do |path| |
263 | | - |
| 263 | + |
264 | 264 | rs_name = File::basename(path) |
265 | 265 | rs_name = rs_name.gsub(/@2x|@3x/, '@2x'=>'','@3x'=>'') |
266 | | - |
| 266 | + |
267 | 267 | if rs_name.end_with?(".xib") then |
268 | 268 | xib(rs_name) |
269 | 269 | elsif rs_name.end_with?(".png",".tiff",".jpg") then |
|
0 commit comments