inqlude 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +23 -0
  3. data/{README → README.md} +0 -0
  4. data/TODO +24 -9
  5. data/accessing-inqlude-data.md +55 -0
  6. data/inqlude.gemspec +2 -1
  7. data/lib/cli.rb +36 -4
  8. data/lib/creator.rb +17 -32
  9. data/lib/distros/suse.rb +2 -2
  10. data/lib/downloader.rb +37 -0
  11. data/lib/exceptions.rb +2 -0
  12. data/lib/inqlude.rb +21 -15
  13. data/lib/json_object.rb +104 -0
  14. data/lib/kde_frameworks_creator.rb +14 -10
  15. data/lib/kde_frameworks_release.rb +14 -13
  16. data/lib/library.rb +4 -4
  17. data/lib/manifest.rb +165 -28
  18. data/lib/manifest_handler.rb +14 -16
  19. data/lib/verifier.rb +23 -48
  20. data/lib/version.rb +1 -1
  21. data/lib/view.rb +29 -26
  22. data/manifest-format.md +15 -0
  23. data/spec/data/inqlude-all-karchive.json +31 -0
  24. data/spec/data/inqlude-all.json +120 -0
  25. data/spec/data/invalid-schema.manifest +4 -0
  26. data/spec/data/karchive-release-5.4.manifest +29 -0
  27. data/spec/data/karchive-release.manifest +7 -7
  28. data/spec/data/karchive.readme +0 -6
  29. data/spec/data/newlib/newlib.manifest +11 -4
  30. data/spec/data/rendertest-generic.manifest +4 -1
  31. data/spec/integration/cli_create_spec.rb +24 -0
  32. data/spec/integration/cli_general_spec.rb +19 -0
  33. data/spec/integration/cli_get_involved_spec.rb +14 -0
  34. data/spec/integration/cli_help_spec.rb +21 -0
  35. data/spec/integration/cli_list_spec.rb +23 -0
  36. data/spec/integration/cli_verify_spec.rb +37 -0
  37. data/spec/integration/cli_view_spec.rb +28 -0
  38. data/spec/integration/spec_helper.rb +2 -0
  39. data/spec/{creator_spec.rb → unit/creator_spec.rb} +8 -41
  40. data/spec/unit/downloader_spec.rb +32 -0
  41. data/spec/unit/json_object_spec.rb +273 -0
  42. data/spec/{kde_frameworks_creator_spec.rb → unit/kde_frameworks_creator_spec.rb} +13 -14
  43. data/spec/{kde_frameworks_release_spec.rb → unit/kde_frameworks_release_spec.rb} +14 -10
  44. data/spec/{library_spec.rb → unit/library_spec.rb} +7 -7
  45. data/spec/{manifest_handler_spec.rb → unit/manifest_handler_spec.rb} +21 -17
  46. data/spec/unit/manifest_spec.rb +301 -0
  47. data/spec/{rpm_manifestizer_spec.rb → unit/rpm_manifestizer_spec.rb} +0 -0
  48. data/spec/{settings_spec.rb → unit/settings_spec.rb} +0 -0
  49. data/spec/{spec_helper.rb → unit/spec_helper.rb} +10 -12
  50. data/spec/{verifier_spec.rb → unit/verifier_spec.rb} +24 -15
  51. data/spec/{view_spec.rb → unit/view_spec.rb} +38 -7
  52. data/view/all.html.haml +4 -4
  53. data/view/commercial.html.haml +1 -1
  54. data/view/development.html.haml +3 -3
  55. data/view/get.html.haml +11 -2
  56. data/view/group.html.haml +4 -4
  57. data/view/index.html.haml +1 -1
  58. data/view/library.html.haml +8 -9
  59. data/view/unreleased.html.haml +1 -1
  60. data/yes_ship_it.conf +3 -0
  61. metadata +67 -51
  62. data/spec/manifest_spec.rb +0 -63
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 29975395e8bb39f24d4d623ae4b1ee12540143eb
4
+ data.tar.gz: 7619b8dc07af9e3cd89fdd8c35736c617112f761
5
+ SHA512:
6
+ metadata.gz: 9572cc4a485616494f4a475edd02e9b6bc41707047951a44c8870091b442dc33f27862ab298a8173963639942ef253a49238d43456a5afd33dd86cd9fba3e145
7
+ data.tar.gz: 95a40483eb41571935499b36892128d36b2ee76c6ed0646e58c093e828c3e2411bc6f83562b2fa449d83e3b88e0db4ae4211929e8ac0821209c5a3788e4d1d11
@@ -0,0 +1,23 @@
1
+ # Change log of Inqlude
2
+
3
+ ## Version 0.7.1
4
+
5
+ * `create_kde_frameworks` command:
6
+
7
+ Generate links from name
8
+
9
+ The standard links for frameworks such as home page, mailing list,
10
+ git repository always follow the same scheme. So instead of parsing
11
+ them from the README.md generate them from the name of the framework.
12
+
13
+ This is more flexible, allows to change all links at once, and is
14
+ compatible with the frameworks where the links have been removed from
15
+ the READMEs.
16
+
17
+ * Accept windows and ubuntu as package category
18
+ * Implement `inqlude download`
19
+ * Generate inqlude-all.json on Inqlude website
20
+
21
+ ## Version 0.7.0
22
+
23
+ * First alpha release
File without changes
data/TODO CHANGED
@@ -1,8 +1,3 @@
1
- # 0.7 (Alpha) (first announcement, ready for early adopters)
2
-
3
- * Release it
4
-
5
-
6
1
  # 0.8 (Alpha) (second announcement, ready for contributors)
