xcselect 0.0.13 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/xcselect +4 -1
- data/lib/xcselect/version.rb +1 -1
- data/lib/xcselect/xcode.rb +1 -1
- data/lib/xcselect.rb +0 -2
- metadata +3 -5
- data/lib/xcselect/xcapp.rb +0 -21
- data/lib/xcselect/xcsimulator.rb +0 -41
data/bin/xcselect
CHANGED
@@ -73,6 +73,7 @@ class Main
|
|
73
73
|
exit
|
74
74
|
end
|
75
75
|
|
76
|
+
# fix this to take an optional arg
|
76
77
|
def open_xcode
|
77
78
|
# TODO: Add conditionall code to look for a project
|
78
79
|
# and if there isn't one then just open xcode
|
@@ -83,11 +84,12 @@ class Main
|
|
83
84
|
`open -a "#{xcodepath}" "#{open_project}"`
|
84
85
|
end
|
85
86
|
|
86
|
-
# don't show line to ask for sudo pass
|
87
|
+
# don't show line to ask for sudo pass unless needed
|
87
88
|
def self.require_sudo_pass?
|
88
89
|
`sudo -n echo 1 2>&1`.chomp != "1"
|
89
90
|
end
|
90
91
|
|
92
|
+
# change the current xcode
|
91
93
|
def set_current xc
|
92
94
|
cmd = "sudo xcode-select -switch #{xc.folder}"
|
93
95
|
if Main.require_sudo_pass?
|
@@ -111,6 +113,7 @@ class Main
|
|
111
113
|
def select_line x
|
112
114
|
"#{x.version} (#{x.build}) #{x.folder} #{'[current]'.red if x.eql? current}"
|
113
115
|
end
|
116
|
+
|
114
117
|
def show_menu
|
115
118
|
puts "Please Select an Xcode install ?\n\n"
|
116
119
|
i = 0;
|
data/lib/xcselect/version.rb
CHANGED
data/lib/xcselect/xcode.rb
CHANGED
data/lib/xcselect.rb
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.13
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kim Hunter
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-
|
17
|
+
date: 2012-07-18 00:00:00 +10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -38,9 +38,7 @@ files:
|
|
38
38
|
- lib/xcselect.rb
|
39
39
|
- lib/xcselect/dir_extension.rb
|
40
40
|
- lib/xcselect/version.rb
|
41
|
-
- lib/xcselect/xcapp.rb
|
42
41
|
- lib/xcselect/xcode.rb
|
43
|
-
- lib/xcselect/xcsimulator.rb
|
44
42
|
- pkg/xcselect-0.0.1.gem
|
45
43
|
- pkg/xcselect-0.0.10.gem
|
46
44
|
- pkg/xcselect-0.0.11.gem
|
data/lib/xcselect/xcapp.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
module Xcselect
|
2
|
-
|
3
|
-
class XcApp
|
4
|
-
|
5
|
-
attr_accessor :simulator
|
6
|
-
attr_accessor :path
|
7
|
-
attr_reader :app_name
|
8
|
-
|
9
|
-
def initialize(sim, path)
|
10
|
-
@simulator = sim
|
11
|
-
@path = path
|
12
|
-
@app_name = File.basename Dir["#{path}/*.app"].first.sub /\.app$/, ''
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_s
|
16
|
-
"<#{self.class}: #{app_name}>"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
end
|
data/lib/xcselect/xcsimulator.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
module Xcselect
|
2
|
-
|
3
|
-
|
4
|
-
class XcSimulator
|
5
|
-
attr_reader :path
|
6
|
-
attr_reader :apps
|
7
|
-
|
8
|
-
def initialize(path)
|
9
|
-
@path = path
|
10
|
-
@ver = path.sub /.*\//, ''
|
11
|
-
@apps = load_apps
|
12
|
-
end
|
13
|
-
|
14
|
-
def app_folder_path
|
15
|
-
"#{@path}/Applications"
|
16
|
-
end
|
17
|
-
|
18
|
-
def load_apps
|
19
|
-
base_path = app_folder_path
|
20
|
-
Dir.entries_nodots(base_path).map {|p| XcApp.new self, "#{base_path}/#{p}" }
|
21
|
-
end
|
22
|
-
|
23
|
-
def to_s
|
24
|
-
"<#{self.class}: #{@ver} Apps:#{@apps.size}}>"
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.get_sims
|
28
|
-
self.find_sim_versions.map {|p| XcSimulator.new "#{self.simulators_base_path}/#{p}" }
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.find_sim_versions
|
32
|
-
Dir.entries_nodots(self.simulators_base_path).select {|p| p =~ /[0-9]/ }
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.simulators_base_path
|
36
|
-
File.expand_path "~/Library/Application Support/iPhone Simulator"
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|