inqlude 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -2
- data/lib/cli.rb +20 -4
- data/lib/creator.rb +50 -0
- data/lib/inqlude.rb +1 -0
- data/lib/manifest_handler.rb +5 -2
- data/lib/settings.rb +2 -5
- data/lib/verifier.rb +64 -23
- data/lib/version.rb +1 -1
- data/lib/view.rb +3 -1
- data/manifest-format.md +201 -0
- data/spec/creator_spec.rb +56 -0
- data/spec/data/awesomelib/awesomelib.2013-09-08.manifest +19 -0
- data/{test/library_test.rb → spec/library_spec.rb} +4 -4
- data/spec/manifest_handler_spec.rb +30 -0
- data/spec/rpm_manifestizer_spec.rb +11 -0
- data/spec/settings_spec.rb +15 -0
- data/{test/test_helper.rb → spec/spec_helper.rb} +1 -3
- data/spec/verifier_spec.rb +59 -0
- data/view/layout.html.haml +2 -0
- data/view/library.html.haml +10 -1
- data/view/public/inqlude.css +6 -0
- metadata +14 -8
- data/Rakefile +0 -8
- data/test/rpm_manifestizer_test.rb +0 -11
data/README
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Inqlude - the Qt library archive
|
2
2
|
|
3
3
|
Inqlude is a tool to handle Qt based libraries. It provides developers using Qt
|
4
|
-
with an easy way to find, install, and use
|
5
|
-
libraries.
|
4
|
+
with an easy way to find, install, and use libraries, in particular 3rd party
|
5
|
+
libraries. A public version of the library runs at http://inqlude.org.
|
6
6
|
|
7
7
|
Inqlude comes as a Ruby gem, which can easily be installed, and provides a
|
8
8
|
command line interface to handle Qt libraries in a similar way as Ruby gems.
|
data/lib/cli.rb
CHANGED
@@ -72,6 +72,8 @@ class Cli < Thor
|
|
72
72
|
desc "view", "Create view"
|
73
73
|
method_option :output_dir, :type => :string, :aliases => "-o",
|
74
74
|
:desc => "Output directory", :required => true
|
75
|
+
method_option :manifest_dir, :type => :string, :aliases => "-m",
|
76
|
+
:desc => "Manifest directory", :required => false
|
75
77
|
method_option :enable_disqus, :type => :boolean,
|
76
78
|
:desc => "Enable Disqus based comments on generate web pages. Works only on
|
77
79
|
actual domain."
|
@@ -79,7 +81,11 @@ actual domain."
|
|
79
81
|
:desc => "Disable Google based search."
|
80
82
|
def view
|
81
83
|
process_global_options options
|
82
|
-
|
84
|
+
|
85
|
+
if options[:manifest_dir]
|
86
|
+
@@settings.manifest_path = options[:manifest_dir]
|
87
|
+
end
|
88
|
+
|
83
89
|
view = View.new ManifestHandler.new @@settings
|
84
90
|
view.enable_disqus = options[:enable_disqus]
|
85
91
|
view.enable_search = !options[:disable_search]
|
@@ -103,7 +109,9 @@ actual domain."
|
|
103
109
|
count_error = 0
|
104
110
|
handler.libraries.each do |library|
|
105
111
|
library.manifests.each do |manifest|
|
106
|
-
|
112
|
+
result = v.verify manifest
|
113
|
+
result.print_result
|
114
|
+
if result.valid?
|
107
115
|
count_ok += 1
|
108
116
|
else
|
109
117
|
count_error += 1
|
@@ -114,14 +122,14 @@ actual domain."
|
|
114
122
|
"#{count_error} with error."
|
115
123
|
end
|
116
124
|
|
117
|
-
desc "
|
125
|
+
desc "system_scan", "Scan system for installed Qt libraries and create manifests"
|
118
126
|
method_option :dry_run, :type => :boolean,
|
119
127
|
:desc => "Dry run. Don't write files."
|
120
128
|
method_option :recreate_source_cache, :type => :boolean,
|
121
129
|
:desc => "Recreate cache with meta data of installed RPMs"
|
122
130
|
method_option :recreate_qt_source_cache, :type => :boolean,
|
123
131
|
:desc => "Recreate cache with meta data of Qt library RPMs"
|
124
|
-
def
|
132
|
+
def system_scan
|
125
133
|
m = RpmManifestizer.new @@settings
|
126
134
|
m.dry_run = options[:dry_run]
|
127
135
|
|
@@ -136,6 +144,14 @@ actual domain."
|
|
136
144
|
m.process_all_rpms
|
137
145
|
end
|
138
146
|
|
147
|
+
desc "create <manifest_name> <version> <release_date>", "Create new or updated manifest"
|
148
|
+
def create name, version, release_date
|
149
|
+
@@settings.manifest_path = "."
|
150
|
+
creator = Creator.new @@settings, name
|
151
|
+
creator.validate_directory
|
152
|
+
creator.create version, release_date
|
153
|
+
end
|
154
|
+
|
139
155
|
desc "get_involved", "Information about how to get involved"
|
140
156
|
def get_involved
|
141
157
|
Upstream.print_info
|
data/lib/creator.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Copyright (C) 2013 Cornelius Schumacher <schumacher@kde.org>
|
2
|
+
#
|
3
|
+
# This program is free software; you can redistribute it and/or modify
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
5
|
+
# the Free Software Foundation; either version 2 of the License, or
|
6
|
+
# (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License along
|
14
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16
|
+
|
17
|
+
class Creator
|
18
|
+
|
19
|
+
def initialize settings, name
|
20
|
+
@settings = settings
|
21
|
+
@settings.offline = true
|
22
|
+
@name = name
|
23
|
+
@dir = File.join settings.manifest_path, name
|
24
|
+
end
|
25
|
+
|
26
|
+
def validate_directory
|
27
|
+
if !File.exists? @dir
|
28
|
+
raise "Unable to find manifest directory '#{@dir}'"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def create version, release_date
|
33
|
+
filename = File.join @settings.manifest_path, @name,
|
34
|
+
"#{@name}.#{release_date}.manifest"
|
35
|
+
|
36
|
+
mh = ManifestHandler.new @settings
|
37
|
+
mh.read_remote
|
38
|
+
|
39
|
+
m = mh.manifest @name
|
40
|
+
m.delete "filename"
|
41
|
+
m.delete "libraryname"
|
42
|
+
m["version"] = version
|
43
|
+
m["release_date"] = release_date
|
44
|
+
|
45
|
+
File.open( filename, "w" ) do |file|
|
46
|
+
file.puts JSON.pretty_generate(m)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
data/lib/inqlude.rb
CHANGED
data/lib/manifest_handler.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
class ManifestHandler
|
18
18
|
|
19
|
-
attr_reader :manifests, :libraries
|
19
|
+
attr_reader :manifests, :libraries, :settings
|
20
20
|
|
21
21
|
def initialize settings
|
22
22
|
@settings = settings
|
@@ -32,10 +32,13 @@ class ManifestHandler
|
|
32
32
|
return library.manifests.last
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
35
|
+
raise "Unable to find manifest '#{name}'"
|
36
36
|
end
|
37
37
|
|
38
38
|
def read_remote
|
39
|
+
@libraries.clear
|
40
|
+
@manifests.clear
|
41
|
+
|
39
42
|
if !@settings.offline
|
40
43
|
fetch_remote
|
41
44
|
end
|
data/lib/settings.rb
CHANGED
@@ -16,14 +16,11 @@
|
|
16
16
|
|
17
17
|
class Settings
|
18
18
|
|
19
|
-
attr_accessor :offline
|
19
|
+
attr_accessor :offline, :manifest_path
|
20
20
|
|
21
21
|
def initialize
|
22
22
|
@offline = false
|
23
|
-
|
24
|
-
|
25
|
-
def manifest_path
|
26
|
-
local_path "manifests"
|
23
|
+
@manifest_path = local_path "manifests"
|
27
24
|
end
|
28
25
|
|
29
26
|
def data_path
|
data/lib/verifier.rb
CHANGED
@@ -16,6 +16,31 @@
|
|
16
16
|
|
17
17
|
class Verifier
|
18
18
|
|
19
|
+
class Result
|
20
|
+
attr_accessor :valid, :errors, :name
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
@valid = false
|
24
|
+
@errors = Array.new
|
25
|
+
end
|
26
|
+
|
27
|
+
def valid?
|
28
|
+
@valid
|
29
|
+
end
|
30
|
+
|
31
|
+
def print_result
|
32
|
+
print "Verify manifest #{@name}..."
|
33
|
+
if valid?
|
34
|
+
puts "ok"
|
35
|
+
else
|
36
|
+
puts "error"
|
37
|
+
@errors.each do |error|
|
38
|
+
puts " #{error}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
19
44
|
def initialize settings
|
20
45
|
@settings = settings
|
21
46
|
|
@@ -23,39 +48,55 @@ class Verifier
|
|
23
48
|
"summary", "urls", "licenses", "description", "authors", "maturity",
|
24
49
|
"platforms", "packages", "keywords", "dependencies", "filename",
|
25
50
|
"libraryname" ]
|
51
|
+
@mandatory_keys = [ "schema_version", "name", "version", "release_date",
|
52
|
+
"summary", "urls", "licenses", "description", "maturity",
|
53
|
+
"platforms", "packages" ]
|
26
54
|
end
|
27
55
|
|
28
56
|
def verify manifest
|
29
|
-
@
|
57
|
+
@result = Result.new
|
30
58
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
if filename != expected_filename
|
37
|
-
@errors.push "Expected file name: #{expected_filename}"
|
59
|
+
if !manifest["filename"]
|
60
|
+
@result.errors = "Unable to determine filename"
|
61
|
+
@result.name = "<unknown>"
|
62
|
+
else
|
63
|
+
@result.name = manifest["filename"]
|
38
64
|
end
|
39
|
-
|
40
|
-
|
41
|
-
@errors.push "Invalid release date: #{manifest["release_date"]}"
|
65
|
+
if !manifest["libraryname"]
|
66
|
+
@result.errors = "Unable to determine libraryname"
|
42
67
|
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
68
|
+
|
69
|
+
if @result.errors.empty?
|
70
|
+
filename = manifest["filename"]
|
71
|
+
expected_filename = "#{manifest["libraryname"]}.#{manifest["release_date"]}.manifest"
|
72
|
+
|
73
|
+
if filename != expected_filename
|
74
|
+
@result.errors.push "Expected file name: #{expected_filename}"
|
75
|
+
end
|
76
|
+
|
77
|
+
if manifest["release_date"] == "1970-01-01"
|
78
|
+
@result.errors.push "Invalid release date: #{manifest["release_date"]}"
|
79
|
+
end
|
80
|
+
|
81
|
+
manifest.keys.each do |key|
|
82
|
+
if !@allowed_keys.include? key
|
83
|
+
@result.errors.push "Illegal entry: #{key}"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
@mandatory_keys.each do |key|
|
88
|
+
if !manifest.keys.include? key
|
89
|
+
@result.errors.push "Mandatory attribute is missing: #{key}"
|
90
|
+
end
|
47
91
|
end
|
48
92
|
end
|
49
93
|
|
50
|
-
if @errors.empty?
|
51
|
-
|
52
|
-
return
|
94
|
+
if @result.errors.empty?
|
95
|
+
@result.valid = true
|
96
|
+
return @result
|
53
97
|
else
|
54
|
-
|
55
|
-
@
|
56
|
-
puts " #{error}"
|
57
|
-
end
|
58
|
-
return false
|
98
|
+
@result.valid = false
|
99
|
+
return @result
|
59
100
|
end
|
60
101
|
end
|
61
102
|
|
data/lib/version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -25,6 +25,8 @@ class View
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def create output_dir
|
28
|
+
puts "Creating web site in '#{output_dir}' from '#{@manifest_handler.settings.manifest_path}'"
|
29
|
+
|
28
30
|
assert_dir output_dir
|
29
31
|
|
30
32
|
assert_dir "#{output_dir}/public"
|
@@ -95,7 +97,7 @@ class View
|
|
95
97
|
end
|
96
98
|
|
97
99
|
def link_to title, url
|
98
|
-
if url !~ /^mailto:/ && url !~ /^http:/ && url !~ /^https:/
|
100
|
+
if url !~ /^mailto:/ && url !~ /^http:/ && url !~ /^https:/ && url !~ /^ftp:/
|
99
101
|
url = "#{@root}#{url}.html"
|
100
102
|
end
|
101
103
|
"<a href=\"#{url}\">#{title}</a>"
|
data/manifest-format.md
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
# Inqlude manifest format
|
2
|
+
|
3
|
+
Inqlude uses manifest files to capture meta data of Qt libraries for further
|
4
|
+
inspection and processing. The meta data is stored as JSON formatted files in
|
5
|
+
the file system. This document describes the format.
|
6
|
+
|
7
|
+
## Directory structure
|
8
|
+
|
9
|
+
All data is stored in a manifest directory. It can have an arbitrary name and
|
10
|
+
path, but by default the inqlude command line tool assumes the path
|
11
|
+
~/.inqlude/manifests.
|
12
|
+
|
13
|
+
The manifest directory is under version control by git.
|
14
|
+
|
15
|
+
Each library reprented in the Inqlude system has its own sub-directory in the
|
16
|
+
manifest directory. The name of the sub-directory is the name of the library.
|
17
|
+
See there for more information about its specification and how it's used.
|
18
|
+
|
19
|
+
Each version of the library has its own manifest file in the library
|
20
|
+
sub-directory. The name of the manifest file is of the format:
|
21
|
+
|
22
|
+
<name>.<release_date>.manifest
|
23
|
+
|
24
|
+
The name and release_date parts have to be identical to the corresponding
|
25
|
+
attributes stored in the manifest file with the same names.
|
26
|
+
|
27
|
+
## Manifest file format
|
28
|
+
|
29
|
+
The manifest files are formatted as JSON and contain a list of structured
|
30
|
+
attributes describing the library and the specific version represented by the
|
31
|
+
concrete file.
|
32
|
+
|
33
|
+
These are the attributes:
|
34
|
+
|
35
|
+
### schema_version
|
36
|
+
|
37
|
+
Version number of the schema used in this manifest
|
38
|
+
|
39
|
+
This is used to make expectations of tools and processing explicit and adapt
|
40
|
+
to schema changes.
|
41
|
+
|
42
|
+
If the schema is changed in a way incompatible with processing tools, the
|
43
|
+
schema version number has to be increased.
|
44
|
+
|
45
|
+
This document specifies schema version 1.
|
46
|
+
|
47
|
+
*schema_version is a mandatory attribute*
|
48
|
+
|
49
|
+
### name
|
50
|
+
|
51
|
+
Name of the library
|
52
|
+
|
53
|
+
The name of the library has to be a lower-case string with only alphanumeric
|
54
|
+
characters. It has to be identical with the name part of the manifest file names
|
55
|
+
and the name of the directory where the manifest is stored in the manifest
|
56
|
+
repository.
|
57
|
+
|
58
|
+
As a convention Qt bindings to other libraries are named with the name of the
|
59
|
+
other library and a "-qt" suffix. For example the Qt bindings to PackageKit
|
60
|
+
are named "packagekit-qt" in Inqlude.
|
61
|
+
|
62
|
+
It's used as internal handle by the tools and shows up where it
|
63
|
+
needs to be processed by software, e.g. as an identifier as paramezer of the
|
64
|
+
command line tool or as part of the URL on the web site. The name has to be
|
65
|
+
identical with the value of the name attribute of the manifest files
|
66
|
+
representing the different versions of the library.
|
67
|
+
|
68
|
+
*name is a mandatory attribute*
|
69
|
+
|
70
|
+
### release_date
|
71
|
+
|
72
|
+
Date, when the version was released
|
73
|
+
|
74
|
+
*release_date is a mandatory attribute*
|
75
|
+
|
76
|
+
### version
|
77
|
+
|
78
|
+
Version of the release
|
79
|
+
|
80
|
+
*version is a mandatory attribute*
|
81
|
+
|
82
|
+
### summary
|
83
|
+
|
84
|
+
One-line summary describing the library
|
85
|
+
|
86
|
+
This is the main description of the library used in summary lists etc.
|
87
|
+
|
88
|
+
*summary is a mandatory attribute*
|
89
|
+
|
90
|
+
### urls
|
91
|
+
|
92
|
+
List of URLs relevant to the library
|
93
|
+
|
94
|
+
All URLs are represented as a key specifying the type of the URL and the
|
95
|
+
actual URL itself. Arbitrary types can be defined. Some types are used for
|
96
|
+
specific purposes and get special treatment.
|
97
|
+
|
98
|
+
The following types are recognized:
|
99
|
+
|
100
|
+
* "homepage": Home page of the library. This is the main URL used as entry point
|
101
|
+
for looking up information about the library. All manifests should contain
|
102
|
+
a homepage URL.
|
103
|
+
* "download": Download area where the source code of the library can be
|
104
|
+
downloaded. This is not the download of the specific version of the library.
|
105
|
+
This is described in the packages section.
|
106
|
+
* "vcs": URL of the source code repository where the library is developed.
|
107
|
+
* "tutorial": URL to tutorial-style documentation how to use the library.
|
108
|
+
* "api_docs": URL to reference documentation of the API of the library.
|
109
|
+
* "description_source": If the description text is taken from another source
|
110
|
+
this URL points to the source.
|
111
|
+
* "announcement": Link to release announcement
|
112
|
+
* "custom": Array of pairs of title and URL of custom links
|
113
|
+
|
114
|
+
*the homepage is a mandatory url attribute*
|
115
|
+
|
116
|
+
### licenses
|
117
|
+
|
118
|
+
List of licenses under which the library can be used
|
119
|
+
|
120
|
+
Array of identifier strings of the software licenses under which the library
|
121
|
+
can be used. This can be a free-form string, but there is a list of predefined
|
122
|
+
strings for the most often used licenses:
|
123
|
+
|
124
|
+
* "LGPLv2.1+": Lesser GNU Public License 2.1 or later
|
125
|
+
* "GPLv2+": GNU Public License v2 or later
|
126
|
+
* "GPLv3+": GNU Public License v3 or later
|
127
|
+
|
128
|
+
*there must be at least one license*
|
129
|
+
|
130
|
+
### description
|
131
|
+
|
132
|
+
Full description of the library
|
133
|
+
|
134
|
+
The description is a text describing the library. It can be of arbitrary length.
|
135
|
+
No special formatting is supported other than using newlines to start a new
|
136
|
+
paragraph.
|
137
|
+
|
138
|
+
*description is a mandatory attribute*
|
139
|
+
|
140
|
+
### authors
|
141
|
+
|
142
|
+
List of authors
|
143
|
+
|
144
|
+
Array of author names and email addresses. The standard email address format
|
145
|
+
"John Doe <jdoe@example.com>" is used.
|
146
|
+
|
147
|
+
### maturity
|
148
|
+
|
149
|
+
Maturity of the release
|
150
|
+
|
151
|
+
This attribute is a flag for identifying the maturity of the release. It's used
|
152
|
+
to identify stable, test, and development versions.
|
153
|
+
|
154
|
+
The flag has to be one of the following identifiers:
|
155
|
+
|
156
|
+
* "stable": for stable releases ready for production use
|
157
|
+
* "beta": for pre-releases of stable versions used for gathering feedback, not
|
158
|
+
recommended for production use
|
159
|
+
* "alpha": preview releases, not suitable for production use
|
160
|
+
|
161
|
+
*maturity is a mandatory attribute*
|
162
|
+
|
163
|
+
### platforms
|
164
|
+
|
165
|
+
List of supported platforms
|
166
|
+
|
167
|
+
Array of strings identifying the platforms on which the library runs.
|
168
|
+
|
169
|
+
Supported values are:
|
170
|
+
|
171
|
+
* "Linux"
|
172
|
+
* "Windows"
|
173
|
+
* "Mac"
|
174
|
+
|
175
|
+
*there must be at least one platform*
|
176
|
+
|
177
|
+
### packages
|
178
|
+
|
179
|
+
List of packages of the release
|
180
|
+
|
181
|
+
This section contains a list of data on packaged versions of the library, which
|
182
|
+
can be used to run it on specific systems. This includes the source code
|
183
|
+
release, but also platform-specific binary packages.
|
184
|
+
|
185
|
+
For each type of package there is a type-specific format to describe the
|
186
|
+
package. The following types are supported:
|
187
|
+
|
188
|
+
#### source
|
189
|
+
|
190
|
+
This is the source code of the release. It has one URL to the file, which
|
191
|
+
can be used to download the code.
|
192
|
+
|
193
|
+
*source is a mandatory package attribute*
|
194
|
+
|
195
|
+
#### openSUSE
|
196
|
+
|
197
|
+
openSUSE binary packages. For each version of openSUSE there is a separate
|
198
|
+
entry.
|
199
|
+
|
200
|
+
Each entry contains the package_name, repository, and source_rpm attributes.
|
201
|
+
The repository contains an url and a name sub-attribute.
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe Creator do
|
4
|
+
|
5
|
+
let(:settings) do
|
6
|
+
s = Settings.new
|
7
|
+
s.manifest_path = File.expand_path('spec/data/')
|
8
|
+
s.offline = true
|
9
|
+
s
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:filename) do
|
13
|
+
File.expand_path('../data/awesomelib/awesomelib.2013-10-01.manifest', __FILE__)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "checks directory" do
|
17
|
+
c = Creator.new settings, "xxx"
|
18
|
+
expect{ c.validate_directory }.to raise_error(StandardError)
|
19
|
+
|
20
|
+
c = Creator.new settings, "awesomelib"
|
21
|
+
c.validate_directory
|
22
|
+
end
|
23
|
+
|
24
|
+
it "create updated manifest" do
|
25
|
+
c = Creator.new settings, "awesomelib"
|
26
|
+
|
27
|
+
File.exists?(filename).should be_false
|
28
|
+
|
29
|
+
c.create "1.0", "2013-10-01"
|
30
|
+
|
31
|
+
File.exists?(filename).should be_true
|
32
|
+
|
33
|
+
mh = ManifestHandler.new settings
|
34
|
+
mh.read_remote
|
35
|
+
|
36
|
+
mh.libraries.count.should == 1
|
37
|
+
m = mh.manifest "awesomelib"
|
38
|
+
m["name"].should == "awesomelib"
|
39
|
+
m["version"].should == "1.0"
|
40
|
+
m["release_date"].should == "2013-10-01"
|
41
|
+
m["summary"].should == "Awesome library"
|
42
|
+
|
43
|
+
mh.manifests.count.should == 2
|
44
|
+
mh.manifests.each do |manifest|
|
45
|
+
manifest.keys.count.should == 14
|
46
|
+
end
|
47
|
+
|
48
|
+
m = JSON File.read(filename)
|
49
|
+
m.keys.count.should == 12
|
50
|
+
end
|
51
|
+
|
52
|
+
after(:each) do
|
53
|
+
File.delete filename if File.exists? filename
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"schema_version": 1,
|
3
|
+
"name": "awesomelib",
|
4
|
+
"release_date": "2013-09-08",
|
5
|
+
"version": "0.2.0",
|
6
|
+
"summary": "Awesome library",
|
7
|
+
"urls": {
|
8
|
+
"homepage": "http://example.com",
|
9
|
+
"download": "http://example.com/download"
|
10
|
+
},
|
11
|
+
"licenses": ["LGPLv2.1+"],
|
12
|
+
"description": "This is an awesome library.",
|
13
|
+
"authors": ["Cornelius Schumacher <schumacher@kde.org>"],
|
14
|
+
"maturity": "stable",
|
15
|
+
"platforms": [ "Linux" ],
|
16
|
+
"packages": {
|
17
|
+
"source": "ftp://example.com/download/awesomelib-0.2.0.tar.gz"
|
18
|
+
}
|
19
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require File.expand_path('../
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
|
3
|
-
|
3
|
+
describe Library do
|
4
4
|
|
5
|
-
|
5
|
+
it "lists versions" do
|
6
6
|
versions = [ "1.0", "2.0" ]
|
7
7
|
|
8
8
|
manifests = Array.new
|
@@ -13,7 +13,7 @@ class LibraryTest < Test::Unit::TestCase
|
|
13
13
|
library = Library.new
|
14
14
|
library.manifests = manifests
|
15
15
|
|
16
|
-
|
16
|
+
library.versions.should == versions
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe ManifestHandler do
|
4
|
+
|
5
|
+
let(:settings) do
|
6
|
+
s = Settings.new
|
7
|
+
s.manifest_path = File.expand_path('spec/data/')
|
8
|
+
s.offline = true
|
9
|
+
s
|
10
|
+
end
|
11
|
+
|
12
|
+
it "reads manifests" do
|
13
|
+
mh = ManifestHandler.new settings
|
14
|
+
mh.read_remote
|
15
|
+
mh.manifests.count.should == 1
|
16
|
+
mh.libraries.count.should == 1
|
17
|
+
mh.read_remote
|
18
|
+
mh.manifests.count.should == 1
|
19
|
+
mh.libraries.count.should == 1
|
20
|
+
end
|
21
|
+
|
22
|
+
it "provides access to manifests" do
|
23
|
+
mh = ManifestHandler.new settings
|
24
|
+
mh.read_remote
|
25
|
+
|
26
|
+
mh.manifest("awesomelib").class.should == Hash
|
27
|
+
expect { mh.manifest("nonexisting") }.to raise_error
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe Settings do
|
4
|
+
|
5
|
+
it "has default manifest path" do
|
6
|
+
Settings.new.manifest_path.should == File.join( ENV["HOME"], ".inqlude/manifests" )
|
7
|
+
end
|
8
|
+
|
9
|
+
it "lets manifest path to be set" do
|
10
|
+
s = Settings.new
|
11
|
+
s.manifest_path = "abc/xyz"
|
12
|
+
s.manifest_path.should == "abc/xyz"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe Verifier do
|
4
|
+
|
5
|
+
let(:settings) do
|
6
|
+
s = Settings.new
|
7
|
+
s.manifest_path = File.expand_path('spec/data/')
|
8
|
+
s.offline = true
|
9
|
+
s
|
10
|
+
end
|
11
|
+
|
12
|
+
it "defines result class" do
|
13
|
+
r = Verifier::Result.new
|
14
|
+
r.valid?.should be_false
|
15
|
+
r.errors.class.should == Array
|
16
|
+
end
|
17
|
+
|
18
|
+
it "verifies read manifests" do
|
19
|
+
handler = ManifestHandler.new settings
|
20
|
+
handler.read_remote
|
21
|
+
|
22
|
+
verifier = Verifier.new settings
|
23
|
+
verifier.verify( handler.manifest("awesomelib") ).class.should == Verifier::Result
|
24
|
+
verifier.verify( handler.manifest("awesomelib") ).valid?.should be_true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "detects incomplete manifest" do
|
28
|
+
verifier = Verifier.new settings
|
29
|
+
|
30
|
+
manifest = Hash.new
|
31
|
+
verifier.verify( manifest ).valid?.should be_false
|
32
|
+
end
|
33
|
+
|
34
|
+
it "detects invalid entries" do
|
35
|
+
handler = ManifestHandler.new settings
|
36
|
+
handler.read_remote
|
37
|
+
verifier = Verifier.new settings
|
38
|
+
|
39
|
+
manifest = handler.manifest("awesomelib")
|
40
|
+
verifier.verify(manifest).valid?.should be_true
|
41
|
+
|
42
|
+
manifest["invalidentry"] = "something"
|
43
|
+
verifier.verify(manifest).valid?.should be_false
|
44
|
+
verifier.verify(manifest).errors.count.should == 1
|
45
|
+
end
|
46
|
+
|
47
|
+
it "detects name mismatch" do
|
48
|
+
handler = ManifestHandler.new settings
|
49
|
+
handler.read_remote
|
50
|
+
verifier = Verifier.new settings
|
51
|
+
|
52
|
+
manifest = handler.manifest("awesomelib")
|
53
|
+
verifier.verify(manifest).valid?.should be_true
|
54
|
+
|
55
|
+
manifest["filename"] = "wrongname"
|
56
|
+
verifier.verify(manifest).valid?.should be_false
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
data/view/layout.html.haml
CHANGED
data/view/library.html.haml
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
Version
|
7
7
|
= m "version"
|
8
8
|
= "(#{m "maturity"})"
|
9
|
+
%span{:class => "release-date"}
|
10
|
+
released on #{m "release_date"}
|
9
11
|
- if !old_versions.empty?
|
10
12
|
%span{:class => "old-versions"}
|
11
13
|
= "(older versions: #{old_versions.join(", ")})"
|
@@ -21,6 +23,7 @@
|
|
21
23
|
= list_attribute "authors"
|
22
24
|
|
23
25
|
%p
|
26
|
+
Home page:
|
24
27
|
= link m( "urls", "homepage" )
|
25
28
|
|
26
29
|
- if more_urls?
|
@@ -29,10 +32,16 @@
|
|
29
32
|
= link_item "api_docs", "API documentation"
|
30
33
|
= link_item "readme", "README"
|
31
34
|
= link_item "tutorial", "Tutorial"
|
32
|
-
= link_item "download", "Download
|
35
|
+
= link_item "download", "Download sources"
|
33
36
|
= link_item "vcs", "Source code repository"
|
37
|
+
= link_item "announcement", "Announcement"
|
34
38
|
= custom_urls
|
35
39
|
|
40
|
+
- if m("packages") && m( "packages", "source" )
|
41
|
+
%h3 Packages
|
42
|
+
|
43
|
+
= link_to "Source code", m( "packages", "source" )
|
44
|
+
|
36
45
|
%p{:class => "edit-link"}
|
37
46
|
= link_to "[Edit]", editor_url
|
38
47
|
|
data/view/public/inqlude.css
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inqlude
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Cornelius Schumacher
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-09-15 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -95,7 +95,6 @@ files:
|
|
95
95
|
- .gitignore
|
96
96
|
- COPYING
|
97
97
|
- README
|
98
|
-
- Rakefile
|
99
98
|
- TODO
|
100
99
|
- bin/inqlude
|
101
100
|
- data/manifest.patch
|
@@ -103,6 +102,7 @@ files:
|
|
103
102
|
- examples/qjson.manifest
|
104
103
|
- inqlude.gemspec
|
105
104
|
- lib/cli.rb
|
105
|
+
- lib/creator.rb
|
106
106
|
- lib/distro.rb
|
107
107
|
- lib/distros/suse.rb
|
108
108
|
- lib/inqlude.rb
|
@@ -114,9 +114,15 @@ files:
|
|
114
114
|
- lib/verifier.rb
|
115
115
|
- lib/version.rb
|
116
116
|
- lib/view.rb
|
117
|
-
-
|
118
|
-
-
|
119
|
-
-
|
117
|
+
- manifest-format.md
|
118
|
+
- spec/creator_spec.rb
|
119
|
+
- spec/data/awesomelib/awesomelib.2013-09-08.manifest
|
120
|
+
- spec/library_spec.rb
|
121
|
+
- spec/manifest_handler_spec.rb
|
122
|
+
- spec/rpm_manifestizer_spec.rb
|
123
|
+
- spec/settings_spec.rb
|
124
|
+
- spec/spec_helper.rb
|
125
|
+
- spec/verifier_spec.rb
|
120
126
|
- view/about.html.haml
|
121
127
|
- view/contribute.html.haml
|
122
128
|
- view/get.html.haml
|
data/Rakefile
DELETED