sfl 2.2 → 2.3

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9f96c10c4149f06eb729c90fbeff3723911b70ff
4
+ data.tar.gz: a558bb51bb2e93531842b814779b1bd4218b57d8
5
+ SHA512:
6
+ metadata.gz: 049bfa2e95be6b21a74269dfac5d196a09235b2f2ff752dc8f3e1140418914f57a420b8b01bd342fd7e66012dadc4f78569d4f82d311199948a9f320a25ccd82
7
+ data.tar.gz: f0367d65117255e264b22392990a94b1ee69f6ad59a133b2f4a4f99b5ec07260d41020c61031bcb0ff40597431f2848c09bcbba20daea2bc39f8958a0ea76f3c
@@ -1,11 +1,36 @@
1
+ # 2.3
2
+
3
+ * Make Licence explicit
4
+ * Specify licence in gemspec file
5
+ * Embed LICENCE.md in the gem package
6
+ * Insert full licencing text in LICENCE.md
7
+ * Note that licence itself it unchanged; It's Ruby's, which means
8
+ dual-licence of 2-clause BSDL / the Ruby licence.
9
+
1
10
  # 2.2
2
11
 
3
- * support command lines including shell special characters
4
- * bugfix: sfl won't re-define Kernel.spawn on Ruby 1.9
12
+ * Enhancements
13
+
14
+ * Supported shell special characters in a command line string.
15
+
16
+ * Bugfixes
17
+
18
+ * Fix the spec suite for ruby version 1.9.2
19
+ * Stop to overwrite Kernel.spawn and Process.spawn for ruby version 1.9
20
+
21
+ * Known bugs
22
+
23
+ * The spec suite may fail under ruby 1.9.1, due to ruby bugs on some spawn redirect options
5
24
 
6
25
  # 2.1
7
26
 
8
- * Livence: the 2-clause BSDL or the Ruby licence.
27
+ * Enhancements
28
+
29
+ Added dual licence: Ruby's and 2-clause BSDL along with MRI.
30
+
31
+ * Bugfixes
32
+
33
+ * Resurected Kernel#spawn that was missing in previous release.
9
34
 
10
35
  # 2.0
11
36
 
@@ -0,0 +1,56 @@
1
+ The spawn-for-legacy library is copyrighted free software by Tatsuhiro Ujihisa <ujihisa at gmail com>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/README.md CHANGED
@@ -48,3 +48,6 @@ Tatsuhiro Ujihisa
48
48
 
49
49
  Bernard Lambeau
50
50
  <http://revision-zero.org/>
51
+
52
+ Kenta Murata
53
+ <http://mrkn.jp/>
data/lib/sfl.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class SFL
2
- VERSION = "2.2".freeze
2
+ VERSION = "2.3".freeze
3
3
 
