ok-extensions 1.0.2 → 1.0.4
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.
- data/Manifest.txt +0 -11
- data/README.txt +2 -1
- data/lib/extensions/exception.rb +2 -3
- data/lib/extensions/object.rb +2 -3
- data/lib/extensions/yaml.rb +1 -3
- data/lib/ok_extensions.rb +15 -11
- metadata +3 -14
- data/Rakefile +0 -17
- data/test/focused_test_runner.rb +0 -79
data/Manifest.txt
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
History.txt
|
2
2
|
Manifest.txt
|
3
3
|
README.txt
|
4
|
-
Rakefile
|
5
4
|
lib/extensions/array.rb
|
6
5
|
lib/extensions/core.rb
|
7
6
|
lib/extensions/enumerable.rb
|
@@ -13,13 +12,3 @@ lib/extensions/object.rb
|
|
13
12
|
lib/extensions/range.rb
|
14
13
|
lib/extensions/yaml.rb
|
15
14
|
lib/ok_extensions.rb
|
16
|
-
test/extensions/test_array.rb
|
17
|
-
test/extensions/test_enumerable.rb
|
18
|
-
test/extensions/test_exception.rb
|
19
|
-
test/extensions/test_file.rb
|
20
|
-
test/extensions/test_fixnum.rb
|
21
|
-
test/extensions/test_hash.rb
|
22
|
-
test/extensions/test_object.rb
|
23
|
-
test/extensions/test_range.rb
|
24
|
-
test/extensions/test_yaml.rb
|
25
|
-
test/focused_test_runner.rb
|
data/README.txt
CHANGED
data/lib/extensions/exception.rb
CHANGED
data/lib/extensions/object.rb
CHANGED
data/lib/extensions/yaml.rb
CHANGED
data/lib/ok_extensions.rb
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
class OkExtensions
|
2
|
-
VERSION = '1.0.
|
2
|
+
VERSION = '1.0.4'
|
3
3
|
end
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
require '
|
10
|
-
require '
|
11
|
-
require '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
5
|
+
$LOAD_PATH << File.dirname(__FILE__)
|
6
|
+
|
7
|
+
gem 'facets', '=2.1.2'
|
8
|
+
|
9
|
+
require 'extensions/core'
|
10
|
+
require 'extensions/array'
|
11
|
+
require 'extensions/enumerable'
|
12
|
+
require 'extensions/exception'
|
13
|
+
require 'extensions/file'
|
14
|
+
require 'extensions/fixnum'
|
15
|
+
require 'extensions/hash'
|
16
|
+
require 'extensions/object'
|
17
|
+
require 'extensions/range'
|
18
|
+
require 'extensions/yaml'
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ok-extensions
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2007-11
|
6
|
+
version: 1.0.4
|
7
|
+
date: 2007-12-11 00:00:00 +07:00
|
8
8
|
summary: The author was too lazy to write a summary
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: ryand-ruby@zenspider.com
|
12
12
|
homepage: http://www.zenspider.com/ZSS/Products/ok-extensions/
|
13
13
|
rubyforge_project: coderrr
|
14
|
-
description: "OkExtensions by steved http://code.google.com/p/ok-extensions/ == DESCRIPTION: A set of
|
14
|
+
description: "OkExtensions by steved http://code.google.com/p/ok-extensions/ == DESCRIPTION: A set of extensions to the ruby stdlib"
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -32,7 +32,6 @@ files:
|
|
32
32
|
- History.txt
|
33
33
|
- Manifest.txt
|
34
34
|
- README.txt
|
35
|
-
- Rakefile
|
36
35
|
- lib/extensions/array.rb
|
37
36
|
- lib/extensions/core.rb
|
38
37
|
- lib/extensions/enumerable.rb
|
@@ -44,16 +43,6 @@ files:
|
|
44
43
|
- lib/extensions/range.rb
|
45
44
|
- lib/extensions/yaml.rb
|
46
45
|
- lib/ok_extensions.rb
|
47
|
-
- test/extensions/test_array.rb
|
48
|
-
- test/extensions/test_enumerable.rb
|
49
|
-
- test/extensions/test_exception.rb
|
50
|
-
- test/extensions/test_file.rb
|
51
|
-
- test/extensions/test_fixnum.rb
|
52
|
-
- test/extensions/test_hash.rb
|
53
|
-
- test/extensions/test_object.rb
|
54
|
-
- test/extensions/test_range.rb
|
55
|
-
- test/extensions/test_yaml.rb
|
56
|
-
- test/focused_test_runner.rb
|
57
46
|
test_files:
|
58
47
|
- test/extensions/test_array.rb
|
59
48
|
- test/extensions/test_hash.rb
|
data/Rakefile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'hoe'
|
5
|
-
require './lib/ok_extensions.rb'
|
6
|
-
|
7
|
-
Hoe.new('ok-extensions', OkExtensions::VERSION) do |p|
|
8
|
-
p.rubyforge_name = 'coderrr'
|
9
|
-
# p.author = 'FIX'
|
10
|
-
# p.email = 'FIX'
|
11
|
-
# p.summary = 'FIX'
|
12
|
-
p.description = p.paragraphs_of('README.txt', 0..1).join("\n\n")
|
13
|
-
# p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
14
|
-
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
15
|
-
p.remote_rdoc_dir = '' # Release to root
|
16
|
-
p.extra_deps << "facets"
|
17
|
-
end
|
data/test/focused_test_runner.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
#!/usr/local/bin/ruby
|
2
|
-
require 'optparse'
|
3
|
-
|
4
|
-
|
5
|
-
# ghetto hack to run focused tests that don't start with test_
|
6
|
-
require 'test/unit/testcase'
|
7
|
-
module Test
|
8
|
-
module Unit
|
9
|
-
class TestCase
|
10
|
-
|
11
|
-
def self.suite
|
12
|
-
method_names = public_instance_methods(true)
|
13
|
-
tests = method_names.delete_if {|method_name| method_name !~ /^(?:explicit_)?test./}
|
14
|
-
suite = TestSuite.new(name)
|
15
|
-
tests.sort.each do
|
16
|
-
|test|
|
17
|
-
catch(:invalid_test) do
|
18
|
-
suite << new(test)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
if (suite.empty?)
|
22
|
-
catch(:invalid_test) do
|
23
|
-
suite << new(:default_test)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
return suite
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
file_path = nil
|
35
|
-
line_number = 0
|
36
|
-
options = OptionParser.new do |o|
|
37
|
-
o.on('-f', '--filepath=FILEPATH', String, "File to run test on") do |path|
|
38
|
-
file_path = path
|
39
|
-
end
|
40
|
-
|
41
|
-
o.on('-l', '--linenumber=LINENUMBER', Integer, "Line of the test") do |line|
|
42
|
-
line_number = line
|
43
|
-
end
|
44
|
-
end
|
45
|
-
options.order(ARGV)
|
46
|
-
|
47
|
-
test_type = nil
|
48
|
-
current_method = nil
|
49
|
-
current_line = 0
|
50
|
-
IO.foreach(file_path) do |line|
|
51
|
-
break if current_line > line_number
|
52
|
-
if /def +((?:explicit_)?test_[a-z0-9_!?]*)/i =~ line
|
53
|
-
test_type = :test
|
54
|
-
current_method = Regexp.last_match(1)
|
55
|
-
elsif /^ *(specify +.*)$/ =~ line
|
56
|
-
test_type = :spec
|
57
|
-
current_method = Regexp.last_match(1)
|
58
|
-
end
|
59
|
-
current_line += 1
|
60
|
-
end
|
61
|
-
|
62
|
-
if test_type == :test
|
63
|
-
require file_path
|
64
|
-
runner = Test::Unit::AutoRunner.new(false) do |runner|
|
65
|
-
runner.filters << proc{|t| current_method == t.method_name }
|
66
|
-
end
|
67
|
-
runner.run
|
68
|
-
elsif test_type == :spec
|
69
|
-
def specify(spec_name)
|
70
|
-
@spec_name = spec_name
|
71
|
-
end
|
72
|
-
current_method.gsub!(/do *$/, "")
|
73
|
-
current_method.gsub!(/\{ *$/, "")
|
74
|
-
eval(current_method) rescue ""
|
75
|
-
current_method = @spec_name
|
76
|
-
exec "spec '#{file_path}' -s '#{current_method}' -f specdoc"
|
77
|
-
end
|
78
|
-
|
79
|
-
puts "Running '#{current_method}' in file #{file_path}"
|