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.
Files changed (56) hide show
  1. data/ChangeLog.markdown +20 -0
  2. data/LICENSE +1 -29
  3. data/README.markdown +16 -2
  4. data/Rakefile +41 -7
  5. data/lib/data_objects.rb +3 -2
  6. data/lib/data_objects/byte_array.rb +6 -0
  7. data/lib/data_objects/connection.rb +21 -9
  8. data/lib/data_objects/logger.rb +15 -15
  9. data/lib/data_objects/pooling.rb +250 -0
  10. data/lib/data_objects/reader.rb +16 -0
  11. data/lib/data_objects/spec/bacon.rb +9 -0
  12. data/lib/data_objects/spec/command_spec.rb +54 -47
  13. data/lib/data_objects/spec/connection_spec.rb +119 -30
  14. data/lib/data_objects/spec/encoding_spec.rb +64 -6
  15. data/lib/data_objects/spec/helpers/immediate_red_green_output.rb +59 -0
  16. data/lib/data_objects/spec/helpers/pending.rb +22 -0
  17. data/lib/data_objects/spec/helpers/ssl.rb +21 -0
  18. data/lib/data_objects/spec/reader_spec.rb +47 -24
  19. data/lib/data_objects/spec/result_spec.rb +10 -19
  20. data/lib/data_objects/spec/typecast/array_spec.rb +16 -20
  21. data/lib/data_objects/spec/typecast/bigdecimal_spec.rb +16 -24
  22. data/lib/data_objects/spec/typecast/boolean_spec.rb +16 -24
  23. data/lib/data_objects/spec/typecast/byte_array_spec.rb +11 -15
  24. data/lib/data_objects/spec/typecast/class_spec.rb +7 -11
  25. data/lib/data_objects/spec/typecast/date_spec.rb +17 -25
  26. data/lib/data_objects/spec/typecast/datetime_spec.rb +18 -26
  27. data/lib/data_objects/spec/typecast/float_spec.rb +19 -27
  28. data/lib/data_objects/spec/typecast/integer_spec.rb +10 -14
  29. data/lib/data_objects/spec/typecast/nil_spec.rb +18 -30
  30. data/lib/data_objects/spec/typecast/other_spec.rb +45 -0
  31. data/lib/data_objects/spec/typecast/range_spec.rb +16 -20
  32. data/lib/data_objects/spec/typecast/string_spec.rb +72 -13
  33. data/lib/data_objects/spec/typecast/time_spec.rb +11 -15
  34. data/lib/data_objects/utilities.rb +18 -0
  35. data/lib/data_objects/version.rb +1 -2
  36. data/spec/command_spec.rb +2 -2
  37. data/spec/connection_spec.rb +7 -5
  38. data/spec/do_mock2.rb +31 -0
  39. data/spec/pooling_spec.rb +162 -0
  40. data/spec/reader_spec.rb +7 -4
  41. data/spec/result_spec.rb +2 -2
  42. data/spec/spec_helper.rb +26 -5
  43. data/spec/transaction_spec.rb +11 -9
  44. data/tasks/metrics.rake +36 -0
  45. data/tasks/release.rake +10 -70
  46. data/tasks/spec.rake +16 -14
  47. data/tasks/yard.rake +9 -0
  48. data/tasks/yardstick.rake +19 -0
  49. metadata +53 -27
  50. data/HISTORY.markdown +0 -7
  51. data/Manifest.txt +0 -44
  52. data/spec/lib/pending_helpers.rb +0 -11
  53. data/spec/lib/rspec_immediate_feedback_formatter.rb +0 -53
  54. data/spec/lib/ssl_helpers.rb +0 -20
  55. data/tasks/gem.rake +0 -8
  56. data/tasks/install.rake +0 -13
data/HISTORY.markdown DELETED
@@ -1,7 +0,0 @@
1
- == 0.9.11 2009-01-19
2
- * Fixes
3
- * Use Extlib Object.full_const_get instead of custom code
4
- * Remove Field as it was unused
5
-
6
- == 0.9.9 2008-11-27
7
- * No Changes since 0.9.8
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
@@ -1,11 +0,0 @@
1
- module DataObjects::Spec
2
- module PendingHelpers
3
- def pending_if(message, boolean)
4
- if boolean
5
- pending(message) { yield }
6
- else
7
- yield
8
- end
9
- end
10
- end
11
- end
@@ -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
@@ -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
@@ -1,8 +0,0 @@
1
- require 'rubygems/package_task'
2
-
3
- GEM_SPEC = eval(File.read('data_objects.gemspec'))
4
-
5
- gem_package = Gem::PackageTask.new(GEM_SPEC) do |pkg|
6
- pkg.need_tar = false
7
- pkg.need_zip = false
8
- end
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