heroku_formation_validator 0.0.1 → 0.0.2

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: 8db25599dfeadbc6795f83b5aed596c79b409605
4
- data.tar.gz: 82a4061b706961ca54aac6cbc99e49c181f6cb52
3
+ metadata.gz: 2712eb6fc6fd6a0af1b5096ee73122ab07f7b054
4
+ data.tar.gz: 396a486c00579967e53ccad034c321f201b2c920
5
5
  SHA512:
6
- metadata.gz: 715d92f138ff1f48a46da1a16b36a483dc74747eff5685fbdf435fce2b25d95599e0123747f649041fa26f34438a312efd6e88fd78b821c033ec505cebe1984b
7
- data.tar.gz: 5183810cd82669c520bb10dbcbf4c63578e19e94eca32d5839bfb1a269373f0f90ce7d4f3874634ba7df0327f8a3bf192aa85361f992ca2d327626438a616cbe
6
+ metadata.gz: 8021497c7f098c2e984a2b58b8253f3d3aadeaddd30033a0dfc0e8de32921024d86fe1f9d64f6cd16344dfbcf0f914021085ef8a8336d0ceb932b7d24803ce27
7
+ data.tar.gz: 4d650e6a134466a9eb0e9ac28067396713ca7e66bea60f96893db01e12f47d60f96ba9d0675be1101e1dda765587868c6a987f49f3f2c4f22dc4a68eafdbf1fc
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Masatomo Nakano
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -27,7 +27,13 @@ common:
27
27
  groups:
28
28
  api:
29
29
  apps:
30
- - <your app name on heroku>
30
+ - <your-app-name-1>
31
+ - <your-app-name-2>
32
+ variables:
33
+ - YOUR_VARIABLE: "ABC"
34
+ cms:
35
+ apps:
36
+ - <your-app-name-3>
31
37
  variables:
32
38
  - YOUR_VARIABLE: "ABC"
