rebuild 0.0.5 → 0.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84abea741d92e3392e807ef47f3896a572e12ab8
4
- data.tar.gz: 92f73edba6660d2165b108457626f81f95bdd57e
3
+ metadata.gz: ef933e9450217fe4f839e1ac22c367a7a61554fe
4
+ data.tar.gz: 171e3468387786bcbe9828b0f84a1c6ecbc9a239
5
5
  SHA512:
6
- metadata.gz: bbf08461a2d1d33937b06877d89fdfb160514702108f8c607f2af3c9114cfe271d37b576f196253a78748e813cefd337dce95aad94a0f72fec27f5245344fea1
7
- data.tar.gz: c73fcb1246aa336a7cb2aa07ce36f0a8629346e46e88a36b2fc9095eb439e2f99bf034c2d3d0cd71e09e9cc17501adebcad01454534d2d97c2dab7255930164e
6
+ metadata.gz: 0f3f52f1659091a4fa7f496cbc14cb4b5f4be4df79b422f3493522c372cc4cbcffd7c45686a8d52a4f493eaca4de3ad1c2d1c0ab08aba930d4aa6ccd3c1bce85
7
+ data.tar.gz: 4b4a100f8216283c4161089ccee8b72f51890537da9b9f99f2493eb7158ab0e0d41547d971fd9637d3b99ae2720233813870716fe3ec6b6bc34817b93bab2d0f
data/lib/rebuild/cli.rb CHANGED
@@ -6,9 +6,8 @@ module Rebuild
6
6
  def start
7
7
  return show_usage if ARGV.empty? && CommandLineTools.installed?
8
8
 
9
- unless CommandLineTools.installed?
10
- CommandLineTools.install
11
- end
9
+ CommandLineTools.install unless CommandLineTools.installed?
10
+ License.agree unless License.agreed?
12
11
 
13
12
  if ARGV.any?
14
13
  stdin = STDIN.gets unless STDIN.isatty
@@ -0,0 +1,23 @@
1
+ require 'rebuild'
2
+
3
+ module Rebuild
4
+ class License
5
+ class << self
6
+ def agreed?
7
+ system('gcc 2>&1 | grep -v Agreeing > /dev/null')
8
+ end
9
+
10
+ def agree
11
+ execute_exp('agree_license')
12
+ end
13
+
14
+ private
15
+
16
+ def execute_exp(name)
17
+ script_dir = File.expand_path('../../../script', __FILE__)
18
+ script_path = File.join(script_dir, "#{name}.exp")
19
+ `sudo expect -f #{script_path}`
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Rebuild
2
- VERSION = '0.0.5'
2
+ VERSION = '0.1.0.pre'
3
3
  end
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env expect -f
2
+
3
+ set timeout -1
4
+ spawn sudo xcodebuild -license
5
+
6
+ expect {
7
+ "Password"
8
+ {
9
+ stty -echo
10
+ expect_user -re "(.*)\n"
11
+ stty echo
12
+ set pass $expect_out(1,string)
13
+ send -- "$pass\r"
14
+ exp_continue
15
+ }
16
+ "incorrect password attempts"
17
+ {
18
+ exit 1
19
+ }
20
+ "Hit the Enter key to view the license agreements"
21
+ {
22
+ send "\r"
23
+ exp_continue
24
+ }
25
+ "Press 'space' for more"
26
+ {
27
+ send " "
28
+ exp_continue
29
+ }
30
+ "By typing 'agree'"
31
+ {
32
+ send "agree\r"
33
+ exp_continue
34
+ }
35
+ }
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.5
4
+ version: 0.1.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
@@ -55,10 +55,12 @@ files:
55
55
  - lib/rebuild.rb
56
56
  - lib/rebuild/cli.rb
57
57
  - lib/rebuild/command_line_tools.rb
58
+ - lib/rebuild/license.rb
58
59
  - lib/rebuild/repository.rb
59
60
  - lib/rebuild/runner.rb
60
61
  - lib/rebuild/version.rb
61
62
  - rebuild.gemspec
63
+ - script/agree_license.exp
62
64
  - script/click_done.scpt
63
65
  - script/start_install.scpt
64
66
  homepage: https://github.com/k0kubun/rebuild
@@ -76,9 +78,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
78
  version: '0'
77
79
  required_rubygems_version: !ruby/object:Gem::Requirement
78
80
  requirements:
79
- - - ">="
81
+ - - ">"
80
82
  - !ruby/object:Gem::Version
81
- version: '0'
83
+ version: 1.3.1
82
84
  requirements: []
83
85
  rubyforge_project:
84
86
  rubygems_version: 2.2.2