extlib 0.9.13 → 0.9.14
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of extlib might be problematic. Click here for more details.
- data/.autotest +21 -0
- data/.document +5 -0
- data/.gitignore +22 -0
- data/LICENSE +1 -1
- data/README.rdoc +17 -0
- data/Rakefile +18 -170
- data/VERSION +1 -0
- data/extlib.gemspec +146 -0
- data/lib/extlib/class.rb +8 -8
- data/lib/extlib/hash.rb +7 -7
- data/lib/extlib/inflection.rb +11 -5
- data/lib/extlib/lazy_array.rb +26 -32
- data/lib/extlib/mash.rb +11 -11
- data/lib/extlib/object.rb +9 -9
- data/lib/extlib/object_space.rb +1 -1
- data/lib/extlib/rubygems.rb +1 -1
- data/lib/extlib/string.rb +4 -3
- data/spec/inflection_extras_spec.rb +18 -1
- data/spec/lazy_array_spec.rb +25 -0
- data/spec/rcov.opts +6 -0
- data/spec/spec.opts +1 -0
- data/spec/string_spec.rb +1 -0
- data/tasks/ci.rake +1 -0
- data/tasks/metrics.rake +36 -0
- data/tasks/spec.rake +25 -0
- data/tasks/yard.rake +9 -0
- data/tasks/yardstick.rake +19 -0
- metadata +81 -20
- data/History.txt +0 -77
- data/README +0 -0
- data/lib/extlib/tasks/release.rb +0 -15
- data/lib/extlib/version.rb +0 -3
data/spec/lazy_array_spec.rb
CHANGED
@@ -146,6 +146,10 @@ end
|
|
146
146
|
|
147
147
|
subject { @lazy_array }
|
148
148
|
|
149
|
+
it 'should be an Enumerable' do
|
150
|
+
(Enumerable === subject).should be_true
|
151
|
+
end
|
152
|
+
|
149
153
|
describe 'when frozen', state do
|
150
154
|
before { subject.freeze }
|
151
155
|
|
@@ -551,6 +555,17 @@ end
|
|
551
555
|
should_be_a_kicker
|
552
556
|
should_not_change_subject
|
553
557
|
end
|
558
|
+
|
559
|
+
describe 'when the subject has only nil entries' do
|
560
|
+
subject { LazyArray.new << nil }
|
561
|
+
|
562
|
+
action { subject.empty? }
|
563
|
+
|
564
|
+
should_return_false
|
565
|
+
should_not_be_a_kicker
|
566
|
+
should_not_change_subject
|
567
|
+
end
|
568
|
+
|
554
569
|
end
|
555
570
|
|
556
571
|
[ :eql?, :== ].each do |method|
|
@@ -976,6 +991,16 @@ end
|
|
976
991
|
end
|
977
992
|
end
|
978
993
|
|
994
|
+
should_respond_to(:nil?)
|
995
|
+
|
996
|
+
describe '#nil?' do
|
997
|
+
action { subject.nil? }
|
998
|
+
|
999
|
+
should_return_expected_value { false }
|
1000
|
+
|
1001
|
+
should_not_be_a_kicker
|
1002
|
+
end
|
1003
|
+
|
979
1004
|
should_respond_to(:pop)
|
980
1005
|
|
981
1006
|
describe '#pop', state do
|
data/spec/rcov.opts
ADDED
data/spec/spec.opts
CHANGED
data/spec/string_spec.rb
CHANGED
@@ -77,6 +77,7 @@ describe String, "#snake_case" do
|
|
77
77
|
"CNN".snake_case.should == "cnn"
|
78
78
|
"CNNNews".snake_case.should == "cnn_news"
|
79
79
|
"HeadlineCNNNews".snake_case.should == "headline_cnn_news"
|
80
|
+
"NameACRONYM".snake_case.should == "name_acronym"
|
80
81
|
end
|
81
82
|
|
82
83
|
it "does NOT change one word lowercase" do
|
data/tasks/ci.rake
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
task :ci => [ :verify_measurements, 'metrics:all' ]
|
data/tasks/metrics.rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
begin
|
2
|
+
require 'metric_fu'
|
3
|
+
rescue LoadError
|
4
|
+
namespace :metrics do
|
5
|
+
task :all do
|
6
|
+
abort 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
begin
|
12
|
+
require 'reek/adapters/rake_task'
|
13
|
+
|
14
|
+
Reek::RakeTask.new do |t|
|
15
|
+
t.fail_on_error = true
|
16
|
+
t.verbose = false
|
17
|
+
t.source_files = 'lib/**/*.rb'
|
18
|
+
end
|
19
|
+
rescue LoadError
|
20
|
+
task :reek do
|
21
|
+
abort 'Reek is not available. In order to run reek, you must: gem install reek'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
begin
|
26
|
+
require 'roodi'
|
27
|
+
require 'roodi_task'
|
28
|
+
|
29
|
+
RoodiTask.new do |t|
|
30
|
+
t.verbose = false
|
31
|
+
end
|
32
|
+
rescue LoadError
|
33
|
+
task :roodi do
|
34
|
+
abort 'Roodi is not available. In order to run roodi, you must: gem install roodi'
|
35
|
+
end
|
36
|
+
end
|
data/tasks/spec.rake
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec/rake/spectask'
|
2
|
+
require 'spec/rake/verify_rcov'
|
3
|
+
|
4
|
+
spec_defaults = lambda do |spec|
|
5
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
6
|
+
spec.libs << 'lib' << 'spec'
|
7
|
+
spec.spec_opts << '--options' << 'spec/spec.opts'
|
8
|
+
end
|
9
|
+
|
10
|
+
Spec::Rake::SpecTask.new(:spec, &spec_defaults)
|
11
|
+
|
12
|
+
Spec::Rake::SpecTask.new(:rcov) do |rcov|
|
13
|
+
spec_defaults.call(rcov)
|
14
|
+
rcov.rcov = true
|
15
|
+
rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
|
16
|
+
end
|
17
|
+
|
18
|
+
RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
|
19
|
+
rcov.threshold = 100
|
20
|
+
end
|
21
|
+
|
22
|
+
task :spec => :check_dependencies
|
23
|
+
task :rcov => :check_dependencies
|
24
|
+
|
25
|
+
task :default => :spec
|
data/tasks/yard.rake
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
begin
|
2
|
+
require 'pathname'
|
3
|
+
require 'yardstick/rake/measurement'
|
4
|
+
require 'yardstick/rake/verify'
|
5
|
+
|
6
|
+
# yardstick_measure task
|
7
|
+
Yardstick::Rake::Measurement.new
|
8
|
+
|
9
|
+
# verify_measurements task
|
10
|
+
Yardstick::Rake::Verify.new do |verify|
|
11
|
+
verify.threshold = 100
|
12
|
+
end
|
13
|
+
rescue LoadError
|
14
|
+
%w[ yardstick_measure verify_measurements ].each do |name|
|
15
|
+
task name.to_s do
|
16
|
+
abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Kubb
|
@@ -9,11 +9,40 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-11 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: json_pure
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.2.0
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.2.9
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: yard
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.4.0
|
44
|
+
version:
|
45
|
+
description: Support library for DataMapper and Merb
|
17
46
|
email: dan.kubb@gmail.com
|
18
47
|
executables: []
|
19
48
|
|
@@ -21,13 +50,17 @@ extensions: []
|
|
21
50
|
|
22
51
|
extra_rdoc_files:
|
23
52
|
- LICENSE
|
24
|
-
- README
|
25
|
-
- History.txt
|
53
|
+
- README.rdoc
|
26
54
|
files:
|
55
|
+
- .autotest
|
56
|
+
- .document
|
57
|
+
- .gitignore
|
27
58
|
- LICENSE
|
28
|
-
- README
|
59
|
+
- README.rdoc
|
29
60
|
- Rakefile
|
30
|
-
-
|
61
|
+
- VERSION
|
62
|
+
- extlib.gemspec
|
63
|
+
- lib/extlib.rb
|
31
64
|
- lib/extlib/array.rb
|
32
65
|
- lib/extlib/assertions.rb
|
33
66
|
- lib/extlib/blank.rb
|
@@ -55,11 +88,8 @@ files:
|
|
55
88
|
- lib/extlib/string.rb
|
56
89
|
- lib/extlib/struct.rb
|
57
90
|
- lib/extlib/symbol.rb
|
58
|
-
- lib/extlib/tasks/release.rb
|
59
91
|
- lib/extlib/time.rb
|
60
|
-
- lib/extlib/version.rb
|
61
92
|
- lib/extlib/virtual_file.rb
|
62
|
-
- lib/extlib.rb
|
63
93
|
- spec/array_spec.rb
|
64
94
|
- spec/blank_spec.rb
|
65
95
|
- spec/byte_array_spec.rb
|
@@ -77,6 +107,7 @@ files:
|
|
77
107
|
- spec/object_space_spec.rb
|
78
108
|
- spec/object_spec.rb
|
79
109
|
- spec/pooling_spec.rb
|
110
|
+
- spec/rcov.opts
|
80
111
|
- spec/simple_set_spec.rb
|
81
112
|
- spec/spec.opts
|
82
113
|
- spec/spec_helper.rb
|
@@ -87,13 +118,18 @@ files:
|
|
87
118
|
- spec/try_call_spec.rb
|
88
119
|
- spec/try_dup_spec.rb
|
89
120
|
- spec/virtual_file_spec.rb
|
90
|
-
|
91
|
-
|
121
|
+
- tasks/ci.rake
|
122
|
+
- tasks/metrics.rake
|
123
|
+
- tasks/spec.rake
|
124
|
+
- tasks/yard.rake
|
125
|
+
- tasks/yardstick.rake
|
126
|
+
has_rdoc: true
|
127
|
+
homepage: http://github.com/datamapper/extlib
|
92
128
|
licenses: []
|
93
129
|
|
94
130
|
post_install_message:
|
95
|
-
rdoc_options:
|
96
|
-
|
131
|
+
rdoc_options:
|
132
|
+
- --charset=UTF-8
|
97
133
|
require_paths:
|
98
134
|
- lib
|
99
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -110,10 +146,35 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
146
|
version:
|
111
147
|
requirements: []
|
112
148
|
|
113
|
-
rubyforge_project:
|
149
|
+
rubyforge_project: extlib
|
114
150
|
rubygems_version: 1.3.5
|
115
151
|
signing_key:
|
116
152
|
specification_version: 3
|
117
|
-
summary: Support library for DataMapper and Merb
|
118
|
-
test_files:
|
119
|
-
|
153
|
+
summary: Support library for DataMapper and Merb
|
154
|
+
test_files:
|
155
|
+
- spec/array_spec.rb
|
156
|
+
- spec/blank_spec.rb
|
157
|
+
- spec/byte_array_spec.rb
|
158
|
+
- spec/class_spec.rb
|
159
|
+
- spec/datetime_spec.rb
|
160
|
+
- spec/hash_spec.rb
|
161
|
+
- spec/hook_spec.rb
|
162
|
+
- spec/inflection/plural_spec.rb
|
163
|
+
- spec/inflection/singular_spec.rb
|
164
|
+
- spec/inflection_extras_spec.rb
|
165
|
+
- spec/lazy_array_spec.rb
|
166
|
+
- spec/lazy_module_spec.rb
|
167
|
+
- spec/mash_spec.rb
|
168
|
+
- spec/module_spec.rb
|
169
|
+
- spec/object_space_spec.rb
|
170
|
+
- spec/object_spec.rb
|
171
|
+
- spec/pooling_spec.rb
|
172
|
+
- spec/simple_set_spec.rb
|
173
|
+
- spec/spec_helper.rb
|
174
|
+
- spec/string_spec.rb
|
175
|
+
- spec/struct_spec.rb
|
176
|
+
- spec/symbol_spec.rb
|
177
|
+
- spec/time_spec.rb
|
178
|
+
- spec/try_call_spec.rb
|
179
|
+
- spec/try_dup_spec.rb
|
180
|
+
- spec/virtual_file_spec.rb
|
data/History.txt
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
=== 0.9.13 / 2009-10-15
|
2
|
-
|
3
|
-
* 3 minor enhancements:
|
4
|
-
* Updated LazyArray#head, #tail and #lazy_possible? to be public
|
5
|
-
* Refactored Time#to_datetime to not use DateTime.parse
|
6
|
-
* Updated Logger to use Array#join instead of Array#to_s to make
|
7
|
-
it compatible with Ruby 1.9
|
8
|
-
|
9
|
-
=== 0.9.12 / 2009-05-05
|
10
|
-
|
11
|
-
* 4 bug fixes
|
12
|
-
|
13
|
-
* Fixed constant lookup for nested constructs
|
14
|
-
* Moved ByteArray to the Extlib module
|
15
|
-
* Fix specs for recent RSpec versions
|
16
|
-
* Fix compatibility with ActiveSupport
|
17
|
-
|
18
|
-
=== 0.9.11 / 2009-03-29
|
19
|
-
|
20
|
-
* 1 major enhancement:
|
21
|
-
|
22
|
-
* Added LazyModule, providing similar capabilities to traits in
|
23
|
-
Smalltalk
|
24
|
-
|
25
|
-
* 5 minor enhancements:
|
26
|
-
|
27
|
-
* Added Array#to_hash and Array#to_mash
|
28
|
-
* Silenced warnings when running in verbose mode
|
29
|
-
* Add ByteArray for representing binary data explicitly
|
30
|
-
* Alias Pathname#to_s to Pathname#to_str when not defined
|
31
|
-
* Added Object#try_call
|
32
|
-
|
33
|
-
* 2 bug fixes:
|
34
|
-
|
35
|
-
* Updated Module.find_const to use const_missing if constant not found
|
36
|
-
* Fixed LazyArray#equal? to compare object_ids
|
37
|
-
|
38
|
-
=== 0.9.10 / 2009-01-19
|
39
|
-
|
40
|
-
* 1 major enhancement:
|
41
|
-
|
42
|
-
* Ruby 1.9.1 compatibility
|
43
|
-
|
44
|
-
* 1 minor enhancement:
|
45
|
-
|
46
|
-
* Updated LazyArray#eql? and LazyArray#== to compare without lazy
|
47
|
-
loading if possible.
|
48
|
-
|
49
|
-
* 3 bug fixes:
|
50
|
-
|
51
|
-
* Fix for inheritance and hooks
|
52
|
-
* Fix for Class inheritable accessor to use #try_dup
|
53
|
-
* Fix for LazyArray to be more explicit in delegating to Array,
|
54
|
-
to lessen conflicts in subclasses
|
55
|
-
|
56
|
-
=== 0.9.9 / 2008-12-07
|
57
|
-
|
58
|
-
* 1 major enhancement:
|
59
|
-
|
60
|
-
* Updated LazyArray to have a tail/head so that it can append/prepend
|
61
|
-
without lazy-loading. This will eliminate some too-eager loading
|
62
|
-
from DataMapper::Collection, and (in certain cases) will boost
|
63
|
-
performance significantly.
|
64
|
-
|
65
|
-
* 3 minor enhancements:
|
66
|
-
|
67
|
-
* Minor Ruby 1.9.1 fixes. RSpec still needs to be updated to support
|
68
|
-
1.9.1 before everything can be verified completely.
|
69
|
-
* Updated Extlib::Inflection so that the plural of "cow" is now
|
70
|
-
"cows" instead of "kine".
|
71
|
-
* Misc documentation updates.
|
72
|
-
|
73
|
-
* 2 bug fixes:
|
74
|
-
|
75
|
-
* Fixed Extlib::Pooling Threading issue on JRuby and Windows.
|
76
|
-
* Removed Object#encoded_hash. It was not used by DataMapper or Merb,
|
77
|
-
and the specs were failing for JRuby.
|
data/README
DELETED
File without changes
|
data/lib/extlib/tasks/release.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
desc "Publish the release files to RubyForge."
|
2
|
-
task :release => [ :package ] do
|
3
|
-
packages = %w( gem tgz zip ).collect{ |ext| "pkg/#{GEM_NAME}-#{GEM_VERSION}.#{ext}" }
|
4
|
-
|
5
|
-
begin
|
6
|
-
sh %{rubyforge login}
|
7
|
-
sh %{rubyforge add_release #{RUBY_FORGE_PROJECT} #{GEM_NAME} #{GEM_VERSION} #{packages.join(' ')}}
|
8
|
-
sh %{rubyforge add_file #{RUBY_FORGE_PROJECT} #{GEM_NAME} #{GEM_VERSION} #{packages.join(' ')}}
|
9
|
-
rescue Exception => e
|
10
|
-
puts
|
11
|
-
puts "Release failed: #{e.message}"
|
12
|
-
puts
|
13
|
-
puts "Set PKG_BUILD environment variable if you do a subrelease (0.9.4.2008_08_02 when version is 0.9.4)"
|
14
|
-
end
|
15
|
-
end
|
data/lib/extlib/version.rb
DELETED