4
4
  SHELL_SPECIALS = %r([\*\?\{\}\[\]<>\(\)~&\|\\\$;'`"\n])m.freeze
5
5
 
@@ -1,7 +1,12 @@
1
- require File.expand_path('../lib/sfl', __FILE__)
1
+ libdir = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift libdir unless $LOAD_PATH.include? libdir
3
+
4
+ require 'sfl'
5
+
2
6
  Gem::Specification.new do |s|
3
7
  s.name = %q{sfl}
4
8
  s.version = SFL::VERSION.dup
9
+ s.license = 'Ruby'
5
10
  s.date = Time.now.strftime('%Y-%m-%d')
6
11
 
7
12
  s.summary = %q{Spawn For Ruby 1.8}
@@ -13,7 +18,7 @@ Gem::Specification.new do |s|
13
18
  s.files =
14
19
  Dir['lib/**/*'] +
15
20
  Dir['spec/**/*'] +
16
- %w{ sfl.gemspec Rakefile README.md CHANGELOG.md }
21
+ %w{ sfl.gemspec Rakefile README.md CHANGELOG.md LICENCE.md}
17
22
 
18
23
  s.require_paths = ["lib"]
19
24
  s.executables = []
@@ -37,13 +37,13 @@ end
37
37
  describe 'Kernel.spawn' do
38
38
  def mocker(code)
39
39
  sfl_expanded = File.expand_path('../../lib/sfl', __FILE__)
40
- rubyfile = File.expand_path('../mocker.rb', __FILE__) # Tempfile.new('-').path
40
+ rubyfile = File.expand_path(Dir.tmpdir, 'mocker.rb')
41
41
  File.open(rubyfile, 'w') {|io| io.puts <<-"EOF"
42
42
  require '#{sfl_expanded}'
43
43
  #{code}
44
44
  EOF
45
45
  }
46
- resultfile = File.expand_path('../mocker_output.txt', __FILE__) # Tempfile.new('-').path
46
+ resultfile = File.expand_path(Dir.tmpdir, '../mocker_output.txt')
47
47
  system "ruby #{rubyfile} > #{resultfile}"
48
48
  File.read(resultfile)
49
49
  end
@@ -114,14 +114,15 @@ describe 'Kernel.spawn' do
114
114
  end
115
115
  end
116
116
 
117
- context 'with option {:out => "/tmp/aaaaaaa.txt"}' do
117
+ context 'with option {:out => "$TMPDIR/aaaaaaa.txt"}' do
118
118
  it 'outputs with given ENV "1"' do
119
+ tmpfile_path = File.expand_path(Dir.tmpdir, "aaaaaaa.txt")
119
120
  mocker(
120
121
  %q|
121
- pid = Kernel.spawn('echo', '123', {:out => "/tmp/aaaaaaa.txt"})
122
+ pid = Kernel.spawn('echo', '123', {:out => tmpfile_path})
122
123
  Process.wait(pid)
123
124
  |).should == ""
124
- File.read('/tmp/aaaaaaa.txt').should == "123\n"
125
+ File.read(tmpfile_path).should == "123\n"
125
126
  end
126
127
  end
127
128
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfl
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.2'
5
- prerelease:
4
+ version: '2.3'
6
5
  platform: ruby
7
6
  authors:
8
7
  - ujihisa
@@ -10,38 +9,34 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-06-13 00:00:00.000000000 Z
12
+ date: 2016-10-03 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rake
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0'
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: rspec
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - ">="
37
33
  - !ruby/object:Gem::Version
38
34
  version: 2.4.0
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - ">="
45
40
  - !ruby/object:Gem::Version
46
41
  version: 2.4.0
47
42
  description: Spawn For Ruby 1.8
@@ -51,36 +46,35 @@ extensions: []
51
46
  extra_rdoc_files:
52
47
  - README.md
53
48
  files:
49
+ - CHANGELOG.md
50
+ - LICENCE.md
51
+ - README.md
52
+ - Rakefile
54
53
  - lib/sfl.rb
55
- - spec/mocker.rb
56
- - spec/mocker_output.txt
57
- - spec/sfl_spec.rb
58
54
  - sfl.gemspec
59
- - Rakefile
60
- - README.md
61
- - CHANGELOG.md
55
+ - spec/sfl_spec.rb
62
56
  homepage: https://github.com/ujihisa/spawn-for-legacy
63
- licenses: []
57
+ licenses:
58
+ - Ruby
59
+ metadata: {}
64
60
  post_install_message:
65
61
  rdoc_options: []
66
62
  require_paths:
67
63
  - lib
68
64
  required_ruby_version: !ruby/object:Gem::Requirement
69
- none: false
70
65
  requirements:
71
- - - ! '>='
66
+ - - ">="
72
67
  - !ruby/object:Gem::Version
73
68
  version: '0'
74
69
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
70
  requirements:
77
- - - ! '>='
71
+ - - ">="
78
72
  - !ruby/object:Gem::Version
79
73
  version: '0'
80
74
  requirements: []
81
75
  rubyforge_project:
82
- rubygems_version: 1.8.23
76
+ rubygems_version: 2.5.1
83
77
  signing_key:
84
- specification_version: 3
78
+ specification_version: 4
85
79
  summary: Spawn For Ruby 1.8
86
80
  test_files: []
@@ -1,5 +0,0 @@
1
- require '/home/ujihisa/git/spawn-for-legacy/lib/sfl'
2
-
3
- pid = Kernel.spawn('cat', {:in => File.expand_path('../../README.md', __FILE__)})
4
- Process.wait(pid)
5
-
@@ -1,50 +0,0 @@
1
- # Spawn for Legacy
2
-
3
- ![demo](http://gyazo.com/e22144b2aadbbecfc43761f95c27bf3e.png)
4
-
5
- Kernel.spawn in ruby 1.9 solves all issues on asynchronous executions[[1]](http://ujihisa.blogspot.com/2010/03/how-to-run-external-command.html)[[2]](http://ujihisa.blogspot.com/2010/03/all-about-spawn.html).
6
- But ruby 1.8, the legacy version of MRI, is still used on many environments.
7
-
8
- This library provides `spawn()` which is almost perfectly compatible with ruby 1.9's.
9
- This library is pure ruby; you don't need to build it.
10
-
11
- ## Install
12
-
13
- gem install sfl
14
-
15
- ## How to use
16
-
17
- require 'rubygems'
18
- require 'sfl'
19
-
20
- spawn 'ls'
21
-
22
- If your ruby is 1.9, `require 'sfl'` doesn't do anything. If your ruby is 1.8, that defines `spawn`.
23
-
24
- ## How compatible this spawn is?
25
-
26
- (I'll put the coverage here later)
27
-
28
- ## Misc.
29
-
30
- * At first I tried to use the name `spawn` as this gem library name, but the name was already used. The `spawn` gem library does not mean ruby 1.9's `spawn` at all.
31
- * Ruby 1.9's `open3` library, based on `spawn`, is very useful. I would like to port `open3` to ruby 1.8 in my future.
32
-
33
- ## Supports
34
-
35
- * (On MacOS) MRI 1.8.6, 1.8.7, 1.9.1, 1.9.2-rc2
36
- * (On UNIX) MRI 1.8.6, 1.8.7, 1.9.1, 1.9.2pre
37
- * (On Windows) MRI 1.9.1, 1.9.2pre
38
-
39
- Currently there are no supports on:
40
-
41
- * MRI 1.8 on Windows
42
- * Other Ruby implementations such as JRuby, Rubinius and MacRuby
43
-
44
- ## Authors
45
-
46
- Tatsuhiro Ujihisa
47
- <http://ujihisa.blogspot.com/>
48
-
49
- Bernard Lambeau
50
- <http://revision-zero.org/>