systemu 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README +4 -4
  2. data/Rakefile +34 -24
  3. data/lib/systemu.rb +3 -4
  4. data/systemu.gemspec +20 -5
  5. metadata +7 -7
data/README CHANGED
@@ -53,7 +53,7 @@ SAMPLES
53
53
 
54
54
  ~ > ruby samples/a.rb
55
55
 
56
- [#<Process::Status: pid=44129,exited(0)>, "Tue Apr 12 21:43:07 -0600 2011\n", "Tue Apr 12 21:43:07 -0600 2011\n"]
56
+ [#<Process::Status: pid=17907,exited(0)>, "Tue Aug 16 22:40:42 -0600 2011\n", "Tue Aug 16 22:40:42 -0600 2011\n"]
57
57
 
58
58
 
59
59
  <========< samples/b.rb >========>
@@ -75,7 +75,7 @@ SAMPLES
75
75
 
76
76
  ~ > ruby samples/b.rb
77
77
 
78
- [#<Process::Status: pid=44134,exited(0)>, "Tue Apr 12 21:43:07 -0600 2011\n", "Tue Apr 12 21:43:07 -0600 2011\n"]
78
+ [#<Process::Status: pid=17912,exited(0)>, "Tue Aug 16 22:40:42 -0600 2011\n", "Tue Aug 16 22:40:42 -0600 2011\n"]
79
79
 
80
80
 
81
81
  <========< samples/c.rb >========>
@@ -163,7 +163,7 @@ SAMPLES
163
163
 
164
164
  ~ > ruby samples/f.rb
165
165
 
166
- #<Process::Status: pid=44154,signaled(SIGKILL=9)>
167
- "1302666187\n1302666188\n1302666189\n"
166
+ #<Process::Status: pid=17932,signaled(SIGKILL=9)>
167
+ "1313556042\n1313556043\n1313556044\n"
168
168
 
169
169
 
data/Rakefile CHANGED
@@ -1,8 +1,11 @@
1
1
  This.rubyforge_project = 'codeforpeople'
2
2
  This.author = "Ara T. Howard"
3
3
  This.email = "ara.t.howard@gmail.com"
4
- This.homepage = "http://github.com/ahoward/#{ This.lib }"
4
+ This.homepage = "https://github.com/ahoward/#{ This.lib }"
5
5
 
6
+ task :license do
7
+ open('LICENSE', 'w'){|fd| fd.puts "same as ruby's"}
8
+ end
6
9
 
7
10
  task :default do
8
11
  puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort)
@@ -26,11 +29,10 @@ def run_tests!(which = nil)
26
29
 
27
30
  div = ('=' * 119)
28
31
  line = ('-' * 119)
29
- helper = "-r ./test/helper.rb" if test(?e, "./test/helper.rb")
30
32
 
31
33
  test_rbs.each_with_index do |test_rb, index|
32
34
  testno = index + 1
33
- command = "#{ This.ruby } -I ./lib -I ./test/lib #{ helper } #{ test_rb }"
35
+ command = "#{ This.ruby } -I ./lib -I ./test/lib #{ test_rb }"
34
36
 
35
37
  puts
36
38
  say(div, :color => :cyan, :bold => true)
@@ -59,9 +61,9 @@ end
59
61
 
60
62
 
61
63
  task :gemspec do
62
- ignore_extensions = 'git', 'svn', 'tmp', /sw./, 'bak', 'gem'
63
- ignore_directories = %w[ pkg ]
64
- ignore_files = %w[ test/log ]
64
+ ignore_extensions = ['git', 'svn', 'tmp', /sw./, 'bak', 'gem']
65
+ ignore_directories = ['pkg']
66
+ ignore_files = ['test/log', 'a.rb']
65
67
 
66
68
  shiteless =
67
69
  lambda do |list|
@@ -87,7 +89,7 @@ task :gemspec do
87
89
  version = This.version
88
90
  files = shiteless[Dir::glob("**/**")]
89
91
  executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)}
90
- has_rdoc = true #File.exist?('doc')
92
+ #has_rdoc = true #File.exist?('doc')
91
93
  test_files = "test/#{ lib }.rb" if File.file?("test/#{ lib }.rb")
92
94
  summary = object.respond_to?(:summary) ? object.summary : "summary: #{ lib } kicks the ass"
93
95
  description = object.respond_to?(:description) ? object.description : "description: #{ lib } kicks the ass"
@@ -117,15 +119,15 @@ task :gemspec do
117
119
  spec.summary = #{ lib.inspect }
118
120
  spec.description = #{ description.inspect }
119
121
 
120
- spec.files = #{ files.inspect }
122
+ spec.files =\n#{ files.sort.pretty_inspect }
121
123
  spec.executables = #{ executables.inspect }
122
124
 
123
125
  spec.require_path = "lib"
124
126
 
125
- spec.has_rdoc = #{ has_rdoc.inspect }
126
127
  spec.test_files = #{ test_files.inspect }
127
128
 
128
- # spec.add_dependency 'lib', '>= version'
129
+ ### spec.add_dependency 'lib', '>= version'
130
+ #### spec.add_dependency 'map'
129
131
 
130
132
  spec.extensions.push(*#{ extensions.inspect })
131
133
 
@@ -139,8 +141,9 @@ task :gemspec do
139
141
  end
140
142
 
141
143
  Fu.mkdir_p(This.pkgdir)
142
- This.gemspec = File.join(This.dir, "#{ This.lib }.gemspec") #File.join(This.pkgdir, "gemspec.rb")
143
- open("#{ This.gemspec }", "w"){|fd| fd.puts(template)}
144
+ gemspec = "#{ lib }.gemspec"
145
+ open(gemspec, "w"){|fd| fd.puts(template)}
146
+ This.gemspec = gemspec
144
147
  end
145
148
 
146
149
  task :gem => [:clean, :gemspec] do
@@ -150,8 +153,8 @@ task :gem => [:clean, :gemspec] do
150
153
  `#{ cmd }`
151
154
  after = Dir['*.gem']
152
155
  gem = ((after - before).first || after.first) or abort('no gem!')
153
- Fu.mv gem, This.pkgdir
154
- This.gem = File.basename(gem)
156
+ Fu.mv(gem, This.pkgdir)
157
+ This.gem = File.join(This.pkgdir, File.basename(gem))
155
158
  end
156
159
 
157
160
  task :readme do
@@ -207,12 +210,18 @@ task :release => [:clean, :gemspec, :gem] do
207
210
  gems = Dir[File.join(This.pkgdir, '*.gem')].flatten
208
211
  raise "which one? : #{ gems.inspect }" if gems.size > 1
209
212
  raise "no gems?" if gems.size < 1
210
- cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.pkgdir }/#{ This.gem }"
213
+
214
+ cmd = "gem push #{ This.gem }"
211
215
  puts cmd
212
- system cmd
213
- cmd = "gem push #{ This.pkgdir }/#{ This.gem }"
216
+ puts
217
+ system(cmd)
218
+ abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
219
+
220
+ cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.gem }"
214
221
  puts cmd
