inqlude 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +6 -3
- data/lib/cli.rb +3 -3
- data/lib/creator.rb +11 -7
- data/lib/kde_frameworks_creator.rb +22 -17
- data/lib/manifest_handler.rb +27 -16
- data/lib/version.rb +1 -1
- data/lib/view.rb +34 -16
- data/spec/data/karchive-generic-with-topics.manifest +25 -0
- data/spec/unit/kde_frameworks_creator_spec.rb +65 -42
- data/spec/unit/manifest_handler_spec.rb +20 -5
- data/spec/unit/spec_helper.rb +2 -2
- data/spec/unit/view_spec.rb +33 -3
- data/view/two-column/index.html.haml +0 -3
- data/view/two-column/layout.html.haml +54 -61
- data/view/two-column/public/inqlude.css +6 -9
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c3e385a1e75d48f95ba09e2e00ffb8475a4c4b0
|
4
|
+
data.tar.gz: 6e1047fe4eda55e343b6ff56bcf834762322547e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337c36e66ded8d0fbde51d50c9e002bc8abad32da03fef20657b070ebbe840eb44e73817cd31aed29d107238b15538940efc96a0a95dbbfb8395f88cceb42341
|
7
|
+
data.tar.gz: 9934c8c88cb135ac29c6c84056ab81971a7fb4f2d77fecd555e13b835b601e30d8105ddc80e6b8dd668f34871e1965e6a44c4342c41513d5a8734c6c70eecf3c
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -3,8 +3,10 @@ rvm:
|
|
3
3
|
- 2.1.9
|
4
4
|
- 2.2.5
|
5
5
|
- 2.3.1
|
6
|
-
script: bundle exec rspec spec
|
6
|
+
script: bundle exec rspec spec/unit
|
7
7
|
addons:
|
8
8
|
code_climate:
|
9
9
|
repo_token:
|
10
10
|
secure: x4ET3gWdfwTC66ExUDoYFdJ3AvCTbms7dokF7RaUrf7xnr3PInHnRgzZP7hICkEYW4t20JPjwiJUUdifk5XUcMSlQ5AAPKjFXP4wyQYPvpizI5FvRsX0a62/Fv1juXxs9hPFmXITqN861iT1rkqC383evyR9KxPDZMOi0VEOjAs=
|
11
|
+
after_success:
|
12
|
+
- bundle exec codeclimate-test-reporter
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change log of Inqlude
|
2
2
|
|
3
|
+
## Version 0.11.0
|
4
|
+
|
5
|
+
* Change the default view to the new two column layout. This takes advantage of all the new features Nanduni implemented during the Google Summer of Code 2016, such as the topics, the display names, responsive layout, better navigation and searchability. The new default layout now will show up on the Inqlude home page.
|
6
|
+
|
3
7
|
## Version 0.10.0
|
4
8
|
|
5
9
|
* Add `linux` attribute for `packages` section for generic links to generic Linux binaries
|
data/Gemfile
CHANGED
@@ -2,6 +2,9 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
gem "
|
7
|
-
gem "
|
5
|
+
group :test do
|
6
|
+
gem "simplecov"
|
7
|
+
gem "codeclimate-test-reporter", "~> 1.0.0"
|
8
|
+
gem "travis"
|
9
|
+
gem "nokogiri"
|
10
|
+
end
|
data/lib/cli.rb
CHANGED
@@ -66,13 +66,13 @@ class Cli < Thor
|
|
66
66
|
actual domain."
|
67
67
|
method_option :disable_search, :type => :boolean,
|
68
68
|
:desc => "Disable Google based search."
|
69
|
-
method_option :templates, :type => :string, :aliases => "-t", :default => "
|
69
|
+
method_option :templates, :type => :string, :aliases => "-t", :default => "two-column",
|
70
70
|
:desc => "Switch templates", :required => false
|
71
71
|
def view
|
72
72
|
process_global_options options
|
73
73
|
|
74
74
|
output_dir = options[:output_dir]
|
75
|
-
|
75
|
+
|
76
76
|
if options[:manifest_dir]
|
77
77
|
@@settings.manifest_path = options[:manifest_dir]
|
78
78
|
end
|
@@ -82,7 +82,7 @@ actual domain."
|
|
82
82
|
manifest_handler.read_remote
|
83
83
|
|
84
84
|
view = View.new(manifest_handler)
|
85
|
-
|
85
|
+
|
86
86
|
view.templates = options[:templates]
|
87
87
|
|
88
88
|
if !view.template_directory_exists?
|
data/lib/creator.rb
CHANGED
@@ -26,7 +26,7 @@ class Creator
|
|
26
26
|
def is_new?
|
27
27
|
return !File.exists?( @dir )
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def validate_directory
|
31
31
|
if !File.exists? @dir
|
32
32
|
raise "Unable to find manifest directory '#{@dir}'"
|
@@ -36,14 +36,14 @@ class Creator
|
|
36
36
|
def update version, release_date
|
37
37
|
filename = File.join @settings.manifest_path, @name,
|
38
38
|
"#{@name}.#{release_date}.manifest"
|
39
|
-
|
39
|
+
|
40
40
|
mh = ManifestHandler.new @settings
|
41
41
|
mh.read_remote
|
42
42
|
|
43
43
|
m = mh.manifest @name
|
44
44
|
m.version = version
|
45
45
|
m.release_date = release_date
|
46
|
-
|
46
|
+
|
47
47
|
File.open( filename, "w" ) do |file|
|
48
48
|
file.puts m.to_json
|
49
49
|
end
|
@@ -68,7 +68,7 @@ class Creator
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def write_manifest manifest
|
71
|
-
filename =
|
71
|
+
filename = manifest_basename
|
72
72
|
if manifest.release_date
|
73
73
|
filename += ".#{manifest.release_date}"
|
74
74
|
end
|
@@ -78,7 +78,11 @@ class Creator
|
|
78
78
|
file.puts manifest.to_json
|
79
79
|
end
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
|
+
def manifest_basename
|
83
|
+
File.join @settings.manifest_path, @name, @name
|
84
|
+
end
|
85
|
+
|
82
86
|
def create_generic_manifest
|
83
87
|
m = ManifestGeneric.new
|
84
88
|
m.name = @name
|
@@ -92,7 +96,7 @@ class Creator
|
|
92
96
|
m = create_generic_manifest
|
93
97
|
write_manifest m
|
94
98
|
end
|
95
|
-
|
99
|
+
|
96
100
|
def create version, release_date
|
97
101
|
create_dir
|
98
102
|
m = create_manifest version, release_date
|
@@ -113,7 +117,7 @@ class Creator
|
|
113
117
|
"vcs" => vcs,
|
114
118
|
"homepage" => "http://community.kde.org/Frameworks"
|
115
119
|
}
|
116
|
-
|
120
|
+
|
117
121
|
m["packages"] = {
|
118
122
|
"source" => "http://anongit.kde.org/kdelibs/kdelibs-latest.tar.gz"
|
119
123
|
}
|
@@ -17,13 +17,13 @@
|
|
17
17
|
class KdeFrameworksCreator
|
18
18
|
|
19
19
|
attr_reader :warnings, :errors
|
20
|
-
|
20
|
+
|
21
21
|
def initialize
|
22
22
|
@frameworks = Hash.new
|
23
23
|
@warnings = []
|
24
24
|
@errors = []
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def parse_checkout dir_name, options = {}
|
28
28
|
@warnings = []
|
29
29
|
@errors = []
|
@@ -32,7 +32,7 @@ class KdeFrameworksCreator
|
|
32
32
|
next if entry == "kapidox"
|
33
33
|
next if entry == "kde4support"
|
34
34
|
next if !File.exist?(File.join(dir_name, entry, ".git"))
|
35
|
-
|
35
|
+
|
36
36
|
@frameworks[entry] = {}
|
37
37
|
parse_readme File.join(dir_name,entry), options
|
38
38
|
parse_metainfo File.join(dir_name,entry)
|
@@ -43,16 +43,16 @@ class KdeFrameworksCreator
|
|
43
43
|
def frameworks
|
44
44
|
@frameworks.keys
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
def framework name
|
48
48
|
f = @frameworks[name]
|
49
49
|
raise InqludeError.new("Unable to read '#{name}'") if !f
|
50
50
|
f
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
def parse_readme path, options = {}
|
54
54
|
@errors = [] if !@errors
|
55
|
-
|
55
|
+
|
56
56
|
name = extract_name( path )
|
57
57
|
framework = @frameworks[name] || {}
|
58
58
|
|
@@ -67,7 +67,7 @@ class KdeFrameworksCreator
|
|
67
67
|
state = :parse_summary
|
68
68
|
next
|
69
69
|
elsif line =~ /^## Introduction/
|
70
|
-
framework["introduction"] = ""
|
70
|
+
framework["introduction"] = ""
|
71
71
|
state = :parse_introduction
|
72
72
|
next
|
73
73
|
elsif line =~ /^## Links/
|
@@ -84,7 +84,7 @@ class KdeFrameworksCreator
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
if state == :parse_introduction
|
89
89
|
if line =~ /^##/
|
90
90
|
framework["introduction"].strip!
|
@@ -93,7 +93,7 @@ class KdeFrameworksCreator
|
|
93
93
|
framework["introduction"] += line
|
94
94
|
end
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
if state == :parse_links
|
98
98
|
if line =~ /^##/
|
99
99
|
state = nil
|
@@ -110,14 +110,14 @@ class KdeFrameworksCreator
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
required_fields = []
|
115
115
|
[ "title", "introduction", "link_home_page" ].each do |field|
|
116
116
|
if !options[:ignore_errors] || !options[:ignore_errors].include?(field)
|
117
117
|
required_fields.push field
|
118
118
|
end
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
required_fields.each do |field|
|
122
122
|
if !framework.has_key?(field) || framework[field].strip.empty?
|
123
123
|
@errors.push( { :name => name, :issue => "missing_" + field } )
|
@@ -126,7 +126,7 @@ class KdeFrameworksCreator
|
|
126
126
|
|
127
127
|
@frameworks[name] = framework
|
128
128
|
end
|
129
|
-
|
129
|
+
|
130
130
|
def parse_metainfo path
|
131
131
|
name = extract_name( path )
|
132
132
|
|
@@ -155,7 +155,7 @@ class KdeFrameworksCreator
|
|
155
155
|
:details => "AUTHORS" } )
|
156
156
|
return
|
157
157
|
end
|
158
|
-
|
158
|
+
|
159
159
|
authors = []
|
160
160
|
File.open(authors_path).each_line do |line|
|
161
161
|
if line =~ /(.* <.*@.*>)/
|
@@ -166,26 +166,31 @@ class KdeFrameworksCreator
|
|
166
166
|
framework = @frameworks[name] || {}
|
167
167
|
|
168
168
|
framework["authors"] = authors
|
169
|
-
|
169
|
+
|
170
170
|
@frameworks[name] = framework
|
171
171
|
end
|
172
172
|
|
173
173
|
def extract_name path
|
174
174
|
path.split("/").last
|
175
175
|
end
|
176
|
-
|
176
|
+
|
177
177
|
def create_manifests output_dir
|
178
178
|
settings = Settings.new
|
179
179
|
settings.manifest_path = output_dir
|
180
180
|
@frameworks.each do |name,framework|
|
181
181
|
creator = Creator.new settings, name
|
182
|
-
|
182
|
+
generic_manifest_filename = creator.manifest_basename + ".manifest"
|
183
|
+
if File.exist?(generic_manifest_filename)
|
184
|
+
manifest = Manifest.parse_file(creator.manifest_basename + ".manifest")
|
185
|
+
else
|
186
|
+
manifest = creator.create_generic_manifest
|
187
|
+
end
|
183
188
|
fill_in_data framework, manifest
|
184
189
|
creator.create_dir
|
185
190
|
creator.write_manifest manifest
|
186
191
|
end
|
187
192
|
end
|
188
|
-
|
193
|
+
|
189
194
|
def fill_in_data framework, manifest
|
190
195
|
manifest.display_name = framework["title"]
|
191
196
|
manifest.summary = framework["summary"]
|
data/lib/manifest_handler.rb
CHANGED
@@ -17,12 +17,15 @@
|
|
17
17
|
class ManifestHandler
|
18
18
|
|
19
19
|
attr_reader :manifests, :settings
|
20
|
-
|
20
|
+
|
21
21
|
def initialize settings
|
22
22
|
@settings = settings
|
23
23
|
|
24
24
|
@libraries = Array.new
|
25
25
|
@manifests = Array.new
|
26
|
+
|
27
|
+
@topics_cache = Hash.new
|
28
|
+
@no_of_libraries_cache = Hash.new
|
26
29
|
end
|
27
30
|
|
28
31
|
def manifest_path manifest
|
@@ -46,7 +49,7 @@ class ManifestHandler
|
|
46
49
|
!l.latest_manifest.is_released?
|
47
50
|
end
|
48
51
|
end
|
49
|
-
|
52
|
+
|
50
53
|
def commercial_libraries
|
51
54
|
return @libraries.select do |l|
|
52
55
|
manifest = l.latest_manifest
|
@@ -81,7 +84,7 @@ class ManifestHandler
|
|
81
84
|
manifest.group == name
|
82
85
|
end
|
83
86
|
end
|
84
|
-
|
87
|
+
|
85
88
|
def library name
|
86
89
|
@libraries.each do |library|
|
87
90
|
if library.name == name
|
@@ -90,7 +93,7 @@ class ManifestHandler
|
|
90
93
|
end
|
91
94
|
nil
|
92
95
|
end
|
93
|
-
|
96
|
+
|
94
97
|
def manifest name
|
95
98
|
@libraries.each do |library|
|
96
99
|
if library.name == name
|
@@ -101,31 +104,39 @@ class ManifestHandler
|
|
101
104
|
end
|
102
105
|
|
103
106
|
def topic name
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
manifest.topics
|
107
|
+
if !@topics_cache.has_key?(name)
|
108
|
+
@topics_cache[name] = @libraries.select do |l|
|
109
|
+
manifest = l.latest_manifest
|
110
|
+
if manifest.topics
|
111
|
+
manifest.topics.include? name
|
112
|
+
end
|
108
113
|
end
|
109
114
|
end
|
115
|
+
@topics_cache[name]
|
110
116
|
end
|
111
117
|
|
112
118
|
def no_of_libraries topic
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
if
|
118
|
-
|
119
|
+
if !@no_of_libraries_cache.has_key?(topic)
|
120
|
+
count = 0
|
121
|
+
@libraries.each do |l|
|
122
|
+
topics = l.latest_manifest.topics
|
123
|
+
if topics
|
124
|
+
if l.latest_manifest.topics.include? topic
|
125
|
+
count += 1
|
126
|
+
end
|
119
127
|
end
|
120
128
|
end
|
129
|
+
@no_of_libraries_cache[topic] = count
|
121
130
|
end
|
122
|
-
|
131
|
+
@no_of_libraries_cache[topic]
|
123
132
|
end
|
124
133
|
|
125
134
|
def read_remote
|
126
135
|
@libraries.clear
|
127
136
|
@manifests.clear
|
128
|
-
|
137
|
+
@topics_cache.clear
|
138
|
+
@no_of_libraries_cache.clear
|
139
|
+
|
129
140
|
if !@settings.offline
|
130
141
|
fetch_remote
|
131
142
|
end
|
data/lib/version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -18,7 +18,7 @@ class View
|
|
18
18
|
|
19
19
|
attr_accessor :enable_disqus,:enable_search,:manifest,:library,:group_name,:templates
|
20
20
|
attr_reader :root
|
21
|
-
|
21
|
+
|
22
22
|
def initialize handler
|
23
23
|
@manifest_handler = handler
|
24
24
|
end
|
@@ -31,10 +31,10 @@ class View
|
|
31
31
|
if templates == "two-column"
|
32
32
|
system "cp #{view_dir}/ios.ico #{output_dir}"
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
assert_dir "#{output_dir}/public"
|
36
36
|
system "cp #{view_dir}/public/* #{output_dir}/public/"
|
37
|
-
|
37
|
+
|
38
38
|
assert_dir "#{output_dir}/schema"
|
39
39
|
system "cp #{schema_dir}/* #{output_dir}/schema"
|
40
40
|
|
@@ -52,13 +52,13 @@ class View
|
|
52
52
|
|
53
53
|
groups_path = "#{output_dir}/groups/"
|
54
54
|
assert_dir groups_path
|
55
|
-
|
55
|
+
|
56
56
|
@root = "../"
|
57
|
-
|
57
|
+
|
58
58
|
@group_name = "kde-frameworks"
|
59
59
|
file_name = "groups/kde-frameworks"
|
60
60
|
render_template "group", output_dir, file_name
|
61
|
-
|
61
|
+
|
62
62
|
|
63
63
|
library_path = "#{output_dir}/libraries/"
|
64
64
|
assert_dir library_path
|
@@ -106,8 +106,10 @@ class View
|
|
106
106
|
output_path = ""
|
107
107
|
if file_name
|
108
108
|
output_path = "#{output_dir}/#{file_name}.html"
|
109
|
+
@file = file_name
|
109
110
|
else
|
110
111
|
output_path = "#{output_dir}/#{name}.html"
|
112
|
+
@file = name
|
111
113
|
end
|
112
114
|
|
113
115
|
File.open output_path, "w" do |file|
|
@@ -202,12 +204,28 @@ class View
|
|
202
204
|
end
|
203
205
|
out
|
204
206
|
end
|
205
|
-
|
207
|
+
|
208
|
+
def add_footer
|
209
|
+
if @file == "index"
|
210
|
+
text = 'Last updated on ' + Date.today.to_s
|
211
|
+
else
|
212
|
+
text = ""
|
213
|
+
end
|
214
|
+
out = "Inqlude is a "
|
215
|
+
out += link_to "KDE project", "http://kde.org"
|
216
|
+
out += "|"
|
217
|
+
out += link_to "Legal", "http://www.kde.org/community/whatiskde/impressum.php"
|
218
|
+
out += "<span class='footer-text'>"
|
219
|
+
out += text
|
220
|
+
out += "</span>"
|
221
|
+
out
|
222
|
+
end
|
223
|
+
|
206
224
|
def markup_email email
|
207
225
|
if email =~ /(.*) <(.*)>/
|
208
226
|
name = $1
|
209
227
|
email = $2
|
210
|
-
|
228
|
+
|
211
229
|
return "<a href=\"mailto:#{email}\">#{name}</a>"
|
212
230
|
else
|
213
231
|
return email
|
@@ -235,11 +253,11 @@ class View
|
|
235
253
|
end
|
236
254
|
out
|
237
255
|
end
|
238
|
-
|
256
|
+
|
239
257
|
def libraries maturity = nil
|
240
258
|
@manifest_handler.libraries(maturity)
|
241
259
|
end
|
242
|
-
|
260
|
+
|
243
261
|
def unreleased_libraries
|
244
262
|
@manifest_handler.unreleased_libraries
|
245
263
|
end
|
@@ -258,7 +276,7 @@ class View
|
|
258
276
|
end
|
259
277
|
""
|
260
278
|
end
|
261
|
-
|
279
|
+
|
262
280
|
def group
|
263
281
|
@manifest_handler.group(@group_name)
|
264
282
|
end
|
@@ -270,7 +288,7 @@ class View
|
|
270
288
|
def no_of_libraries topic
|
271
289
|
@manifest_handler.no_of_libraries(topic)
|
272
290
|
end
|
273
|
-
|
291
|
+
|
274
292
|
def disqus_enabled?
|
275
293
|
@enable_disqus
|
276
294
|
end
|
@@ -286,7 +304,7 @@ class View
|
|
286
304
|
end
|
287
305
|
return false
|
288
306
|
end
|
289
|
-
|
307
|
+
|
290
308
|
def editor_url
|
291
309
|
url = "https://github.com/cornelius/inqlude-data/blob/master/"
|
292
310
|
url += @manifest.name
|
@@ -309,11 +327,11 @@ class View
|
|
309
327
|
end
|
310
328
|
|
311
329
|
private
|
312
|
-
|
330
|
+
|
313
331
|
def assert_dir name
|
314
332
|
Dir::mkdir name unless File.exists? name
|
315
|
-
end
|
316
|
-
|
333
|
+
end
|
334
|
+
|
317
335
|
def template name
|
318
336
|
File.read( view_dir + "#{name}.html.haml" )
|
319
337
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://inqlude.org/schema/generic-manifest-v1#",
|
3
|
+
"name": "karchive",
|
4
|
+
"display_name": "KArchive",
|
5
|
+
"summary": "Reading, creating, and manipulating file archives",
|
6
|
+
"urls": {
|
7
|
+
"homepage": "https://projects.kde.org/projects/frameworks/karchive",
|
8
|
+
"vcs": "https://projects.kde.org/projects/frameworks/karchive/repository",
|
9
|
+
"mailing_list": "https://mail.kde.org/mailman/listinfo/kde-frameworks-devel"
|
10
|
+
},
|
11
|
+
"licenses": [
|
12
|
+
"LGPLv2.1+"
|
13
|
+
],
|
14
|
+
"description": "KArchive provides classes for easy reading, creation and manipulation of\n\"archive\" formats like ZIP and TAR.\n\nIf also provides transparent compression and decompression of data, like the\nGZip format, via a subclass of QIODevice.",
|
15
|
+
"authors": [
|
16
|
+
"The KDE Community"
|
17
|
+
],
|
18
|
+
"platforms": [
|
19
|
+
"Linux"
|
20
|
+
],
|
21
|
+
"group": "kde-frameworks",
|
22
|
+
"topics": [
|
23
|
+
"Data"
|
24
|
+
]
|
25
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
|
3
3
|
describe KdeFrameworksCreator do
|
4
|
-
|
4
|
+
|
5
5
|
include GivenFilesystemSpecHelpers
|
6
6
|
|
7
7
|
describe "#framework" do
|
@@ -10,7 +10,7 @@ describe KdeFrameworksCreator do
|
|
10
10
|
expect{c.framework("invalid-name")}.to raise_error(InqludeError)
|
11
11
|
end
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
describe "#fill_in_data" do
|
15
15
|
it "fills in all data" do
|
16
16
|
c = Creator.new Settings.new, "karchive"
|
@@ -23,7 +23,7 @@ describe KdeFrameworksCreator do
|
|
23
23
|
"link_git_repository" => "http://git.kde.org/karchive"
|
24
24
|
}
|
25
25
|
k.fill_in_data framework, manifest
|
26
|
-
|
26
|
+
|
27
27
|
expect( manifest.display_name ).to eq "KArchive"
|
28
28
|
expect( manifest.description ).to eq "The intro"
|
29
29
|
expect( manifest.urls.vcs ).to eq "http://git.kde.org/karchive"
|
@@ -31,7 +31,7 @@ describe KdeFrameworksCreator do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
context "parse git checkout" do
|
34
|
-
|
34
|
+
|
35
35
|
use_given_filesystem
|
36
36
|
|
37
37
|
context "multi-directory checkout" do
|
@@ -69,9 +69,9 @@ describe KdeFrameworksCreator do
|
|
69
69
|
c.parse_checkout @checkout_path
|
70
70
|
|
71
71
|
output_dir = given_directory
|
72
|
-
|
72
|
+
|
73
73
|
c.create_manifests output_dir
|
74
|
-
|
74
|
+
|
75
75
|
expect( File.exists? File.join(output_dir,"karchive",
|
76
76
|
"karchive.manifest") ).to be true
|
77
77
|
expect( File.exists? File.join(output_dir,"threadweaver",
|
@@ -95,18 +95,18 @@ describe KdeFrameworksCreator do
|
|
95
95
|
|
96
96
|
it "parses README" do
|
97
97
|
c = KdeFrameworksCreator.new
|
98
|
-
|
98
|
+
|
99
99
|
framework_path = given_directory "karchive" do
|
100
100
|
given_directory(".git")
|
101
101
|
given_file "README.md", :from => "karchive.readme"
|
102
102
|
end
|
103
|
-
|
103
|
+
|
104
104
|
c.parse_readme framework_path
|
105
105
|
|
106
106
|
karchive = c.framework("karchive")
|
107
|
-
|
107
|
+
|
108
108
|
expect( c.errors.count ).to eq 0
|
109
|
-
|
109
|
+
|
110
110
|
expect(karchive["title"]).to eq "KArchive"
|
111
111
|
expect(karchive["introduction"]).to eq "KArchive provides classes for easy reading, creation and manipulation of\n\"archive\" formats like ZIP and TAR.\n\nIf also provides transparent compression and decompression of data, like the\nGZip format, via a subclass of QIODevice."
|
112
112
|
expect(karchive["link_mailing_list"]).to eq "https://mail.kde.org/mailman/listinfo/kde-frameworks-devel"
|
@@ -133,19 +133,19 @@ describe KdeFrameworksCreator do
|
|
133
133
|
|
134
134
|
it "parses AUTHORS" do
|
135
135
|
c = KdeFrameworksCreator.new
|
136
|
-
|
136
|
+
|
137
137
|
framework_path = given_directory "karchive" do
|
138
138
|
given_file "AUTHORS", :from => "karchive.authors"
|
139
139
|
end
|
140
140
|
|
141
141
|
c.parse_authors framework_path
|
142
|
-
|
142
|
+
|
143
143
|
karchive = c.framework("karchive")
|
144
|
-
|
144
|
+
|
145
145
|
expect(karchive["authors"]).to eq [ "Mario Bensi <mbensi@ipsquad.net>",
|
146
146
|
"David Faure <faure@kde.org>" ]
|
147
147
|
end
|
148
|
-
|
148
|
+
|
149
149
|
it "generates warnings for missing files" do
|
150
150
|
c = KdeFrameworksCreator.new
|
151
151
|
|
@@ -156,9 +156,9 @@ describe KdeFrameworksCreator do
|
|
156
156
|
given_dummy_file "README.md"
|
157
157
|
end
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
c.parse_checkout checkout_path
|
161
|
-
|
161
|
+
|
162
162
|
expect( c.warnings.count ).to eq 1
|
163
163
|
expect( c.warnings.first[:name] ).to eq "ki18n"
|
164
164
|
expect( c.warnings.first[:issue] ).to eq "missing_file"
|
@@ -174,22 +174,22 @@ describe KdeFrameworksCreator do
|
|
174
174
|
given_dummy_file "README.md"
|
175
175
|
end
|
176
176
|
end
|
177
|
-
|
177
|
+
|
178
178
|
c.parse_checkout checkout_path
|
179
|
-
|
179
|
+
|
180
180
|
f = c.framework("ki18n")
|
181
|
-
|
181
|
+
|
182
182
|
expect( c.errors.count ).to eq 3
|
183
|
-
|
183
|
+
|
184
184
|
error_hash = {}
|
185
185
|
c.errors.each do |error|
|
186
186
|
error_hash[error[:issue]] = error
|
187
187
|
end
|
188
|
-
|
188
|
+
|
189
189
|
expect( error_hash.has_key? "missing_title" ).to be true
|
190
190
|
expect( error_hash.has_key? "missing_introduction" ).to be true
|
191
191
|
end
|
192
|
-
|
192
|
+
|
193
193
|
it "generates error for missing summary" do
|
194
194
|
c = KdeFrameworksCreator.new
|
195
195
|
|
@@ -199,17 +199,17 @@ describe KdeFrameworksCreator do
|
|
199
199
|
given_file "README.md", :from => "kservice.readme"
|
200
200
|
end
|
201
201
|
end
|
202
|
-
|
202
|
+
|
203
203
|
c.parse_checkout checkout_path
|
204
|
-
|
204
|
+
|
205
205
|
f = c.framework("kservice")
|
206
|
-
|
206
|
+
|
207
207
|
expect( f["title"] ).to eq "KService"
|
208
208
|
expect( f["summary"] ).to be nil
|
209
|
-
|
209
|
+
|
210
210
|
expect( c.errors.count ).to eq 2
|
211
211
|
end
|
212
|
-
|
212
|
+
|
213
213
|
it "optionally doesn't generate error for missing summary" do
|
214
214
|
c = KdeFrameworksCreator.new
|
215
215
|
|
@@ -219,17 +219,17 @@ describe KdeFrameworksCreator do
|
|
219
219
|
given_file "README.md", :from => "kservice.readme"
|
220
220
|
end
|
221
221
|
end
|
222
|
-
|
222
|
+
|
223
223
|
c.parse_checkout checkout_path, :ignore_errors => [ "link_home_page" ]
|
224
|
-
|
224
|
+
|
225
225
|
f = c.framework("kservice")
|
226
|
-
|
226
|
+
|
227
227
|
expect( f["title"] ).to eq "KService"
|
228
228
|
expect( f["summary"] ).to be nil
|
229
|
-
|
229
|
+
|
230
230
|
expect( c.errors.count ).to eq 2
|
231
231
|
end
|
232
|
-
|
232
|
+
|
233
233
|
context "karchive as full example" do
|
234
234
|
before(:each) do
|
235
235
|
@checkout_path = given_directory do
|
@@ -241,12 +241,12 @@ describe KdeFrameworksCreator do
|
|
241
241
|
end
|
242
242
|
end
|
243
243
|
end
|
244
|
-
|
244
|
+
|
245
245
|
it "parses framework from checkout" do
|
246
246
|
c = KdeFrameworksCreator.new
|
247
247
|
|
248
248
|
c.parse_checkout @checkout_path
|
249
|
-
|
249
|
+
|
250
250
|
karchive = c.framework("karchive")
|
251
251
|
expect(karchive["title"]).to eq "KArchive"
|
252
252
|
expect(karchive["summary"]).to eq "File compression"
|
@@ -261,15 +261,15 @@ describe KdeFrameworksCreator do
|
|
261
261
|
c.parse_checkout @checkout_path
|
262
262
|
|
263
263
|
output_dir = given_directory
|
264
|
-
|
264
|
+
|
265
265
|
c.create_manifests output_dir
|
266
|
-
|
266
|
+
|
267
267
|
expect( File.exists? File.join(output_dir,"karchive",
|
268
268
|
"karchive.manifest") ).to be true
|
269
|
-
|
269
|
+
|
270
270
|
manifest = Manifest.parse_file File.join(output_dir,"karchive",
|
271
271
|
"karchive.manifest")
|
272
|
-
|
272
|
+
|
273
273
|
expect( manifest.name ).to eq "karchive"
|
274
274
|
expect( manifest.display_name ).to eq "KArchive"
|
275
275
|
expect( manifest.urls.vcs ).to eq "https://projects.kde.org/projects/frameworks/karchive/repository"
|
@@ -278,24 +278,47 @@ describe KdeFrameworksCreator do
|
|
278
278
|
expect( manifest.urls.mailing_list ).to eq "https://mail.kde.org/mailman/listinfo/kde-frameworks-devel"
|
279
279
|
expect( manifest.summary ).to eq "File compression"
|
280
280
|
end
|
281
|
-
|
281
|
+
|
282
282
|
it "overwrites existing manifests" do
|
283
283
|
c = KdeFrameworksCreator.new
|
284
284
|
|
285
285
|
c.parse_checkout @checkout_path
|
286
286
|
|
287
287
|
output_dir = given_directory
|
288
|
-
|
288
|
+
|
289
289
|
c.create_manifests output_dir
|
290
|
-
|
290
|
+
|
291
291
|
expect( File.exists? File.join(output_dir,"karchive",
|
292
292
|
"karchive.manifest") ).to be true
|
293
293
|
|
294
294
|
c.create_manifests output_dir
|
295
|
-
|
295
|
+
|
296
296
|
expect( File.exists? File.join(output_dir,"karchive",
|
297
297
|
"karchive.manifest") ).to be true
|
298
298
|
end
|
299
|
+
|
300
|
+
it "preserves topics from generic manifest" do
|
301
|
+
c = KdeFrameworksCreator.new
|
302
|
+
|
303
|
+
c.parse_checkout @checkout_path
|
304
|
+
|
305
|
+
manifest_file = nil
|
306
|
+
output_dir = given_directory do
|
307
|
+
given_directory "karchive" do
|
308
|
+
manifest_file = given_file "karchive.manifest", :from => "karchive-generic-with-topics.manifest"
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
manifest = JSON.parse(File.read(manifest_file))
|
313
|
+
expect(manifest.has_key?("topics")).to be(true)
|
314
|
+
expect(manifest["topics"].first).to eq("Data")
|
315
|
+
|
316
|
+
c.create_manifests output_dir
|
317
|
+
|
318
|
+
manifest = JSON.parse(File.read(manifest_file))
|
319
|
+
expect(manifest.has_key?("topics")).to be(true)
|
320
|
+
expect(manifest["topics"].first).to eq("Data")
|
321
|
+
end
|
299
322
|
end
|
300
323
|
end
|
301
324
|
end
|
@@ -3,7 +3,6 @@ require File.expand_path('../spec_helper', __FILE__)
|
|
3
3
|
include GivenFilesystemSpecHelpers
|
4
4
|
|
5
5
|
describe ManifestHandler do
|
6
|
-
|
7
6
|
let(:settings) do
|
8
7
|
s = Settings.new
|
9
8
|
s.manifest_path = File.expand_path('spec/data/manifests')
|
@@ -55,7 +54,6 @@ describe ManifestHandler do
|
|
55
54
|
end
|
56
55
|
|
57
56
|
describe "#libraries" do
|
58
|
-
|
59
57
|
it "returns all libraries" do
|
60
58
|
expect( mh.libraries.count ).to eq 5
|
61
59
|
end
|
@@ -92,7 +90,6 @@ describe ManifestHandler do
|
|
92
90
|
expect(libraries.first.manifests.last.name).to eq "proprietarylib"
|
93
91
|
expect(libraries).not_to include "newlib"
|
94
92
|
end
|
95
|
-
|
96
93
|
end
|
97
94
|
|
98
95
|
describe "#group" do
|
@@ -109,15 +106,33 @@ describe ManifestHandler do
|
|
109
106
|
expect( libraries.count ).to eq 2
|
110
107
|
expect( libraries.first.manifests.last.name ).to eq "awesomelib"
|
111
108
|
end
|
109
|
+
|
110
|
+
it "returns same results when called again" do
|
111
|
+
libraries = mh.topic("API")
|
112
|
+
expect( libraries.count ).to eq 2
|
113
|
+
expect( libraries.first.manifests.last.name ).to eq "awesomelib"
|
114
|
+
|
115
|
+
libraries2 = mh.topic("API")
|
116
|
+
expect(libraries2).to eq(libraries)
|
117
|
+
end
|
112
118
|
end
|
113
119
|
|
114
|
-
describe "#
|
120
|
+
describe "#no_of_libraries" do
|
121
|
+
it "returns number of libraries with given topic" do
|
122
|
+
expect(mh.no_of_libraries("API")).to eq(2)
|
123
|
+
end
|
124
|
+
|
125
|
+
it "returns same result when called again" do
|
126
|
+
no = mh.no_of_libraries("API")
|
127
|
+
expect(mh.no_of_libraries("API")).to eq(no)
|
128
|
+
end
|
129
|
+
end
|
115
130
|
|
131
|
+
describe "#library" do
|
116
132
|
it "returns one library" do
|
117
133
|
library = mh.library "awesomelib"
|
118
134
|
expect( library.name ).to eq "awesomelib"
|
119
135
|
end
|
120
|
-
|
121
136
|
end
|
122
137
|
|
123
138
|
context "library with generic and release manifest" do
|
data/spec/unit/spec_helper.rb
CHANGED
data/spec/unit/view_spec.rb
CHANGED
@@ -149,8 +149,7 @@ describe View do
|
|
149
149
|
expect(File.exists?(all_path)).to be true
|
150
150
|
expected_all_content = File.read(test_data_path("inqlude-all-karchive.json"))
|
151
151
|
expect(File.read(all_path)).to eq expected_all_content
|
152
|
-
end
|
153
|
-
|
152
|
+
end
|
154
153
|
end
|
155
154
|
|
156
155
|
context "rendertest" do
|
@@ -188,7 +187,7 @@ EOT
|
|
188
187
|
|
189
188
|
it "returns if there are more URLs" do
|
190
189
|
expect(@view.more_urls?).to be true
|
191
|
-
end
|
190
|
+
end
|
192
191
|
end
|
193
192
|
|
194
193
|
context "templates" do
|
@@ -241,4 +240,35 @@ EOT
|
|
241
240
|
expect(paragraphs_content).to eq(expected_content)
|
242
241
|
end
|
243
242
|
end
|
243
|
+
|
244
|
+
context "footer" do
|
245
|
+
include_context "manifest_files"
|
246
|
+
|
247
|
+
include GivenFilesystemSpecHelpers
|
248
|
+
|
249
|
+
use_given_filesystem
|
250
|
+
|
251
|
+
before(:each) do
|
252
|
+
mh = ManifestHandler.new(settings)
|
253
|
+
mh.read_remote
|
254
|
+
@v = View.new mh
|
255
|
+
@v.templates = "two-column"
|
256
|
+
|
257
|
+
@dir = given_directory
|
258
|
+
end
|
259
|
+
|
260
|
+
it "generates footer for home page" do
|
261
|
+
@v.render_template("index", @dir)
|
262
|
+
rendered = @v.add_footer
|
263
|
+
expected = 'Last updated on ' + Date.today.to_s
|
264
|
+
expect(rendered).to include expected
|
265
|
+
end
|
266
|
+
|
267
|
+
it "generates footer for sub pages" do
|
268
|
+
@v.render_template("about", @dir)
|
269
|
+
rendered = @v.add_footer
|
270
|
+
expected = 'Last updated on ' + Date.today.to_s
|
271
|
+
expect(rendered).not_to include expected
|
272
|
+
end
|
273
|
+
end
|
244
274
|
end
|
@@ -11,7 +11,6 @@
|
|
11
11
|
|
12
12
|
%body
|
13
13
|
.container-fluid.header
|
14
|
-
|
15
14
|
.col-sm-8.left
|
16
15
|
.ribbon
|
17
16
|
= link_to "Alpha", "about"
|
@@ -25,78 +24,72 @@
|
|
25
24
|
%h2
|
26
25
|
%span.subtitle><
|
27
26
|
= link_to "The Qt library archive", "index"
|
28
|
-
|
29
27
|
.col-sm-4.right
|
30
28
|
- if enable_search
|
31
29
|
%gcse:searchbox-only{ resultsUrl: "https://inqlude.org/search.html" }
|
32
30
|
Loading...
|
33
31
|
%br{ :clear => "all" }
|
34
32
|
|
35
|
-
.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
%li
|
46
|
-
= link_to "How to contribute", "contribute"
|
33
|
+
.col-sm-3.side-bar
|
34
|
+
%p{:class => "description"}
|
35
|
+
Inqlude provides a comprehensive listing of all existing libraries for developers of applications using the #{link_to "Qt toolkit", "http://qt-project.org"}. Inqlude is run by the community and open for contributions.
|
36
|
+
%ul.titles-list
|
37
|
+
%li
|
38
|
+
= link_to "About", "about"
|
39
|
+
%li
|
40
|
+
= link_to "How to get libraries", "get"
|
41
|
+
%li
|
42
|
+
= link_to "How to contribute", "contribute"
|
47
43
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
44
|
+
%p{:class => "title"} Latest releases
|
45
|
+
%hr
|
46
|
+
%ul.side-list
|
47
|
+
%li
|
48
|
+
- latest_libraries.each do |library|
|
49
|
+
- if library.latest_manifest.group == "kde-frameworks"
|
50
|
+
= link_to_group('kde-frameworks', 'KDE Frameworks')
|
51
|
+
-else
|
52
|
+
- if library.latest_manifest.display_name
|
53
|
+
= link_to_library(library.latest_manifest.name, library.latest_manifest.display_name)
|
54
|
+
- else
|
55
|
+
= link_to_library(library.latest_manifest.name, library.latest_manifest.name)
|
56
|
+
%date
|
57
|
+
= '(' + library.latest_manifest.release_date + ')'
|
58
|
+
%br
|
63
59
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
%p{:class => "title"} Topics
|
61
|
+
%hr
|
62
|
+
%ul.side-list
|
63
|
+
%li
|
64
|
+
= link_to "All", "all"
|
65
|
+
%number
|
66
|
+
= ' (' + libraries.length.to_s + ')'
|
67
|
+
%li
|
68
|
+
- topics.each do |topic|
|
69
|
+
= link_to_topic(topic)
|
69
70
|
%number
|
70
|
-
= ' (' +
|
71
|
-
|
72
|
-
- topics.each do |topic|
|
73
|
-
= link_to_topic(topic)
|
74
|
-
%number
|
75
|
-
= ' (' + no_of_libraries(topic).to_s + ')'
|
76
|
-
%br
|
71
|
+
= ' (' + no_of_libraries(topic).to_s + ')'
|
72
|
+
%br
|
77
73
|
|
78
|
-
|
79
|
-
|
74
|
+
.col-sm-9.main-pane
|
75
|
+
= yank
|
80
76
|
|
81
|
-
|
77
|
+
%br{ :clear => "all" }
|
82
78
|
|
83
79
|
%hr
|
84
80
|
|
85
|
-
.col-sm-12.
|
86
|
-
|
87
|
-
= link_to "KDE project", "http://kde.org"
|
88
|
-
= "|"
|
89
|
-
= link_to "Legal", "http://www.kde.org/community/whatiskde/impressum.php"
|
81
|
+
.col-sm-12.footer
|
82
|
+
= add_footer
|
90
83
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
84
|
+
- if enable_search
|
85
|
+
:javascript
|
86
|
+
(function() {
|
87
|
+
var cx = '012526638842992167133:g7thmrlp2uw';
|
88
|
+
var gcse = document.createElement('script');
|
89
|
+
gcse.type = 'text/javascript';
|
90
|
+
gcse.async = true;
|
91
|
+
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
92
|
+
'//cse.google.com/cse.js?cx=' + cx;
|
93
|
+
var s = document.getElementsByTagName('script')[0];
|
94
|
+
s.parentNode.insertBefore(gcse, s);
|
95
|
+
})();
|
@@ -119,8 +119,7 @@ h4 {
|
|
119
119
|
}
|
120
120
|
|
121
121
|
.col-sm-3.side-bar {
|
122
|
-
padding:
|
123
|
-
padding-top: 30px;
|
122
|
+
padding: 30px;
|
124
123
|
}
|
125
124
|
|
126
125
|
.description {
|
@@ -151,9 +150,7 @@ number {
|
|
151
150
|
}
|
152
151
|
|
153
152
|
.col-sm-9.main-pane {
|
154
|
-
padding
|
155
|
-
padding-left: 15px;
|
156
|
-
padding-right: 20px;
|
153
|
+
padding: 30px;
|
157
154
|
}
|
158
155
|
|
159
156
|
table.table-hover.col-sm-12 {
|
@@ -218,9 +215,8 @@ home {
|
|
218
215
|
font-style: italic;
|
219
216
|
}
|
220
217
|
|
221
|
-
.footer {
|
218
|
+
.footer-text {
|
222
219
|
float: right;
|
223
|
-
font-size: 80%;
|
224
220
|
font-style: italic;
|
225
221
|
}
|
226
222
|
|
@@ -229,10 +225,11 @@ home {
|
|
229
225
|
font-size: 80%;
|
230
226
|
}
|
231
227
|
|
232
|
-
.col-sm-12.
|
228
|
+
.col-sm-12.footer {
|
233
229
|
text-align: center;
|
234
230
|
font-size: 75%;
|
235
|
-
padding
|
231
|
+
padding: 30px;
|
232
|
+
padding-top: 0px;
|
236
233
|
}
|
237
234
|
|
238
235
|
.attribute {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inqlude
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cornelius Schumacher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- spec/data/inqlude-all-karchive.json
|
189
189
|
- spec/data/inqlude-all.json
|
190
190
|
- spec/data/invalid-schema.manifest
|
191
|
+
- spec/data/karchive-generic-with-topics.manifest
|
191
192
|
- spec/data/karchive-generic.manifest
|
192
193
|
- spec/data/karchive-release-5.4.manifest
|
193
194
|
- spec/data/karchive-release-beta.manifest
|
@@ -292,9 +293,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
293
|
version: 1.3.6
|
293
294
|
requirements: []
|
294
295
|
rubyforge_project: inqlude
|
295
|
-
rubygems_version: 2.
|
296
|
+
rubygems_version: 2.5.1
|
296
297
|
signing_key:
|
297
298
|
specification_version: 4
|
298
299
|
summary: Command line tool for handling Qt based libraries
|
299
300
|
test_files: []
|
300
|
-
has_rdoc:
|