rmk-ruby 0.1.1 → 0.2.0
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/exe/rmk +28 -34
- data/lib/rmk/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: 3493f1bf596eaa8ded4e0fa5fedf9dfb2466225e56d905e6a39110f403d024e3
|
4
|
+
data.tar.gz: 6b367be611ddf7a97ff77a9c3f7d4a128c82cc538edee17e5083f8fda9390bcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92c924b833147271a64d082f955957bd0c58e58fa0de3f0151a852e4280d6c4cfdb4d2a37cb4d20a41b7ece6d1d1962c0f61b3402e8758c5aaf7d494ac8fe45
|
7
|
+
data.tar.gz: 85771986004ab0d4f42a8f4889d27d4382d53c8319e32e92fd77f730e5f2990c34cc2d29404b1025a8988ad48abaf8a0bf0d3efaae1cb7ebad17604508994fb0
|
data/exe/rmk
CHANGED
@@ -44,54 +44,48 @@ targets = parser.parse(ARGV)
|
|
44
44
|
Dir.chdir options[:prjroot] if options[:prjroot]
|
45
45
|
options_file = '.rmk/options'
|
46
46
|
loaded_options = File.exist?(options_file) ? Marshal.load(IO.binread options_file) : {}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
next cache_options[key] = loaded_options[key] if loaded_options[key]
|
51
|
-
changed = true
|
52
|
-
end
|
53
|
-
cache_options[:outroot] ||= '_Build'
|
54
|
-
cache_options[:srcroot] ||= '..'
|
55
|
-
cache_options[:name] ||= File.basename Dir.pwd
|
56
|
-
cache_options[:link] ||= File.join ENV['TMP'], cache_options[:name]
|
57
|
-
if changed
|
47
|
+
if cache_options.empty?
|
48
|
+
cache_options = loaded_options
|
49
|
+
elsif cache_options.any?{|k, v| v != loaded_options[k]}
|
58
50
|
Dir.mkdir '.rmk' unless Dir.exist? '.rmk'
|
59
51
|
IO.binwrite options_file, Marshal.dump(cache_options)
|
60
52
|
end
|
61
|
-
|
53
|
+
srcroot = cache_options[:srcroot] || '..'
|
54
|
+
outroot = cache_options[:outroot] || '_Build'
|
55
|
+
link = cache_options[:link] || File.join(ENV['TMP'], cache_options[:name] || File.basename(Dir.pwd))
|
62
56
|
if link && link != '/'
|
63
57
|
require 'fileutils'
|
64
58
|
link = link.gsub(/\$(?:(\$)|{(.*?)})/){$1 || ENV[$2]}.gsub! ?\\, ?\/
|
65
59
|
FileUtils.mkpath link unless Dir.exist? link
|
66
|
-
if File.symlink?
|
67
|
-
if File.readlink(
|
68
|
-
Dir.rmdir
|
69
|
-
File.symlink link,
|
60
|
+
if File.symlink? outroot
|
61
|
+
if File.readlink(outroot) != link
|
62
|
+
Dir.rmdir outroot
|
63
|
+
File.symlink link, outroot
|
70
64
|
end
|
71
|
-
elsif Dir.exist?(
|
72
|
-
raise "need symlink '#{
|
65
|
+
elsif Dir.exist?(outroot) || File.exist?(outroot)
|
66
|
+
raise "need symlink '#{outroot}' as outroot, but file(or dir) '#{outroot}' already exist"
|
73
67
|
else
|
74
|
-
FileUtils.mkpath File.dirname
|
75
|
-
File.symlink link,
|
68
|
+
FileUtils.mkpath File.dirname outroot
|
69
|
+
File.symlink link, outroot
|
76
70
|
end
|
77
71
|
else
|
78
|
-
FileUtils.mkpath
|
72
|
+
FileUtils.mkpath outroot
|
79
73
|
end
|
80
74
|
variants = options[:variants]
|
81
|
-
if variants && variants.size != 1
|
82
|
-
targets = targets.map{|tgt| %|"#{tgt}"|}.join ' '
|
83
|
-
exe = File.join RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']
|
84
|
-
thrs = []
|
85
|
-
variants.each {|name| thrs << Thread.new {system %|"#{exe}" "#{__FILE__}" -V #{name} #{targets}|}}
|
86
|
-
thrs.each{|thr| thr.join}
|
87
|
-
exit
|
88
|
-
end
|
89
75
|
if variants
|
90
|
-
variants
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
76
|
+
if variants.size == 1
|
77
|
+
variants = variants[0]
|
78
|
+
outroot = File.join outroot, variants
|
79
|
+
srcroot = File.join '..', srcroot unless srcroot.match?(/^[a-z]:\//i)
|
80
|
+
else
|
81
|
+
targets = targets.map{|tgt| %|"#{tgt}"|}.join ' '
|
82
|
+
exe = File.join RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']
|
83
|
+
thrs = []
|
84
|
+
variants.each {|name| thrs << Thread.new {system %|"#{exe}" "#{__FILE__}" -V #{name} #{targets}|}}
|
85
|
+
thrs.each{|thr| thr.join}
|
86
|
+
exit
|
87
|
+
end
|
95
88
|
end
|
89
|
+
rmk = Rmk.new srcroot:srcroot, outroot:outroot, variant:variants
|
96
90
|
rmk.parse
|
97
91
|
rmk.build *targets
|
data/lib/rmk/version.rb
CHANGED