rext 0.3.5 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/Manifest +2 -0
- data/README.rdoc +5 -0
- data/lib/rext/all.rb +1 -0
- data/lib/rext/hash/helpers.rb +8 -0
- data/lib/rext/process.rb +6 -0
- data/lib/rext/process/helpers.rb +22 -0
- data/lib/rext/version.rb +1 -1
- data/rext.gemspec +4 -4
- data/spec/hash_spec.rb +7 -0
- metadata +6 -2
data/History.rdoc
CHANGED
data/Manifest
CHANGED
data/README.rdoc
CHANGED
@@ -80,6 +80,7 @@ Below are the methods currently provided by Rext.
|
|
80
80
|
* Hash
|
81
81
|
- delete_at / extract!
|
82
82
|
- switchify
|
83
|
+
- to_query
|
83
84
|
|
84
85
|
* Time
|
85
86
|
- in_words_since / in_words_since_now
|
@@ -103,6 +104,10 @@ Below are the methods currently provided by Rext.
|
|
103
104
|
|
104
105
|
* Symbol
|
105
106
|
- to_proc
|
107
|
+
|
108
|
+
* Process
|
109
|
+
- alive?
|
110
|
+
- pid_from_file
|
106
111
|
|
107
112
|
== Contrib
|
108
113
|
|
data/lib/rext/all.rb
CHANGED
data/lib/rext/hash/helpers.rb
CHANGED
data/lib/rext/process.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
module Process
|
3
|
+
|
4
|
+
##
|
5
|
+
# Check if process _pid_ is alive. Where _pid_
|
6
|
+
# may be a pidfile path, or an integer.
|
7
|
+
|
8
|
+
def self.alive? pid
|
9
|
+
pid = pid_from_file(pid) if String === pid
|
10
|
+
Process.kill 0, pid if Numeric === pid
|
11
|
+
rescue Errno::ESRCH
|
12
|
+
end
|
13
|
+
|
14
|
+
##
|
15
|
+
# Get pid integer from pidfile at _path_.
|
16
|
+
|
17
|
+
def self.pid_from_file path
|
18
|
+
if File.exists? path
|
19
|
+
File.read(path).to_i
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/rext/version.rb
CHANGED
data/rext.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rext}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.4.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["TJ Holowaychuk"]
|
9
|
-
s.date = %q{2009-10
|
9
|
+
s.date = %q{2009-11-10}
|
10
10
|
s.description = %q{Ruby extensions}
|
11
11
|
s.email = %q{tj@vision-media.ca}
|
12
|
-
s.extra_rdoc_files = ["README.rdoc", "lib/rext.rb", "lib/rext/all.rb", "lib/rext/array.rb", "lib/rext/array/helpers.rb", "lib/rext/date.rb", "lib/rext/date/helpers.rb", "lib/rext/enumerable.rb", "lib/rext/enumerable/helpers.rb", "lib/rext/hash.rb", "lib/rext/hash/helpers.rb", "lib/rext/integer.rb", "lib/rext/integer/helpers.rb", "lib/rext/module.rb", "lib/rext/module/helpers.rb", "lib/rext/numeric.rb", "lib/rext/numeric/bytes.rb", "lib/rext/numeric/time.rb", "lib/rext/object.rb", "lib/rext/object/helpers.rb", "lib/rext/object/metaclass.rb", "lib/rext/proc.rb", "lib/rext/proc/helpers.rb", "lib/rext/string.rb", "lib/rext/string/encode.rb", "lib/rext/string/helpers.rb", "lib/rext/symbol.rb", "lib/rext/symbol/helpers.rb", "lib/rext/time.rb", "lib/rext/time/helpers.rb", "lib/rext/version.rb", "tasks/benchmark.rake", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
13
|
-
s.files = ["History.rdoc", "Manifest", "README.rdoc", "Rakefile", "benchmarks/enumerable.rb", "benchmarks/proc.rb", "lib/rext.rb", "lib/rext/all.rb", "lib/rext/array.rb", "lib/rext/array/helpers.rb", "lib/rext/date.rb", "lib/rext/date/helpers.rb", "lib/rext/enumerable.rb", "lib/rext/enumerable/helpers.rb", "lib/rext/hash.rb", "lib/rext/hash/helpers.rb", "lib/rext/integer.rb", "lib/rext/integer/helpers.rb", "lib/rext/module.rb", "lib/rext/module/helpers.rb", "lib/rext/numeric.rb", "lib/rext/numeric/bytes.rb", "lib/rext/numeric/time.rb", "lib/rext/object.rb", "lib/rext/object/helpers.rb", "lib/rext/object/metaclass.rb", "lib/rext/proc.rb", "lib/rext/proc/helpers.rb", "lib/rext/string.rb", "lib/rext/string/encode.rb", "lib/rext/string/helpers.rb", "lib/rext/symbol.rb", "lib/rext/symbol/helpers.rb", "lib/rext/time.rb", "lib/rext/time/helpers.rb", "lib/rext/version.rb", "rext.gemspec", "spec/array_spec.rb", "spec/date_spec.rb", "spec/enumerable_spec.rb", "spec/hash_spec.rb", "spec/integer_spec.rb", "spec/module_spec.rb", "spec/numeric_spec.rb", "spec/object_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/string_spec.rb", "spec/symbol_spec.rb", "spec/time_spec.rb", "tasks/benchmark.rake", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
12
|
+
s.extra_rdoc_files = ["README.rdoc", "lib/rext.rb", "lib/rext/all.rb", "lib/rext/array.rb", "lib/rext/array/helpers.rb", "lib/rext/date.rb", "lib/rext/date/helpers.rb", "lib/rext/enumerable.rb", "lib/rext/enumerable/helpers.rb", "lib/rext/hash.rb", "lib/rext/hash/helpers.rb", "lib/rext/integer.rb", "lib/rext/integer/helpers.rb", "lib/rext/module.rb", "lib/rext/module/helpers.rb", "lib/rext/numeric.rb", "lib/rext/numeric/bytes.rb", "lib/rext/numeric/time.rb", "lib/rext/object.rb", "lib/rext/object/helpers.rb", "lib/rext/object/metaclass.rb", "lib/rext/proc.rb", "lib/rext/proc/helpers.rb", "lib/rext/process.rb", "lib/rext/process/helpers.rb", "lib/rext/string.rb", "lib/rext/string/encode.rb", "lib/rext/string/helpers.rb", "lib/rext/symbol.rb", "lib/rext/symbol/helpers.rb", "lib/rext/time.rb", "lib/rext/time/helpers.rb", "lib/rext/version.rb", "tasks/benchmark.rake", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
13
|
+
s.files = ["History.rdoc", "Manifest", "README.rdoc", "Rakefile", "benchmarks/enumerable.rb", "benchmarks/proc.rb", "lib/rext.rb", "lib/rext/all.rb", "lib/rext/array.rb", "lib/rext/array/helpers.rb", "lib/rext/date.rb", "lib/rext/date/helpers.rb", "lib/rext/enumerable.rb", "lib/rext/enumerable/helpers.rb", "lib/rext/hash.rb", "lib/rext/hash/helpers.rb", "lib/rext/integer.rb", "lib/rext/integer/helpers.rb", "lib/rext/module.rb", "lib/rext/module/helpers.rb", "lib/rext/numeric.rb", "lib/rext/numeric/bytes.rb", "lib/rext/numeric/time.rb", "lib/rext/object.rb", "lib/rext/object/helpers.rb", "lib/rext/object/metaclass.rb", "lib/rext/proc.rb", "lib/rext/proc/helpers.rb", "lib/rext/process.rb", "lib/rext/process/helpers.rb", "lib/rext/string.rb", "lib/rext/string/encode.rb", "lib/rext/string/helpers.rb", "lib/rext/symbol.rb", "lib/rext/symbol/helpers.rb", "lib/rext/time.rb", "lib/rext/time/helpers.rb", "lib/rext/version.rb", "rext.gemspec", "spec/array_spec.rb", "spec/date_spec.rb", "spec/enumerable_spec.rb", "spec/hash_spec.rb", "spec/integer_spec.rb", "spec/module_spec.rb", "spec/numeric_spec.rb", "spec/object_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/string_spec.rb", "spec/symbol_spec.rb", "spec/time_spec.rb", "tasks/benchmark.rake", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
14
14
|
s.homepage = %q{http://github.com/visionmedia/rext}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rext", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
data/spec/hash_spec.rb
CHANGED
@@ -14,6 +14,13 @@ describe Hash do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
describe "#to_query" do
|
18
|
+
it "should build a query string" do
|
19
|
+
{ :foo => 'bar' }.to_query.should == 'foo=bar'
|
20
|
+
{ :foo => 'bar', :baz => 'yay' }.to_query.should == 'foo=bar&baz=yay'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
17
24
|
describe "#switchify" do
|
18
25
|
it "should work with bools" do
|
19
26
|
{ :use_foobar => true }.switchify.should == ['--use-foobar']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Holowaychuk
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10
|
12
|
+
date: 2009-11-10 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -43,6 +43,8 @@ extra_rdoc_files:
|
|
43
43
|
- lib/rext/object/metaclass.rb
|
44
44
|
- lib/rext/proc.rb
|
45
45
|
- lib/rext/proc/helpers.rb
|
46
|
+
- lib/rext/process.rb
|
47
|
+
- lib/rext/process/helpers.rb
|
46
48
|
- lib/rext/string.rb
|
47
49
|
- lib/rext/string/encode.rb
|
48
50
|
- lib/rext/string/helpers.rb
|
@@ -84,6 +86,8 @@ files:
|
|
84
86
|
- lib/rext/object/metaclass.rb
|
85
87
|
- lib/rext/proc.rb
|
86
88
|
- lib/rext/proc/helpers.rb
|
89
|
+
- lib/rext/process.rb
|
90
|
+
- lib/rext/process/helpers.rb
|
87
91
|
- lib/rext/string.rb
|
88
92
|
- lib/rext/string/encode.rb
|
89
93
|
- lib/rext/string/helpers.rb
|