puppet-library 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.yml +4 -0
- data/TODO.yml +22 -24
- data/features/module_list.feature +1 -0
- data/features/module_search.feature +1 -0
- data/features/support/env.rb +2 -0
- data/lib/puppet_library/app/views/index.haml +22 -8
- data/lib/puppet_library/app/views/layout.haml +1 -1
- data/lib/puppet_library/forge/cache.rb +3 -3
- data/lib/puppet_library/forge/directory.rb +2 -2
- data/lib/puppet_library/forge/git_repository.rb +3 -3
- data/lib/puppet_library/forge/proxy.rb +2 -2
- data/lib/puppet_library/forge/source.rb +7 -0
- data/lib/puppet_library/server.rb +8 -6
- data/lib/puppet_library/util/config_api.rb +14 -7
- data/lib/puppet_library/util/patches.rb +1 -1
- data/lib/puppet_library/version.rb +1 -1
- data/puppet-library.gemspec +2 -0
- data/spec/server_spec.rb +2 -10
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 318299128135093f04410ff8266b6b13276d1926
|
4
|
+
data.tar.gz: 1d1d6e3fa14700b925fc544ffad3bc8fda8140a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50528c35cf90a196f27fdb525e47cef146f3df818929b94350fe88b97c5d9ee8734d52d23ad4f9ddde937233fd73043712e20ced9f0b4cf0a0bca65a1a6d952b
|
7
|
+
data.tar.gz: be971c3867dfc917ebfa107526483c2a29011f02910cd749856fd689aac666e08b65c1c2f69a2d70173378ddecd775d839fdf16159dcf4a7aa6fb94664c01d8a
|
data/CHANGELOG.yml
CHANGED
@@ -75,3 +75,7 @@
|
|
75
75
|
- Fixed issue with "Too many open files" caused by Git repo forges on Ruby 1.8
|
76
76
|
- Fixed issue Git repo forges with tags without Modulefiles
|
77
77
|
- Fixed issue Git repo forges with no description in Modulefile
|
78
|
+
- tag: v0.12.0
|
79
|
+
changes:
|
80
|
+
- Load web UI asynchronously to improve performance
|
81
|
+
- Updated API documentation
|
data/TODO.yml
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
features:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
- logging
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
-
|
20
|
-
- Config APIs:
|
21
|
-
- documentation
|
2
|
+
- Git repo forge:
|
3
|
+
- make it more flexible:
|
4
|
+
- fail gracefully if we can't contact the remote repo
|
5
|
+
- Performance:
|
6
|
+
- cache stuff so it's faster
|
7
|
+
- logging:
|
8
|
+
- use Ruby logging
|
9
|
+
- include some verbose logging
|
10
|
+
- improve error messages (e.g. for when a module can't be untarred)
|
11
|
+
- Named subforges:
|
12
|
+
- per-subforge queries
|
13
|
+
- upload modules (web form and API)
|
14
|
+
- browse proxy cache
|
15
|
+
- clear proxy cache (web form and API)
|
16
|
+
- delete modules from disk (web form)
|
17
|
+
- Authentication
|
18
|
+
- Config APIs:
|
19
|
+
- documentation
|
22
20
|
|
23
21
|
dubious_features:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
- Proxy modules' source in a directory (supported individually for now: should we just leave it that way?)
|
23
|
+
- Make proxy cache TTL configurable
|
24
|
+
- Allow failover between module repositories
|
25
|
+
- Look in /etc/puppet-library.yml for config by default
|
data/features/support/env.rb
CHANGED
@@ -17,6 +17,7 @@
|
|
17
17
|
|
18
18
|
require 'puppet_library'
|
19
19
|
require 'capybara/cucumber'
|
20
|
+
require 'capybara/poltergeist'
|
20
21
|
|
21
22
|
class ServerWorld
|
22
23
|
def server
|
@@ -30,6 +31,7 @@ end
|
|
30
31
|
|
31
32
|
world = ServerWorld.new
|
32
33
|
Capybara.app = world.server
|
34
|
+
Capybara.javascript_driver = :poltergeist
|
33
35
|
|
34
36
|
World do
|
35
37
|
world
|
@@ -16,11 +16,25 @@
|
|
16
16
|
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
17
|
|
18
18
|
%h1 Modules
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
.loading
|
20
|
+
Loding module list...
|
21
|
+
%ul.modules
|
22
|
+
|
23
|
+
:javascript
|
24
|
+
$(document).ready(function() {
|
25
|
+
$.getJSON("modules.json?q=#{query}", function(modules) {
|
26
|
+
$.each(modules, function(index, module) {
|
27
|
+
var item = $("<li/>");
|
28
|
+
item.append($("<b/>").append($("<a/>").attr("href", module.full_name).text(module.full_name)));
|
29
|
+
|
30
|
+
var versionList = $("<ul/>");
|
31
|
+
$.each(module.releases, function(index, release) {
|
32
|
+
versionList.append($("<li>").text(release.version));
|
33
|
+
});
|
34
|
+
|
35
|
+
item.append(versionList);
|
36
|
+
item.appendTo(".modules");
|
37
|
+
});
|
38
|
+
$(".loading").hide();
|
39
|
+
});
|
40
|
+
});
|
@@ -69,7 +69,7 @@
|
|
69
69
|
%input.form-control.search-query{ :name => "search", :type => "search", :placeholder => "Search modules" }
|
70
70
|
%span.input-group-btn
|
71
71
|
%button.btn.btn-primary{ :type => "submit" } Search
|
72
|
+
%script{ :src => "https://code.jquery.com/jquery-2.1.0.min.js" }
|
72
73
|
.container
|
73
74
|
= yield
|
74
|
-
%script{ :src => "https://code.jquery.com/jquery-2.1.0.min.js" }
|
75
75
|
%script{ :src => "https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js" }
|
@@ -26,12 +26,12 @@ module PuppetLibrary::Forge
|
|
26
26
|
#
|
27
27
|
# <b>Usage:</b>
|
28
28
|
#
|
29
|
-
# forge = PuppetLibrary::Forge::Cache.configure do
|
29
|
+
# forge = PuppetLibrary::Forge::Cache.configure do
|
30
30
|
# # The URL of the remote forge
|
31
|
-
#
|
31
|
+
# url "http://forge.example.com"
|
32
32
|
#
|
33
33
|
# # The path to cache the files to on disk
|
34
|
-
#
|
34
|
+
# path "/var/modules/cache"
|
35
35
|
# end
|
36
36
|
class Cache < Proxy
|
37
37
|
|
@@ -31,9 +31,9 @@ module PuppetLibrary::Forge
|
|
31
31
|
#
|
32
32
|
# <b>Usage:</b>
|
33
33
|
#
|
34
|
-
# forge = PuppetLibrary::Forge::Directory.configure do
|
34
|
+
# forge = PuppetLibrary::Forge::Directory.configure do
|
35
35
|
# # The path to serve the modules from
|
36
|
-
#
|
36
|
+
# path "/var/modules/cache"
|
37
37
|
# end
|
38
38
|
class Directory < PuppetLibrary::Forge::Abstract
|
39
39
|
|
@@ -29,12 +29,12 @@ module PuppetLibrary::Forge
|
|
29
29
|
#
|
30
30
|
# <b>Usage:</b>
|
31
31
|
#
|
32
|
-
# forge = PuppetLibrary::Forge::GitRepository.configure do
|
32
|
+
# forge = PuppetLibrary::Forge::GitRepository.configure do
|
33
33
|
# # The location of the git repository
|
34
|
-
#
|
34
|
+
# source "http://example.com/mymodule.git"
|
35
35
|
#
|
36
36
|
# # A regular expression describing which tags to serve
|
37
|
-
#
|
37
|
+
# include_tags /[0-9.]+/
|
38
38
|
# end
|
39
39
|
class GitRepository < PuppetLibrary::Forge::Abstract
|
40
40
|
|
@@ -27,9 +27,9 @@ module PuppetLibrary::Forge
|
|
27
27
|
#
|
28
28
|
# <b>Usage:</b>
|
29
29
|
#
|
30
|
-
# forge = PuppetLibrary::Forge::Proxy.configure do
|
30
|
+
# forge = PuppetLibrary::Forge::Proxy.configure do
|
31
31
|
# # The URL of the remote forge
|
32
|
-
#
|
32
|
+
# url "http://forge.example.com"
|
33
33
|
# end
|
34
34
|
class Proxy < Forge
|
35
35
|
|
@@ -26,6 +26,13 @@ module PuppetLibrary::Forge
|
|
26
26
|
#
|
27
27
|
# <b>Note:</b>
|
28
28
|
# The module directory must have a +Modulefile+.
|
29
|
+
#
|
30
|
+
# <b>Usage:</b>
|
31
|
+
#
|
32
|
+
# forge = PuppetLibrary::Forge::Source.configure do
|
33
|
+
# # The path of the module's source
|
34
|
+
# path "/var/modules/mymodulesource"
|
35
|
+
# end
|
29
36
|
class Source < PuppetLibrary::Forge::Abstract
|
30
37
|
def self.configure(&block)
|
31
38
|
config_api = PuppetLibrary::Util::ConfigApi.for(Source) do
|
@@ -27,12 +27,16 @@ module PuppetLibrary
|
|
27
27
|
#
|
28
28
|
# A Rack application that can be configured as follows:
|
29
29
|
#
|
30
|
-
# server = PuppetLibrary::Server.configure
|
30
|
+
# server = PuppetLibrary::Server.configure
|
31
31
|
# # Look for my modules locally
|
32
|
-
#
|
32
|
+
# forge :directory do
|
33
|
+
# path "/var/lib/modules"
|
34
|
+
# end
|
33
35
|
#
|
34
36
|
# # Get everything else from the Puppet Forge
|
35
|
-
#
|
37
|
+
# forge :proxy do
|
38
|
+
# url "http://forge.puppetlabs.com"
|
39
|
+
# end
|
36
40
|
# end
|
37
41
|
#
|
38
42
|
# run server
|
@@ -73,9 +77,7 @@ module PuppetLibrary
|
|
73
77
|
|
74
78
|
get "/" do
|
75
79
|
query = params[:search]
|
76
|
-
|
77
|
-
|
78
|
-
haml :index, { :locals => { "modules" => modules } }
|
80
|
+
haml :index, { :locals => { "query" => query } }
|
79
81
|
end
|
80
82
|
|
81
83
|
get "/modules.json" do
|
@@ -58,19 +58,26 @@ module PuppetLibrary::Util
|
|
58
58
|
config_class = Class.new(Config) do
|
59
59
|
define_method(:params) { params }
|
60
60
|
params.each do |param|
|
61
|
-
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
define_method("get_#{param.name}".to_sym) do
|
66
|
-
get(param)
|
67
|
-
end
|
61
|
+
define_getter(param)
|
62
|
+
define_setter(param)
|
68
63
|
end
|
69
64
|
end
|
70
65
|
PuppetLibrary.const_set(class_name, config_class)
|
71
66
|
end
|
72
67
|
|
73
68
|
class Config
|
69
|
+
def self.define_getter(param)
|
70
|
+
define_method("get_#{param.name}".to_sym) do
|
71
|
+
get(param)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.define_setter(param)
|
76
|
+
define_method(param.name.to_sym) do |new_value|
|
77
|
+
set(param, new_value)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
74
81
|
def initialize
|
75
82
|
@values = {}
|
76
83
|
end
|
data/puppet-library.gemspec
CHANGED
@@ -64,5 +64,7 @@ Gem::Specification.new do |spec|
|
|
64
64
|
spec.add_development_dependency "capybara"
|
65
65
|
spec.add_development_dependency "nokogiri" # Rubygems 1.8 fails to resolve this on Ruby 2.0.0
|
66
66
|
spec.add_development_dependency "cucumber"
|
67
|
+
spec.add_development_dependency "selenium-webdriver"
|
68
|
+
spec.add_development_dependency "poltergeist"
|
67
69
|
end
|
68
70
|
end
|
data/spec/server_spec.rb
CHANGED
@@ -61,14 +61,10 @@ module PuppetLibrary
|
|
61
61
|
"desc" => "Puppet module for Apache"
|
62
62
|
}
|
63
63
|
]
|
64
|
-
expect(forge).to receive(:search_modules).with(nil).and_return(modules)
|
65
64
|
|
66
65
|
get "/"
|
67
66
|
|
68
|
-
expect(last_response.body).to include "
|
69
|
-
expect(last_response.body).to include "puppetlabs/apache"
|
70
|
-
expect(last_response.body).to include "0.0.1"
|
71
|
-
expect(last_response.body).to include "0.0.2"
|
67
|
+
expect(last_response.body).to include '"modules.json?q="'
|
72
68
|
end
|
73
69
|
|
74
70
|
context "when a search term is provided" do
|
@@ -85,14 +81,10 @@ module PuppetLibrary
|
|
85
81
|
"desc" => "Puppet module for Apache"
|
86
82
|
}
|
87
83
|
]
|
88
|
-
expect(forge).to receive(:search_modules).with("apache").and_return(modules)
|
89
84
|
|
90
85
|
get "/?search=apache"
|
91
86
|
|
92
|
-
expect(last_response.body).to include "
|
93
|
-
expect(last_response.body).to include "puppetlabs/apache"
|
94
|
-
expect(last_response.body).to include "0.0.1"
|
95
|
-
expect(last_response.body).to include "0.0.2"
|
87
|
+
expect(last_response.body).to include "modules.json?q=apache"
|
96
88
|
end
|
97
89
|
end
|
98
90
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-library
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- drrb
|
@@ -318,6 +318,34 @@ dependencies:
|
|
318
318
|
- - '>='
|
319
319
|
- !ruby/object:Gem::Version
|
320
320
|
version: '0'
|
321
|
+
- !ruby/object:Gem::Dependency
|
322
|
+
name: selenium-webdriver
|
323
|
+
requirement: !ruby/object:Gem::Requirement
|
324
|
+
requirements:
|
325
|
+
- - '>='
|
326
|
+
- !ruby/object:Gem::Version
|
327
|
+
version: '0'
|
328
|
+
type: :development
|
329
|
+
prerelease: false
|
330
|
+
version_requirements: !ruby/object:Gem::Requirement
|
331
|
+
requirements:
|
332
|
+
- - '>='
|
333
|
+
- !ruby/object:Gem::Version
|
334
|
+
version: '0'
|
335
|
+
- !ruby/object:Gem::Dependency
|
336
|
+
name: poltergeist
|
337
|
+
requirement: !ruby/object:Gem::Requirement
|
338
|
+
requirements:
|
339
|
+
- - '>='
|
340
|
+
- !ruby/object:Gem::Version
|
341
|
+
version: '0'
|
342
|
+
type: :development
|
343
|
+
prerelease: false
|
344
|
+
version_requirements: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - '>='
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: '0'
|
321
349
|
description: A private Puppet forge
|
322
350
|
email:
|
323
351
|
- drrrrrrrrrrrb@gmail.com
|
@@ -431,7 +459,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
431
459
|
version: '0'
|
432
460
|
requirements: []
|
433
461
|
rubyforge_project:
|
434
|
-
rubygems_version: 2.
|
462
|
+
rubygems_version: 2.0.3
|
435
463
|
signing_key:
|
436
464
|
specification_version: 4
|
437
465
|
summary: Puppet Library is a private Puppet module server that's compatible with librarian-puppet.
|