215
- system cmd
222
+ puts
223
+ system(cmd)
224
+ abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
216
225
  end
217
226
 
218
227
 
@@ -228,6 +237,7 @@ BEGIN {
228
237
  require 'erb'
229
238
  require 'fileutils'
230
239
  require 'rbconfig'
240
+ require 'pp'
231
241
 
232
242
  # fu shortcut
233
243
  #
@@ -286,11 +296,11 @@ BEGIN {
286
296
  def unindent(s)
287
297
  indent = nil
288
298
  s.each_line do |line|
289
- next if line =~ %r/^\s*$/
290
- indent = line[%r/^\s*/] and break
291
- end
292
- indent ? s.gsub(%r/^#{ indent }/, "") : s
299
+ next if line =~ %r/^\s*$/
300
+ indent = line[%r/^\s*/] and break
293
301
  end
302
+ indent ? s.gsub(%r/^#{ indent }/, "") : s
303
+ end
294
304
  extend self
295
305
  end
296
306
 
@@ -298,11 +308,11 @@ BEGIN {
298
308
  #
299
309
  class Template
300
310
  def initialize(&block)
301
- @block = block.binding
311
+ @block = block
302
312
  @template = block.call.to_s
303
313
  end
304
314
  def expand(b=nil)
305
- ERB.new(Util.unindent(@template)).result(b||@block)
315
+ ERB.new(Util.unindent(@template)).result((b||@block).binding)
306
316
  end
307
317
  alias_method 'to_s', 'expand'
308
318
  end
data/lib/systemu.rb CHANGED
@@ -4,7 +4,6 @@ require 'socket'
4
4
  require 'fileutils'
5
5
  require 'rbconfig'
6
6
  require 'thread'
7
- require 'yaml'
8
7
 
9
8
  class Object
10
9
  def systemu(*a, &b) SystemUniversal.new(*a, &b).systemu end
@@ -14,7 +13,7 @@ class SystemUniversal
14
13
  #
15
14
  # constants
16
15
  #
17
- SystemUniversal::VERSION = '2.2.0' unless SystemUniversal.send(:const_defined?, :VERSION)
16
+ SystemUniversal::VERSION = '2.3.0' unless SystemUniversal.send(:const_defined?, :VERSION)
18
17
  def SystemUniversal.version() SystemUniversal::VERSION end
19
18
  def version() SystemUniversal::VERSION end
20
19
  #
@@ -155,7 +154,7 @@ class SystemUniversal
155
154
  c['stdout'] = stdout
156
155
  c['stderr'] = stderr
157
156
  c['program'] = program
158
- open(config, 'w'){|f| YAML.dump c, f}
157
+ open(config, 'w'){|f| Marshal.dump(c, f)}
159
158
 
160
159
  open(program, 'w'){|f| f.write child_program(config)}
161
160
 
@@ -176,7 +175,7 @@ class SystemUniversal
176
175
  begin
177
176
  require 'yaml'
178
177
 
179
- config = YAML.load(IO.read('#{ config }'))
178
+ config = Marshal.load(IO.read('#{ config }'))
180
179
 
181
180
  argv = config['argv']
182
181
  env = config['env']
data/systemu.gemspec CHANGED
@@ -3,25 +3,40 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "systemu"
6
- spec.version = "2.2.0"
6
+ spec.version = "2.3.0"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "systemu"
9
9
  spec.description = "description: systemu kicks the ass"
10
10
 
11
- spec.files = ["lib", "lib/systemu.rb", "LICENSE", "Rakefile", "README", "README.erb", "samples", "samples/a.rb", "samples/b.rb", "samples/c.rb", "samples/d.rb", "samples/e.rb", "samples/f.rb", "systemu.gemspec"]
11
+ spec.files =
12
+ ["LICENSE",
13
+ "README",
14
+ "README.erb",
15
+ "Rakefile",
16
+ "lib",
17
+ "lib/systemu.rb",
18
+ "samples",
19
+ "samples/a.rb",
20
+ "samples/b.rb",
21
+ "samples/c.rb",
22
+ "samples/d.rb",
23
+ "samples/e.rb",
24
+ "samples/f.rb",
25
+ "systemu.gemspec"]
26
+
12
27
  spec.executables = []
13
28
 
14
29
  spec.require_path = "lib"
15
30
 
16
- spec.has_rdoc = true
17
31
  spec.test_files = nil
18
32
 
19
- # spec.add_dependency 'lib', '>= version'
33
+ ### spec.add_dependency 'lib', '>= version'
34
+ #### spec.add_dependency 'map'
20
35
 
21
36
  spec.extensions.push(*[])
22
37
 
23
38
  spec.rubyforge_project = "codeforpeople"
24
39
  spec.author = "Ara T. Howard"
25
40
  spec.email = "ara.t.howard@gmail.com"
26
- spec.homepage = "http://github.com/ahoward/systemu"
41
+ spec.homepage = "https://github.com/ahoward/systemu"
27
42
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: systemu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 2.2.0
10
+ version: 2.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ara T. Howard
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-12 00:00:00 -06:00
18
+ date: 2011-08-16 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -28,11 +28,11 @@ extensions: []
28
28
  extra_rdoc_files: []
29
29
 
30
30
  files:
31
- - lib/systemu.rb
32
31
  - LICENSE
33
- - Rakefile
34
32
  - README
35
33
  - README.erb
34
+ - Rakefile
35
+ - lib/systemu.rb
36
36
  - samples/a.rb
37
37
  - samples/b.rb
38
38
  - samples/c.rb
@@ -41,7 +41,7 @@ files:
41
41
  - samples/f.rb
42
42
  - systemu.gemspec
43
43
  has_rdoc: true
44
- homepage: http://github.com/ahoward/systemu
44
+ homepage: https://github.com/ahoward/systemu
45
45
  licenses: []
46
46
 
47
47
  post_install_message: