ruby_make_script 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 811d2d6b124818651c7c5a640210e1466ba04295328e29b2dfca41065055d47b
4
- data.tar.gz: 6acaee8f863ecc8c5c0a52bd33305ec7b6f987deec22b94335d7a1973fa77ffc
3
+ metadata.gz: 4efc88cb1707db34f55f5acd35874b6db8cec446d3b8eb3f9b20c4e1f8f24500
4
+ data.tar.gz: 9907123c9b639c5d82f3dad0089e1b3ac96577ed096ea6271ad3c6ecd69c75cb
5
5
  SHA512:
6
- metadata.gz: cfeb362dc613114466eab0de7ea53642ea2305af2149837e6a66a5d8b356cc54ed2ff57ad3c84093a20989aaf3d55ba3a964bf3bbcb824e2f5d6f36924ac2f21
7
- data.tar.gz: 680bfa6f85cbbdbe9ebb6dd49793bb62cae7d8dd095dab6353fb1c74c338a9a05495362eb74403c094ad181b063253d3634d32ddfb572334550ba6aacfaf5207
6
+ metadata.gz: 7c2fdb3f541787fd2be4b27f6bbee1fe3507bb868d091418e5e834edc456aa48d5c0d14911d35e0ba1c89bf22fed5b7434141ce59d3cab6d09e37eb3b298c9f9
7
+ data.tar.gz: e6ae3f7b98d1ddc84fb38e7d13d940d88b58fa0bdc8eaf75ce7c04574576abba348e858e9d096cac7d7f45ce8e0c1e0092d74d162f357501dc6dfd8ea71e618e
@@ -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) || force_exec
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.green.bold("ruby_make_script> ") + "start"
165
+ puts Pastel.new.bright_cyan("make> ") + "start"
166
+
162
167
  begin
163
- if ARGV.length <= 1
168
+ if ARGV.length == 0
164
169
  $targetlist[0].resolve_all
165
170
  else
166
- resolve(ARGV[1], force_exec=true)
171
+ resolve(ARGV[0], true)
167
172
  end
168
173
 
169
174
  rescue StandardError => e
170
- puts Pastel.new.red.bold("ruby_make_script failed> ") + e.message
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.green.bold("ruby_make_script> ") + "completed"
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
@@ -1,3 +1,3 @@
1
1
  module RubyMakeScript
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/test.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "ruby_make_script"
2
+
3
+ make do
4
+ :setup.from do
5
+ r "echo", "Hello", "World"
6
+ end
7
+ end
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.3
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