foreman_templates 1.5.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,8 +6,8 @@ of your choice) to your local Foreman instance
6
6
 
7
7
  ## Installation
8
8
 
9
- See [How_to_Install_a_Plugin](http://projects.theforeman.org/projects/foreman/wiki/How_to_Install_a_Plugin)
10
- for how to install Foreman plugins
9
+ See [Install a plugin](http://theforeman.org/manuals/latest/index.html#6.1InstallaPlugin) in the
10
+ Foreman documentation for how to install Foreman plugins.
11
11
 
12
12
  The gem name is "foreman_templates".
13
13
 
@@ -8,7 +8,8 @@ module ForemanTemplates
8
8
 
9
9
  initializer 'foreman_templates.register_plugin', :after=> :finisher_hook do |app|
10
10
  Foreman::Plugin.register :foreman_templates do
11
- end if (Rails.env == "development" or defined? Foreman::Plugin)
11
+ requires_foreman '>= 1.9'
12
+ end
12
13
  end
13
14
 
14
15
  rake_tasks do
@@ -1,3 +1,3 @@
1
1
  module ForemanTemplates
2
- VERSION = "1.5.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -32,7 +32,7 @@ def update_template
32
32
  raise NoKindError
33
33
  end
34
34
 
35
- db_template = ConfigTemplate.find_or_initialize_by_name(@name)
35
+ db_template = ProvisioningTemplate.find_or_initialize_by_name(@name)
36
36
  data = {
37
37
  :template => @text,
38
38
  :snippet => false,
@@ -91,7 +91,7 @@ def update_ptable
91
91
  end
92
92
 
93
93
  def update_snippet
94
- db_snippet = ConfigTemplate.find_or_initialize_by_name(@name)
94
+ db_snippet = ProvisioningTemplate.find_or_initialize_by_name(@name)
95
95
  data = {
96
96
  :template => @text,
97
97
  :snippet => true
@@ -143,8 +143,8 @@ namespace :templates do
143
143
  repo = ENV['repo'] ? ENV['repo'] : "https://github.com/theforeman/community-templates.git"
144
144
 
145
145
  # Check out the community templates to a temp location
146
+ dir = Dir.mktmpdir
146
147
  begin
147
- dir = Dir.mktmpdir
148
148
  gitrepo = Git.clone(repo, dir)
149
149
  branch = ENV['branch'] ? ENV['branch'] : get_default_branch(gitrepo)
150
150
  gitrepo.checkout(branch) if branch
@@ -159,7 +159,7 @@ namespace :templates do
159
159
  # Get the name and filter
160
160
  filename = template.split('/').last
161
161
  title = filename.split('.').first
162
- @name = @metadata ['name'] || title
162
+ @name = @metadata['name'] || title
163
163
  @name = [prefix, @name].compact.join()
164
164
  next if filter and not @name.match(/#{filter}/i)
165
165
 
@@ -191,7 +191,7 @@ namespace :templates do
191
191
  end
192
192
  end
193
193
  ensure
194
- FileUtils.remove_entry_secure(dir)
194
+ FileUtils.remove_entry_secure(dir) if File.exist?(dir)
195
195
  end
196
196
 
197
197
  end
metadata CHANGED
@@ -1,44 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 2.0.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Greg Sutcliffe
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-03-17 00:00:00.000000000 Z
12
+ date: 2015-07-06 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: diffy
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - ">="
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - ">="
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: git
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - ">="
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - ">="
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
- description: Engine to sychronise provisioning templates from GitHub
46
+ description: Engine to synchronise provisioning templates from GitHub
42
47
  email: gsutclif@redhat.com
43
48
  executables: []
44
49
  extensions: []
@@ -46,35 +51,36 @@ extra_rdoc_files:
46
51
  - LICENSE
47
52
  - README.md
48
53
  files:
49
- - LICENSE
50
- - README.md
51
- - Rakefile
52
- - lib/foreman_templates.rb
53
- - lib/foreman_templates/engine.rb
54
54
  - lib/foreman_templates/version.rb
55
+ - lib/foreman_templates/engine.rb
55
56
  - lib/templates.rake
57
+ - lib/foreman_templates.rb
58
+ - LICENSE
59
+ - Rakefile
60
+ - README.md
56
61
  homepage: http://github.com/theforeman/foreman_templates
57
62
  licenses:
58
63
  - GPL-3
59
- metadata: {}
60
64
  post_install_message:
61
65
  rdoc_options: []
62
66
  require_paths:
63
67
  - lib
64
68
  required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
65
70
  requirements:
66
- - - ">="
71
+ - - ! '>='
67
72
  - !ruby/object:Gem::Version
68
73
  version: '0'
69
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
70
76
  requirements:
71
- - - ">="
77
+ - - ! '>='
72
78
  - !ruby/object:Gem::Version
73
79
  version: '0'
74
80
  requirements: []
75
81
  rubyforge_project:
76
- rubygems_version: 2.4.5
82
+ rubygems_version: 1.8.23
77
83
  signing_key:
78
- specification_version: 4
84
+ specification_version: 3
79
85
  summary: Template-syncing engine for Foreman
80
86
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 13dc963ac08604e046539bf41fe0b6d8221d94c5
4
- data.tar.gz: 6e037a128dd982bd13f9d0f793040973995f094e
5
- SHA512:
6
- metadata.gz: f25a1b7948860f422816ff98683f80b7ac8bbd38b73e6d246dd66f1ea145b88c45a4278535a2ca9ba90c62c66b71eb6311c6fc479f31300ebe280d75eb9d94a8
7
- data.tar.gz: b952bb1305484cfdab98352740bd6b7ddf42d94b0e4b291ff8292a46209b0227bd31a8b926eaa2eb551c9e6f0a480d5318f25e0a0414f41847d5dbea74a7cfe7