33
39
  ```
@@ -41,6 +47,17 @@ $ heroku_formation_validator formation.yml
41
47
  - When no errors, you will get nothing with exit code 0
42
48
  - When errors, You will get errors with exit code 1
43
49
 
50
+ ```
51
+ === api <your-app-name1> ===
52
+ Addons: "scheduler:standard" is not installed
53
+ === api <your-app-name2> ===
54
+ Addons: "scheduler:standard" is not installed
55
+ Papertrail: not set in logdrains
56
+ === cms <your-app-name3> ===
57
+ Addons: "sendgrid:bronze" is not installed
58
+ Addons: "redistogo:small" is not installed
59
+ ```
60
+
44
61
  ## Contributing
45
62
 
46
63
  1. Fork it ( http://github.com/quipper/heroku_formation_validator/fork )
data/Rakefile CHANGED
@@ -1 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new("spec")
5
+ task :default => :spec
@@ -20,7 +20,9 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
22
  spec.add_development_dependency "rake", "~> 10.1"
23
+ spec.add_development_dependency "rspec"
23
24
 
24
25
  spec.add_dependency 'httparty', "~> 0.12"
25
26
  spec.add_dependency 'activesupport', "~> 4"
27
+ spec.add_dependency 'rainbow'
26
28
  end
@@ -3,6 +3,7 @@ require "heroku_formation_validator/heroku_api"
3
3
  require "heroku_formation_validator/runner"
4
4
  require "yaml"
5
5
  require "active_support/all"
6
+ require "rainbow"
6
7
 
7
8
  Dir[File.join(File.dirname(__FILE__), 'heroku_formation_validator', 'plugins', '*.rb')].each do |extension|
8
9
  require extension
@@ -13,13 +14,13 @@ module HerokuFormationValidator
13
14
  begin
14
15
  cnf = YAML::load(File.open(config_file))
15
16
  rescue Errno::ENOENT
16
- $stderr.puts "File not found: #{config_file}"
17
+ error "File not found: #{config_file}"
17
18
  return false
18
19
  end
19
20
  heroku_api = HerokuApi.new(cnf["auth"]["email"], cnf["auth"]["token"])
20
21
 
21
22
  unless heroku_api.ping
22
- $stderr.puts "Heroku API error. Heroku credential in config is not correct?"
23
+ error "Heroku API error. Heroku credential in config is not correct?"
23
24
  return false
24
25
  end
25
26
 
@@ -35,11 +36,15 @@ module HerokuFormationValidator
35
36
 
36
37
  if errors.length > 0
37
38
  success = false
38
- $stderr.puts "=== #{group} #{app} ==="
39
- $stderr.puts errors.join("\n")
39
+ error "=== #{group} #{app} ==="
40
+ error errors.join("\n")
40
41
  end
41
42
  end
42
43
  end
43
44
  success
44
45
  end
46
+
47
+ def self.error(msg)
48
+ $stderr.puts msg.color(:red)
49
+ end
45
50
  end
@@ -1,3 +1,3 @@
1
1
  module HerokuFormationValidator
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+ require "stringio"
3
+
4
+ describe HerokuFormationValidator do
5
+ describe ".error" do
6
+ around do |ex|
7
+ $stderr = StringIO.new
8
+ ex.run
9
+ $stderr = STDERR
10
+ end
11
+
12
+ it "should aroud given message by escape sequence" do
13
+ HerokuFormationValidator.error("Error!")
14
+ expect($stderr.string.chomp).to eq "\e[31mError!\e[0m"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ require "rspec"
2
+ require "heroku_formation_validator"
3
+
4
+ RSpec.configure do |config|
5
+ end
metadata CHANGED
@@ -1,71 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_formation_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomo Nakano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-26 00:00:00.000000000 Z
11
+ date: 2013-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: httparty
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ~>
46
60
  - !ruby/object:Gem::Version
47
61
  version: '0.12'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ~>
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0.12'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: activesupport
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ~>
60
74
  - !ruby/object:Gem::Version
61
75
  version: '4'
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ~>
67
81
  - !ruby/object:Gem::Version
68
82
  version: '4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rainbow
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description: Heroku config/addons validator for multiple apps. It checks addons /
70
98
  config varibales etc
71
99
  email:
@@ -75,9 +103,9 @@ executables:
75
103
  extensions: []
76
104
  extra_rdoc_files: []
77
105
  files:
78
- - ".gitignore"
106
+ - .gitignore
79
107
  - Gemfile
80
- - LICENSE.txt
108
+ - LICENSE.md
81
109
  - README.md
82
110
  - Rakefile
83
111
  - TODO.md
@@ -91,6 +119,8 @@ files:
91
119
  - lib/heroku_formation_validator/plugins/variables.rb
92
120
  - lib/heroku_formation_validator/runner.rb
93
121
  - lib/heroku_formation_validator/version.rb
122
+ - spec/heroku_formation_validator_spec.rb
123
+ - spec/spec_helper.rb
94
124
  homepage: https://github.com/quipper/heroku_formation_validator
95
125
  licenses:
96
126
  - MIT
@@ -101,18 +131,20 @@ require_paths:
101
131
  - lib
102
132
  required_ruby_version: !ruby/object:Gem::Requirement
103
133
  requirements:
104
- - - ">="
134
+ - - '>='
105
135
  - !ruby/object:Gem::Version
106
136
  version: '0'
107
137
  required_rubygems_version: !ruby/object:Gem::Requirement
108
138
  requirements:
109
- - - ">="
139
+ - - '>='
110
140
  - !ruby/object:Gem::Version
111
141
  version: '0'
112
142
  requirements: []
113
143
  rubyforge_project:
114
- rubygems_version: 2.2.0
144
+ rubygems_version: 2.0.14
115
145
  signing_key:
116
146
  specification_version: 4
117
147
  summary: Heroku config/addons validator for multiple apps
118
- test_files: []
148
+ test_files:
149
+ - spec/heroku_formation_validator_spec.rb
150
+ - spec/spec_helper.rb
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Tomo Nakano
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.