7
2
 
8
3
  * Create ROADMAP.md
@@ -10,20 +5,25 @@
10
5
  * Move all issues from this file to GitHub
11
6
  * Add Upstream.get_involved for all issues where possible
12
7
 
8
+ * Split cli #23
9
+ * Sort out client naming
10
+
11
+ * Point KDE Frameworks homepages to http://api.kde.org
12
+
13
13
  * Release it
14
14
 
15
15
 
16
16
  # 0.9 (Beta) (ready for contributors of meta data, schema stable)
17
17
 
18
- * Replace manifest hash by Manifest object
19
-
20
18
  * Add display name High Priority #12
21
19
  * Check platform attribute for valid entries High Priority #18
22
20
  * Check maturity for valid values High Priority #16
23
- * Link to license text Medium Priority #14
24
21
  * Add a comment field for authors Medium Priority #15
25
22
  * Add attribute for screenshots Medium Priority #10
26
23
  * Add bugtracker URL Low Priority #7
24
+ * Add vcs:git:clone_url
25
+ * Use SPDX license identifiers (http://spdx.org/licenses/)
26
+ * Link to license text Medium Priority #14
27
27
 
28
28
  * Define maturity scale
29
29
  * State policy for inclusion of libraries (at least one stable release, no qt3,
@@ -32,11 +32,16 @@
32
32
  tags in meta data for bound library)
33
33
 
34
34
  * Show Qt5 compability High Priority #20
35
+
36
+ * Define how to handle dependencies between libraries on inqlude.org
37
+
35
38
  * Check links Medium Priority #11
36
39
  * Add command for showing library details High Priority #1
37
40
 
38
41
  * Turn alpha ribbon into beta ribbon on web site
39
42
 
43
+ * Commit hook on server to verify the manifests
44
+
40
45
  * Release it
41
46
 
42
47
 
@@ -67,11 +72,21 @@
67
72
  * Get manifests from build service
68
73
  * List libraries with available packages
69
74
  * Properly identify repository (use vendor?)
75
+ * Dependencies to other libraries
76
+ * Get from list_dependencies in kde build meta data
77
+ * Qt version information
78
+ * minimum_qt_version = [ 4.2.1, 5.1.0 ]
79
+ or
80
+ * split manifests between Qt 4 and Qt 5 (directory with Qt version suffix)
81
+ * Check installation experience on Mac
82
+ * Check installation experience on Windows
83
+ * User client without dependencies on git and Ruby
84
+ * Integration tests for download/list/etc. functionality
85
+ * Define way to manage local downloads
70
86
 
71
87
  * Release it
72
88
 
73
89
 
74
90
  # Later
75
91
 
76
- * Create more friendly progress display for cache creation Low Priority #3
77
92
  * Add some quality indication Low Priority #17
@@ -0,0 +1,55 @@
1
+ # Accessing Inqlude data
2
+
3
+ The data of the Inqlude library archive is maintained in the
4
+ [inqlude-data](https://github.com/cornelius/inqlude-data) repository. It
5
+ includes the meta data for all libraries collected in Inqlude. There are various
6
+ ways to access this data from a client. They are described in this document.
7
+
8
+ ## Using the git repository
9
+
10
+ The most direct way is to clone the [meta data git repository](https://github.com/cornelius/inqlude-data) and work on the
11
+ data locally. The repository contains a set of directories with manifests
12
+ following the [Inqlude manifest specification](https://github.com/cornelius/inqlude/blob/master/manifest-format.md).
13
+ The data can be updated with standard git commands such as `git pull`.
14
+
15
+ ## All data in one JSON
16
+
17
+ There is a JSON file available at http://inqlude.org/inqlude-all.json, which
18
+ contains the data for the latest version of all libraries. This is the most
19
+ convenient way, if you just want to have the current data.
20
+
21
+ The file is updated whenever the data in the inqlude-data git repository is
22
+ updated.
23
+
24
+ The file is simply wrapping the manifests in a JSON array:
25
+
26
+ ```json
27
+ [
28
+ {
29
+ "$schema": "http://inqlude.org/schema/release-manifest-v1#",
30
+ "name": "attica",
31
+ "release_date": "2013-06-12",
32
+ "version": "0.4.2",
33
+ ...
34
+ },
35
+ {
36
+ "$schema": "http://inqlude.org/schema/release-manifest-v1#",
37
+ "name": "avahi-qt",
38
+ "release_date": "2012-02-15",
39
+ "version": "0.6.31",
40
+ ...
41
+ }
42
+ ]
43
+ ```
44
+
45
+ ## Using a client
46
+
47
+ There currently are two clients to access the Inqlude data.
48
+
49
+ The preferred way to access the data as a user of libraries is the native
50
+ command line client written in C++. Its source is maintained as the
51
+ [inqlude-client project](https://projects.kde.org/projects/playground/sdk/inqlude-client).
52
+
53
+ The other client is the [Inqlude admin tool](https://github.com/cornelius/inqlude).
54
+ It provides commands to access the meta data. It also has commands to manipulate
55
+ and verify meta data.
@@ -23,7 +23,8 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency "xdg"
24
24
 
25
25
  s.add_development_dependency "rspec", "~>3"
26
- s.add_development_dependency "given_filesystem"
26
+ s.add_development_dependency "given_filesystem", ">=0.1.2"
27
+ s.add_development_dependency "cli_tester"
27
28
 
28
29
  s.files = `git ls-files`.split("\n")
29
30
  s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
data/lib/cli.rb CHANGED
@@ -20,6 +20,7 @@ class Cli < Thor
20
20
 
21
21
  class_option :version, :type => :boolean, :desc => "Show version"
22
22
  class_option :offline, :type => :boolean, :desc => "Work offline"
23
+ class_option :manifest_dir, :type => :string, :desc => "Manifest directory"
23
24
 
24
25
  def self.settings= s
25
26
  @@settings = s
@@ -86,7 +87,10 @@ actual domain."
86
87
  @@settings.manifest_path = options[:manifest_dir]
87
88
  end
88
89
 
89
- view = View.new ManifestHandler.new @@settings
90
+ manifest_handler = ManifestHandler.new(@@settings)
91
+ manifest_handler.read_remote
92
+
93
+ view = View.new(manifest_handler)
90
94
  view.enable_disqus = options[:enable_disqus]
91
95
  view.enable_search = !options[:disable_search]
92
96
  view.create options[:output_dir]
@@ -110,6 +114,8 @@ actual domain."
110
114
  exit 1
111
115
  end
112
116
 
117
+ errors = []
118
+
113
119
  if filename
114
120
  result = v.verify_file filename
115
121
  result.print_result
@@ -117,7 +123,6 @@ actual domain."
117
123
  handler = ManifestHandler.new @@settings
118
124
  handler.read_remote
119
125
  count_ok = 0
120
- count_error = 0
121
126
  handler.libraries.each do |library|
122
127
  library.manifests.each do |manifest|
123
128
  result = v.verify manifest
@@ -125,12 +130,23 @@ actual domain."
125
130
  if result.valid?
126
131
  count_ok += 1
127
132
  else
128
- count_error += 1
133
+ errors.push result
129
134
  end
130
135
  end
131
136
  end
137
+ puts
132
138
  puts "#{handler.manifests.count} manifests checked. #{count_ok} ok, " +
133
- "#{count_error} with error."
139
+ "#{errors.count} with error."
140
+ if !errors.empty?
141
+ puts
142
+ puts "Errors:"
143
+ errors.each do |error|
144
+ puts " #{error.name}"
145
+ error.errors.each do |e|
146
+ puts " #{e}"
147
+ end
148
+ end
149
+ end
134
150
  end
135
151
  end
136
152
 
@@ -260,10 +276,26 @@ actual domain."
260
276
  end
261
277
  end
262
278
 
279
+ desc "download", "Download source code archive"
280
+ def download(name)
281
+ handler = ManifestHandler.new(@@settings)
282
+ handler.read_remote
283
+ manifest = handler.manifest(name)
284
+ if !manifest
285
+ STDERR.outs "Manifest for '#{name}' not found"
286
+ exit 1
287
+ else
288
+ Downloader.new(handler, STDOUT).download(name, Dir.pwd)
289
+ end
290
+ end
291
+
263
292
  private
264
293
 
265
294
  def process_global_options options
266
295
  @@settings.offline = options[:offline]
296
+ if options[:manifest_dir]
297
+ @@settings.manifest_path = options[:manifest_dir]
298
+ end
267
299
  end
268
300
 
269
301
  end
@@ -41,13 +41,11 @@ class Creator
41
41
  mh.read_remote
42
42
 
43
43
  m = mh.manifest @name
44
- m.delete "filename"
45
- m.delete "libraryname"
46
- m["version"] = version
47
- m["release_date"] = release_date
44
+ m.version = version
45
+ m.release_date = release_date
48
46
 
49
47
  File.open( filename, "w" ) do |file|
50
- file.puts Manifest.to_json(m)
48
+ file.puts m.to_json
51
49
  end
52
50
  end
53
51
 
@@ -56,49 +54,36 @@ class Creator
56
54
  end
57
55
 
58
56
  def create_manifest version, release_date
59
- m = Hash.new
60
- m["$schema"] = Manifest.release_schema_id
61
- m["name"] = @name
62
- m["version"] = version
63
- m["release_date"] = release_date
64
- m["summary"] = ""
65
- m["urls"] = { "homepage" => "", "vcs" => "", "download" => "" }
66
- m["licenses"] = [ "" ]
67
- m["description"] = ""
57
+ m = ManifestRelease.new
58
+ m.name = @name
59
+ m.version = version
60
+ m.release_date = release_date
68
61
  if version == "edge"
69
- m["maturity"] = "edge"
62
+ m.maturity = "edge"
70
63
  else
71
- m["maturity"] = "stable"
64
+ m.maturity = "stable"
72
65
  end
73
- m["authors"] = [ "" ]
74
- m["platforms"] = [ "Linux" ]
75
- m["packages"] = { "source" => "" }
66
+ m.platforms = [ "Linux" ]
76
67
  m
77
68
  end
78
69
 
79
70
  def write_manifest manifest
80
71
  filename = File.join @settings.manifest_path, @name, @name
81
- if manifest["release_date"]
82
- filename += ".#{manifest["release_date"]}"
72
+ if manifest.release_date
73
+ filename += ".#{manifest.release_date}"
83
74
  end
84
75
  filename += ".manifest"
85
76
 
86
77
  File.open( filename, "w" ) do |file|
87
- file.puts Manifest.to_json(manifest)
78
+ file.puts manifest.to_json
88
79
  end
89
80
  end
90
81
 
91
82
  def create_generic_manifest
92
- m = Hash.new
93
- m["$schema"] = Manifest.generic_schema_id
94
- m["name"] = @name
95
- m["display_name"] = @name.capitalize
96
- m["summary"] = ""
97
- m["urls"] = { "homepage" => "", "vcs" => "" }
98
- m["licenses"] = [ "" ]
99
- m["description"] = ""
100
- m["authors"] = [ "" ]
101
- m["platforms"] = [ "Linux" ]
83
+ m = ManifestGeneric.new
84
+ m.name = @name
85
+ m.display_name = @name.capitalize
86
+ m.platforms = [ "Linux" ]
102
87
  m
103
88
  end
104
89
 
@@ -46,7 +46,7 @@ class Suse
46
46
  installed = Array.new
47
47
  handler.manifests.each do |manifest|
48
48
  unknown += 1
49
- package_section = manifest["packages"]
49
+ package_section = manifest.packages.openSUSE
50
50
  next unless package_section
51
51
  name_section = package_section[name]
52
52
  next unless name_section
@@ -84,7 +84,7 @@ class Suse
84
84
  end
85
85
 
86
86
  def get_package_name manifest
87
- package_section = manifest["packages"]
87
+ package_section = manifest.packages.openSUSE
88
88
  if !package_section
89
89
  STDERR.puts "No packages section in metadata"
90
90
  else
@@ -0,0 +1,37 @@
1
+ # Copyright (C) 2014 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 Downloader
18
+ def initialize(handler, output)
19
+ @handler = handler
20
+ @output = output
21
+ end
22
+
23
+ def download(name, directory)
24
+ @output.puts "Downloading #{name}"
25
+ url = @handler.manifest(name).packages.source
26
+ @output.puts " from: #{url}"
27
+ file_path = File.join(directory, File.basename(url))
28
+ @output.puts " to: #{file_path}"
29
+ File.open(file_path, "w") do |f|
30
+ f.write(read_from_url(url))
31
+ end
32
+ end
33
+
34
+ def read_from_url(url)
35
+ URI.parse(url).open.read
36
+ end
37
+ end
@@ -0,0 +1,2 @@
1
+ class VerificationError < StandardError
2
+ end
@@ -8,18 +8,24 @@ require "json-schema"
8
8
  require "kramdown"
9
9
  require "xdg"
10
10
 
11
- require File.expand_path('../version', __FILE__)
12
- require File.expand_path('../cli', __FILE__)
13
- require File.expand_path('../manifest_handler', __FILE__)
14
- require File.expand_path('../view', __FILE__)
15
- require File.expand_path('../distro', __FILE__)
16
- require File.expand_path('../rpm_manifestizer', __FILE__)
17
- require File.expand_path('../settings', __FILE__)
18
- require File.expand_path('../upstream', __FILE__)
19
- require File.expand_path('../verifier', __FILE__)
20
- require File.expand_path('../library', __FILE__)
21
- require File.expand_path('../creator', __FILE__)
22
- require File.expand_path('../git_hub_tool', __FILE__)
23
- require File.expand_path('../manifest', __FILE__)
24
- require File.expand_path('../kde_frameworks_creator', __FILE__)
25
- require File.expand_path('../kde_frameworks_release', __FILE__)
11
+ class InqludeError < StandardError
12
+ end
13
+
14
+ require_relative("json_object")
15
+ require_relative("exceptions")
16
+ require_relative("version")
17
+ require_relative("cli")
18
+ require_relative("manifest_handler")
19
+ require_relative("view")
20
+ require_relative("distro")
21
+ require_relative("rpm_manifestizer")
22
+ require_relative("settings")
23
+ require_relative("upstream")
24
+ require_relative("verifier")
25
+ require_relative("library")
26
+ require_relative("creator")
27
+ require_relative("git_hub_tool")
28
+ require_relative("manifest")
29
+ require_relative("kde_frameworks_creator")
30
+ require_relative("kde_frameworks_release")
31
+ require_relative("downloader")