poise-application-ruby 4.0.1 → 4.1.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.kitchen.yml +1 -8
  3. data/.travis.yml +59 -15
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +5 -1
  6. data/README.md +34 -4
  7. data/Rakefile +1 -1
  8. data/chef/templates/secret_token.rb.erb +3 -0
  9. data/chef/templates/secrets.yml.erb +1 -1
  10. data/lib/poise_application_ruby.rb +1 -1
  11. data/lib/poise_application_ruby/app_mixin.rb +1 -1
  12. data/lib/poise_application_ruby/cheftie.rb +1 -1
  13. data/lib/poise_application_ruby/error.rb +1 -1
  14. data/lib/poise_application_ruby/resources.rb +2 -1
  15. data/lib/poise_application_ruby/resources/bundle_install.rb +1 -1
  16. data/lib/poise_application_ruby/resources/puma.rb +86 -0
  17. data/lib/poise_application_ruby/resources/rackup.rb +1 -1
  18. data/lib/poise_application_ruby/resources/rails.rb +40 -8
  19. data/lib/poise_application_ruby/resources/ruby.rb +1 -1
  20. data/lib/poise_application_ruby/resources/ruby_execute.rb +1 -1
  21. data/lib/poise_application_ruby/resources/ruby_gem.rb +1 -1
  22. data/lib/poise_application_ruby/resources/thin.rb +1 -1
  23. data/lib/poise_application_ruby/resources/unicorn.rb +1 -1
  24. data/lib/poise_application_ruby/service_mixin.rb +10 -2
  25. data/lib/poise_application_ruby/version.rb +2 -2
  26. data/poise-application-ruby.gemspec +5 -3
  27. data/test/{cookbooks/application_ruby_test → cookbook}/attributes/default.rb +1 -1
  28. data/test/{cookbooks/application_ruby_test → cookbook}/metadata.rb +2 -2
  29. data/test/{cookbooks/application_ruby_test → cookbook}/recipes/default.rb +4 -1
  30. data/test/{cookbooks/application_ruby_test → cookbook}/recipes/rails.rb +2 -2
  31. data/test/{cookbooks/application_ruby_test → cookbook}/recipes/sinatra.rb +2 -2
  32. data/test/gemfiles/chef-12.1.gemfile +23 -0
  33. data/test/gemfiles/chef-12.10.gemfile +23 -0
  34. data/test/gemfiles/chef-12.11.gemfile +23 -0
  35. data/test/gemfiles/chef-12.12.gemfile +22 -0
  36. data/test/gemfiles/chef-12.13.gemfile +22 -0
  37. data/test/gemfiles/chef-12.14.gemfile +19 -0
  38. data/test/gemfiles/chef-12.15.gemfile +19 -0
  39. data/test/gemfiles/chef-12.16.gemfile +19 -0
  40. data/test/gemfiles/chef-12.17.gemfile +19 -0
  41. data/test/gemfiles/chef-12.18.gemfile +19 -0
  42. data/test/gemfiles/chef-12.19.gemfile +19 -0
  43. data/test/gemfiles/chef-12.2.gemfile +23 -0
  44. data/test/gemfiles/chef-12.3.gemfile +23 -0
  45. data/test/gemfiles/chef-12.4.gemfile +24 -0
  46. data/test/gemfiles/chef-12.5.gemfile +23 -0
  47. data/test/gemfiles/chef-12.6.gemfile +23 -0
  48. data/test/gemfiles/chef-12.7.gemfile +23 -0
  49. data/test/gemfiles/chef-12.8.gemfile +23 -0
  50. data/test/gemfiles/chef-12.9.gemfile +23 -0
  51. data/test/gemfiles/chef-12.gemfile +2 -2
  52. data/test/gemfiles/chef-13.0.gemfile +19 -0
  53. data/test/gemfiles/chef-13.gemfile +19 -0
  54. data/test/gemfiles/master.gemfile +6 -1
  55. data/test/integration/default/serverspec/default_spec.rb +1 -1
  56. data/test/integration/default/serverspec/rails_spec.rb +1 -1
  57. data/test/integration/default/serverspec/sinatra_spec.rb +1 -1
  58. data/test/spec/resources/ruby_execute_spec.rb +1 -1
  59. data/test/spec/resources/ruby_spec.rb +1 -1
  60. data/test/spec/spec_helper.rb +1 -1
  61. metadata +94 -19
  62. data/.kitchen.travis.yml +0 -9
  63. data/Berksfile +0 -35
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ module PoiseApplicationRuby
39
39
  module Provider
40
40
  include PoiseApplication::ServiceMixin::Provider
41
41
  include PoiseApplicationRuby::AppMixin::Provider
42
+ include PoiseRuby::RubyCommandMixin::Provider
42
43
  include PoiseRuby::BundlerMixin
43
44
 
44
45
  # Set up the service for running Ruby stuff.
@@ -48,10 +49,17 @@ module PoiseApplicationRuby
48
49
  self_ = self
49
50
  # Create a new singleton method that fills in Python for you.
