inqlude 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.travis.yml +7 -3
  4. data/CHANGELOG.md +9 -0
  5. data/Gemfile +4 -0
  6. data/README.md +4 -0
  7. data/lib/cli.rb +24 -26
  8. data/lib/cli_controller.rb +24 -0
  9. data/lib/inqlude.rb +1 -0
  10. data/lib/kde_frameworks_release.rb +6 -1
  11. data/lib/manifest_handler.rb +44 -1
  12. data/lib/verifier.rb +4 -0
  13. data/lib/version.rb +1 -1
  14. data/lib/view.rb +62 -15
  15. data/manifest-format.md +30 -5
  16. data/spec/data/inqlude-all.json +11 -2
  17. data/spec/data/manifests/awesomelib/awesomelib.2013-09-08.manifest +4 -2
  18. data/spec/data/manifests/bleedingedge/bleedingedge.2012-01-01.manifest +3 -0
  19. data/spec/data/manifests/commercial/commercial.manifest +3 -0
  20. data/spec/data/manifests/newlib/newlib.manifest +1 -0
  21. data/spec/data/missing-topics/miss-topics/miss-topics.manifest +2 -1
  22. data/spec/integration/cli_verify_spec.rb +2 -0
  23. data/spec/integration/cli_view_spec.rb +102 -0
  24. data/spec/integration/spec_helper.rb +3 -0
  25. data/spec/online/cli_view_spec.rb +64 -0
  26. data/spec/online/spec_helper.rb +5 -0
  27. data/spec/stubs/qmake/qmake +2 -0
  28. data/spec/unit/cli_controller_spec.rb +51 -0
  29. data/spec/unit/kde_frameworks_release_spec.rb +36 -23
  30. data/spec/unit/manifest_handler_spec.rb +15 -1
  31. data/spec/unit/manifest_spec.rb +1 -1
  32. data/spec/unit/spec_helper.rb +10 -0
  33. data/spec/unit/view_spec.rb +68 -0
  34. data/topics/Manifest_updater/README.md +19 -0
  35. data/topics/Manifest_updater/app.js +43 -0
  36. data/topics/Manifest_updater/manifests/example/example.manifest +20 -0
  37. data/topics/Manifest_updater/package.json +9 -0
  38. data/topics/Manifest_updater/topics.csv +1 -0
  39. data/topics/Manifest_updater/update_manifests/example/example.manifest +24 -0
  40. data/topics/topics.csv +3 -0
  41. data/view/{about.html.haml → one-column/about.html.haml} +0 -0
  42. data/view/{all.html.haml → one-column/all.html.haml} +0 -0
  43. data/view/{commercial.html.haml → one-column/commercial.html.haml} +0 -0
  44. data/view/{contribute.html.haml → one-column/contribute.html.haml} +0 -0
  45. data/view/{development.html.haml → one-column/development.html.haml} +0 -0
  46. data/view/{favicon.ico → one-column/favicon.ico} +0 -0
  47. data/view/{get.html.haml → one-column/get.html.haml} +0 -0
  48. data/view/{group.html.haml → one-column/group.html.haml} +0 -0
  49. data/view/{index.html.haml → one-column/index.html.haml} +0 -0
  50. data/view/{layout.html.haml → one-column/layout.html.haml} +0 -0
  51. data/view/{library.html.haml → one-column/library.html.haml} +1 -1
  52. data/view/{public → one-column/public}/inqlude.css +0 -0
  53. data/view/{search.html.haml → one-column/search.html.haml} +0 -0
  54. data/view/{unreleased.html.haml → one-column/unreleased.html.haml} +0 -0
  55. data/view/two-column/about.html.haml +34 -0
  56. data/view/two-column/all.html.haml +47 -0
  57. data/view/two-column/contribute.html.haml +49 -0
  58. data/view/two-column/favicon.ico +0 -0
  59. data/view/two-column/get.html.haml +57 -0
  60. data/view/two-column/group.html.haml +52 -0
  61. data/view/two-column/index.html.haml +194 -0
  62. data/view/two-column/ios.ico +0 -0
  63. data/view/two-column/layout.html.haml +102 -0
  64. data/view/two-column/library.html.haml +64 -0
  65. data/view/two-column/public/inqlude.css +265 -0
  66. data/view/two-column/search.html.haml +20 -0
  67. data/view/two-column/topic.html.haml +47 -0
  68. metadata +41 -16
@@ -12,7 +12,7 @@ path, but by default the inqlude command line tool assumes the path
12
12
 
