hw 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/hw +1 -1
- data/lib/hw/actions.rb +1 -1
- data/lib/hw/base.rb +2 -1
- data/lib/hw/packages.rb +1 -1
- data/lib/hw/runner.rb +42 -40
- data/lib/hw/sources.rb +1 -1
- data/lib/hw/version.rb +2 -2
- metadata +4 -4
data/bin/hw
CHANGED
data/lib/hw/actions.rb
CHANGED
data/lib/hw/base.rb
CHANGED
data/lib/hw/packages.rb
CHANGED
data/lib/hw/runner.rb
CHANGED
@@ -1,53 +1,55 @@
|
|
1
|
-
require 'hw/base'
|
1
|
+
#require 'hw/base'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module HW
|
4
|
+
class Runner < Thor
|
5
|
+
include Base
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
def self.start(given_args = ARGV, config = {})
|
8
|
+
unless self.is_a_reserved_task?(given_args)
|
9
|
+
name = ARGV.first
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
if Packages.reserved?(name)
|
12
|
+
Packages.register(name, "hw/packages/#{name}")
|
13
|
+
else
|
14
|
+
Packages.add(name)
|
15
|
+
end
|
14
16
|
end
|
17
|
+
|
18
|
+
super(given_args, config)
|
15
19
|
end
|
16
20
|
|
17
|
-
|
18
|
-
|
21
|
+
desc "list", "list available packages"
|
22
|
+
def list
|
23
|
+
Packages.formatted_list
|
24
|
+
end
|
19
25
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
26
|
+
desc "add_source <name> <source>", "Add a source to ~/.hw/config"
|
27
|
+
def add_source name, source
|
28
|
+
Sources.add(name, source)
|
29
|
+
end
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
31
|
+
desc "update", "Update installed packages"
|
32
|
+
method_option :pull, :aliases => "-p", :type => :boolean, :default => "true", :desc => "Pull from remote sources"
|
33
|
+
def update
|
34
|
+
header "Updating hw"
|
35
|
+
Sources.ensure_defaults
|
29
36
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
if options["pull"]
|
37
|
-
Sources.fetch
|
38
|
-
else
|
39
|
-
warn "Sources not updated"
|
40
|
-
info "Remove `-p false` to update your sources"
|
37
|
+
if options["pull"]
|
38
|
+
Sources.fetch
|
39
|
+
else
|
40
|
+
warn "Sources not updated"
|
41
|
+
info "Remove `-p false` to update your sources"
|
42
|
+
end
|
41
43
|
end
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
44
|
+
|
45
|
+
desc "install", "Update installed packages"
|
46
|
+
method_option :pull, :aliases => "-p", :type => :boolean, :default => "true", :desc => "Pull from remote sources"
|
47
|
+
alias :install :update
|
48
|
+
|
49
|
+
no_tasks do
|
50
|
+
def self.is_a_reserved_task? args
|
51
|
+
ARGV.empty? or reserved?(args) or self.instance_methods(false).include?(args.first.to_sym)
|
52
|
+
end
|
51
53
|
end
|
52
54
|
end
|
53
55
|
end
|
data/lib/hw/sources.rb
CHANGED
data/lib/hw/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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: 2013-06-
|
12
|
+
date: 2013-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
segments:
|
117
117
|
- 0
|
118
|
-
hash:
|
118
|
+
hash: -1471843386893629720
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
none: false
|
121
121
|
requirements:
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
segments:
|
126
126
|
- 0
|
127
|
-
hash:
|
127
|
+
hash: -1471843386893629720
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
130
|
rubygems_version: 1.8.25
|