data_objects 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.markdown +20 -0
- data/LICENSE +1 -29
- data/README.markdown +16 -2
- data/Rakefile +41 -7
- data/lib/data_objects.rb +3 -2
- data/lib/data_objects/byte_array.rb +6 -0
- data/lib/data_objects/connection.rb +21 -9
- data/lib/data_objects/logger.rb +15 -15
- data/lib/data_objects/pooling.rb +250 -0
- data/lib/data_objects/reader.rb +16 -0
- data/lib/data_objects/spec/bacon.rb +9 -0
- data/lib/data_objects/spec/command_spec.rb +54 -47
- data/lib/data_objects/spec/connection_spec.rb +119 -30
- data/lib/data_objects/spec/encoding_spec.rb +64 -6
- data/lib/data_objects/spec/helpers/immediate_red_green_output.rb +59 -0
- data/lib/data_objects/spec/helpers/pending.rb +22 -0
- data/lib/data_objects/spec/helpers/ssl.rb +21 -0
- data/lib/data_objects/spec/reader_spec.rb +47 -24
- data/lib/data_objects/spec/result_spec.rb +10 -19
- data/lib/data_objects/spec/typecast/array_spec.rb +16 -20
- data/lib/data_objects/spec/typecast/bigdecimal_spec.rb +16 -24
- data/lib/data_objects/spec/typecast/boolean_spec.rb +16 -24
- data/lib/data_objects/spec/typecast/byte_array_spec.rb +11 -15
- data/lib/data_objects/spec/typecast/class_spec.rb +7 -11
- data/lib/data_objects/spec/typecast/date_spec.rb +17 -25
- data/lib/data_objects/spec/typecast/datetime_spec.rb +18 -26
- data/lib/data_objects/spec/typecast/float_spec.rb +19 -27
- data/lib/data_objects/spec/typecast/integer_spec.rb +10 -14
- data/lib/data_objects/spec/typecast/nil_spec.rb +18 -30
- data/lib/data_objects/spec/typecast/other_spec.rb +45 -0
- data/lib/data_objects/spec/typecast/range_spec.rb +16 -20
- data/lib/data_objects/spec/typecast/string_spec.rb +72 -13
- data/lib/data_objects/spec/typecast/time_spec.rb +11 -15
- data/lib/data_objects/utilities.rb +18 -0
- data/lib/data_objects/version.rb +1 -2
- data/spec/command_spec.rb +2 -2
- data/spec/connection_spec.rb +7 -5
- data/spec/do_mock2.rb +31 -0
- data/spec/pooling_spec.rb +162 -0
- data/spec/reader_spec.rb +7 -4
- data/spec/result_spec.rb +2 -2
- data/spec/spec_helper.rb +26 -5
- data/spec/transaction_spec.rb +11 -9
- data/tasks/metrics.rake +36 -0
- data/tasks/release.rake +10 -70
- data/tasks/spec.rake +16 -14
- data/tasks/yard.rake +9 -0
- data/tasks/yardstick.rake +19 -0
- metadata +53 -27
- data/HISTORY.markdown +0 -7
- data/Manifest.txt +0 -44
- data/spec/lib/pending_helpers.rb +0 -11
- data/spec/lib/rspec_immediate_feedback_formatter.rb +0 -53
- data/spec/lib/ssl_helpers.rb +0 -20
- data/tasks/gem.rake +0 -8
- data/tasks/install.rake +0 -13
data/HISTORY.markdown
DELETED
data/Manifest.txt
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
.gitignore
|
2
|
-
HISTORY.markdown
|
3
|
-
LICENSE
|
4
|
-
Manifest.txt
|
5
|
-
README.markdown
|
6
|
-
Rakefile
|
7
|
-
lib/data_objects.rb
|
8
|
-
lib/data_objects/command.rb
|
9
|
-
lib/data_objects/connection.rb
|
10
|
-
lib/data_objects/logger.rb
|
11
|
-
lib/data_objects/quoting.rb
|
12
|
-
lib/data_objects/reader.rb
|
13
|
-
lib/data_objects/result.rb
|
14
|
-
lib/data_objects/spec/command_spec.rb
|
15
|
-
lib/data_objects/spec/connection_spec.rb
|
16
|
-
lib/data_objects/spec/encoding_spec.rb
|
17
|
-
lib/data_objects/spec/quoting_spec.rb
|
18
|
-
lib/data_objects/spec/reader_spec.rb
|
19
|
-
lib/data_objects/spec/result_spec.rb
|
20
|
-
lib/data_objects/spec/typecast/bigdecimal_spec.rb
|
21
|
-
lib/data_objects/spec/typecast/boolean_spec.rb
|
22
|
-
lib/data_objects/spec/typecast/byte_array_spec.rb
|
23
|
-
lib/data_objects/spec/typecast/class_spec.rb
|
24
|
-
lib/data_objects/spec/typecast/date_spec.rb
|
25
|
-
lib/data_objects/spec/typecast/datetime_spec.rb
|
26
|
-
lib/data_objects/spec/typecast/float_spec.rb
|
27
|
-
lib/data_objects/spec/typecast/integer_spec.rb
|
28
|
-
lib/data_objects/spec/typecast/ipaddr_spec.rb
|
29
|
-
lib/data_objects/spec/typecast/nil_spec.rb
|
30
|
-
lib/data_objects/spec/typecast/string_spec.rb
|
31
|
-
lib/data_objects/spec/typecast/time_spec.rb
|
32
|
-
lib/data_objects/transaction.rb
|
33
|
-
lib/data_objects/uri.rb
|
34
|
-
lib/data_objects/version.rb
|
35
|
-
spec/command_spec.rb
|
36
|
-
spec/connection_spec.rb
|
37
|
-
spec/do_mock.rb
|
38
|
-
spec/lib/pending_helpers.rb
|
39
|
-
spec/reader_spec.rb
|
40
|
-
spec/result_spec.rb
|
41
|
-
spec/spec.opts
|
42
|
-
spec/spec_helper.rb
|
43
|
-
spec/transaction_spec.rb
|
44
|
-
spec/uri_spec.rb
|
data/spec/lib/pending_helpers.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'spec/runner/formatter/base_text_formatter'
|
2
|
-
|
3
|
-
# Code is based on standard SpecdocFormatter, but will print full error details as soon as they are found.
|
4
|
-
# Successful or pending examples are written only as a dot in the output. Header is only printed if errors occur.
|
5
|
-
#
|
6
|
-
# To use it, add the following to your spec/spec.opts:
|
7
|
-
# --require
|
8
|
-
# lib/rspec_immediate_feedback_formatter.rb
|
9
|
-
# --format
|
10
|
-
# Spec::Runner::Formatter::ImmediateFeedbackFormatter
|
11
|
-
|
12
|
-
module Spec
|
13
|
-
module Runner
|
14
|
-
module Formatter
|
15
|
-
class ImmediateFeedbackFormatter < BaseTextFormatter
|
16
|
-
|
17
|
-
def add_example_group(example_group)
|
18
|
-
super
|
19
|
-
@current_group = example_group.description
|
20
|
-
end
|
21
|
-
|
22
|
-
def example_failed(example, counter, failure)
|
23
|
-
if @current_group
|
24
|
-
output.puts
|
25
|
-
output.puts @current_group
|
26
|
-
@current_group = nil # only print the group name once
|
27
|
-
end
|
28
|
-
|
29
|
-
message = if failure.expectation_not_met?
|
30
|
-
"- #{example.description} (FAILED - #{counter})"
|
31
|
-
else
|
32
|
-
"- #{example.description} (ERROR - #{counter})"
|
33
|
-
end
|
34
|
-
|
35
|
-
output.puts(red(message))
|
36
|
-
dump_failure(counter, failure) # dump stacktrace immediately
|
37
|
-
output.flush
|
38
|
-
end
|
39
|
-
|
40
|
-
def example_passed(*)
|
41
|
-
output.print green('.')
|
42
|
-
output.flush
|
43
|
-
end
|
44
|
-
|
45
|
-
def example_pending(*)
|
46
|
-
super
|
47
|
-
output.print yellow('*')
|
48
|
-
output.flush
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
data/spec/lib/ssl_helpers.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'cgi'
|
2
|
-
|
3
|
-
module SSLHelpers
|
4
|
-
|
5
|
-
CERTS_DIR = Pathname(__FILE__).dirname.join('ssl_certs').to_s
|
6
|
-
|
7
|
-
CONFIG = OpenStruct.new
|
8
|
-
CONFIG.ca_cert = CERTS_DIR / 'ca-cert.pem'
|
9
|
-
CONFIG.ca_key = CERTS_DIR / 'ca-key.pem'
|
10
|
-
CONFIG.server_cert = CERTS_DIR / 'server-cert.pem'
|
11
|
-
CONFIG.server_key = CERTS_DIR / 'server-key.pem'
|
12
|
-
CONFIG.client_cert = CERTS_DIR / 'client-cert.pem'
|
13
|
-
CONFIG.client_key = CERTS_DIR / 'client-key.pem'
|
14
|
-
CONFIG.cipher = 'AES128-SHA'
|
15
|
-
|
16
|
-
def self.query(*keys)
|
17
|
-
keys.map { |key| "ssl[#{key}]=#{CGI::escape(CONFIG.send(key))}" }.join('&')
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
data/tasks/gem.rake
DELETED
data/tasks/install.rake
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
def sudo_gem(cmd)
|
2
|
-
sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
|
3
|
-
end
|
4
|
-
|
5
|
-
desc "Install #{GEM_SPEC.name} #{GEM_SPEC.version}"
|
6
|
-
task :install => [ :package ] do
|
7
|
-
sudo_gem "install --local pkg/#{GEM_SPEC.name}-#{GEM_SPEC.version} --no-update-sources"
|
8
|
-
end
|
9
|
-
|
10
|
-
desc "Uninstall #{GEM_SPEC.name} #{GEM_SPEC.version}"
|
11
|
-
task :uninstall => [ :clean ] do
|
12
|
-
sudo_gem "uninstall #{GEM_SPEC.name} -v#{GEM_SPEC.version} -I -x"
|
13
|
-
end
|