13
13
  The manifest directory is under version control by git.
14
14
 
15
- Each library reprented in the Inqlude system has its own sub-directory in the
15
+ Each library represented in the Inqlude system has its own sub-directory in the
16
16
  manifest directory. The name of the sub-directory is the name of the library.
17
17
  See there for more information about its specification and how it's used.
18
18
 
@@ -38,7 +38,7 @@ This is a reference to the schema which is used in the manifest file. The
38
38
  schema follows the [JSON Schema](http://json-schema.org) specification.
39
39
 
40
40
  The schema comes in three flavors: "generic", "release", and
41
- "proprietary-release". They differe in what fields are required, the meaning of
41
+ "proprietary-release". They differ in what fields are required, the meaning of
42
42
  fields is the same in all. "generic" is a subset of "proprietary-release", which
43
43
  is a subset of "release".
44
44
 
@@ -74,13 +74,23 @@ other library and a "-qt" suffix. For example the Qt bindings to PackageKit
74
74
  are named "packagekit-qt" in Inqlude.
75
75
 
76
76
  It's used as internal handle by the tools and shows up where it
77
- needs to be processed by software, e.g. as an identifier as paramezer of the
77
+ needs to be processed by software, e.g. as an identifier as parameter of the
78
78
  command line tool or as part of the URL on the web site. The name has to be
79
79
  identical with the value of the name attribute of the manifest files
80
80
  representing the different versions of the library.
81
81
 
82
82
  *name is a mandatory attribute*
83
83
 
84
+ ### display_name
85
+
86
+ The real name of the library that is displayed in the website.
87
+
88
+ This holds the name in a way formatted for best human readability. This can contain
89
+ characters which are upper-case, lower-case, alphanumeric, symbols and
90
+ special signs.
91
+
92
+ *display_name is an optional attribute*
93
+
84
94
  ### release_date
85
95
 
86
96
  Date, when the version was released
@@ -101,6 +111,21 @@ This is the main description of the library used in summary lists etc.
101
111
 
102
112
  *summary is a mandatory attribute*
103
113
 
114
+ ### topics
115
+
116
+ Array of strings identifying the topics to which the library belongs.
117
+
118
+ Topics are used to categorize libraries. Each library has at least one topic,
119
+ but can have more than one.
120
+
121
+ At the moment valid topics are:
122
+
123
+ "API", "Artwork", "Bindings", "Communication", "Data", "Desktop", "Development",
124
+ "Graphics", "Logging", "Mobile", "Multimedia", "Printing", "QML", "Scripting",
125
+ "Security", "Text", "Web", "Widgets"
126
+
127
+ *topics is an optional attribute, preferred to have at least one topic*
128
+
104
129
  ### urls
105
130
 
106
131
  List of URLs relevant to the library
@@ -216,13 +241,13 @@ openSUSE binary packages. For each version of openSUSE there is a separate
216
241
  entry.
217
242
 
218
243
  Each entry contains the package_name, repository, and source_rpm attributes.
219
- The repository contains an url and a name sub-attribute.
244
+ The repository contains a url and a name sub-attribute.
220
245
 
221
246
  ### group
222
247
 
223
248
  Name of a group
224
249
 
225
250
  The group optionally specifies the name of a group of libraries the library
226
- described my the manifest belongs to.
251
+ described by the manifest belongs to.
227
252
 
228
253
  At the moment only the value "kde-frameworks" is used.
@@ -2,6 +2,7 @@
2
2
  {
3
3
  "$schema": "http://inqlude.org/schema/release-manifest-v1#",
4
4
  "name": "awesomelib",
5
+ "display_name": "Awesomelib",
5
6
  "release_date": "2013-09-08",
6
7
  "version": "0.2.0",
7
8
  "summary": "Awesome library",
@@ -10,7 +11,8 @@
10
11
  ],
11
12
  "urls": {
12
13
  "homepage": "http://example.com",
13
- "download": "http://example.com/download"
14
+ "download": "http://example.com/download",
15
+ "vcs": "http://example.com/git"
14
16
  },
15
17
  "licenses": [
16
18
  "LGPLv2.1+",
@@ -35,6 +37,9 @@
35
37
  "release_date": "2012-01-01",
36
38
  "version": "edge",
37
39
  "summary": "Bleeding edge version of a library",
40
+ "topics": [
41
+ "API"
42
+ ],
38
43
  "urls": {
39
44
  "homepage": "http://example.org",
40
45
  "download": "http://example.org/download"
@@ -59,6 +64,9 @@
59
64
  "$schema": "http://inqlude.org/schema/generic-manifest-v1#",
60
65
  "name": "commercial",
61
66
  "summary": "Commercial library",
67
+ "topics": [
68
+ "Data"
69
+ ],
62
70
  "urls": {
63
71
  "homepage": "http://commercial.example.org"
64
72
  },
@@ -78,6 +86,7 @@
78
86
  {
79
87
  "$schema": "http://inqlude.org/schema/generic-manifest-v1#",
80
88
  "name": "newlib",
89
+ "display_name": "Newlib",
81
90
  "summary": "A new lib under heavy development",
82
91
  "topics": [
83
92
  "Bindings"
@@ -123,4 +132,4 @@
123
132
  "OS X"
124
133
  ]
125
134
  }
126
- ]
135
+ ]
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "$schema": "http://inqlude.org/schema/release-manifest-v1#",
3
3
  "name": "awesomelib",
4
+ "display_name": "Awesomelib",
4
5
  "release_date": "2013-09-08",
5
6
  "version": "0.2.0",
6
7
  "summary": "Awesome library",
@@ -9,7 +10,8 @@
9
10
  ],
