File tree Expand file tree Collapse file tree 9 files changed +19
-23
lines changed Expand file tree Collapse file tree 9 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ require "../versions"
4
4
module Shards
5
5
module Commands
6
6
class Check < Command
7
- def run ( * args)
7
+ def run
8
8
if has_dependencies?
9
9
locks # ensures that lockfile exists
10
10
verify(spec.dependencies)
Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ module Shards
22
22
@lockfile_path = File .join(@path , LOCK_FILENAME )
23
23
end
24
24
25
- abstract def run (* args)
25
+ abstract def run (* args, ** kwargs )
26
26
27
- def self.run (path, * args)
28
- new(path).run(* args)
27
+ def self.run (path, * args, ** kwargs )
28
+ new(path).run(* args, ** kwargs )
29
29
end
30
30
31
31
def spec
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ require "ecr/macros"
4
4
module Shards
5
5
module Commands
6
6
class Init < Command
7
- def run ( * args)
7
+ def run
8
8
if File .exists?(shard_path)
9
9
raise Error .new(" #{ SPEC_FILENAME } already exists" )
10
10
end
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module Shards
4
4
module Commands
5
5
# OPTIMIZE: avoid updating GIT caches until required
6
6
class Install < Command
7
- def run ( * args)
7
+ def run
8
8
if lockfile?
9
9
manager.locks = locks
10
10
manager.resolve
Original file line number Diff line number Diff line change @@ -3,11 +3,9 @@ require "./command"
3
3
module Shards
4
4
module Commands
5
5
class List < Command
6
- def self.run (path, @@tree = false )
7
- super
8
- end
6
+ @tree = false
9
7
10
- def run (* args )
8
+ def run (@tree = false )
11
9
return unless has_dependencies?
12
10
puts " Shards installed:"
13
11
list(spec.dependencies)
@@ -27,7 +25,7 @@ module Shards
27
25
indent = " " * level
28
26
puts " #{ indent } * #{ _spec.name } (#{ _spec.version } )"
29
27
30
- indent_level = @@ tree ? level + 1 : level
28
+ indent_level = @tree ? level + 1 : level
31
29
list(_spec.dependencies, indent_level)
32
30
end
33
31
end
Original file line number Diff line number Diff line change @@ -3,14 +3,12 @@ require "./command"
3
3
module Shards
4
4
module Commands
5
5
class Outdated < Command
6
+ @prereleases = false
7
+
6
8
@up_to_date = true
7
9
@output = IO ::Memory .new
8
10
9
- def self.run (path, @@prereleases = false )
10
- super
11
- end
12
-
13
- def run (* args)
11
+ def run (@prereleases = false )
14
12
return unless has_dependencies?
15
13
16
14
if lockfile?
@@ -44,7 +42,7 @@ module Shards
44
42
installed = _spec.version
45
43
46
44
# already the latest version?
47
- latest = Versions .sort(package.available_versions(@@ prereleases )).first
45
+ latest = Versions .sort(package.available_versions(@prereleases )).first
48
46
return if latest == installed
49
47
50
48
@up_to_date = false
@@ -53,7 +51,7 @@ module Shards
53
51
@output << " (installed: " << installed
54
52
55
53
# is new version matching constraints available?
56
- available = package.matching_versions(@@ prereleases ).first
54
+ available = package.matching_versions(@prereleases ).first
57
55
unless available == installed
58
56
@output << " , available: " << available
59
57
end
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ require "../helpers/path"
5
5
module Shards
6
6
module Commands
7
7
class Prune < Command
8
- def run ( * args)
8
+ def run
9
9
return unless lockfile?
10
10
11
11
Dir [File .join(Shards .install_path, " *" )].each do |path |
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module Shards
4
4
module Commands
5
5
class Update < Command
6
6
# TODO: only update specified dependencies (ie. load locked versions, but don't enforce them)
7
- def run ( * args)
7
+ def run
8
8
manager.resolve
9
9
10
10
install(manager.packages)
Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ require "./command"
3
3
module Shards
4
4
module Commands
5
5
class Version < Command
6
- def self.run (path, * args )
6
+ def self.run (path )
7
7
path = lookup_path(path)
8
- new(path).run( * args)
8
+ new(path).run
9
9
end
10
10
11
- def run ( * args)
11
+ def run
12
12
puts spec.version
13
13
end
14
14
You can’t perform that action at this time.
0 commit comments