inqlude 0.0.8 → 0.7.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.
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/Gemfile +3 -0
- data/README +35 -1
- data/TODO +50 -15
- data/inqlude.gemspec +7 -2
- data/lib/cli.rb +70 -6
- data/lib/creator.rb +32 -8
- data/lib/git_hub_tool.rb +92 -0
- data/lib/inqlude.rb +7 -0
- data/lib/kde_frameworks_creator.rb +173 -0
- data/lib/kde_frameworks_release.rb +61 -0
- data/lib/library.rb +26 -1
- data/lib/manifest.rb +43 -0
- data/lib/manifest_handler.rb +59 -17
- data/lib/rpm_manifestizer.rb +2 -2
- data/lib/settings.rb +21 -10
- data/lib/verifier.rb +29 -18
- data/lib/version.rb +1 -1
- data/lib/view.rb +55 -10
- data/manifest-format.md +27 -12
- data/schema/generic-manifest-v1 +54 -0
- data/schema/proprietary-release-manifest-v1 +63 -0
- data/schema/release-manifest-v1 +73 -0
- data/spec/creator_spec.rb +94 -34
- data/spec/data/awesomelib/awesomelib.2013-09-08.manifest +14 -6
- data/spec/data/bleedingedge/bleedingedge.2012-01-01.manifest +3 -2
- data/spec/data/commercial/commercial.manifest +13 -0
- data/spec/data/karchive-generic.manifest +22 -0
- data/spec/data/karchive-release-beta.manifest +29 -0
- data/spec/data/karchive-release.manifest +29 -0
- data/spec/data/karchive-release2.manifest +29 -0
- data/spec/data/karchive.authors +10 -0
- data/spec/data/karchive.readme +35 -0
- data/spec/data/kservice-generic.manifest +22 -0
- data/spec/data/kservice.readme +9 -0
- data/spec/data/newlib/newlib.manifest +13 -0
- data/spec/data/proprietarylib/proprietarylib.2013-12-22.manifest +16 -0
- data/spec/data/rendertest-generic.manifest +20 -0
- data/spec/data/testcontent +1 -0
- data/spec/kde_frameworks_creator_spec.rb +263 -0
- data/spec/kde_frameworks_release_spec.rb +72 -0
- data/spec/library_spec.rb +54 -2
- data/spec/manifest_handler_spec.rb +102 -8
- data/spec/manifest_spec.rb +63 -0
- data/spec/rpm_manifestizer_spec.rb +2 -2
- data/spec/settings_spec.rb +53 -4
- data/spec/spec_helper.rb +40 -1
- data/spec/verifier_spec.rb +53 -22
- data/spec/view_spec.rb +145 -0
- data/view/all.html.haml +24 -0
- data/view/commercial.html.haml +17 -0
- data/view/contribute.html.haml +7 -3
- data/view/development.html.haml +36 -0
- data/view/favicon.ico +0 -0
- data/view/group.html.haml +20 -0
- data/view/index.html.haml +11 -1
- data/view/layout.html.haml +0 -5
- data/view/library.html.haml +4 -4
- data/view/public/inqlude.css +2 -2
- data/view/unreleased.html.haml +18 -0
- metadata +172 -97
- data/view/edge.html.haml +0 -9
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://inqlude.org/schema/generic-manifest-v1#",
|
3
|
+
"name": "kservice",
|
4
|
+
"display_name": "KService",
|
5
|
+
"summary": "Plugin framework for desktop services",
|
6
|
+
"urls": {
|
7
|
+
"homepage": "https://projects.kde.org/projects/frameworks/kservice",
|
8
|
+
"vcs": "https://projects.kde.org/projects/frameworks/kservice/repository",
|
9
|
+
"mailing_list": "https://mail.kde.org/mailman/listinfo/kde-frameworks-devel"
|
10
|
+
},
|
11
|
+
"licenses": [
|
12
|
+
"LGPLv2.1+"
|
13
|
+
],
|
14
|
+
"description": "\nKService provides a plugin framework for handling desktop services. Services can\nbe applications or libraries. They can be bound to MIME types or handled by\napplication specific code.\n\n",
|
15
|
+
"authors": [
|
16
|
+
"The KDE Community"
|
17
|
+
],
|
18
|
+
"platforms": [
|
19
|
+
"Linux"
|
20
|
+
],
|
21
|
+
"group": "kde-frameworks"
|
22
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://inqlude.org/schema/generic-manifest-v1#",
|
3
|
+
"name": "newlib",
|
4
|
+
"summary": "A new lib under heavy development",
|
5
|
+
"urls": {
|
6
|
+
"homepage": "http://new.example.org",
|
7
|
+
"download": "http://new.example.org/download"
|
8
|
+
},
|
9
|
+
"licenses": ["GPLv3"],
|
10
|
+
"description": "This is an awesome library. It's new.",
|
11
|
+
"authors": ["Cornelius Schumacher <schumacher@kde.org>"],
|
12
|
+
"platforms": [ "Linux", "Windows" ]
|
13
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://inqlude.org/schema/proprietary-release-manifest-v1#",
|
3
|
+
"name": "proprietarylib",
|
4
|
+
"release_date": "2013-12-22",
|
5
|
+
"version": "1.2.1",
|
6
|
+
"summary": "Awesome proprietary library",
|
7
|
+
"urls": {
|
8
|
+
"homepage": "http://xyz.example.com",
|
9
|
+
"download": "http://xyz.example.com/download"
|
10
|
+
},
|
11
|
+
"licenses": ["LGPLv2.1+", "Commercial"],
|
12
|
+
"description": "This is an awesome proprietarylibrary.",
|
13
|
+
"authors": ["Cool Company"],
|
14
|
+
"maturity": "stable",
|
15
|
+
"platforms": [ "Linux", "Windows", "OS X" ]
|
16
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://inqlude.org/schema/generic-manifest-v1#",
|
3
|
+
"name": "rendertest",
|
4
|
+
"display_name": "RenderTest",
|
5
|
+
"summary": "Test manifest for testing rendering",
|
6
|
+
"urls": {
|
7
|
+
"homepage": "https://example.org",
|
8
|
+
"vcs": "https://example.org/git"
|
9
|
+
},
|
10
|
+
"licenses": [
|
11
|
+
"LGPLv2.1+"
|
12
|
+
],
|
13
|
+
"description": "This description tests rendering. It tests rendering markdown to HTML.\n\nThis includes:\n\n- Paragraphs\n- Lists\n",
|
14
|
+
"authors": [
|
15
|
+
"Slartibartfass"
|
16
|
+
],
|
17
|
+
"platforms": [
|
18
|
+
"Linux"
|
19
|
+
]
|
20
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
This is my test content.
|
@@ -0,0 +1,263 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe KdeFrameworksCreator do
|
4
|
+
|
5
|
+
include GivenFilesystemSpecHelpers
|
6
|
+
|
7
|
+
describe "#framework" do
|
8
|
+
it "raises error on invalid name" do
|
9
|
+
c = KdeFrameworksCreator.new
|
10
|
+
expect{c.framework("invalid-name")}.to raise_error
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#fill_in_data" do
|
15
|
+
it "fills in all data" do
|
16
|
+
c = Creator.new Settings.new, "karchive"
|
17
|
+
manifest = c.create_generic_manifest
|
18
|
+
|
19
|
+
k = KdeFrameworksCreator.new
|
20
|
+
framework = {
|
21
|
+
"title" => "KArchive",
|
22
|
+
"introduction" => "The intro",
|
23
|
+
"link_git_repository" => "http://git.kde.org/karchive"
|
24
|
+
}
|
25
|
+
k.fill_in_data framework, manifest
|
26
|
+
|
27
|
+
expect( manifest["display_name"] ).to eq "KArchive"
|
28
|
+
expect( manifest["description"] ).to eq "The intro"
|
29
|
+
expect( manifest["urls"]["vcs"] ).to eq "http://git.kde.org/karchive"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "parse git checkout" do
|
34
|
+
|
35
|
+
use_given_filesystem
|
36
|
+
|
37
|
+
context "multi-directory checkout" do
|
38
|
+
before(:each) do
|
39
|
+
@checkout_path = given_directory do
|
40
|
+
given_directory "karchive" do
|
41
|
+
given_dummy_file "README.md"
|
42
|
+
given_dummy_file "AUTHORS"
|
43
|
+
end
|
44
|
+
given_directory "threadweaver" do
|
45
|
+
given_dummy_file "README.md"
|
46
|
+
given_dummy_file "AUTHORS"
|
47
|
+
end
|
48
|
+
given_directory "kconfig" do
|
49
|
+
given_dummy_file "README.md"
|
50
|
+
given_dummy_file "AUTHORS"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
it "parses checkout" do
|
56
|
+
c = KdeFrameworksCreator.new
|
57
|
+
|
58
|
+
c.parse_checkout @checkout_path
|
59
|
+
|
60
|
+
expect( c.frameworks.sort ).to eq ["karchive", "kconfig", "threadweaver"]
|
61
|
+
end
|
62
|
+
|
63
|
+
it "generates manifests" do
|
64
|
+
c = KdeFrameworksCreator.new
|
65
|
+
|
66
|
+
c.parse_checkout @checkout_path
|
67
|
+
|
68
|
+
output_dir = given_directory
|
69
|
+
|
70
|
+
c.create_manifests output_dir
|
71
|
+
|
72
|
+
expect( File.exists? File.join(output_dir,"karchive",
|
73
|
+
"karchive.manifest") ).to be true
|
74
|
+
expect( File.exists? File.join(output_dir,"threadweaver",
|
75
|
+
"threadweaver.manifest") ).to be true
|
76
|
+
expect( File.exists? File.join(output_dir,"kconfig",
|
77
|
+
"kconfig.manifest") ).to be true
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
it "parses README" do
|
82
|
+
c = KdeFrameworksCreator.new
|
83
|
+
|
84
|
+
framework_path = given_directory "karchive" do
|
85
|
+
given_file "README.md", :from => "karchive.readme"
|
86
|
+
end
|
87
|
+
|
88
|
+
c.parse_readme framework_path
|
89
|
+
|
90
|
+
karchive = c.framework("karchive")
|
91
|
+
|
92
|
+
expect( c.errors.count ).to eq 0
|
93
|
+
|
94
|
+
expect(karchive["title"]).to eq "KArchive"
|
95
|
+
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."
|
96
|
+
expect(karchive["link_mailing_list"]).to eq "https://mail.kde.org/mailman/listinfo/kde-frameworks-devel"
|
97
|
+
expect(karchive["link_git_repository"]).to eq "https://projects.kde.org/projects/frameworks/karchive/repository"
|
98
|
+
expect(karchive["link_home_page"]).to eq "https://projects.kde.org/projects/frameworks/karchive"
|
99
|
+
expect(karchive["summary"]).to eq "Reading, creation, and manipulation of file archives"
|
100
|
+
end
|
101
|
+
|
102
|
+
it "parses AUTHORS" do
|
103
|
+
c = KdeFrameworksCreator.new
|
104
|
+
|
105
|
+
framework_path = given_directory "karchive" do
|
106
|
+
given_file "AUTHORS", :from => "karchive.authors"
|
107
|
+
end
|
108
|
+
|
109
|
+
c.parse_authors framework_path
|
110
|
+
|
111
|
+
karchive = c.framework("karchive")
|
112
|
+
|
113
|
+
expect(karchive["authors"]).to eq [ "Mario Bensi <mbensi@ipsquad.net>",
|
114
|
+
"David Faure <faure@kde.org>" ]
|
115
|
+
end
|
116
|
+
|
117
|
+
it "generates warnings for missing files" do
|
118
|
+
c = KdeFrameworksCreator.new
|
119
|
+
|
120
|
+
checkout_path = given_directory do
|
121
|
+
given_directory "ki18n" do
|
122
|
+
given_dummy_file "README.md"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
c.parse_checkout checkout_path
|
127
|
+
|
128
|
+
expect( c.warnings.count ).to eq 1
|
129
|
+
expect( c.warnings.first[:name] ).to eq "ki18n"
|
130
|
+
expect( c.warnings.first[:issue] ).to eq "missing_file"
|
131
|
+
expect( c.warnings.first[:details] ).to eq "AUTHORS"
|
132
|
+
end
|
133
|
+
|
134
|
+
it "generates errors for missing fields" do
|
135
|
+
c = KdeFrameworksCreator.new
|
136
|
+
|
137
|
+
checkout_path = given_directory do
|
138
|
+
given_directory "ki18n" do
|
139
|
+
given_dummy_file "README.md"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
c.parse_checkout checkout_path
|
144
|
+
|
145
|
+
f = c.framework("ki18n")
|
146
|
+
|
147
|
+
expect( c.errors.count ).to eq 4
|
148
|
+
|
149
|
+
error_hash = {}
|
150
|
+
c.errors.each do |error|
|
151
|
+
error_hash[error[:issue]] = error
|
152
|
+
end
|
153
|
+
|
154
|
+
expect( error_hash.has_key? "missing_title" ).to be true
|
155
|
+
expect( error_hash.has_key? "missing_summary" ).to be true
|
156
|
+
expect( error_hash.has_key? "missing_introduction" ).to be true
|
157
|
+
expect( error_hash.has_key? "missing_link_home_page" ).to be true
|
158
|
+
end
|
159
|
+
|
160
|
+
it "generates error for missing summary" do
|
161
|
+
c = KdeFrameworksCreator.new
|
162
|
+
|
163
|
+
checkout_path = given_directory do
|
164
|
+
given_directory "kservice" do
|
165
|
+
given_file "README.md", :from => "kservice.readme"
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
c.parse_checkout checkout_path
|
170
|
+
|
171
|
+
f = c.framework("kservice")
|
172
|
+
|
173
|
+
expect( f["title"] ).to eq "KService"
|
174
|
+
expect( f["summary"] ).to be nil
|
175
|
+
|
176
|
+
expect( c.errors.count ).to eq 3
|
177
|
+
end
|
178
|
+
|
179
|
+
it "optionally doesn't generate error for missing summary" do
|
180
|
+
c = KdeFrameworksCreator.new
|
181
|
+
|
182
|
+
checkout_path = given_directory do
|
183
|
+
given_directory "kservice" do
|
184
|
+
given_file "README.md", :from => "kservice.readme"
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
c.parse_checkout checkout_path, :ignore_errors => [ "link_home_page" ]
|
189
|
+
|
190
|
+
f = c.framework("kservice")
|
191
|
+
|
192
|
+
expect( f["title"] ).to eq "KService"
|
193
|
+
expect( f["summary"] ).to be nil
|
194
|
+
|
195
|
+
expect( c.errors.count ).to eq 2
|
196
|
+
end
|
197
|
+
|
198
|
+
context "karchive as full example" do
|
199
|
+
before(:each) do
|
200
|
+
@checkout_path = given_directory do
|
201
|
+
given_directory "karchive" do
|
202
|
+
given_file "README.md", :from => "karchive.readme"
|
203
|
+
given_file "AUTHORS", :from => "karchive.authors"
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
it "parses framework from checkout" do
|
209
|
+
c = KdeFrameworksCreator.new
|
210
|
+
|
211
|
+
c.parse_checkout @checkout_path
|
212
|
+
|
213
|
+
karchive = c.framework("karchive")
|
214
|
+
expect(karchive["title"]).to eq "KArchive"
|
215
|
+
expect(karchive["link_git_repository"]).to eq "https://projects.kde.org/projects/frameworks/karchive/repository"
|
216
|
+
expect(karchive["authors"]).to eq [ "Mario Bensi <mbensi@ipsquad.net>",
|
217
|
+
"David Faure <faure@kde.org>" ]
|
218
|
+
end
|
219
|
+
|
220
|
+
it "generates manifest" do
|
221
|
+
c = KdeFrameworksCreator.new
|
222
|
+
|
223
|
+
c.parse_checkout @checkout_path
|
224
|
+
|
225
|
+
output_dir = given_directory
|
226
|
+
|
227
|
+
c.create_manifests output_dir
|
228
|
+
|
229
|
+
expect( File.exists? File.join(output_dir,"karchive",
|
230
|
+
"karchive.manifest") ).to be true
|
231
|
+
|
232
|
+
manifest = Manifest.parse_file File.join(output_dir,"karchive",
|
233
|
+
"karchive.manifest")
|
234
|
+
|
235
|
+
expect( manifest["name"] ).to eq "karchive"
|
236
|
+
expect( manifest["display_name"] ).to eq "KArchive"
|
237
|
+
expect( manifest["urls"]["vcs"] ).to eq "https://projects.kde.org/projects/frameworks/karchive/repository"
|
238
|
+
expect( manifest["urls"]["homepage"] ).to eq "https://projects.kde.org/projects/frameworks/karchive"
|
239
|
+
expect( manifest["description"] ).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."
|
240
|
+
expect( manifest["urls"]["mailing_list"] ).to eq "https://mail.kde.org/mailman/listinfo/kde-frameworks-devel"
|
241
|
+
expect( manifest["summary"] ).to eq "Reading, creation, and manipulation of file archives"
|
242
|
+
end
|
243
|
+
|
244
|
+
it "overwrites existing manifests" do
|
245
|
+
c = KdeFrameworksCreator.new
|
246
|
+
|
247
|
+
c.parse_checkout @checkout_path
|
248
|
+
|
249
|
+
output_dir = given_directory
|
250
|
+
|
251
|
+
c.create_manifests output_dir
|
252
|
+
|
253
|
+
expect( File.exists? File.join(output_dir,"karchive",
|
254
|
+
"karchive.manifest") ).to be true
|
255
|
+
|
256
|
+
c.create_manifests output_dir
|
257
|
+
|
258
|
+
expect( File.exists? File.join(output_dir,"karchive",
|
259
|
+
"karchive.manifest") ).to be true
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe KdeFrameworksRelease do
|
4
|
+
|
5
|
+
include GivenFilesystemSpecHelpers
|
6
|
+
|
7
|
+
use_given_filesystem
|
8
|
+
|
9
|
+
context "given KDE generic manifests" do
|
10
|
+
before(:each) do
|
11
|
+
@manifest_dir = given_directory do
|
12
|
+
given_directory("karchive") do
|
13
|
+
given_file("karchive.manifest", :from => "karchive-generic.manifest")
|
14
|
+
end
|
15
|
+
given_directory("kservice") do
|
16
|
+
given_file("kservice.manifest", :from => "kservice-generic.manifest")
|
17
|
+
end
|
18
|
+
given_directory("newlib") do
|
19
|
+
given_file("newlib.manifest", :from => "newlib/newlib.manifest")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
s = Settings.new
|
24
|
+
s.manifest_path = @manifest_dir
|
25
|
+
s.offline = true
|
26
|
+
@manifest_handler = ManifestHandler.new s
|
27
|
+
end
|
28
|
+
|
29
|
+
it "reads generic manifests" do
|
30
|
+
k = KdeFrameworksRelease.new @manifest_handler
|
31
|
+
k.read_generic_manifests
|
32
|
+
|
33
|
+
expect( k.generic_manifests.count ).to eq 2
|
34
|
+
expect( k.generic_manifests[0]["name"] ).to eq "karchive"
|
35
|
+
expect( k.generic_manifests[1]["name"] ).to eq "kservice"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "writes release manifests" do
|
39
|
+
k = KdeFrameworksRelease.new @manifest_handler
|
40
|
+
k.read_generic_manifests
|
41
|
+
|
42
|
+
k.write_release_manifests( "2014-02-01", "4.9.90" )
|
43
|
+
|
44
|
+
manifest_path = File.join( @manifest_dir,
|
45
|
+
"karchive/karchive.2014-02-01.manifest" )
|
46
|
+
expect( File.exists? manifest_path ).to be true
|
47
|
+
|
48
|
+
manifest_path = File.join( @manifest_dir,
|
49
|
+
"kservice/kservice.2014-02-01.manifest" )
|
50
|
+
expect( File.exists? manifest_path ).to be true
|
51
|
+
|
52
|
+
manifest = Manifest.parse_file( manifest_path )
|
53
|
+
expect( manifest["name"] ).to eq "kservice"
|
54
|
+
expect( manifest["version"] ).to eq "4.9.90"
|
55
|
+
expect( manifest["release_date"] ).to eq "2014-02-01"
|
56
|
+
expect( manifest["schema_type"] ).to eq "release"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
it "creates release manifest from generic manifest" do
|
61
|
+
generic_manifest = Manifest.parse_file(
|
62
|
+
given_file("karchive-generic.manifest") )
|
63
|
+
date = "2014-07-07"
|
64
|
+
version = "5.0.0"
|
65
|
+
release_manifest = KdeFrameworksRelease.create_release_manifest(
|
66
|
+
generic_manifest, date, version)
|
67
|
+
expected_json = File.read( given_file("karchive-release.manifest") )
|
68
|
+
expected_json.chomp! # Remove newline added by File.read
|
69
|
+
expect( Manifest.to_json(release_manifest) ).to eq expected_json
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
data/spec/library_spec.rb
CHANGED
@@ -6,14 +6,66 @@ describe Library do
|
|
6
6
|
versions = [ "1.0", "2.0" ]
|
7
7
|
|
8
8
|
manifests = Array.new
|
9
|
+
manifests.push create_generic_manifest "mylib"
|
9
10
|
versions.each do |version|
|
10
|
-
manifests.push create_manifest "mylib", version
|
11
|
+
manifests.push create_manifest "mylib", "2014-02-03", version
|
11
12
|
end
|
12
13
|
|
13
14
|
library = Library.new
|
14
15
|
library.manifests = manifests
|
15
16
|
|
16
|
-
library.versions.
|
17
|
+
expect(library.versions).to eq versions
|
18
|
+
end
|
19
|
+
|
20
|
+
it "returns generic manifest" do
|
21
|
+
manifests = Array.new
|
22
|
+
manifests.push create_generic_manifest "mylib"
|
23
|
+
manifests.push create_manifest "mylib", "2014-02-03", "1.0"
|
24
|
+
|
25
|
+
library = Library.new
|
26
|
+
library.manifests = manifests
|
27
|
+
|
28
|
+
expect( library.generic_manifest["name"] ).to eq "mylib"
|
29
|
+
expect( library.generic_manifest["schema_type"] ).to eq "generic"
|
30
|
+
end
|
31
|
+
|
32
|
+
it "returns relase manifests" do
|
33
|
+
manifests = Array.new
|
34
|
+
manifests.push create_generic_manifest "mylib"
|
35
|
+
manifests.push create_manifest "mylib", "2014-02-03", "1.0"
|
36
|
+
manifests.push create_manifest "mylib", "2014-03-03", "1.1"
|
37
|
+
|
38
|
+
library = Library.new
|
39
|
+
library.manifests = manifests
|
40
|
+
|
41
|
+
expect( library.release_manifests.count ).to eq 2
|
42
|
+
library.release_manifests.each do |release_manifest|
|
43
|
+
expect( release_manifest["schema_type"] ).to eq "release"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it "returns latest manifest from multiple releases" do
|
48
|
+
manifests = Array.new
|
49
|
+
manifests.push create_generic_manifest "mylib"
|
50
|
+
manifests.push create_manifest "mylib", "2014-02-03", "1.0"
|
51
|
+
manifests.push create_manifest "mylib", "2014-03-03", "1.1"
|
52
|
+
|
53
|
+
library = Library.new
|
54
|
+
library.manifests = manifests
|
55
|
+
|
56
|
+
expect( library.latest_manifest["schema_type"] ).to eq "release"
|
57
|
+
expect( library.latest_manifest["version"] ).to eq "1.1"
|
58
|
+
end
|
59
|
+
|
60
|
+
it "returns latest manifest from generic manifest" do
|
61
|
+
manifests = Array.new
|
62
|
+
manifests.push create_generic_manifest "mylib"
|
63
|
+
|
64
|
+
library = Library.new
|
65
|
+
library.manifests = manifests
|
66
|
+
|
67
|
+
expect( library.latest_manifest["schema_type"] ).to eq "generic"
|
68
|
+
expect( library.latest_manifest["version"] ).to be nil
|
17
69
|
end
|
18
70
|
|
19
71
|
end
|