rebuild 0.0.3 → 0.0.4.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rebuild/bootstrap.rb +23 -1
- data/lib/rebuild/cli.rb +7 -1
- data/lib/rebuild/version.rb +1 -1
- data/script/click_agree.scpt +24 -0
- data/script/click_finish.scpt +22 -0
- data/script/click_install.scpt +24 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 161e98d3124980dad705d57d12bf58f4a16dfea3
|
4
|
+
data.tar.gz: 8704a6e0a69dd76caac6f4b9260fbd3694a35165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05123b168b5b6c6283aab7e7a7920c739852f9cad42eba2cf72520078e8945a8b7154a16d66c44b444e6a6ad08f277baa5e6b91f9b418ec070a0397704759478
|
7
|
+
data.tar.gz: 6b6f59b63d8db6c416cff9f5ffcc4ec298a1c5b0f6829d1016be0a244a9d19170a2ac3b64915dfe4edd1fca72925cfbac3647ffd7c5ac386cb706c61941be66d
|
data/README.md
CHANGED
data/lib/rebuild/bootstrap.rb
CHANGED
@@ -1,7 +1,29 @@
|
|
1
1
|
require 'rebuild'
|
2
|
+
require 'open3'
|
2
3
|
|
3
4
|
module Rebuild
|
4
5
|
class Bootstrap
|
5
|
-
|
6
|
+
def installed?
|
7
|
+
system('xcode-select -p > /dev/null')
|
8
|
+
end
|
9
|
+
|
10
|
+
def install
|
11
|
+
return if installed?
|
12
|
+
|
13
|
+
`xcode-select --install`
|
14
|
+
execute_scpt('click_install')
|
15
|
+
execute_scpt('click_agree')
|
16
|
+
|
17
|
+
sleep 5 until installed?
|
18
|
+
execute_scpt('click_finish')
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def execute_scpt(name)
|
24
|
+
script_dir = File.expand_path('../../../script', __FILE__)
|
25
|
+
script_path = File.join(script_dir, "#{name}.scpt")
|
26
|
+
`osascript #{script_path}`
|
27
|
+
end
|
6
28
|
end
|
7
29
|
end
|
data/lib/rebuild/cli.rb
CHANGED
@@ -5,7 +5,13 @@ module Rebuild
|
|
5
5
|
class CLI
|
6
6
|
class << self
|
7
7
|
def start
|
8
|
-
|
8
|
+
bootstrap = Bootstrap.new
|
9
|
+
if bootstrap.installed?
|
10
|
+
show_usage if ARGV.empty?
|
11
|
+
else
|
12
|
+
bootstrap.install
|
13
|
+
end
|
14
|
+
return if ARGV.empty?
|
9
15
|
|
10
16
|
repo_path = Repository.new(ARGV.first).fetch
|
11
17
|
primary_scripts = STDIN.gets unless STDIN.isatty
|
data/lib/rebuild/version.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env osascript
|
2
|
+
|
3
|
+
-- Second: Click Agree Button
|
4
|
+
delay 2.0
|
5
|
+
|
6
|
+
set timeoutSeconds to 2.0
|
7
|
+
set uiScript to "click UI Element 3 of window 1 of application process \"Install Command Line Developer Tools\""
|
8
|
+
my doWithTimeout(uiScript, timeoutSeconds)
|
9
|
+
|
10
|
+
on doWithTimeout(uiScript, timeoutSeconds)
|
11
|
+
set endDate to (current date) + timeoutSeconds
|
12
|
+
repeat
|
13
|
+
try
|
14
|
+
run script "tell application \"System Events\"
|
15
|
+
" & uiScript & "
|
16
|
+
end tell"
|
17
|
+
exit repeat
|
18
|
+
on error errorMessage
|
19
|
+
if ((current date) > endDate) then
|
20
|
+
error "Can not " & uiScript
|
21
|
+
end if
|
22
|
+
end try
|
23
|
+
end repeat
|
24
|
+
end doWithTimeout
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env osascript
|
2
|
+
|
3
|
+
-- Third: Click Finish Button
|
4
|
+
set timeoutSeconds to 2.0
|
5
|
+
set uiScript to "click UI Element 1 of window 1 of application process \"Install Command Line Developer Tools\""
|
6
|
+
my doWithTimeout(uiScript, timeoutSeconds)
|
7
|
+
|
8
|
+
on doWithTimeout(uiScript, timeoutSeconds)
|
9
|
+
set endDate to (current date) + timeoutSeconds
|
10
|
+
repeat
|
11
|
+
try
|
12
|
+
run script "tell application \"System Events\"
|
13
|
+
" & uiScript & "
|
14
|
+
end tell"
|
15
|
+
exit repeat
|
16
|
+
on error errorMessage
|
17
|
+
if ((current date) > endDate) then
|
18
|
+
error "Can not " & uiScript
|
19
|
+
end if
|
20
|
+
end try
|
21
|
+
end repeat
|
22
|
+
end doWithTimeout
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env osascript
|
2
|
+
|
3
|
+
-- Fist: Click Install Button
|
4
|
+
delay 2.0
|
5
|
+
|
6
|
+
set timeoutSeconds to 2.0
|
7
|
+
set uiScript to "click UI Element 4 of window 1 of application process \"Install Command Line Developer Tools\""
|
8
|
+
my doWithTimeout(uiScript, timeoutSeconds)
|
9
|
+
|
10
|
+
on doWithTimeout(uiScript, timeoutSeconds)
|
11
|
+
set endDate to (current date) + timeoutSeconds
|
12
|
+
repeat
|
13
|
+
try
|
14
|
+
run script "tell application \"System Events\"
|
15
|
+
" & uiScript & "
|
16
|
+
end tell"
|
17
|
+
exit repeat
|
18
|
+
on error errorMessage
|
19
|
+
if ((current date) > endDate) then
|
20
|
+
error "Can not " & uiScript
|
21
|
+
end if
|
22
|
+
end try
|
23
|
+
end repeat
|
24
|
+
end doWithTimeout
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rebuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
@@ -73,6 +73,9 @@ files:
|
|
73
73
|
- lib/rebuild/runner.rb
|
74
74
|
- lib/rebuild/version.rb
|
75
75
|
- rebuild.gemspec
|
76
|
+
- script/click_agree.scpt
|
77
|
+
- script/click_finish.scpt
|
78
|
+
- script/click_install.scpt
|
76
79
|
homepage: https://github.com/k0kubun/rebuild
|
77
80
|
licenses:
|
78
81
|
- MIT
|
@@ -88,9 +91,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
91
|
version: '0'
|
89
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
93
|
requirements:
|
91
|
-
- - "
|
94
|
+
- - ">"
|
92
95
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
96
|
+
version: 1.3.1
|
94
97
|
requirements: []
|
95
98
|
rubyforge_project:
|
96
99
|
rubygems_version: 2.2.2
|