inqlude 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.travis.yml +7 -3
- data/CHANGELOG.md +9 -0
- data/Gemfile +4 -0
- data/README.md +4 -0
- data/lib/cli.rb +24 -26
- data/lib/cli_controller.rb +24 -0
- data/lib/inqlude.rb +1 -0
- data/lib/kde_frameworks_release.rb +6 -1
- data/lib/manifest_handler.rb +44 -1
- data/lib/verifier.rb +4 -0
- data/lib/version.rb +1 -1
- data/lib/view.rb +62 -15
- data/manifest-format.md +30 -5
- data/spec/data/inqlude-all.json +11 -2
- data/spec/data/manifests/awesomelib/awesomelib.2013-09-08.manifest +4 -2
- data/spec/data/manifests/bleedingedge/bleedingedge.2012-01-01.manifest +3 -0
- data/spec/data/manifests/commercial/commercial.manifest +3 -0
- data/spec/data/manifests/newlib/newlib.manifest +1 -0
- data/spec/data/missing-topics/miss-topics/miss-topics.manifest +2 -1
- data/spec/integration/cli_verify_spec.rb +2 -0
- data/spec/integration/cli_view_spec.rb +102 -0
- data/spec/integration/spec_helper.rb +3 -0
- data/spec/online/cli_view_spec.rb +64 -0
- data/spec/online/spec_helper.rb +5 -0
- data/spec/stubs/qmake/qmake +2 -0
- data/spec/unit/cli_controller_spec.rb +51 -0
- data/spec/unit/kde_frameworks_release_spec.rb +36 -23
- data/spec/unit/manifest_handler_spec.rb +15 -1
- data/spec/unit/manifest_spec.rb +1 -1
- data/spec/unit/spec_helper.rb +10 -0
- data/spec/unit/view_spec.rb +68 -0
- data/topics/Manifest_updater/README.md +19 -0
- data/topics/Manifest_updater/app.js +43 -0
- data/topics/Manifest_updater/manifests/example/example.manifest +20 -0
- data/topics/Manifest_updater/package.json +9 -0
- data/topics/Manifest_updater/topics.csv +1 -0
- data/topics/Manifest_updater/update_manifests/example/example.manifest +24 -0
- data/topics/topics.csv +3 -0
- data/view/{about.html.haml → one-column/about.html.haml} +0 -0
- data/view/{all.html.haml → one-column/all.html.haml} +0 -0
- data/view/{commercial.html.haml → one-column/commercial.html.haml} +0 -0
- data/view/{contribute.html.haml → one-column/contribute.html.haml} +0 -0
- data/view/{development.html.haml → one-column/development.html.haml} +0 -0
- data/view/{favicon.ico → one-column/favicon.ico} +0 -0
- data/view/{get.html.haml → one-column/get.html.haml} +0 -0
- data/view/{group.html.haml → one-column/group.html.haml} +0 -0
- data/view/{index.html.haml → one-column/index.html.haml} +0 -0
- data/view/{layout.html.haml → one-column/layout.html.haml} +0 -0
- data/view/{library.html.haml → one-column/library.html.haml} +1 -1
- data/view/{public → one-column/public}/inqlude.css +0 -0
- data/view/{search.html.haml → one-column/search.html.haml} +0 -0
- data/view/{unreleased.html.haml → one-column/unreleased.html.haml} +0 -0
- data/view/two-column/about.html.haml +34 -0
- data/view/two-column/all.html.haml +47 -0
- data/view/two-column/contribute.html.haml +49 -0
- data/view/two-column/favicon.ico +0 -0
- data/view/two-column/get.html.haml +57 -0
- data/view/two-column/group.html.haml +52 -0
- data/view/two-column/index.html.haml +194 -0
- data/view/two-column/ios.ico +0 -0
- data/view/two-column/layout.html.haml +102 -0
- data/view/two-column/library.html.haml +64 -0
- data/view/two-column/public/inqlude.css +265 -0
- data/view/two-column/search.html.haml +20 -0
- data/view/two-column/topic.html.haml +47 -0
- metadata +41 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b71cfe26a50e95a5925b48324ff91b084b0bcd7e
|
4
|
+
data.tar.gz: 3a07f9ec5fd189e2d258f5de6871dccb8cc44ab0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0665295254b87ab55b65dcd8e95c5e9406f467186684e551e989b2955bd460f92f2c62873dbed355a94f76f23a7bee76124c59e7eae38cda6bff462329fac7bc
|
7
|
+
data.tar.gz: 704e0a8c7584a2c4ba13524dc5b8c1e62c593341bccb70d2a10171225c4bc8c974e380bb7a8df9867cacaa8bc281263776a0ce7b7985da31827f6cd5817d1508
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
- 2.1.9
|
4
|
+
- 2.2.5
|
5
|
+
- 2.3.1
|
6
6
|
script: bundle exec rspec spec
|
7
|
+
addons:
|
8
|
+
code_climate:
|
9
|
+
repo_token:
|
10
|
+
secure: x4ET3gWdfwTC66ExUDoYFdJ3AvCTbms7dokF7RaUrf7xnr3PInHnRgzZP7hICkEYW4t20JPjwiJUUdifk5XUcMSlQ5AAPKjFXP4wyQYPvpizI5FvRsX0a62/Fv1juXxs9hPFmXITqN861iT1rkqC383evyR9KxPDZMOi0VEOjAs=
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change log of Inqlude
|
2
2
|
|
3
|
+
## Version 0.9.0
|
4
|
+
|
5
|
+
* Put out progress when creating release manifests
|
6
|
+
* Prototype for new layout of the website as alternative view template
|
7
|
+
* Better error when view templates directory does not exist
|
8
|
+
* Show topics in view
|
9
|
+
* Add validation for display_name attribute
|
10
|
+
* Gracefully fail in --version when Qt is not installed
|
11
|
+
|
3
12
|
## Version 0.8.0
|
4
13
|
|
5
14
|
* 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.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Inqlude - the Qt library archive
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/inqlude)
|
3
4
|
[](https://travis-ci.org/cornelius/inqlude)
|
5
|
+
[](https://dependencyci.com/github/cornelius/inqlude)
|
6
|
+
[](https://codeclimate.com/github/cornelius/inqlude)
|
7
|
+
[](https://codeclimate.com/github/cornelius/inqlude/coverage)
|
4
8
|
|
5
9
|
## Overview
|
6
10
|
|
data/lib/cli.rb
CHANGED
@@ -26,29 +26,10 @@ class Cli < Thor
|
|
26
26
|
@@settings = s
|
27
27
|
end
|
28
28
|
|
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
|
36
|
-
end
|
37
|
-
|
38
29
|
desc "global", "Global options", :hide => true
|
39
30
|
def global
|
40
31
|
if options[:version]
|
41
|
-
|
42
|
-
|
43
|
-
qmake_out = `qmake -v`
|
44
|
-
qmake_out =~ /Qt version (.*) in/
|
45
|
-
puts "Qt: #{$1}"
|
46
|
-
|
47
|
-
if self.distro
|
48
|
-
puts "OS: #{self.distro.name} #{self.distro.version}"
|
49
|
-
else
|
50
|
-
puts "OS: unknown"
|
51
|
-
end
|
32
|
+
CliController.print_versions(Distro.detect)
|
52
33
|
else
|
53
34
|
Cli.help shell
|
54
35
|
end
|
@@ -68,7 +49,7 @@ class Cli < Thor
|
|
68
49
|
puts library.name + " (" + library.versions.join(", ") + ")"
|
69
50
|
end
|
70
51
|
else
|
71
|
-
manifests =
|
52
|
+
manifests = Distro.detect.installed handler
|
72
53
|
manifests.each do |manifest|
|
73
54
|
puts manifest["name"]
|
74
55
|
end
|
@@ -85,20 +66,37 @@ class Cli < Thor
|
|
85
66
|
actual domain."
|
86
67
|
method_option :disable_search, :type => :boolean,
|
87
68
|
:desc => "Disable Google based search."
|
69
|
+
method_option :templates, :type => :string, :aliases => "-t", :default => "one-column",
|
70
|
+
:desc => "Switch templates", :required => false
|
88
71
|
def view
|
89
72
|
process_global_options options
|
90
73
|
|
74
|
+
output_dir = options[:output_dir]
|
75
|
+
|
91
76
|
if options[:manifest_dir]
|
92
77
|
@@settings.manifest_path = options[:manifest_dir]
|
93
78
|
end
|
94
79
|
|
95
80
|
manifest_handler = ManifestHandler.new(@@settings)
|
81
|
+
|
96
82
|
manifest_handler.read_remote
|
97
83
|
|
98
84
|
view = View.new(manifest_handler)
|
99
|
-
|
100
|
-
view.
|
101
|
-
|
85
|
+
|
86
|
+
view.templates = options[:templates]
|
87
|
+
|
88
|
+
if !view.template_directory_exists?
|
89
|
+
STDERR.puts "Error: Templates directory doesn't exist"
|
90
|
+
exit 1
|
91
|
+
else
|
92
|
+
puts "Creating web site in '#{output_dir}' from '#{manifest_handler.settings.manifest_path}'"
|
93
|
+
|
94
|
+
view.enable_disqus = options[:enable_disqus]
|
95
|
+
view.enable_search = !options[:disable_search]
|
96
|
+
|
97
|
+
view.create output_dir
|
98
|
+
end
|
99
|
+
|
102
100
|
end
|
103
101
|
|
104
102
|
desc "show <library_name>", "Show library details"
|
@@ -273,7 +271,7 @@ actual domain."
|
|
273
271
|
if !manifest
|
274
272
|
STDERR.puts "Manifest for '#{name}' not found"
|
275
273
|
else
|
276
|
-
|
274
|
+
Distro.detect.uninstall manifest
|
277
275
|
end
|
278
276
|
end
|
279
277
|
|
@@ -286,7 +284,7 @@ actual domain."
|
|
286
284
|
if !manifest
|
287
285
|
STDERR.puts "Manifest for '#{name}' not found"
|
288
286
|
else
|
289
|
-
|
287
|
+
Distro.detect.install manifest, :dry_run => options[:dry_run]
|
290
288
|
end
|
291
289
|
end
|
292
290
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class CliController
|
2
|
+
def self.print_versions(distro)
|
3
|
+
puts "Inqlude: #{Inqlude::VERSION}"
|
4
|
+
|
5
|
+
if find_executable("qmake")
|
6
|
+
qmake_out = `qmake -v`
|
7
|
+
qmake_out =~ /Qt version (.*) in/
|
8
|
+
puts "Qt: #{$1}"
|
9
|
+
else
|
10
|
+
puts "Qt: not found"
|
11
|
+
end
|
12
|
+
|
13
|
+
if distro
|
14
|
+
puts "OS: #{distro.name} #{distro.version}"
|
15
|
+
else
|
16
|
+
puts "OS: unknown"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.find_executable(executable)
|
21
|
+
`which #{executable}`
|
22
|
+
$?.success?
|
23
|
+
end
|
24
|
+
end
|
data/lib/inqlude.rb
CHANGED
@@ -40,23 +40,28 @@ class KdeFrameworksRelease
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def read_generic_manifests
|
43
|
+
puts "Reading generic manifests from '#{@handler.settings.manifest_path}'..."
|
43
44
|
@generic_manifests = Array.new
|
44
45
|
@handler.read_remote
|
45
46
|
@handler.group("kde-frameworks").each do |library|
|
46
47
|
@generic_manifests.push library.generic_manifest
|
47
48
|
end
|
49
|
+
puts "Read #{@generic_manifests.count} manifests."
|
48
50
|
@generic_manifests
|
49
51
|
end
|
50
52
|
|
51
53
|
def write_release_manifests release_date, version
|
54
|
+
puts "Writing release manifests for version '#{version}'..."
|
52
55
|
@generic_manifests.each do |generic_manifest|
|
53
56
|
release_manifest = KdeFrameworksRelease.create_release_manifest(
|
54
57
|
generic_manifest, release_date, version )
|
55
58
|
path = @handler.manifest_path( release_manifest )
|
56
59
|
File.open( path, "w" ) do |file|
|
60
|
+
puts " #{path}"
|
57
61
|
file.write release_manifest.to_json
|
58
62
|
end
|
59
|
-
end
|
63
|
+
end
|
64
|
+
puts "Written #{@generic_manifests.count} manifests."
|
60
65
|
end
|
61
66
|
|
62
67
|
end
|
data/lib/manifest_handler.rb
CHANGED
@@ -53,7 +53,28 @@ class ManifestHandler
|
|
53
53
|
manifest.licenses.include? "Commercial"
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
|
+
def latest_libraries
|
58
|
+
releases = Array.new
|
59
|
+
is_kde_added = false
|
60
|
+
|
61
|
+
libraries.select do |library|
|
62
|
+
if library.latest_manifest.has_version? && library.latest_manifest.group != "kde-frameworks"
|
63
|
+
releases.push library
|
64
|
+
elsif library.latest_manifest.has_version? && library.latest_manifest.group == "kde-frameworks"
|
65
|
+
if !is_kde_added
|
66
|
+
is_kde_added = true
|
67
|
+
releases.push library
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
releases.sort! {|a,b| a.latest_manifest.release_date <=> b.latest_manifest.release_date}
|
73
|
+
releases.reverse!
|
74
|
+
|
75
|
+
return releases[0 .. 4]
|
76
|
+
end
|
77
|
+
|
57
78
|
def group name
|
58
79
|
return @libraries.select do |l|
|
59
80
|
manifest = l.latest_manifest
|
@@ -79,6 +100,28 @@ class ManifestHandler
|
|
79
100
|
raise InqludeError.new("Unable to find manifest '#{name}'")
|
80
101
|
end
|
81
102
|
|
103
|
+
def topic name
|
104
|
+
return @libraries.select do |l|
|
105
|
+
manifest = l.latest_manifest
|
106
|
+
if manifest.topics
|
107
|
+
manifest.topics.include? name
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def no_of_libraries topic
|
113
|
+
count =0;
|
114
|
+
@libraries.each do |l|
|
115
|
+
topics = l.latest_manifest.topics
|
116
|
+
if topics
|
117
|
+
if l.latest_manifest.topics.include? topic
|
118
|
+
count = count + 1
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
count
|
123
|
+
end
|
124
|
+
|
82
125
|
def read_remote
|
83
126
|
@libraries.clear
|
84
127
|
@manifests.clear
|
data/lib/verifier.rb
CHANGED
@@ -88,6 +88,10 @@ class Verifier
|
|
88
88
|
@result.errors.push "Schema validation error: #{error}"
|
89
89
|
end
|
90
90
|
|
91
|
+
if manifest.display_name.nil?
|
92
|
+
@result.warnings.push "Warning: missing `display_name` attribute"
|
93
|
+
end
|
94
|
+
|
91
95
|
topics = manifest.topics
|
92
96
|
if topics.nil?
|
93
97
|
@result.warnings.push "Warning: missing `topics` attribute"
|
data/lib/version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
class View
|
18
18
|
|
19
|
-
attr_accessor :enable_disqus,:enable_search,:manifest,:library,:group_name
|
19
|
+
attr_accessor :enable_disqus,:enable_search,:manifest,:library,:group_name,:templates
|
20
20
|
attr_reader :root
|
21
21
|
|
22
22
|
def initialize handler
|
@@ -24,11 +24,13 @@ class View
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def create output_dir
|
27
|
-
puts "Creating web site in '#{output_dir}' from '#{@manifest_handler.settings.manifest_path}'"
|
28
|
-
|
29
27
|
assert_dir output_dir
|
30
28
|
|
31
29
|
system "cp #{view_dir}/favicon.ico #{output_dir}"
|
30
|
+
|
31
|
+
if templates == "two-column"
|
32
|
+
system "cp #{view_dir}/ios.ico #{output_dir}"
|
33
|
+
end
|
32
34
|
|
33
35
|
assert_dir "#{output_dir}/public"
|
34
36
|
system "cp #{view_dir}/public/* #{output_dir}/public/"
|
@@ -38,19 +40,15 @@ class View
|
|
38
40
|
|
39
41
|
create_inqlude_all(output_dir)
|
40
42
|
|
41
|
-
|
42
43
|
@root = ""
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
render_template "contribute", output_dir
|
52
|
-
render_template "search", output_dir
|
53
|
-
|
45
|
+
Dir.glob("#{view_dir}*.html.haml") do |file|
|
46
|
+
template_name = (File.basename file).split(".").first
|
47
|
+
|
48
|
+
if !["layout","group","library"].include? template_name
|
49
|
+
render_template template_name, output_dir
|
50
|
+
end
|
51
|
+
end
|
54
52
|
|
55
53
|
groups_path = "#{output_dir}/groups/"
|
56
54
|
assert_dir groups_path
|
@@ -73,6 +71,19 @@ class View
|
|
73
71
|
file_name = "libraries/" + library.name
|
74
72
|
render_template "library", output_dir, file_name
|
75
73
|
end
|
74
|
+
|
75
|
+
if templates == 'two-column'
|
76
|
+
topics_path = "#{output_dir}/topics/"
|
77
|
+
assert_dir topics_path
|
78
|
+
|
79
|
+
@root = "../"
|
80
|
+
|
81
|
+
topics.each do |topic|
|
82
|
+
@topic = topic
|
83
|
+
file_name = "topics/" + topic
|
84
|
+
render_template "topic", output_dir, file_name
|
85
|
+
end
|
86
|
+
end
|
76
87
|
end
|
77
88
|
|
78
89
|
def create_inqlude_all(output_dir)
|
@@ -81,6 +92,10 @@ class View
|
|
81
92
|
end
|
82
93
|
end
|
83
94
|
|
95
|
+
def template_directory_exists?
|
96
|
+
File.directory?(view_dir) ? true : false
|
97
|
+
end
|
98
|
+
|
84
99
|
def render_template name, output_dir, file_name = nil
|
85
100
|
layout = template "layout"
|
86
101
|
layout_engine = Haml::Engine.new layout
|
@@ -112,10 +127,18 @@ class View
|
|
112
127
|
@manifest
|
113
128
|
end
|
114
129
|
|
130
|
+
def t
|
131
|
+
@topic
|
132
|
+
end
|
133
|
+
|
115
134
|
def link_to_manifest name
|
116
135
|
"<a href=\"#{@root}libraries/#{name}.html\">#{name}</a>"
|
117
136
|
end
|
118
137
|
|
138
|
+
def link_to_library name, display_name
|
139
|
+
"<a href=\"#{@root}libraries/#{name}.html\">#{display_name}</a>"
|
140
|
+
end
|
141
|
+
|
119
142
|
def link url
|
120
143
|
"<a href=\"#{url}\" target=\"_blank\">#{url}</a>"
|
121
144
|
end
|
@@ -127,6 +150,14 @@ class View
|
|
127
150
|
"<a href=\"#{url}\">#{title}</a>"
|
128
151
|
end
|
129
152
|
|
153
|
+
def link_to_group name, display_name
|
154
|
+
"<a href=\"#{@root}groups/#{name}.html\">#{display_name}</a>"
|
155
|
+
end
|
156
|
+
|
157
|
+
def link_to_topic name
|
158
|
+
"<a href=\"#{@root}topics/#{name}.html\">#{name}</a>"
|
159
|
+
end
|
160
|
+
|
130
161
|
def list_attribute attribute
|
131
162
|
attr = @manifest.send(attribute)
|
132
163
|
return "" if !attr || attr.size == 0
|
@@ -217,6 +248,10 @@ class View
|
|
217
248
|
@manifest_handler.commercial_libraries
|
218
249
|
end
|
219
250
|
|
251
|
+
def latest_libraries
|
252
|
+
@manifest_handler.latest_libraries
|
253
|
+
end
|
254
|
+
|
220
255
|
def group_title
|
221
256
|
if @group_name == "kde-frameworks"
|
222
257
|
return "KDE Frameworks"
|
@@ -227,6 +262,14 @@ class View
|
|
227
262
|
def group
|
228
263
|
@manifest_handler.group(@group_name)
|
229
264
|
end
|
265
|
+
|
266
|
+
def topic name
|
267
|
+
@manifest_handler.topic(name)
|
268
|
+
end
|
269
|
+
|
270
|
+
def no_of_libraries topic
|
271
|
+
@manifest_handler.no_of_libraries(topic)
|
272
|
+
end
|
230
273
|
|
231
274
|
def disqus_enabled?
|
232
275
|
@enable_disqus
|
@@ -261,6 +304,10 @@ class View
|
|
261
304
|
doc.to_html
|
262
305
|
end
|
263
306
|
|
307
|
+
def topics
|
308
|
+
['API', 'Artwork', 'Bindings', 'Communication', 'Data', 'Desktop', 'Development', 'Graphics', 'Logging', 'Mobile', 'Multimedia', 'Printing', 'QML', 'Scripting', 'Security', 'Text', 'Web', 'Widgets']
|
309
|
+
end
|
310
|
+
|
264
311
|
private
|
265
312
|
|
266
313
|
def assert_dir name
|
@@ -272,7 +319,7 @@ class View
|
|
272
319
|
end
|
273
320
|
|
274
321
|
def view_dir
|
275
|
-
File.expand_path( File.dirname( __FILE__ ) + "/../view
|
322
|
+
File.expand_path( File.dirname( __FILE__ ) + "/../view/#{templates}" ) + "/"
|
276
323
|
end
|
277
324
|
|
278
325
|
def schema_dir
|