unienv 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/unienv/version.rb +1 -1
  3. data/lib/unienv.rb +23 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9ceec0de1f1a728b6dc727425517ac8c27bc9f3
4
- data.tar.gz: 187230ed880ff60eda9c2c09592374b75276df8c
3
+ metadata.gz: 0c7d4e94248a9aa7fae797c859dbf344d9bd4ff4
4
+ data.tar.gz: 1084cc9063734945e8558c4eef5babc6325c70af
5
5
  SHA512:
6
- metadata.gz: c3eb3b359ac46178b692105a936709761519f68b9abbd7b600fed9ca9f6a52fea9961f1a1582828cc86c46c1c7cc7c74b9b59ae063381bcfaa9c76edf029c44d
7
- data.tar.gz: 2c4065620a8e535109e6f29f7a9d08e30ad95d8db1246837e60049e9bb1d4da02a91222cba3485a38072cae860ea716ad86c587e13520f71f0f9776ecd5adf26
6
+ metadata.gz: 5685736f1c90687d4c6aa713f617e4edd6c4a7f2a1f8a6356159471216186b32a318cb1a56fba62763c5adda7c6f41a3fbb5f9a748c94a1ca5dafe57019803cc
7
+ data.tar.gz: c18be530e284675149dd81fa1f5951b9b415eeeec31160d2979ae70bf308281cdc5b42f12ef7efb14cec58c478fe7d906df0179fa0d791810e4000deea88e2f2
@@ -1,3 +1,3 @@
1
1
  module UniEnv
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unienv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - fum1h1ro