dpmrb 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.en-US.md +4 -4
- data/README.md +5 -5
- data/lib/dpm/options.rb +5 -1
- data/lib/dpm/runner.rb +6 -1
- data/lib/dpm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d315bd0172c0bbcc72a159b18170c25fa032a652eec376f47f28aa06323d8ec8
|
4
|
+
data.tar.gz: fc768c6e80c8f45909b838a6a59c05bffe3682efdf3cb81f782a7c72065ed696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a758ce7ea8ebc362853c7ad2e7289d7debd7bf9174a0a11527260bda87e8faae74329db05032a4555b5b98e75a1e515bf5d90283aa3f0a8d4e7c7118bd58a78f
|
7
|
+
data.tar.gz: d283ba5ad26596745bf42c7f50bbab781e7785ea27549967da1126629613c15318488f9ad0b32381987fa51a0cb1857a3933a88cb00def388406bb6021bc0ab3
|
data/Gemfile.lock
CHANGED
data/README.en-US.md
CHANGED
@@ -56,10 +56,6 @@ If the package already exists in the "system package configuration", the content
|
|
56
56
|
|
57
57
|
**Note:** If the PACKAGE parameter is `package`, the "Global Package Config" `config/package.yml` is configured, and the configuration here will be merged into all packages.
|
58
58
|
|
59
|
-
## Related Tools
|
60
|
-
|
61
|
-
- [Visual Studio Code Plugin](https://marketplace.visualstudio.com/items?itemName=UoooBarry.dpm-vscode)
|
62
|
-
|
63
59
|
## Development
|
64
60
|
|
65
61
|
### Setup environment
|
@@ -74,3 +70,7 @@ bin/setup # Need Ruby >= 2.6
|
|
74
70
|
|
75
71
|
- Adding ENV `DEBUG` to all commands will show detailed error stack to help locate the problem
|
76
72
|
- After development, use the command `bin/check` to check code specifications and tests, and resolve some CI failures in advance
|
73
|
+
|
74
|
+
## Recommended tools
|
75
|
+
|
76
|
+
- [Visual Studio Code Plugin](https://github.com/UoooBarry/vscode-dpm)
|
data/README.md
CHANGED
@@ -55,11 +55,7 @@ dpm configure PACKAGE
|
|
55
55
|
|
56
56
|
**注意:** 如果 PACKAGE 参数为 `package`,则配置的是 "全局系统包配置" `config/package.yml`,这里的配置会合并到所有包里。
|
57
57
|
|
58
|
-
##
|
59
|
-
|
60
|
-
- [Visual Studio Code 插件](https://marketplace.visualstudio.com/items?itemName=UoooBarry.dpm-vscode)
|
61
|
-
|
62
|
-
## 开发调试
|
58
|
+
## 开发
|
63
59
|
|
64
60
|
### 搭建环境
|
65
61
|
|
@@ -73,3 +69,7 @@ bin/setup # 需要 Ruby >= 2.6
|
|
73
69
|
|
74
70
|
- 给所有命令添加 ENV `DEBUG` 会展示详细错误堆栈,帮助定位问题
|
75
71
|
- 开发完后,请使用命令 `bin/check` 检查代码规范和测试,提前解决一些 CI 失败的情况
|
72
|
+
|
73
|
+
## 推荐工具
|
74
|
+
|
75
|
+
- [Visual Studio Code 插件](https://github.com/UoooBarry/vscode-dpm)
|
data/lib/dpm/options.rb
CHANGED
@@ -6,7 +6,7 @@ module DPM
|
|
6
6
|
PACKAGE_REGEX = /\A[\w.\-:]+\z/.freeze
|
7
7
|
UNPACKAGE_COMMANDS = %w[list packages cleanup].freeze
|
8
8
|
|
9
|
-
attr_accessor :argv, :dry_run, :parser, :command, :package
|
9
|
+
attr_accessor :argv, :dry_run, :raw, :parser, :command, :package
|
10
10
|
|
11
11
|
def initialize(argv)
|
12
12
|
self.argv = argv
|
@@ -29,6 +29,10 @@ module DPM
|
|
29
29
|
self.dry_run = v
|
30
30
|
end
|
31
31
|
|
32
|
+
parser.on("-r", "--raw", "Try to run a package even if it doesn't exist") do |v|
|
33
|
+
self.raw = v
|
34
|
+
end
|
35
|
+
|
32
36
|
parser.on_tail("-h", "--help", "Show the help") do
|
33
37
|
puts help_text
|
34
38
|
exit
|
data/lib/dpm/runner.rb
CHANGED
@@ -150,7 +150,11 @@ module DPM
|
|
150
150
|
@package_config ||= begin
|
151
151
|
version = package_tag.dup
|
152
152
|
version_config = loop do
|
153
|
-
|
153
|
+
if !version
|
154
|
+
break {} if options.raw
|
155
|
+
raise Error, "Package tag `#{package_tag}` not support"
|
156
|
+
end
|
157
|
+
|
154
158
|
break package_config_yaml[version] if package_config_yaml[version]
|
155
159
|
version = version.sub!(/\.\d+\z/, "")
|
156
160
|
end
|
@@ -161,6 +165,7 @@ module DPM
|
|
161
165
|
def package_config_yaml
|
162
166
|
@package_config_yaml ||= load_yaml(File.join("packages", "#{package_name}.yml"))
|
163
167
|
rescue Errno::ENOENT
|
168
|
+
return {} if options.raw
|
164
169
|
raise Error, "Package `#{package_name}` not support"
|
165
170
|
end
|
166
171
|
|
data/lib/dpm/version.rb
CHANGED