travis-lint 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,45 +16,51 @@ module Travis
16
16
  end
17
17
  end
18
18
 
19
- @travis_file_path = Pathname.new(argv.first).expand_path
19
+ @travis_yml_file_paths = []
20
+ argv.each do |arg|
21
+ @travis_yml_file_paths << Pathname.new(arg).expand_path
22
+ end
20
23
  end
21
24
 
22
25
 
23
26
  def run
24
- check_that_travis_yml_file_exists!
25
- check_that_travis_yml_file_is_valid_yaml!
26
-
27
- if (issues = Linter.validate(self.parsed_travis_yml)).empty?
28
- puts "Hooray, .travis.yml at #{@travis_file_path} seems to be solid!"
29
- else
30
- issues.each do |i|
31
- puts "Found an issue with the `#{i[:key]}:` key:\n\n\t#{i[:issue]}"
32
- puts
33
- puts
27
+ errors = false
28
+ @travis_yml_file_paths.each do |travis_yml_file_path|
29
+ check_that_travis_yml_file_exists!(travis_yml_file_path)
30
+ check_that_travis_yml_file_is_valid_yaml!(travis_yml_file_path)
31
+
32
+ if (issues = Linter.validate(self.parsed_travis_yml(travis_yml_file_path))).empty?
33
+ puts "Hooray, #{travis_yml_file_path} seems to be solid!"
34
+ else
35
+ errors = true
36
+ puts "#{travis_yml_file_path} has issues:"
37
+ issues.each do |issue|
38
+ puts " Found an issue with the `#{issue[:key]}:` key:\n #{issue[:issue]}"
39
+ end
34
40
  end
35
- quit ".travis.yml at #{@travis_file_path} has issues and thus will be ignored by Travis CI."
41
+ puts
36
42
  end
43
+ exit(1) if errors
37
44
  end
38
45
 
39
-
40
46
  protected
41
47
 
42
- def check_that_travis_yml_file_exists!
43
- quit("Cannot read #{@travis_file_path}: file does not exist or is not readable") unless File.exists?(@travis_file_path) &&
44
- File.file?(@travis_file_path) &&
45
- File.readable?(@travis_file_path)
48
+ def check_that_travis_yml_file_exists!(travis_yml_file_path)
49
+ quit("Cannot read #{travis_yml_file_path}: file does not exist or is not readable") unless File.exists?(travis_yml_file_path) &&
50
+ File.file?(travis_yml_file_path) &&
51
+ File.readable?(travis_yml_file_path)
46
52
  end
47
53
 
48
- def check_that_travis_yml_file_is_valid_yaml!
54
+ def check_that_travis_yml_file_is_valid_yaml!(travis_yml_file_path)
49
55
  begin
50
- YAML.load_file(@travis_file_path)
56
+ YAML.load_file(travis_yml_file_path)
51
57
  rescue ArgumentError, Psych::SyntaxError
52
- quit ".travis.yml at #{@travis_file_path} is not a valid YAML file and thus will be ignored by Travis CI."
58
+ quit "#{travis_yml_file_path} is not a valid YAML file and thus will be ignored by Travis CI."
53
59
  end
54
60
  end
55
61
 
56
- def parsed_travis_yml
57
- YAML.load_file(@travis_file_path)
62
+ def parsed_travis_yml(travis_yml_file_path)
63
+ YAML.load_file(travis_yml_file_path)
58
64
  end
59
65
 
60
66
  def show_help
@@ -1,6 +1,6 @@
1
1
  module Travis
2
2
  module Lint
3
- VERSION = "1.3.0"
3
+ VERSION = "1.4.0"
4
4
  Version = VERSION
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,66 +1,59 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: travis-lint
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 3
9
- - 0
10
- version: 1.3.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Michael S. Klishin
14
9
  - Travis CI Development Team
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2012-03-06 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
13
+ date: 2012-03-12 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: hashr
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 57
30
- segments:
31
- - 0
32
- - 0
33
- - 19
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
34
22
  version: 0.0.19
35
23
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: rspec
39
24
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 0.0.19
31
+ - !ruby/object:Gem::Dependency
32
+ name: rspec
33
+ requirement: !ruby/object:Gem::Requirement
41
34
  none: false
42
- requirements:
35
+ requirements:
43
36
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 47
46
- segments:
47
- - 2
48
- - 8
49
- - 0
37
+ - !ruby/object:Gem::Version
50
38
  version: 2.8.0
51
39
  type: :development
52
- version_requirements: *id002
53
- description: travis-lint is a tool that check your .travis.yml for possible issues, deprecations and so on. Recommended for all travis-ci.org users.
54
- email:
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 2.8.0
47
+ description: travis-lint is a tool that check your .travis.yml for possible issues,
48
+ deprecations and so on. Recommended for all travis-ci.org users.
49
+ email:
55
50
  - michaelklishin@me.com
56
51
  - michael@novemberain.com
57
- executables:
52
+ executables:
58
53
  - travis-lint
59
54
  extensions: []
60
-
61
55
  extra_rdoc_files: []
62
-
63
- files:
56
+ files:
64
57
  - .gitignore
65
58
  - .rspec
66
59
  - .travis.yml
@@ -90,38 +83,29 @@ files:
90
83
  - travis-lint.gemspec
91
84
  homepage: http://github.com/travis-ci
92
85
  licenses: []
93
-
94
86
  post_install_message:
95
87
  rdoc_options: []
96
-
97
- require_paths:
88
+ require_paths:
98
89
  - lib
99
- required_ruby_version: !ruby/object:Gem::Requirement
90
+ required_ruby_version: !ruby/object:Gem::Requirement
100
91
  none: false
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- hash: 3
105
- segments:
106
- - 0
107
- version: "0"
108
- required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
97
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- hash: 3
114
- segments:
115
- - 0
116
- version: "0"
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
117
102
  requirements: []
118
-
119
103
  rubyforge_project:
120
- rubygems_version: 1.8.15
104
+ rubygems_version: 1.8.18
121
105
  signing_key:
122
106
  specification_version: 3
123
107
  summary: Checks your .travis.yml for possible issues, deprecations and so on
124
- test_files:
108
+ test_files:
125
109
  - spec/files/no_language_key.yml
126
110
  - spec/files/no_rvm_key.yml
127
111
  - spec/files/uses_jruby_instead_of_jruby_in_specific_mode.yml
@@ -135,3 +119,4 @@ test_files:
135
119
  - spec/spec_helper.rb
136
120
  - spec/travis_lint_runner_spec.rb
137
121
  - spec/travis_lint_spec.rb
122
+ has_rdoc: