inqlude 0.7.4 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -0
  3. data/CHANGELOG.md +7 -0
  4. data/README.md +2 -0
  5. data/bin/inqlude +0 -6
  6. data/lib/cli.rb +18 -8
  7. data/lib/manifest.rb +1 -0
  8. data/lib/verifier.rb +23 -1
  9. data/lib/version.rb +1 -1
  10. data/manifest-format.md +12 -15
  11. data/schema/generic-manifest-v1 +7 -0
  12. data/schema/proprietary-release-manifest-v1 +7 -0
  13. data/schema/release-manifest-v1 +7 -0
  14. data/spec/data/inqlude-all.json +6 -0
  15. data/spec/data/{awesomelib → manifests/awesomelib}/awesomelib.2013-09-08.manifest +3 -0
  16. data/spec/data/{bleedingedge → manifests/bleedingedge}/bleedingedge.2012-01-01.manifest +0 -0
  17. data/spec/data/{commercial → manifests/commercial}/commercial.manifest +0 -0
  18. data/spec/data/{newlib → manifests/newlib}/newlib.manifest +3 -0
  19. data/spec/data/{proprietarylib → manifests/proprietarylib}/proprietarylib.2013-12-22.manifest +0 -0
  20. data/spec/data/missing-topics/miss-topics/miss-topics.manifest +20 -0
  21. data/spec/data/missing-topics/no-topics/no-topics.manifest +20 -0
  22. data/spec/integration/cli_general_spec.rb +1 -3
  23. data/spec/integration/cli_list_spec.rb +2 -2
  24. data/spec/integration/cli_verify_spec.rb +44 -7
  25. data/spec/integration/cli_view_spec.rb +2 -2
  26. data/spec/unit/creator_spec.rb +12 -12
  27. data/spec/unit/kde_frameworks_release_spec.rb +11 -11
  28. data/spec/unit/manifest_handler_spec.rb +18 -18
  29. data/spec/unit/spec_helper.rb +1 -3
  30. data/spec/unit/verifier_spec.rb +165 -16
  31. data/topics/README.md +11 -0
  32. data/topics/list_topics +11 -0
  33. data/topics/list_topics.rb +28 -0
  34. data/topics/list_topics_spec.rb +32 -0
  35. data/topics/topics-test.csv +5 -0
  36. data/topics/topics.csv +202 -0
  37. data/view/contribute.html.haml +3 -1
  38. metadata +16 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0224ffe44586e1ff0a7c20230442433a0143b087
4
- data.tar.gz: e83375ed1990a411ac5229cd73bb390b029bfda2
3
+ metadata.gz: dfb73e8e83eb6e2b8e86b2e7289be7934d3c5967
4
+ data.tar.gz: 43279f4302b345f134218d48aebb844031c9b8a2
5
5
  SHA512:
6
- metadata.gz: 69fd8daf47555415e889c364aa31465e26664aa8fef2a46a35791f504a721bab8799187f5ee169563130a321e29fec82989337d5a14a5f70f1638da1f5ff2620
7
- data.tar.gz: 3ae968eb4d5a6d295cff30794cd46f5bc0b8a125d95a6fe20eba188b40421dab480087d6350b5c93caea1504d0fdae99467cf60012da8b7620b461332f58cf60
6
+ metadata.gz: d177de51fd1b3d7161adad5eef36ff8bdb47e7aeae565f48a6728ba8beefd2be19537bba03bd0134c2a24e5df102717492de7cfa1196d24f214c2e72e3f77eca
7
+ data.tar.gz: 8638a6c79f6c7400f577e010b7273022130d51d9ea7457d2e0bc5db48ba124098cdb4da83d85f0d5946512e32529781fdc2bb9a597a4a9e4b2f85871db42790e
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - "2.1.9"
4
+ - "2.2.5"
5
+ - "2.3.1"
6
+ script: bundle exec rspec spec
@@ -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
@@ -1,5 +1,7 @@
1
1
  # Inqlude - the Qt library archive
2
2
 
3
+ [![Build Status](https://travis-ci.org/cornelius/inqlude.svg?branch=master)](https://travis-ci.org/cornelius/inqlude)
4
+
3
5
  ## Overview
4
6
 
5
7
  Inqlude is a tool to handle Qt based libraries. It provides developers using Qt
@@ -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= d
30
- @@distro = d
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 @@distro
43
- puts "OS: #{@@distro.name} #{@@distro.version}"
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 = @@distro.installed handler
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
- @@distro.uninstall manifest
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
- @@distro.install manifest, :dry_run => options[:dry_run]
289
+ self.distro.install manifest, :dry_run => options[:dry_run]
280
290
  end
281
291
  end
282
292
 
@@ -38,6 +38,7 @@ class Manifest < JsonObject
38
38
  attribute :release_date
39
39
  attribute :version
40
40
  attribute :summary
41
+ attribute :topics
41
42
  attribute :urls do
42
43
  attribute :homepage
43
44
  attribute :api_docs
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Inqlude
2
- VERSION = "0.7.4"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -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
- * "homepage": Home page of the library. This is the main URL used as entry point
119
- for looking up information about the library. All manifests should contain
120
- a homepage URL.
121
- * "download": Download area where the source code of the library can be
122
- downloaded. This is not the download of the specific version of the library.
123
- This is described in the packages section.
124
- * "vcs": URL of the source code repository where the library is developed.
125
- * "tutorial": URL to tutorial-style documentation how to use the library.
126
- * "api_docs": URL to reference documentation of the API of the library.
127
- * "description_source": If the description text is taken from another source
128
- this URL points to the source.
129
- * "announcement": Link to release announcement
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
 
@@ -10,6 +10,13 @@
10
10
  "summary": {
11
11
  "type": "string"
12
12
  },
13
+ "topics": {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "string"
17
+ },
18
+ "minItems": 1
19
+ },
13
20
  "urls": {
14
21
  "type": "object",
15
22
  "properties": {
@@ -16,6 +16,13 @@
16
16
  "summary": {
17
17
  "type": "string"
18
18
  },
19
+ "topics": {
20
+ "type": "array",
21
+ "items": {
22
+ "type": "string"
23
+ },
24
+ "minItems": 1
25
+ },
19
26
  "urls": {
20
27
  "type": "object",
21
28
  "properties": {
@@ -16,6 +16,13 @@
16
16
  "summary": {
17
17
  "type": "string"
18
18
  },
19
+ "topics": {
20
+ "type": "array",
21
+ "items": {
22
+ "type": "string"
23
+ },
24
+ "minItems": 1
25
+ },
19
26
  "urls": {
20
27
  "type": "object",
21
28
  "properties": {
@@ -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"
@@ -4,6 +4,9 @@
4
4
  "release_date": "2013-09-08",
5
5
  "version": "0.2.0",
6
6
  "summary": "Awesome library",
7
+ "topics": [
8
+ "API"
9
+ ],
7
10
  "urls": {
8
11
  "homepage": "http://example.com",
9
12
  "download": "http://example.com/download"
@@ -2,6 +2,9 @@
2
2
  "$schema": "http://inqlude.org/schema/generic-manifest-v1#",
3
3
  "name": "newlib",
4
4
  "summary": "A new lib under heavy development",
5
+ "topics": [
6
+ "Bindings"
7
+ ],
5
8
  "urls": {
6
9
  "homepage": "http://new.example.org",
7
10
  "download": "http://new.example.org/download"
@@ -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 = given_directory do
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