travis 1.6.2.travis.366.4 → 1.6.2.travis.367.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTIzYWU4ZThiMjc1ZmYxYjI3MWNmZjdiZjNmNzdlMDJkZWRkYjU0ZA==
4
+ MTk5YzM2YWU1MGQ4OWE2NzYyYjFiNDhiNDhjNzNmMGJlZDFhNzlhOA==
5
5
  data.tar.gz: !binary |-
6
- ZGJhNGYxZjRkZjAwYmY1MDE0ZmMwYWRhNjVmNDE5ZDYxOGExOTI0Yg==
6
+ NzcxODViZDI2Y2JkNDk3OWFhNGIxMDg0NTJhNjJjYjA3ZTg4MDhjNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWRhYTM5OTg3MDBlM2QyNmJiYzYzZmYzNDBhNTA4MjE2YTZhMTRjNGE3MjAz
10
- ZGEzMGUyYzllMzJmYTc3M2UyMjQ1NzVhM2JhOGQ4ODUyMzE3NzI2ZjdmMjgy
11
- NzU4MzlhMGY0M2RlMGVlMTQwZDljYTNiNjQ5MTE2YjBhOTc1ZjM=
9
+ NTUwZmI1YmE1YWIyMDNlY2UzNGZmM2M4YjM0MzRkNTJjMzdiNmU0N2UwZjNl
10
+ MGJhY2MyZTNkNTU2NjBmNzZiZDExYjUzMzE5Mjk1Y2E2NTViZDI3YmE2YTI4
11
+ MGUwZjQ4MDA4YjI0MTkyMTU2NTVhYzJhNGFiZWI4OGQ4MmEzZDM=
12
12
  data.tar.gz: !binary |-
13
- YzM2ZWY1NjU3ODU3YWM3M2YyOWQwMTJjZWIzZTY0YTljYzk0MDE1NGE0ZTMx
14
- MjJiZDI1YjA2Mzg4NWQ4MTI3ZDFkNTY1YzMyZTM1M2JjOGE3MWVkNjkwZWQ3
15
- YzVlYThmNDkzYmRiNWFmYjY1OWRkYTliZjE4NWU2ZTU4NjQ2ZDk=
13
+ MDU2MTE1MTUzMzM5NGQ3MWMxZTQwNzYzNzMzNDBlNWQ5NDAxYTBmODA3NzM5
14
+ NGJhZTdmNzI2MTU0NTAyY2Y5MTBlMmYwMjliYTFhYzQzZDhlMzIyYzViYWQ0
15
+ ZDQwN2RlYmEwZTUxMjdkYzkzOGI2NGUyZDAyZWVhNzg2ZTk2ZDI=
@@ -17,7 +17,7 @@ module Travis
17
17
  extend Parser, Forwardable, Tools::Assets
18
18
  def_delegators :terminal, :agree, :ask, :choose
19
19
 
20
- HighLine.use_color = !Tools::System.windows? && $stdout.tty?
20
+ HighLine.use_color = Tools::System.unix? && $stdout.tty?
21
21
  HighLine.color_scheme = HighLine::ColorScheme.new do |cs|
22
22
  cs[:command] = [ :bold ]
23
23
  cs[:error] = [ :red ]
@@ -33,7 +33,7 @@ module Travis
33
33
  end
34
34
 
35
35
  on('-i', '--[no-]interactive', "be interactive and colorful") do |c, v|
36
- HighLine.use_color = v unless Tools::System.windows?
36
+ HighLine.use_color = v if Tools::System.unix?
37
37
  c.force_interactive = v
38
38
  end
39
39
 
@@ -44,7 +44,7 @@ module Travis
44
44
 
45
45
  def general
46
46
  yield "Ruby", Tools::System.ruby
47
- yield "Operating System", Tools::System.full_os
47
+ yield "Operating System", Tools::System.os
48
48
  yield "RubyGems", Tools::System.rubygems
49
49
  end
50
50
 
@@ -41,7 +41,7 @@ module Travis
41
41
  end
42
42
 
43
43
  def available?
44
- System.mac? and `sw_vers -productVersion`.strip >= '10.8'
44
+ System.mac? and System.os_version.to_s >= '10.8'
45
45
  end
46
46
  end
47
47
 
@@ -55,7 +55,7 @@ module Travis
55
55
  end
56
56
 
57
57
  def available?
58
- system "which #{@command} >/dev/null 2>/dev/null" unless System.windows?
58
+ System.has? @command
59
59
  end
60
60
  end
61
61
 
@@ -15,12 +15,30 @@ module Travis
15
15
  RUBY_PLATFORM =~ /linux/i
16
16
  end
17
17
 
18
+ def unix?
19
+ not windows?
20
+ end
21
+
18
22
  def os
19
- @os ||= windows? ? "Windows" : `uname`.chomp
23
+ os_name ? "#{os_name} #{os_version}".strip : os_type
20
24
  end
21
25
 
22
26
  def full_os
23
- @full_os ||= mac? ? "#{`sw_vers -productName`.chomp} #{`sw_vers -productVersion`.chomp}" : os
27
+ os_name == os_type ? os : "#{os} like #{os_type}"
28
+ end
29
+
30
+ def os_version
31
+ @os_version ||= has?(:sw_vers) && `sw_vers -productVersion`.chomp
32
+ @os_version ||= has?(:lsb_release) && `lsb_release -r -s`.chomp
33
+ end
34
+
35
+ def os_name
36
+ @os_name ||= has?(:sw_vers) && `sw_vers -productName`.chomp
37
+ @os_name ||= has?(:lsb_release) && `lsb_release -i -s`.chomp
38
+ end
39
+
40
+ def os_type
41
+ @os_type ||= `uname`.chomp
24
42
  end
25
43
 
26
44
  def ruby_engine
@@ -46,7 +64,13 @@ module Travis
46
64
  end
47
65
 
48
66
  def description(*args)
49
- [ os, ruby, rubygems, *args.flatten].compact.uniq.join("; ")
67
+ [ full_os, ruby, rubygems, *args.flatten].compact.uniq.join("; ")
68
+ end
69
+
70
+ def has?(command)
71
+ return false unless unix?
72
+ @has ||= {}
73
+ @has.fetch(command) { @has[command] = system "which #{command} 2>/dev/null >/dev/null" }
50
74
  end
51
75
  end
52
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2.travis.366.4
4
+ version: 1.6.2.travis.367.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase