ruby_make_script 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/lib/ruby_make_script.rb +13 -10
- data/lib/ruby_make_script/version.rb +1 -1
- data/test.rb +7 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4efc88cb1707db34f55f5acd35874b6db8cec446d3b8eb3f9b20c4e1f8f24500
|
4
|
+
data.tar.gz: 9907123c9b639c5d82f3dad0089e1b3ac96577ed096ea6271ad3c6ecd69c75cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c2fdb3f541787fd2be4b27f6bbee1fe3507bb868d091418e5e834edc456aa48d5c0d14911d35e0ba1c89bf22fed5b7434141ce59d3cab6d09e37eb3b298c9f9
|
7
|
+
data.tar.gz: e6ae3f7b98d1ddc84fb38e7d13d940d88b58fa0bdc8eaf75ce7c04574576abba348e858e9d096cac7d7f45ce8e0c1e0092d74d162f357501dc6dfd8ea71e618e
|
data/lib/ruby_make_script.rb
CHANGED
@@ -15,6 +15,10 @@
|
|
15
15
|
#
|
16
16
|
#
|
17
17
|
|
18
|
+
if !system('gem list | grep pastel > /dev/null')
|
19
|
+
puts "pastel not install automaticly, please 'gem install pastel'"
|
20
|
+
end
|
21
|
+
|
18
22
|
require 'pastel'
|
19
23
|
require 'yaml'
|
20
24
|
|
@@ -35,7 +39,7 @@ require 'ruby_make_script/target'
|
|
35
39
|
|
36
40
|
# check a file (recursively) and run the commands of the target.
|
37
41
|
def resolve(file, force_exec=false)
|
38
|
-
if file_modified?(file)
|
42
|
+
if force_exec || file_modified?(file)
|
39
43
|
t = $file_target_dict[file]
|
40
44
|
# when t == nil, its a file not used for target
|
41
45
|
if t != nil
|
@@ -108,7 +112,7 @@ class Symbol
|
|
108
112
|
# end
|
109
113
|
# ```
|
110
114
|
def then
|
111
|
-
from()
|
115
|
+
PhonyTarget.new(String(self)).from() { yield }
|
112
116
|
end
|
113
117
|
end
|
114
118
|
|
@@ -158,24 +162,23 @@ def make
|
|
158
162
|
$file_time_dict = YAML.load(File.read('./.make_script.yaml'))
|
159
163
|
$cur_file_time_dict = $file_time_dict.clone()
|
160
164
|
end
|
161
|
-
puts Pastel.new.
|
165
|
+
puts Pastel.new.bright_cyan("make> ") + "start"
|
166
|
+
|
162
167
|
begin
|
163
|
-
if ARGV.length
|
168
|
+
if ARGV.length == 0
|
164
169
|
$targetlist[0].resolve_all
|
165
170
|
else
|
166
|
-
resolve(ARGV[
|
171
|
+
resolve(ARGV[0], true)
|
167
172
|
end
|
168
173
|
|
169
174
|
rescue StandardError => e
|
170
|
-
puts Pastel.new.red.bold("
|
175
|
+
puts Pastel.new.red.bold("make failed> ") + e.message
|
171
176
|
if e.message != "make command failed"
|
172
177
|
puts e.backtrace
|
173
178
|
end
|
174
179
|
else
|
175
|
-
puts Pastel.new.
|
180
|
+
puts Pastel.new.bright_cyan("make> ") + "completed"
|
176
181
|
end
|
177
182
|
|
178
183
|
File.open('./.make_script.yaml', 'w') { |f| f.write(YAML.dump($cur_file_time_dict)) }
|
179
|
-
|
180
|
-
|
181
|
-
end
|
184
|
+
end
|
data/test.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_make_script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dnailz
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/ruby_make_script/utils.rb
|
88
88
|
- lib/ruby_make_script/version.rb
|
89
89
|
- ruby_make_script.gemspec
|
90
|
+
- test.rb
|
90
91
|
homepage: https://github.com/DnailZ/ruby_make_script
|
91
92
|
licenses:
|
92
93
|
- MIT
|