50
51
  resource.define_singleton_method(:ruby_command) do |val|
51
- path = self_.new_resource.app_state_environment_ruby['PATH']
52
+ path = self_.new_resource.app_state_environment_ruby['PATH'] || ENV['PATH']
52
53
  cmd = if self_.new_resource.parent_bundle
53
54
  bundle_exec_command(val, path: path)
54
55
  else
56
+ # Insert the gem executable directory at the front of the path.
57
+ gem_environment = self_.send(:ruby_shell_out!, self_.new_resource.gem_binary, 'environment')
58
+ matches = gem_environment.stdout.scan(/EXECUTABLE DIRECTORY: (.*)$/).first
59
+ if matches
60
+ Chef::Log.debug("[#{new_resource}] Prepending gem executable directory #{matches.first} to existing $PATH (#{path})")
61
+ path = "#{matches.first}:#{path}"
62
+ end
55
63
  "#{self_.new_resource.ruby} #{PoiseLanguages::Utils.absolute_command(val, path: path)}"
56
64
  end
57
65
  resource.command(cmd)
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module PoiseApplicationRuby
18
- VERSION = '4.0.1'
18
+ VERSION = '4.1.0'
19
19
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -34,12 +34,14 @@ Gem::Specification.new do |spec|
34
34
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
35
35
  spec.require_paths = %w{lib}
36
36
 
37
+ spec.add_dependency 'chef', '>= 12.1', '< 14'
37
38
  spec.add_dependency 'halite', '~> 1.0'
38
39
  spec.add_dependency 'poise', '~> 2.0'
39
40
  spec.add_dependency 'poise-application', '~> 5.0'
40
41
  spec.add_dependency 'poise-ruby', '~> 2.1'
41
42
  spec.add_dependency 'poise-service', '~> 1.0'
42
43
 
43
- spec.add_development_dependency 'poise-boiler', '~> 1.0'
44
- spec.add_development_dependency 'poise-application-git', '~> 1.0'
44
+ spec.add_development_dependency 'poise-application-git', '~> 1.2'
45
+ spec.add_development_dependency 'poise-boiler', '~> 1.15'
46
+ spec.add_development_dependency 'poise-build-essential', '~> 1.0'
45
47
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -17,4 +17,4 @@
17
17
  name 'application_ruby_test'
18
18
  depends 'application_git'
19
19
  depends 'application_ruby'
20
- depends 'build-essential'
20
+ depends 'poise-build-essential'
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -64,3 +64,6 @@ EOH
64
64
  port 8001
65
65
  end
66
66
  end
67
+
68
+ include_recipe '::rails'
69
+ include_recipe '::sinatra'
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
17
17
  # RHEL 6 is too old to run Rails 4.2 on the system Ruby.
18
18
  return if platform_family?('rhel') && node['platform_version'].start_with?('6')
19
19
 
20
- include_recipe 'build-essential'
20
+ include_recipe 'poise-build-essential'
21
21
 
22
22
  package value_for_platform_family(debian: 'ruby-dev', rhel: 'ruby-devel')
23
23
  package value_for_platform_family(debian: 'zlib1g-dev', rhel: 'zlib-devel')
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, Noah Kantrowitz
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- include_recipe 'build-essential'
17
+ include_recipe 'poise-build-essential'
18
18
 
19
19
  package value_for_platform_family(debian: 'ruby-dev', rhel: 'ruby-devel')
20
20
 
@@ -0,0 +1,23 @@
1
+ #
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.1.2'
20
+ gem 'rack', '< 2'
21
+ gem 'foodcritic', '< 8'
22
+ gem 'fauxhai', '<= 3.9.0'
23
+ gem 'chefspec', '< 6'
@@ -0,0 +1,23 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.10.24'
20
+ gem 'rack', '< 2'
21
+ gem 'foodcritic', '< 8'
22
+ gem 'fauxhai', '<= 3.9.0'
23
+ gem 'chefspec', '< 6'
@@ -0,0 +1,23 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.11.18'
20
+ gem 'rack', '< 2'
21
+ gem 'foodcritic', '< 8'
22
+ gem 'fauxhai', '<= 3.9.0'
23
+ gem 'chefspec', '< 6'
@@ -0,0 +1,22 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.12.15'
20
+ gem 'foodcritic', '< 8'
21
+ gem 'fauxhai', '<= 3.9.0'
22
+ gem 'chefspec', '< 6'
@@ -0,0 +1,22 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.13.37'
20
+ gem 'foodcritic', '< 8'
21
+ gem 'fauxhai', '<= 3.9.0'
22
+ gem 'chefspec', '< 6'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.14.89'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.15.19'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.16.42'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.17.44'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.18.31'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.19.36'
@@ -0,0 +1,23 @@
1
+ #
2
+ # Copyright 2015-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.2.1'
20
+ gem 'rack', '< 2'
21
+ gem 'foodcritic', '< 8'
22
+ gem 'fauxhai', '<= 3.9.0'
23
+ gem 'chefspec', '< 6'