dr 1.0.5 → 1.2.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/.travis.yml +1 -0
- data/README.md +1 -1
- data/Rakefile +6 -0
- data/bin/dr +125 -31
- data/dr.gemspec +2 -0
- data/lib/dr/gitpackage.rb +1 -1
- data/lib/dr/logger.rb +17 -0
- data/lib/dr/pkgversion.rb +3 -3
- data/lib/dr/repo.rb +4 -0
- data/lib/dr/server.rb +22 -0
- data/lib/dr/version.rb +1 -1
- data/spec/pkgversion_spec.rb +20 -20
- metadata +36 -2
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
language: ruby
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Kano Repository Manager
|
2
2
|
|
3
|
-
[](http://badge.fury.io/rb/dr)
|
3
|
+
[](http://badge.fury.io/rb/dr) [](https://travis-ci.org/KanoComputing/kano-repository-manager) [](https://gitter.im/KanoComputing/kano-repository-manager?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
4
|
|
5
5
|
**dr** (stands for debian repository) is a Debian repository management tool.
|
6
6
|
It will help you set up and maintain your own small package repository for any
|
data/Rakefile
CHANGED
data/bin/dr
CHANGED
@@ -17,6 +17,7 @@ require "dr/pkgversion"
|
|
17
17
|
require "dr/shellcmd"
|
18
18
|
require "dr/logger"
|
19
19
|
require "dr/config"
|
20
|
+
require "dr/server"
|
20
21
|
|
21
22
|
|
22
23
|
class ExtendedThor < Thor
|
@@ -27,6 +28,10 @@ class ExtendedThor < Thor
|
|
27
28
|
def initialize(*args)
|
28
29
|
super
|
29
30
|
Dr::Logger::set_verbosity options[:verbosity]
|
31
|
+
if not options[:log_file].nil?
|
32
|
+
file = File.open options[:log_file],"w"
|
33
|
+
Dr::Logger::set_logfile(file)
|
34
|
+
end
|
30
35
|
end
|
31
36
|
|
32
37
|
|
@@ -61,7 +66,7 @@ class Archive < ExtendedThor
|
|
61
66
|
end
|
62
67
|
|
63
68
|
class Conf < ExtendedThor
|
64
|
-
desc "repo", "Configuration of the whole repository"
|
69
|
+
desc "repo KEY [VALUE]", "Configuration of the whole repository"
|
65
70
|
def repo(key, value=nil)
|
66
71
|
repo = get_repo_handle
|
67
72
|
|
@@ -75,7 +80,7 @@ class Conf < ExtendedThor
|
|
75
80
|
end
|
76
81
|
end
|
77
82
|
|
78
|
-
desc "package", "Package-specific configuration options"
|
83
|
+
desc "package PKG-NAME KEY [VALUE]", "Package-specific configuration options"
|
79
84
|
def package(pkg_name, key, value=nil)
|
80
85
|
repo = get_repo_handle
|
81
86
|
pkg = repo.get_package pkg_name
|
@@ -145,13 +150,13 @@ class List < ExtendedThor
|
|
145
150
|
end
|
146
151
|
end
|
147
152
|
|
148
|
-
desc "versions
|
153
|
+
desc "versions PKG-NAME", "DEPRECATED, please use builds instead"
|
149
154
|
def versions(pkg_name)
|
150
155
|
log :warn, "This subcommand is deprecated, please use builds instead"
|
151
156
|
builds pkg_name
|
152
157
|
end
|
153
158
|
|
154
|
-
desc "builds
|
159
|
+
desc "builds PKG-NAME", "Show the history of all builds of a package"
|
155
160
|
def builds(pkg_name)
|
156
161
|
repo = get_repo_handle
|
157
162
|
log :info, "Listing all buils of #{pkg_name.style "pkg-name"}"
|
@@ -183,27 +188,22 @@ class List < ExtendedThor
|
|
183
188
|
else
|
184
189
|
suites.each do |suite, codename|
|
185
190
|
codename = suite if codename == nil
|
191
|
+
colour = suite_to_colour suite
|
186
192
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
else nil end
|
192
|
-
|
193
|
-
all_included = true
|
194
|
-
subpkgs.each do |subpkg|
|
195
|
-
unless repo.query_for_deb_version(suite, subpkg) == version
|
196
|
-
all_included = false
|
197
|
-
end
|
193
|
+
all_included = true
|
194
|
+
subpkgs.each do |subpkg|
|
195
|
+
unless repo.query_for_deb_version(suite, subpkg) == version
|
196
|
+
all_included = false
|
198
197
|
end
|
198
|
+
end
|
199
199
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
end
|
200
|
+
if all_included
|
201
|
+
if colour
|
202
|
+
line << " " + open + codename.fg(colour) + close
|
203
|
+
else
|
204
|
+
line << " " + open + codename + close
|
206
205
|
end
|
206
|
+
end
|
207
207
|
end
|
208
208
|
end
|
209
209
|
log :info, " #{line}"
|
@@ -239,12 +239,38 @@ class List < ExtendedThor
|
|
239
239
|
end
|
240
240
|
end
|
241
241
|
end
|
242
|
+
|
243
|
+
desc "codenames", "Show the codenames of the configured suites"
|
244
|
+
def codenames
|
245
|
+
repo = get_repo_handle
|
246
|
+
|
247
|
+
suites = repo.get_suites
|
248
|
+
|
249
|
+
suites.each do |suite, codename|
|
250
|
+
codename = suite if codename == nil
|
251
|
+
colour = suite_to_colour suite
|
252
|
+
|
253
|
+
log :info, "#{codename.fg colour}: #{suite}"
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
private
|
258
|
+
def suite_to_colour(suite)
|
259
|
+
colour = case suite
|
260
|
+
when "stable-security" then "magenta"
|
261
|
+
when "stable" then "red"
|
262
|
+
when "testing" then "yellow"
|
263
|
+
when "unstable" then "green"
|
264
|
+
else nil end
|
265
|
+
return colour
|
266
|
+
end
|
242
267
|
end
|
243
268
|
|
244
269
|
|
245
270
|
class RepoCLI < ExtendedThor
|
246
271
|
class_option :repo, :type => :string, :aliases => "-r"
|
247
272
|
class_option :verbosity, :type => :string, :aliases => "-v", :default => "verbose"
|
273
|
+
class_option :log_file, :type => :string, :aliases => "-l", :default => nil
|
248
274
|
|
249
275
|
|
250
276
|
desc "init [LOCATION]", "setup a whole new repository from scratch"
|
@@ -256,7 +282,7 @@ class RepoCLI < ExtendedThor
|
|
256
282
|
:desc => "",
|
257
283
|
:arches => ["amd64"],
|
258
284
|
:components => ["main"],
|
259
|
-
:suites => ["stable", "testing", "unstable"],
|
285
|
+
:suites => ["stable-security", "stable", "testing", "unstable"],
|
260
286
|
:build_environment => :kano,
|
261
287
|
:codenames => []
|
262
288
|
}
|
@@ -361,7 +387,7 @@ class RepoCLI < ExtendedThor
|
|
361
387
|
end
|
362
388
|
|
363
389
|
|
364
|
-
desc "build
|
390
|
+
desc "build PKG-NAME", "build a package from the sources"
|
365
391
|
method_option :branch, :aliases => "-b", :type => :string,
|
366
392
|
:desc => "build from a different branch"
|
367
393
|
method_option :push, :aliases => "-p", :type => :string,
|
@@ -389,13 +415,16 @@ class RepoCLI < ExtendedThor
|
|
389
415
|
if options["push"] == "push"
|
390
416
|
repo.push pkg.name, version, "testing" # FIXME: should be configurable
|
391
417
|
else
|
418
|
+
if repo.codename_to_suite(options["push"]) == 'stable-security'
|
419
|
+
raise "Package built, but can't push to #{options["push"]}, use the 'release-security' subcommand"
|
420
|
+
end
|
392
421
|
repo.push pkg.name, version, options["push"]
|
393
422
|
end
|
394
423
|
end
|
395
424
|
end
|
396
425
|
|
397
426
|
|
398
|
-
desc "push
|
427
|
+
desc "push PKG-NAME", "push a built package to a specified suite"
|
399
428
|
method_option :suite, :aliases => "-s", :type => :string,
|
400
429
|
:desc => "the target suite (defaults to testing)"
|
401
430
|
method_option :build, :aliases => "-b", :type => :string,
|
@@ -408,6 +437,10 @@ class RepoCLI < ExtendedThor
|
|
408
437
|
suite = nil
|
409
438
|
suite = options["suite"] if options.has_key? "suite"
|
410
439
|
|
440
|
+
if repo.codename_to_suite(options["suite"]) == 'stable-security'
|
441
|
+
raise "Can't push package to #{options["suite"]}, please use the 'release-security' subcommand"
|
442
|
+
end
|
443
|
+
|
411
444
|
version = nil
|
412
445
|
version = options["build"] if options.has_key? "build"
|
413
446
|
|
@@ -415,7 +448,7 @@ class RepoCLI < ExtendedThor
|
|
415
448
|
end
|
416
449
|
|
417
450
|
|
418
|
-
desc "unpush
|
451
|
+
desc "unpush PKG-NAME SUITE", "remove a built package from a suite"
|
419
452
|
def unpush(pkg_name, suite)
|
420
453
|
repo = get_repo_handle
|
421
454
|
repo.unpush pkg_name, suite
|
@@ -439,7 +472,7 @@ class RepoCLI < ExtendedThor
|
|
439
472
|
end
|
440
473
|
|
441
474
|
|
442
|
-
desc "rmbuild
|
475
|
+
desc "rmbuild PKG-NAME VERSION", "remove a built version of a package"
|
443
476
|
method_option :force, :aliases => "-f", :type => :boolean,
|
444
477
|
:desc => "force removal even if the build is still used"
|
445
478
|
def rmbuild(pkg_name, version)
|
@@ -447,7 +480,7 @@ class RepoCLI < ExtendedThor
|
|
447
480
|
repo.remove_build pkg_name, version, options["force"] == true
|
448
481
|
end
|
449
482
|
|
450
|
-
desc "update", "Update and rebuild (if necessary) all the packages in the suite"
|
483
|
+
desc "update [SUITE]", "Update and rebuild (if necessary) all the packages in the suite"
|
451
484
|
def update(suite="testing")
|
452
485
|
log :info, "Updating all packages in the #{suite.fg "blue"} suite"
|
453
486
|
repo = get_repo_handle
|
@@ -479,7 +512,7 @@ class RepoCLI < ExtendedThor
|
|
479
512
|
end
|
480
513
|
|
481
514
|
|
482
|
-
desc "git-tag-release", "Mark relased packages' repositories"
|
515
|
+
desc "git-tag-release TAG", "Mark relased packages' repositories"
|
483
516
|
method_option :force, :aliases => "-f", :type => :boolean,
|
484
517
|
:desc => "Force override existing tags"
|
485
518
|
method_option :package, :aliases => "-p", :type => :string,
|
@@ -539,7 +572,35 @@ class RepoCLI < ExtendedThor
|
|
539
572
|
end
|
540
573
|
|
541
574
|
|
542
|
-
desc "
|
575
|
+
desc "release-security PKG-NAME", "Push a built package from testing to 'stable-security' suite"
|
576
|
+
method_option :force, :aliases => "-f", :type => :boolean,
|
577
|
+
:desc => "Force-push the released package"
|
578
|
+
def release_security(pkg_name)
|
579
|
+
repo = get_repo_handle
|
580
|
+
|
581
|
+
suite_source = 'testing'
|
582
|
+
|
583
|
+
log :info, "Releasing pkg #{pkg_name.style "pkg-name"} package from '#{suite_source}' to 'stable-security'"
|
584
|
+
|
585
|
+
if !repo.suite_has_package? suite_source, pkg_name
|
586
|
+
log :err, "Package #{pkg_name.style "pkg-name"} not in '#{suite_source}'"
|
587
|
+
raise "Package #{pkg_name.style "pkg-name"} doesn't exist in the repo"
|
588
|
+
end
|
589
|
+
|
590
|
+
prompt_msg = "Are you absolutely sure you want to push package #{pkg_name.style "pkg-name"} to 'stable-security'?"
|
591
|
+
negative_msg = "Couldn't confirm for releasing to stable-security"
|
592
|
+
prompt_to_confirm prompt_msg, negative_msg
|
593
|
+
|
594
|
+
version = repo.get_subpackage_versions(pkg_name)[suite_source].values.max
|
595
|
+
log :info, "Package version #{version.style "version"} found in '#{suite_source}'"
|
596
|
+
begin
|
597
|
+
repo.push pkg_name, version, "stable-security", (options["force"] == true)
|
598
|
+
rescue Dr::AlreadyExists
|
599
|
+
;
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
desc "suite-diff SUITE OTHER-SUITE", "Show the differences between packages in two suites"
|
543
604
|
def suite_diff(first, second)
|
544
605
|
repo = get_repo_handle
|
545
606
|
|
@@ -578,7 +639,7 @@ class RepoCLI < ExtendedThor
|
|
578
639
|
end
|
579
640
|
|
580
641
|
|
581
|
-
desc "force-sync", "Force cloning the sources repository from scratch again"
|
642
|
+
desc "force-sync PKG-NAME", "Force cloning the sources repository from scratch again"
|
582
643
|
method_option :url, :aliases => "-u", :type => :string,
|
583
644
|
:desc => "The URL to clone from"
|
584
645
|
method_option :branch, :aliases => "-b", :type => :string,
|
@@ -644,12 +705,45 @@ class RepoCLI < ExtendedThor
|
|
644
705
|
end
|
645
706
|
elsif number != nil && kept >= number.to_i
|
646
707
|
rmbuild pkg.name, version_string
|
647
|
-
else
|
708
|
+
else
|
648
709
|
kept += 1
|
649
710
|
end
|
650
711
|
end
|
651
712
|
end
|
652
713
|
end
|
714
|
+
|
715
|
+
desc "serve", "Start the archive server"
|
716
|
+
method_option :port, :aliases => "-p", :type => :numeric,
|
717
|
+
:desc => "The port to run the server on", :default => 80
|
718
|
+
method_option :bind, :aliases => "-b", :type => :string,
|
719
|
+
:desc => "Address to listen on", :default => "0.0.0.0"
|
720
|
+
method_option :route, :aliases => "-R", :type => :string,
|
721
|
+
:desc => "The route to serve the archive on", :default => "/"
|
722
|
+
def serve
|
723
|
+
repo = get_repo_handle
|
724
|
+
s = Dr::Server.new options["port"], options["route"],
|
725
|
+
options["bind"], repo.get_archive_path
|
726
|
+
s.start
|
727
|
+
end
|
728
|
+
|
729
|
+
private
|
730
|
+
def prompt_to_confirm(prompt_msg, negative_message)
|
731
|
+
response = 'x'
|
732
|
+
while ! ['y', 'n'].include? response
|
733
|
+
print prompt_msg
|
734
|
+
print "[y/n]: "
|
735
|
+
response = STDIN.gets.strip.downcase
|
736
|
+
if response == 'n'
|
737
|
+
log :err, "Replied negatively to prompt, aborting..."
|
738
|
+
raise negative_message
|
739
|
+
elsif response == 'y'
|
740
|
+
log :info, "Received confirmation, will carry on"
|
741
|
+
else
|
742
|
+
print "Not an acceptable answer, please answer y/n\n"
|
743
|
+
end
|
744
|
+
end
|
745
|
+
end
|
746
|
+
|
653
747
|
end
|
654
748
|
|
655
749
|
|
data/dr.gemspec
CHANGED
@@ -28,6 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "thor", "~> 0.18"
|
29
29
|
spec.add_dependency "tco", "~> 0.1"
|
30
30
|
spec.add_dependency "octokit", "~> 3.3"
|
31
|
+
spec.add_dependency "rack", "~> 1.6.4"
|
32
|
+
spec.add_dependency "thin", "~> 1.6.3"
|
31
33
|
|
32
34
|
spec.add_development_dependency "bundler", "~> 1.5"
|
33
35
|
spec.add_development_dependency "rake", "~> 10.3"
|
data/lib/dr/gitpackage.rb
CHANGED
@@ -271,7 +271,7 @@ EOS
|
|
271
271
|
expected_pkgs = get_subpackage_names "#{src_dir}/debian/control"
|
272
272
|
expected_pkgs.each do |subpkg_name|
|
273
273
|
includes = debs.inject(false) do |r, n|
|
274
|
-
r || ((/^#{br}\/#{subpkg_name}_#{version}/ =~ n) != nil)
|
274
|
+
r || ((/^#{br}\/#{subpkg_name}_#{version.to_s omit_epoch=true}/ =~ n) != nil)
|
275
275
|
end
|
276
276
|
|
277
277
|
unless includes
|
data/lib/dr/logger.rb
CHANGED
@@ -14,6 +14,7 @@ tco_conf.names["purple"] = "#90559e"
|
|
14
14
|
tco_conf.names["blue"] = "#4D9EEB" #"#1b8efa"
|
15
15
|
tco_conf.names["orange"] = "#ff842a"
|
16
16
|
tco_conf.names["brown"] = "#6a4a3c"
|
17
|
+
tco_conf.names["magenta"] = "#ff00ff"
|
17
18
|
|
18
19
|
tco_conf.styles["info"] = {
|
19
20
|
:fg => "green",
|
@@ -88,6 +89,12 @@ module Dr
|
|
88
89
|
:verbose => 3
|
89
90
|
}
|
90
91
|
|
92
|
+
@@log_file = nil
|
93
|
+
|
94
|
+
def self.set_logfile(file)
|
95
|
+
@@log_file = file
|
96
|
+
end
|
97
|
+
|
91
98
|
def self.set_verbosity(level)
|
92
99
|
msg = "Message verbosity level not recognised (#{})."
|
93
100
|
raise msg unless @@logger_verbosity_levels.has_key? level.to_sym
|
@@ -117,6 +124,11 @@ module Dr
|
|
117
124
|
out << " " << msg.chomp
|
118
125
|
puts out
|
119
126
|
STDOUT.flush
|
127
|
+
|
128
|
+
unless @@log_file.nil?
|
129
|
+
@@log_file.puts strip_colours out
|
130
|
+
@@log_file.flush
|
131
|
+
end
|
120
132
|
end
|
121
133
|
end
|
122
134
|
|
@@ -127,5 +139,10 @@ module Dr
|
|
127
139
|
def tag(tag, msg)
|
128
140
|
tag.fg("blue").bg("dark-grey") << " " << msg
|
129
141
|
end
|
142
|
+
|
143
|
+
private
|
144
|
+
def self.strip_colours(string)
|
145
|
+
string.gsub(/\033\[[0-9]+(;[0-9]+){0,2}m/, '')
|
146
|
+
end
|
130
147
|
end
|
131
148
|
end
|
data/lib/dr/pkgversion.rb
CHANGED
data/lib/dr/repo.rb
CHANGED
data/lib/dr/server.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Copyright (C) 2015 Kano Computing Ltd.
|
2
|
+
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
|
3
|
+
|
4
|
+
require "rack"
|
5
|
+
|
6
|
+
module Dr
|
7
|
+
class Server
|
8
|
+
def initialize(port, root_route, address, archive_path)
|
9
|
+
@port = port
|
10
|
+
@host = address
|
11
|
+
@dir_server = Rack::Builder.new do
|
12
|
+
map root_route do
|
13
|
+
run Rack::Directory.new(archive_path)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def start
|
19
|
+
Rack::Handler::Thin.run(@dir_server, :Port => @port, :Host => @host)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/dr/version.rb
CHANGED
data/spec/pkgversion_spec.rb
CHANGED
@@ -12,21 +12,21 @@ describe Dr do
|
|
12
12
|
one = Dr::PkgVersion.new('1:1.5-1')
|
13
13
|
two = Dr::PkgVersion.new('2:1.5-1')
|
14
14
|
|
15
|
-
expect(one < two).to
|
15
|
+
expect(one < two).to be true
|
16
16
|
end
|
17
17
|
|
18
18
|
it "works when equal" do
|
19
19
|
one = Dr::PkgVersion.new('1:2.7-2')
|
20
20
|
two = Dr::PkgVersion.new('1:2.7-2')
|
21
21
|
|
22
|
-
expect(one == two).to
|
22
|
+
expect(one == two).to be true
|
23
23
|
end
|
24
24
|
|
25
25
|
it "works when smaller" do
|
26
26
|
one = Dr::PkgVersion.new('2:3.6-1')
|
27
27
|
two = Dr::PkgVersion.new('1:3.5')
|
28
28
|
|
29
|
-
expect(one > two).to
|
29
|
+
expect(one > two).to be true
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -35,42 +35,42 @@ describe Dr do
|
|
35
35
|
one = Dr::PkgVersion.new('1:1.5-1')
|
36
36
|
two = Dr::PkgVersion.new('1:1.6-1')
|
37
37
|
|
38
|
-
expect(one < two).to
|
38
|
+
expect(one < two).to be true
|
39
39
|
end
|
40
40
|
|
41
41
|
it "works when smaller" do
|
42
42
|
one = Dr::PkgVersion.new('1-1')
|
43
43
|
two = Dr::PkgVersion.new('2')
|
44
44
|
|
45
|
-
expect(one < two).to
|
45
|
+
expect(one < two).to be true
|
46
46
|
end
|
47
47
|
|
48
48
|
it "works when smaller with string inbetween" do
|
49
49
|
one = Dr::PkgVersion.new('1.5')
|
50
50
|
two = Dr::PkgVersion.new('1.16-5')
|
51
51
|
|
52
|
-
expect(one < two).to
|
52
|
+
expect(one < two).to be true
|
53
53
|
end
|
54
54
|
|
55
55
|
it "works when equal" do
|
56
56
|
one = Dr::PkgVersion.new('1.5-5')
|
57
57
|
two = Dr::PkgVersion.new('1.5-5')
|
58
58
|
|
59
|
-
expect(one == two).to
|
59
|
+
expect(one == two).to be true
|
60
60
|
end
|
61
61
|
|
62
62
|
it "equal with no debian version" do
|
63
63
|
one = Dr::PkgVersion.new('15')
|
64
64
|
two = Dr::PkgVersion.new('15')
|
65
65
|
|
66
|
-
expect(one == two).to
|
66
|
+
expect(one == two).to be true
|
67
67
|
end
|
68
68
|
|
69
69
|
it "works when bigger" do
|
70
70
|
one = Dr::PkgVersion.new('6.5')
|
71
71
|
two = Dr::PkgVersion.new('1.16-5')
|
72
72
|
|
73
|
-
expect(one > two).to
|
73
|
+
expect(one > two).to be true
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -79,28 +79,28 @@ describe Dr do
|
|
79
79
|
one = Dr::PkgVersion.new('1.5-1')
|
80
80
|
two = Dr::PkgVersion.new('1.5-2')
|
81
81
|
|
82
|
-
expect(one < two).to
|
82
|
+
expect(one < two).to be true
|
83
83
|
end
|
84
84
|
|
85
85
|
it "equal comparison" do
|
86
86
|
one = Dr::PkgVersion.new('1.5-2')
|
87
87
|
two = Dr::PkgVersion.new('1.5-2')
|
88
88
|
|
89
|
-
expect(one == two).to
|
89
|
+
expect(one == two).to be true
|
90
90
|
end
|
91
91
|
|
92
92
|
it "bigger comparison" do
|
93
93
|
one = Dr::PkgVersion.new('1.5-11')
|
94
94
|
two = Dr::PkgVersion.new('1.5-9')
|
95
95
|
|
96
|
-
expect(one > two).to
|
96
|
+
expect(one > two).to be true
|
97
97
|
end
|
98
98
|
|
99
99
|
it "substring comparison" do
|
100
100
|
one = Dr::PkgVersion.new('1.5-111')
|
101
101
|
two = Dr::PkgVersion.new('1.5-11')
|
102
102
|
|
103
|
-
expect(one > two).to
|
103
|
+
expect(one > two).to be true
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
@@ -131,49 +131,49 @@ describe Dr do
|
|
131
131
|
one = Dr::PkgVersion.new('1.5-7.20150320')
|
132
132
|
two = Dr::PkgVersion.new('1.5-7.20150323')
|
133
133
|
|
134
|
-
expect(one < two).to
|
134
|
+
expect(one < two).to be true
|
135
135
|
end
|
136
136
|
|
137
137
|
it "bigger date" do
|
138
138
|
one = Dr::PkgVersion.new('1.5-7.20150328')
|
139
139
|
two = Dr::PkgVersion.new('1.5-7.20150323')
|
140
140
|
|
141
|
-
expect(one > two).to
|
141
|
+
expect(one > two).to be true
|
142
142
|
end
|
143
143
|
|
144
144
|
it "equal dates" do
|
145
145
|
one = Dr::PkgVersion.new('1.5-7.20150328')
|
146
146
|
two = Dr::PkgVersion.new('1.5-7.20150328')
|
147
147
|
|
148
|
-
expect(one == two).to
|
148
|
+
expect(one == two).to be true
|
149
149
|
end
|
150
150
|
|
151
151
|
it "equal dates with build numbers (smaller)" do
|
152
152
|
one = Dr::PkgVersion.new('1.5-7.20150328build1')
|
153
153
|
two = Dr::PkgVersion.new('1.5-7.20150328build5')
|
154
154
|
|
155
|
-
expect(one < two).to
|
155
|
+
expect(one < two).to be true
|
156
156
|
end
|
157
157
|
|
158
158
|
it "equal dates with build numbers (equal)" do
|
159
159
|
one = Dr::PkgVersion.new('1.5-7.20150328build15')
|
160
160
|
two = Dr::PkgVersion.new('1.5-7.20150328build15')
|
161
161
|
|
162
|
-
expect(one == two).to
|
162
|
+
expect(one == two).to be true
|
163
163
|
end
|
164
164
|
|
165
165
|
it "equal dates with build numbers (bigger)" do
|
166
166
|
one = Dr::PkgVersion.new('1.5-7.20150328build15')
|
167
167
|
two = Dr::PkgVersion.new('1.5-7.20150328build5')
|
168
168
|
|
169
|
-
expect(one > two).to
|
169
|
+
expect(one > two).to be true
|
170
170
|
end
|
171
171
|
|
172
172
|
it "build number substrings" do
|
173
173
|
one = Dr::PkgVersion.new('1.5-7.20150328build11')
|
174
174
|
two = Dr::PkgVersion.new('1.5-7.20150328build111')
|
175
175
|
|
176
|
-
expect(one < two).to
|
176
|
+
expect(one < two).to be true
|
177
177
|
end
|
178
178
|
end
|
179
179
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -59,6 +59,38 @@ dependencies:
|
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.3'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rack
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.6.4
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.6.4
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: thin
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.6.3
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.6.3
|
62
94
|
- !ruby/object:Gem::Dependency
|
63
95
|
name: bundler
|
64
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,6 +151,7 @@ extensions: []
|
|
119
151
|
extra_rdoc_files: []
|
120
152
|
files:
|
121
153
|
- .gitignore
|
154
|
+
- .travis.yml
|
122
155
|
- Gemfile
|
123
156
|
- LICENSE.txt
|
124
157
|
- README.md
|
@@ -137,6 +170,7 @@ files:
|
|
137
170
|
- lib/dr/package.rb
|
138
171
|
- lib/dr/pkgversion.rb
|
139
172
|
- lib/dr/repo.rb
|
173
|
+
- lib/dr/server.rb
|
140
174
|
- lib/dr/shellcmd.rb
|
141
175
|
- lib/dr/utils.rb
|
142
176
|
- lib/dr/version.rb
|