inqlude 0.7.4 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +7 -0
- data/README.md +2 -0
- data/bin/inqlude +0 -6
- data/lib/cli.rb +18 -8
- data/lib/manifest.rb +1 -0
- data/lib/verifier.rb +23 -1
- data/lib/version.rb +1 -1
- data/manifest-format.md +12 -15
- data/schema/generic-manifest-v1 +7 -0
- data/schema/proprietary-release-manifest-v1 +7 -0
- data/schema/release-manifest-v1 +7 -0
- data/spec/data/inqlude-all.json +6 -0
- data/spec/data/{awesomelib → manifests/awesomelib}/awesomelib.2013-09-08.manifest +3 -0
- data/spec/data/{bleedingedge → manifests/bleedingedge}/bleedingedge.2012-01-01.manifest +0 -0
- data/spec/data/{commercial → manifests/commercial}/commercial.manifest +0 -0
- data/spec/data/{newlib → manifests/newlib}/newlib.manifest +3 -0
- data/spec/data/{proprietarylib → manifests/proprietarylib}/proprietarylib.2013-12-22.manifest +0 -0
- data/spec/data/missing-topics/miss-topics/miss-topics.manifest +20 -0
- data/spec/data/missing-topics/no-topics/no-topics.manifest +20 -0
- data/spec/integration/cli_general_spec.rb +1 -3
- data/spec/integration/cli_list_spec.rb +2 -2
- data/spec/integration/cli_verify_spec.rb +44 -7
- data/spec/integration/cli_view_spec.rb +2 -2
- data/spec/unit/creator_spec.rb +12 -12
- data/spec/unit/kde_frameworks_release_spec.rb +11 -11
- data/spec/unit/manifest_handler_spec.rb +18 -18
- data/spec/unit/spec_helper.rb +1 -3
- data/spec/unit/verifier_spec.rb +165 -16
- data/topics/README.md +11 -0
- data/topics/list_topics +11 -0
- data/topics/list_topics.rb +28 -0
- data/topics/list_topics_spec.rb +32 -0
- data/topics/topics-test.csv +5 -0
- data/topics/topics.csv +202 -0
- data/view/contribute.html.haml +3 -1
- metadata +16 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfb73e8e83eb6e2b8e86b2e7289be7934d3c5967
|
4
|
+
data.tar.gz: 43279f4302b345f134218d48aebb844031c9b8a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d177de51fd1b3d7161adad5eef36ff8bdb47e7aeae565f48a6728ba8beefd2be19537bba03bd0134c2a24e5df102717492de7cfa1196d24f214c2e72e3f77eca
|
7
|
+
data.tar.gz: 8638a6c79f6c7400f577e010b7273022130d51d9ea7457d2e0bc5db48ba124098cdb4da83d85f0d5946512e32529781fdc2bb9a597a4a9e4b2f85871db42790e
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change log of Inqlude
|
2
2
|
|
3
|
+
## Version 0.8.0
|
4
|
+
|
5
|
+
* Add topic attribute to manifest specification and adapt validator to allow topic attribute as an optional parameter. The validator reports missing topics as a warning for each manifest which does not have a topic attribute, but not fail.
|
6
|
+
As a result, libraries can be categorized under multiple topics. The validator reports an error for each manifest with invalid topics attribute. As a result, the list of topics is kept small and typographical errors are prevented.
|
7
|
+
* Initialize distro only when needed. This should remove "distro not recognized" warnings in cases where the distro is not needed
|
8
|
+
* Clarify documentation of `vcs` URL
|
9
|
+
|
3
10
|
## Version 0.7.4
|
4
11
|
|
5
12
|
* Support links to OS X packages in manifests
|
data/README.md
CHANGED
data/bin/inqlude
CHANGED
@@ -18,13 +18,7 @@
|
|
18
18
|
|
19
19
|
require File.expand_path('../../lib/inqlude',__FILE__)
|
20
20
|
|
21
|
-
distro = Distro.detect
|
22
|
-
if !distro
|
23
|
-
STDERR.puts "Warning: unable to detect distro."
|
24
|
-
end
|
25
|
-
|
26
21
|
Cli.settings = Settings.new
|
27
|
-
Cli.distro = distro
|
28
22
|
|
29
23
|
Cli.check_unknown_options!
|
30
24
|
Cli.start ARGV
|
data/lib/cli.rb
CHANGED
@@ -26,8 +26,13 @@ class Cli < Thor
|
|
26
26
|
@@settings = s
|
27
27
|
end
|
28
28
|
|
29
|
-
def self.distro
|
30
|
-
@@distro
|
29
|
+
def self.distro
|
30
|
+
@@distro if @@distro
|
31
|
+
|
32
|
+
@@distro = Distro.detect
|
33
|
+
if !@@distro
|
34
|
+
STDERR.puts "Warning: unable to detect distro."
|
35
|
+
end
|
31
36
|
end
|
32
37
|
|
33
38
|
desc "global", "Global options", :hide => true
|
@@ -39,8 +44,8 @@ class Cli < Thor
|
|
39
44
|
qmake_out =~ /Qt version (.*) in/
|
40
45
|
puts "Qt: #{$1}"
|
41
46
|
|
42
|
-
if
|
43
|
-
puts "OS: #{
|
47
|
+
if self.distro
|
48
|
+
puts "OS: #{self.distro.name} #{self.distro.version}"
|
44
49
|
else
|
45
50
|
puts "OS: unknown"
|
46
51
|
end
|
@@ -63,7 +68,7 @@ class Cli < Thor
|
|
63
68
|
puts library.name + " (" + library.versions.join(", ") + ")"
|
64
69
|
end
|
65
70
|
else
|
66
|
-
manifests =
|
71
|
+
manifests = self.distro.installed handler
|
67
72
|
manifests.each do |manifest|
|
68
73
|
puts manifest["name"]
|
69
74
|
end
|
@@ -123,6 +128,7 @@ actual domain."
|
|
123
128
|
handler = ManifestHandler.new @@settings
|
124
129
|
handler.read_remote
|
125
130
|
count_ok = 0
|
131
|
+
count_warning = 0
|
126
132
|
handler.libraries.each do |library|
|
127
133
|
library.manifests.each do |manifest|
|
128
134
|
result = v.verify manifest
|
@@ -132,11 +138,15 @@ actual domain."
|
|
132
138
|
else
|
133
139
|
errors.push result
|
134
140
|
end
|
141
|
+
if result.has_warnings?
|
142
|
+
count_warning +=1
|
143
|
+
end
|
135
144
|
end
|
136
145
|
end
|
137
146
|
puts
|
138
147
|
puts "#{handler.manifests.count} manifests checked. #{count_ok} ok, " +
|
139
|
-
"#{errors.count} with error
|
148
|
+
"#{errors.count} with error, " +
|
149
|
+
"#{count_warning} #{count_warning == 1 ? "has warning." : "have warnings."}"
|
140
150
|
if !errors.empty?
|
141
151
|
puts
|
142
152
|
puts "Errors:"
|
@@ -263,7 +273,7 @@ actual domain."
|
|
263
273
|
if !manifest
|
264
274
|
STDERR.puts "Manifest for '#{name}' not found"
|
265
275
|
else
|
266
|
-
|
276
|
+
self.distro.uninstall manifest
|
267
277
|
end
|
268
278
|
end
|
269
279
|
|
@@ -276,7 +286,7 @@ actual domain."
|
|
276
286
|
if !manifest
|
277
287
|
STDERR.puts "Manifest for '#{name}' not found"
|
278
288
|
else
|
279
|
-
|
289
|
+
self.distro.install manifest, :dry_run => options[:dry_run]
|
280
290
|
end
|
281
291
|
end
|
282
292
|
|
data/lib/manifest.rb
CHANGED
data/lib/verifier.rb
CHANGED
@@ -17,17 +17,23 @@
|
|
17
17
|
class Verifier
|
18
18
|
|
19
19
|
class Result
|
20
|
-
attr_accessor :errors, :name
|
20
|
+
attr_accessor :errors, :warnings, :name
|
21
21
|
|
22
22
|
def initialize
|
23
23
|
@valid = false
|
24
|
+
@safe = false
|
24
25
|
@errors = Array.new
|
26
|
+
@warnings = Array.new
|
25
27
|
end
|
26
28
|
|
27
29
|
def valid?
|
28
30
|
@errors.empty?
|
29
31
|
end
|
30
32
|
|
33
|
+
def has_warnings?
|
34
|
+
!@warnings.empty?
|
35
|
+
end
|
36
|
+
|
31
37
|
def print_result
|
32
38
|
print "Verify manifest #{@name}..."
|
33
39
|
if valid?
|
@@ -38,6 +44,11 @@ class Verifier
|
|
38
44
|
puts " #{error}"
|
39
45
|
end
|
40
46
|
end
|
47
|
+
if has_warnings?
|
48
|
+
@warnings.each do |warning|
|
49
|
+
puts " #{warning}"
|
50
|
+
end
|
51
|
+
end
|
41
52
|
end
|
42
53
|
end
|
43
54
|
|
@@ -76,6 +87,17 @@ class Verifier
|
|
76
87
|
errors.each do |error|
|
77
88
|
@result.errors.push "Schema validation error: #{error}"
|
78
89
|
end
|
90
|
+
|
91
|
+
topics = manifest.topics
|
92
|
+
if topics.nil?
|
93
|
+
@result.warnings.push "Warning: missing `topics` attribute"
|
94
|
+
else
|
95
|
+
valid_topics = ['API', 'Artwork', 'Bindings', 'Communication', 'Data', 'Desktop', 'Development', 'Graphics', 'Logging', 'Mobile', 'Multimedia', 'Printing', 'QML', 'Scripting', 'Security', 'Text', 'Web', 'Widgets']
|
96
|
+
invalid_topics = topics - valid_topics
|
97
|
+
if !invalid_topics.empty?
|
98
|
+
@result.errors.push ("Invalid topics " + "'#{invalid_topics.join("', '")}'" + ". Valid topics are " + "'#{valid_topics.join("', '")}'")
|
99
|
+
end
|
100
|
+
end
|
79
101
|
end
|
80
102
|
|
81
103
|
@result
|
data/lib/version.rb
CHANGED
data/manifest-format.md
CHANGED
@@ -115,21 +115,18 @@ requirements. They are not necessarily meant to be read programmatically.
|
|
115
115
|
|
116
116
|
The following types are recognized:
|
117
117
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
* "mailing_list": Mailing list for discussing the library
|
131
|
-
* "contact": Contact information
|
132
|
-
* "custom": Array of pairs of title and URL of custom links
|
118
|
+
Attribute | Description
|
119
|
+
---------------------|----------------
|
120
|
+
`homepage` | Home page of the library. This is the main URL used as entry point for looking up information about the library. All manifests should contain a homepage URL.
|
121
|
+
`download` | Download area where the source code of the library can be downloaded. This is not the download of the specific version of the library. This is described in the packages section.
|
122
|
+
`vcs` | URL of the source code repository where the library is developed. This should point to the home of the repo, not to a specific release.
|
123
|
+
`tutorial` | URL to tutorial-style documentation how to use the library.
|
124
|
+
`api_docs` | URL to reference documentation of the API of the library.
|
125
|
+
`description_source` | If the description text is taken from another source this URL points to the source.
|
126
|
+
`announcement` | Link to release announcement
|
127
|
+
`mailing_list` | Mailing list for discussing the library
|
128
|
+
`contact` | Contact information
|
129
|
+
`custom` | Array of pairs of title and URL of custom links
|
133
130
|
|
134
131
|
*the homepage is a mandatory url attribute*
|
135
132
|
|
data/schema/generic-manifest-v1
CHANGED
data/schema/release-manifest-v1
CHANGED
data/spec/data/inqlude-all.json
CHANGED
@@ -5,6 +5,9 @@
|
|
5
5
|
"release_date": "2013-09-08",
|
6
6
|
"version": "0.2.0",
|
7
7
|
"summary": "Awesome library",
|
8
|
+
"topics": [
|
9
|
+
"API"
|
10
|
+
],
|
8
11
|
"urls": {
|
9
12
|
"homepage": "http://example.com",
|
10
13
|
"download": "http://example.com/download"
|
@@ -76,6 +79,9 @@
|
|
76
79
|
"$schema": "http://inqlude.org/schema/generic-manifest-v1#",
|
77
80
|
"name": "newlib",
|
78
81
|
"summary": "A new lib under heavy development",
|
82
|
+
"topics": [
|
83
|
+
"Bindings"
|
84
|
+
],
|
79
85
|
"urls": {
|
80
86
|
"homepage": "http://new.example.org",
|
81
87
|
"download": "http://new.example.org/download"
|
File without changes
|
File without changes
|
data/spec/data/{proprietarylib → manifests/proprietarylib}/proprietarylib.2013-12-22.manifest
RENAMED
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://inqlude.org/schema/generic-manifest-v1#",
|
3
|
+
"name": "miss-topics",
|
4
|
+
"summary": "Missing topics",
|
5
|
+
"urls": {
|
6
|
+
"homepage": "http://missing-topics.org",
|
7
|
+
"download": "http://missing-topics.org/download"
|
8
|
+
},
|
9
|
+
"licenses": [
|
10
|
+
"GPLv3"
|
11
|
+
],
|
12
|
+
"description": "This is a library with topics missing.",
|
13
|
+
"authors": [
|
14
|
+
"Cornelius Schumacher <schumacher@kde.org>"
|
15
|
+
],
|
16
|
+
"platforms": [
|
17
|
+
"Linux",
|
18
|
+
"Windows"
|
19
|
+
]
|
20
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://inqlude.org/schema/generic-manifest-v1#",
|
3
|
+
"name": "no-topics",
|
4
|
+
"summary": "No topics",
|
5
|
+
"urls": {
|
6
|
+
"homepage": "http://no-topics.org",
|
7
|
+
"download": "http://no-topics.org/download"
|
8
|
+
},
|
9
|
+
"licenses": [
|
10
|
+
"GPLv3"
|
11
|
+
],
|
12
|
+
"description": "This is a library with no topics.",
|
13
|
+
"authors": [
|
14
|
+
"Cornelius Schumacher <schumacher@kde.org>"
|
15
|
+
],
|
16
|
+
"platforms": [
|
17
|
+
"Linux",
|
18
|
+
"Windows"
|
19
|
+
]
|
20
|
+
}
|
@@ -22,9 +22,7 @@ describe "Command line interface" do
|
|
22
22
|
use_given_filesystem
|
23
23
|
|
24
24
|
it "recognizes --offline option" do
|
25
|
-
dir =
|
26
|
-
given_directory_from_data("awesomelib")
|
27
|
-
end
|
25
|
+
dir = given_directory_from_data("manifests")
|
28
26
|
|
29
27
|
# This doesn't make much sense to a user, but that's what it is right now.
|
30
28
|
# It will go away when we switched to GLI
|
@@ -11,8 +11,8 @@ describe "Command line interface" do
|
|
11
11
|
it "lists libraries" do
|
12
12
|
|
13
13
|
dir = given_directory do
|
14
|
-
given_directory_from_data("awesomelib")
|
15
|
-
given_directory_from_data("newlib")
|
14
|
+
given_directory_from_data("awesomelib", from: "manifests/awesomelib")
|
15
|
+
given_directory_from_data("newlib", from: "manifests/newlib")
|
16
16
|
end
|
17
17
|
|
18
18
|
result = run_command(args: ["list", "--remote", "--offline",
|
@@ -10,7 +10,7 @@ describe "Command line interface" do
|
|
10
10
|
describe "verify" do
|
11
11
|
it "verifies single manifest" do
|
12
12
|
dir = given_directory do
|
13
|
-
given_directory_from_data("awesomelib")
|
13
|
+
given_directory_from_data("awesomelib", from: "manifests/awesomelib")
|
14
14
|
end
|
15
15
|
|
16
16
|
result = run_command(args: ["verify",
|
@@ -20,8 +20,8 @@ describe "Command line interface" do
|
|
20
20
|
|
21
21
|
it "verifies all manifests" do
|
22
22
|
dir = given_directory do
|
23
|
-
given_directory_from_data("awesomelib")
|
24
|
-
given_directory_from_data("newlib")
|
23
|
+
given_directory_from_data("awesomelib", from: "manifests/awesomelib")
|
24
|
+
given_directory_from_data("newlib", from: "manifests/newlib")
|
25
25
|
end
|
26
26
|
|
27
27
|
result = run_command(args: ["verify", "--offline", "--manifest_dir=#{dir}"])
|
@@ -29,14 +29,14 @@ describe "Command line interface" do
|
|
29
29
|
Verify manifest awesomelib.2013-09-08.manifest...ok
|
30
30
|
Verify manifest newlib.manifest...ok
|
31
31
|
|
32
|
-
2 manifests checked. 2 ok, 0 with error.
|
32
|
+
2 manifests checked. 2 ok, 0 with error, 0 have warnings.
|
33
33
|
EOT
|
34
34
|
expect(result).to exit_with_success(expected_output)
|
35
35
|
end
|
36
36
|
|
37
37
|
it "verifies all manifests with syntax error" do
|
38
38
|
dir = given_directory do
|
39
|
-
given_directory_from_data("awesomelib")
|
39
|
+
given_directory_from_data("awesomelib", from: "manifests/awesomelib")
|
40
40
|
given_directory("newlib") do
|
41
41
|
given_dummy_file("newlib.manifest")
|
42
42
|
end
|
@@ -48,7 +48,7 @@ EOT
|
|
48
48
|
|
49
49
|
it "verifies all manifests with schema error" do
|
50
50
|
dir = given_directory do
|
51
|
-
given_directory_from_data("awesomelib")
|
51
|
+
given_directory_from_data("awesomelib", from: "manifests/awesomelib")
|
52
52
|
given_directory_from_data("broken")
|
53
53
|
end
|
54
54
|
|
@@ -63,8 +63,9 @@ Verify manifest broken.manifest...error
|
|
63
63
|
Schema validation error: The property '#/' did not contain a required property of 'licenses' in schema http://inqlude.org/schema/generic-manifest-v1#
|
64
64
|
Schema validation error: The property '#/' did not contain a required property of 'description' in schema http://inqlude.org/schema/generic-manifest-v1#
|
65
65
|
Schema validation error: The property '#/' did not contain a required property of 'platforms' in schema http://inqlude.org/schema/generic-manifest-v1#
|
66
|
+
Warning: missing `topics` attribute
|
66
67
|
|
67
|
-
2 manifests checked. 1 ok, 1 with error.
|
68
|
+
2 manifests checked. 1 ok, 1 with error, 1 has warning.
|
68
69
|
|
69
70
|
Errors:
|
70
71
|
broken.manifest
|
@@ -78,5 +79,41 @@ Errors:
|
|
78
79
|
EOT
|
79
80
|
expect(result).to exit_with_error(1,"",expected_output)
|
80
81
|
end
|
82
|
+
|
83
|
+
it "verifies manifests with one warning" do
|
84
|
+
dir = given_directory do
|
85
|
+
given_directory_from_data("awesomelib", from: "manifests/awesomelib")
|
86
|
+
given_directory_from_data("miss-topics", from: "missing-topics/miss-topics")
|
87
|
+
end
|
88
|
+
|
89
|
+
result = run_command(args: ["verify", "--offline", "--manifest_dir=#{dir}"])
|
90
|
+
expected_output = <<EOT
|
91
|
+
Verify manifest awesomelib.2013-09-08.manifest...ok
|
92
|
+
Verify manifest miss-topics.manifest...ok
|
93
|
+
Warning: missing `topics` attribute
|
94
|
+
|
95
|
+
2 manifests checked. 2 ok, 0 with error, 1 has warning.
|
96
|
+
EOT
|
97
|
+
expect(result).to exit_with_success(expected_output)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "verifies manifests with multiple warnings" do
|
101
|
+
dir = given_directory do
|
102
|
+
given_directory_from_data("miss-topics", from: "missing-topics/miss-topics")
|
103
|
+
given_directory_from_data("no-topics", from: "missing-topics/no-topics")
|
104
|
+
end
|
105
|
+
|
106
|
+
result = run_command(args: ["verify", "--offline", "--manifest_dir=#{dir}"])
|
107
|
+
expected_output = <<EOT
|
108
|
+
Verify manifest miss-topics.manifest...ok
|
109
|
+
Warning: missing `topics` attribute
|
110
|
+
Verify manifest no-topics.manifest...ok
|
111
|
+
Warning: missing `topics` attribute
|
112
|
+
|
113
|
+
2 manifests checked. 2 ok, 0 with error, 2 have warnings.
|
114
|
+
EOT
|
115
|
+
expect(result).to exit_with_success(expected_output)
|
116
|
+
end
|
117
|
+
|
81
118
|
end
|
82
119
|
end
|