10
11
  "urls": {
11
12
  "homepage": "http://example.com",
12
- "download": "http://example.com/download"
13
+ "download": "http://example.com/download",
14
+ "vcs": "http://example.com/git"
13
15
  },
14
16
  "licenses": [
15
17
  "LGPLv2.1+",
@@ -27,4 +29,4 @@
27
29
  "source": "ftp://example.com/download/awesomelib-0.2.0.tar.gz"
28
30
  },
29
31
  "group": "kde-frameworks"
30
- }
32
+ }
@@ -4,6 +4,9 @@
4
4
  "release_date": "2012-01-01",
5
5
  "version": "edge",
6
6
  "summary": "Bleeding edge version of a library",
7
+ "topics": [
8
+ "API"
9
+ ],
7
10
  "urls": {
8
11
  "homepage": "http://example.org",
9
12
  "download": "http://example.org/download"
@@ -2,6 +2,9 @@
2
2
  "$schema": "http://inqlude.org/schema/generic-manifest-v1#",
3
3
  "name": "commercial",
4
4
  "summary": "Commercial library",
5
+ "topics": [
6
+ "Data"
7
+ ],
5
8
  "urls": {
6
9
  "homepage": "http://commercial.example.org"
7
10
  },
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "$schema": "http://inqlude.org/schema/generic-manifest-v1#",
3
3
  "name": "newlib",
4
+ "display_name": "Newlib",
4
5
  "summary": "A new lib under heavy development",
5
6
  "topics": [
6
7
  "Bindings"
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "$schema": "http://inqlude.org/schema/generic-manifest-v1#",
3
- "name": "miss-topics",
3
+ "name": "miss-topics",
4
+ "display_name": "Miss-topics",
4
5
  "summary": "Missing topics",
5
6
  "urls": {
6
7
  "homepage": "http://missing-topics.org",
@@ -63,6 +63,7 @@ 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 `display_name` attribute
66
67
  Warning: missing `topics` attribute
67
68
 
68
69
  2 manifests checked. 1 ok, 1 with error, 1 has warning.
@@ -108,6 +109,7 @@ EOT
108
109
  Verify manifest miss-topics.manifest...ok
109
110
  Warning: missing `topics` attribute
110
111
  Verify manifest no-topics.manifest...ok
112
+ Warning: missing `display_name` attribute
111
113
  Warning: missing `topics` attribute
112
114
 
113
115
  2 manifests checked. 2 ok, 0 with error, 2 have warnings.
@@ -24,5 +24,107 @@ describe "Command line interface" do
24
24
  expect(File.exist?(File.join(output_dir, "libraries", "awesomelib.html"))).to be(true)
25
25
  expect(File.exist?(File.join(output_dir, "libraries", "newlib.html"))).to be(true)
26
26
  end
27
+
28
+ it "checks templates direstory" do
29
+ dir = given_directory do
30
+ given_directory_from_data("awesomelib", from: "manifests/awesomelib")
31
+ given_directory_from_data("newlib", from: "manifests/newlib")
32
+ end
33
+
34
+ output_dir = given_directory
35
+
36
+ result = run_command(args: ["view", "--offline", "--manifest_dir=#{dir}",
37
+ "--output-dir=#{output_dir}", "--templates=one-column"])
38
+ expect(result).to exit_with_success(/Creating web site/)
39
+
40
+ result = run_command(args: ["view", "--offline", "--manifest_dir=#{dir}",
41
+ "--output-dir=#{output_dir}", "--templates=unreal-template"])
42
+ expected_output = <<EOT
43
+ Error: Templates directory doesn't exist
44
+ EOT
45
+ expect(result).to exit_with_error(1, expected_output)
46
+ end
47
+
48
+ it "generates templates" do
49
+ dir = given_directory do
50
+ given_directory_from_data("awesomelib", from: "manifests/awesomelib")
51
+ given_directory_from_data("newlib", from: "manifests/newlib")
52
+ end
53
+
54
+ output_dir = given_directory
55
+
56
+ result = run_command(args: ["view", "--offline", "--manifest_dir=#{dir}",
57
+ "--output-dir=#{output_dir}", "--templates=one-column"])
58
+ expect(result).to exit_with_success(/Creating web site/)
59
+
60
+ expect(File.exist?(File.join(output_dir, "index.html"))).to be(true)
61
+ expect(File.exist?(File.join(output_dir, "libraries", "awesomelib.html"))).to be(true)
62
+ expect(File.exist?(File.join(output_dir, "libraries", "newlib.html"))).to be(true)
63
+ end
64
+
65
+ context "inqlude-all.json" do
66
+ before(:each) do
67
+ @manifest_dir = given_directory do
68
+ given_directory_from_data("awesomelib", from: "manifests/awesomelib")
69
+ given_directory_from_data("newlib", from: "manifests/newlib")
70
+ end
71
+
72
+ @output_dir = given_directory
73
+
74
+ run_command(args: ["view", "--offline", "--manifest_dir=#{@manifest_dir}",
75
+ "--output-dir=#{@output_dir}"])
76
+ end
77
+
78
+ it "checks number of manifests" do
79
+ data = File.read(File.join(@output_dir, 'inqlude-all.json'))
80
+ parsed_data = JSON.parse(data);
81
+
82
+ settings = Settings.new
83
+ settings.manifest_path = @manifest_dir
84
+ settings.offline = true
85
+ handler = ManifestHandler.new settings
86
+ handler.read_remote
87
+
88
+ expect(handler.libraries.length).to eq parsed_data.length
89
+ end
90
+
91
+ it "checks content" do
92
+ data = File.read(File.join(@output_dir, 'inqlude-all.json'))
93
+ parsed_data = JSON.parse(data);
94
+ for element in parsed_data do
95
+ if element["name"] == "awesomelib"
96
+ library = element
97
+ break
98
+ end
99
+ end
100
+
101
+ expect(library).to be
102
+
103
+ settings = Settings.new
104
+ handler = ManifestHandler.new settings
105
+ settings.manifest_path = @manifest_dir
106
+ settings.offline = true
107
+ handler.read_remote
108
+
109
+ manifest = handler.library("awesomelib").latest_manifest
110
+
111
+ expect(manifest.display_name).to eq "Awesomelib"
112
+ expect(manifest.release_date).to eq "2013-09-08"
113
+ expect(manifest.version).to eq "0.2.0"
114
+ expect(manifest.summary).to eq "Awesome library"
115
+ expect(manifest.topics).to eq ["API"]
116
+
117
+ expect(manifest.urls.homepage).to eq "http://example.com"
118
+ expect(manifest.urls.download).to eq "http://example.com/download"
119
+ expect(manifest.urls.vcs).to eq "http://example.com/git"
120
+
121
+ expect(manifest.licenses).to eq ["LGPLv2.1+", "Commercial"]
122
+ expect(manifest.description).to eq "This is an awesome library."
123
+ expect(manifest.authors).to eq ["Cornelius Schumacher <schumacher@kde.org>"]
124
+ expect(manifest.maturity).to eq "stable"
125
+
126
+ expect(manifest.packages.source).to eq "ftp://example.com/download/awesomelib-0.2.0.tar.gz"
127
+ end
128
+ end
27
129
  end
28
130
  end
@@ -1,2 +1,5 @@
1
1
  require "cli_tester"
2
2
  require "given_filesystem/spec_helpers"
3
+ require "json"
4
+
5
+ require_relative "../../lib/inqlude"
@@ -0,0 +1,64 @@
1
+ require_relative "spec_helper"
2
+
3
+ include CliTester
4
+
5
+ describe "Command line interface" do
6
+ include GivenFilesystemSpecHelpers
7
+
8
+ use_given_filesystem
9
+
10
+ describe "view" do
11
+ before(:each) do
12
+ @output_dir = given_directory
13
+ run_command(args: ["view", "--output-dir=#{@output_dir}"])
14
+ end
15
+
16
+ it "generates inqlude-all.json from online data" do
17
+ data = File.read(File.join(@output_dir, 'inqlude-all.json'))
18
+ parsed_data = JSON.parse(data);
19
+
20
+ settings = Settings.new
21
+ handler = ManifestHandler.new settings
22
+ handler.read_remote
23
+
24
+ expect(handler.libraries.length).to eq parsed_data.length
25
+
26
+ for element in parsed_data do
27
+ if element["name"] == "baloo"
28
+ library = element
29
+ break
30
+ end
31
+ end
32
+
33
+ manifest = handler.library("baloo").latest_manifest
34
+
35
+ expect(manifest.display_name).to eq library["display_name"]
36
+ expect(manifest.release_date).to eq library["release_date"]
37
+ expect(manifest.version).to eq library["version"]
38
+ expect(manifest.summary).to eq library["summary"]
39
+ expect(manifest.topics).to eq library["topics"]
40
+
41
+ expect(manifest.urls.homepage).to eq library["urls"]["homepage"]
42
+ expect(manifest.urls.api_docs).to eq library["urls"]["api_docs"]
43
+ expect(manifest.urls.download).to eq library["urls"]["download"]
44
+ expect(manifest.urls.tutorial).to eq library["urls"]["tutorial"]
45
+ expect(manifest.urls.vcs).to eq library["urls"]["vcs"]
46
+ expect(manifest.urls.description_source).to eq library["urls"]["description_source"]
47
+ expect(manifest.urls.announcement).to eq library["urls"]["announcement"]
48
+ expect(manifest.urls.mailing_list).to eq library["urls"]["mailing_list"]
49
+ expect(manifest.urls.contact).to eq library["urls"]["contact"]
50
+ expect(manifest.urls.custom).to eq library["urls"]["custom"]
51
+
52
+ expect(manifest.licenses).to eq library["licenses"]
53
+ expect(manifest.description).to eq library["description"]
54
+ expect(manifest.authors).to eq library["authors"]
55
+ expect(manifest.maturity).to eq library["maturity"]
56
+
57
+ expect(manifest.packages.source).to eq library["packages"]["source"]
58
+ expect(manifest.packages.openSUSE).to eq library["packages"]["openSUSE"]
59
+ expect(manifest.packages.windows).to eq library["packages"]["windows"]
60
+ expect(manifest.packages.ubuntu).to eq library["packages"]["ubuntu"]
61
+ expect(manifest.packages.osx).to eq library["packages"]["osx"]
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,5 @@
1
+ require "cli_tester"
2
+ require "given_filesystem/spec_helpers"
3
+ require "json"
4
+
5
+ require_relative "../../lib/inqlude"
@@ -0,0 +1,2 @@
1
+ echo QMake version 2.01a
2
+ echo Using Qt version 4.8.6 in /usr/lib64hello
@@ -0,0 +1,51 @@
1
+ require_relative "spec_helper"
2
+
3
+ class DistroUnknown
4
+ def name
5
+ "<unknown distro>"
6
+ end
7
+
8
+ def version
9
+ "<unknown version>"
10
+ end
11
+ end
12
+
13
+ describe CliController do
14
+ let(:distro) {DistroUnknown.new}
15
+
16
+ describe ".print_versions" do
17
+ context "with qmake installed" do
18
+ before do
19
+ ENV["PATH"] = stubs_path("qmake") + ":" + ENV["PATH"]
20
+ end
21
+
22
+ it "prints versions" do
23
+ expected_output = <<EOT
24
+ Inqlude: #{Inqlude::VERSION}
25
+ Qt: 4.8.6
26
+ OS: <unknown distro> <unknown version>
27
+ EOT
28
+ expect {
29
+ CliController.print_versions(distro)
30
+ }.to output(expected_output).to_stdout
31
+ end
32
+ end
33
+
34
+ context "without qmake installed" do
35
+ before do
36
+ allow(CliController).to receive(:find_executable).with("qmake").and_return(false)
37
+ end
38
+
39
+ it "prints versions" do
40
+ expected_output = <<EOT
41
+ Inqlude: #{Inqlude::VERSION}
42
+ Qt: not found
43
+ OS: <unknown distro> <unknown version>
44
+ EOT
45
+ expect {
46
+ CliController.print_versions(distro)
47
+ }.to output(expected_output).to_stdout
48
+ end
49
+ end
50
+ end
51
+ end