unienv 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unienv/version.rb +1 -1
- data/lib/unienv.rb +23 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c7d4e94248a9aa7fae797c859dbf344d9bd4ff4
|
4
|
+
data.tar.gz: 1084cc9063734945e8558c4eef5babc6325c70af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5685736f1c90687d4c6aa713f617e4edd6c4a7f2a1f8a6356159471216186b32a318cb1a56fba62763c5adda7c6f41a3fbb5f9a748c94a1ca5dafe57019803cc
|
7
|
+
data.tar.gz: c18be530e284675149dd81fa1f5951b9b415eeeec31160d2979ae70bf308281cdc5b42f12ef7efb14cec58c478fe7d906df0179fa0d791810e4000deea88e2f2
|
data/lib/unienv/version.rb
CHANGED
data/lib/unienv.rb
CHANGED
@@ -160,6 +160,16 @@ module UniEnv
|
|
160
160
|
end
|
161
161
|
printf("Recv: %dMB\n", size / (1024 * 1024))
|
162
162
|
end
|
163
|
+
def self.get_projversion
|
164
|
+
Dir.glob("**/ProjectVersion.txt") do |e|
|
165
|
+
File.open(e, "r").readlines.each do |t|
|
166
|
+
if t.strip.chomp =~ /\Am_EditorVersion:\s+(.+)\Z/
|
167
|
+
return $1
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
''
|
172
|
+
end
|
163
173
|
|
164
174
|
|
165
175
|
end
|
@@ -241,6 +251,19 @@ command :select do |c|
|
|
241
251
|
end
|
242
252
|
end
|
243
253
|
|
254
|
+
command :open do |c|
|
255
|
+
c.syntax = 'unienv open'
|
256
|
+
c.summary = 'Read Unity version from "ProjectVersion.txt", and open project by specified version'
|
257
|
+
c.action do |args, options|
|
258
|
+
ver = UniEnv.get_projversion
|
259
|
+
list = UniEnv.enum_installed
|
260
|
+
if list.has_key?(ver)
|
261
|
+
system "#{list[ver]}/Unity.app/Contents/MacOS/Unity -projectPath #{Dir.pwd}"
|
262
|
+
else
|
263
|
+
raise "not installed #{ver}"
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
244
267
|
|
245
268
|
|
246
269
|
command :fetch do |c|
|