mack-data_mapper 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. data/lib/gems/{addressable-2.0.0 → addressable-2.0.1}/lib/addressable/idna.rb +0 -0
  2. data/lib/gems/{addressable-2.0.0 → addressable-2.0.1}/lib/addressable/uri.rb +62 -21
  3. data/lib/gems/{addressable-2.0.0 → addressable-2.0.1}/lib/addressable/version.rb +1 -1
  4. data/lib/gems/addressable-2.0.1/tasks/clobber.rake +2 -0
  5. data/lib/gems/addressable-2.0.1/tasks/gem.rake +68 -0
  6. data/lib/gems/addressable-2.0.1/tasks/git.rake +40 -0
  7. data/lib/gems/addressable-2.0.1/tasks/metrics.rake +22 -0
  8. data/lib/gems/addressable-2.0.1/tasks/rdoc.rake +29 -0
  9. data/lib/gems/addressable-2.0.1/tasks/rubyforge.rake +89 -0
  10. data/lib/gems/addressable-2.0.1/tasks/spec.rake +64 -0
  11. data/lib/gems/data_objects-0.9.10.1/lib/data_objects.rb +46 -0
  12. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/command.rb +30 -0
  13. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/connection.rb +107 -0
  14. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/field.rb +19 -0
  15. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/logger.rb +233 -0
  16. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/quoting.rb +103 -0
  17. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/reader.rb +22 -0
  18. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/result.rb +13 -0
  19. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/transaction.rb +45 -0
  20. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/uri.rb +34 -0
  21. data/lib/gems/data_objects-0.9.10.1/lib/data_objects/version.rb +3 -0
  22. data/lib/gems/{dm-aggregates-0.9.7 → dm-aggregates-0.9.9}/lib/dm-aggregates.rb +1 -1
  23. data/lib/gems/{dm-aggregates-0.9.7 → dm-aggregates-0.9.9}/lib/dm-aggregates/adapters/data_objects_adapter.rb +0 -0
  24. data/lib/gems/{dm-aggregates-0.9.7 → dm-aggregates-0.9.9}/lib/dm-aggregates/aggregate_functions.rb +0 -0
  25. data/lib/gems/{dm-aggregates-0.9.7 → dm-aggregates-0.9.9}/lib/dm-aggregates/collection.rb +4 -0
  26. data/lib/gems/{dm-aggregates-0.9.7 → dm-aggregates-0.9.9}/lib/dm-aggregates/model.rb +4 -0
  27. data/lib/gems/{dm-aggregates-0.9.7 → dm-aggregates-0.9.9}/lib/dm-aggregates/repository.rb +0 -0
  28. data/lib/gems/{dm-aggregates-0.9.7 → dm-aggregates-0.9.9}/lib/dm-aggregates/support/symbol.rb +0 -0
  29. data/lib/gems/dm-aggregates-0.9.9/lib/dm-aggregates/version.rb +5 -0
  30. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core.rb +5 -5
  31. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/adapters.rb +0 -0
  32. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/adapters/abstract_adapter.rb +0 -0
  33. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/adapters/data_objects_adapter.rb +1 -1
  34. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/adapters/in_memory_adapter.rb +0 -0
  35. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/adapters/mysql_adapter.rb +1 -1
  36. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/adapters/postgres_adapter.rb +1 -1
  37. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/adapters/sqlite3_adapter.rb +1 -1
  38. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/associations.rb +0 -0
  39. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/associations/many_to_many.rb +0 -0
  40. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/associations/many_to_one.rb +1 -1
  41. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/associations/one_to_many.rb +3 -6
  42. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/associations/one_to_one.rb +0 -0
  43. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/associations/relationship.rb +0 -0
  44. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/associations/relationship_chain.rb +0 -0
  45. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/auto_migrations.rb +0 -0
  46. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/collection.rb +26 -0
  47. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/dependency_queue.rb +0 -0
  48. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/hook.rb +0 -0
  49. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/identity_map.rb +0 -0
  50. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/is.rb +0 -0
  51. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/logger.rb +0 -0
  52. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/migrations/destructive_migrations.rb +0 -0
  53. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/migrator.rb +0 -0
  54. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/model.rb +29 -3
  55. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/naming_conventions.rb +0 -0
  56. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/property.rb +13 -0
  57. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/property_set.rb +0 -0
  58. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/query.rb +51 -3
  59. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/repository.rb +8 -0
  60. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/resource.rb +19 -6
  61. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/scope.rb +0 -0
  62. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/support.rb +0 -0
  63. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/support/array.rb +0 -0
  64. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/support/assertions.rb +0 -0
  65. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/support/errors.rb +0 -0
  66. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/support/kernel.rb +0 -0
  67. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/support/symbol.rb +0 -0
  68. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/transaction.rb +0 -0
  69. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/type.rb +0 -0
  70. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/type_map.rb +0 -0
  71. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types.rb +0 -0
  72. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types/boolean.rb +0 -0
  73. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types/discriminator.rb +0 -0
  74. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types/object.rb +0 -0
  75. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types/paranoid_boolean.rb +0 -0
  76. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types/paranoid_datetime.rb +0 -0
  77. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types/serial.rb +0 -0
  78. data/lib/gems/{dm-core-0.9.7 → dm-core-0.9.9}/lib/dm-core/types/text.rb +0 -0
  79. data/lib/gems/dm-core-0.9.9/lib/dm-core/version.rb +3 -0
  80. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/dm-migrations.rb +0 -0
  81. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/dm-migrations/version.rb +1 -1
  82. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/migration.rb +5 -3
  83. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/migration_runner.rb +0 -0
  84. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/spec/example/migration_example_group.rb +0 -0
  85. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/spec/matchers/migration_matchers.rb +0 -0
  86. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql.rb +0 -0
  87. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql/column.rb +0 -0
  88. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql/mysql.rb +0 -0
  89. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql/postgresql.rb +0 -0
  90. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql/sqlite3.rb +0 -0
  91. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql/table.rb +0 -0
  92. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql/table_creator.rb +0 -0
  93. data/lib/gems/{dm-migrations-0.9.7 → dm-migrations-0.9.9}/lib/sql/table_modifier.rb +0 -0
  94. data/lib/gems/dm-migrations-0.9.9/tasks/db.rb +22 -0
  95. data/lib/gems/dm-migrations-0.9.9/tasks/install.rb +13 -0
  96. data/lib/gems/dm-migrations-0.9.9/tasks/spec.rb +25 -0
  97. data/lib/gems/{dm-observer-0.9.7 → dm-observer-0.9.9}/lib/dm-observer.rb +1 -1
  98. data/lib/gems/{dm-observer-0.9.7 → dm-observer-0.9.9}/lib/dm-observer/version.rb +1 -1
  99. data/lib/gems/dm-observer-0.9.9/tasks/install.rb +13 -0
  100. data/lib/gems/dm-observer-0.9.9/tasks/spec.rb +25 -0
  101. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer.rb +4 -0
  102. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/common.rb +24 -0
  103. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/to_csv.rb +35 -0
  104. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/to_json.rb +73 -0
  105. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/to_xml.rb +61 -0
  106. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/to_yaml.rb +48 -0
  107. data/lib/gems/{dm-serializer-0.9.7 → dm-serializer-0.9.9}/lib/dm-serializer/version.rb +1 -1
  108. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/xml_serializers.rb +17 -0
  109. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/xml_serializers/libxml.rb +29 -0
  110. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/xml_serializers/nokogiri.rb +28 -0
  111. data/lib/gems/dm-serializer-0.9.9/lib/dm-serializer/xml_serializers/rexml.rb +23 -0
  112. data/lib/gems/dm-serializer-0.9.9/tasks/install.rb +13 -0
  113. data/lib/gems/dm-serializer-0.9.9/tasks/spec.rb +25 -0
  114. data/lib/gems/dm-timestamps-0.9.9/lib/dm-timestamps.rb +58 -0
  115. data/lib/gems/{dm-timestamps-0.9.7 → dm-timestamps-0.9.9}/lib/dm-timestamps/version.rb +1 -1
  116. data/lib/gems/dm-timestamps-0.9.9/tasks/install.rb +13 -0
  117. data/lib/gems/dm-timestamps-0.9.9/tasks/spec.rb +25 -0
  118. data/lib/gems/dm-types-0.9.9/lib/dm-types.rb +26 -0
  119. data/lib/gems/dm-types-0.9.9/lib/dm-types/bcrypt_hash.rb +33 -0
  120. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/csv.rb +0 -0
  121. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/enum.rb +4 -4
  122. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/epoch_time.rb +0 -0
  123. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/file_path.rb +0 -0
  124. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/flag.rb +0 -0
  125. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/ip_address.rb +0 -0
  126. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/json.rb +3 -6
  127. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/regexp.rb +0 -0
  128. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/serial.rb +0 -0
  129. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/slug.rb +0 -0
  130. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/uri.rb +2 -0
  131. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/uuid.rb +3 -0
  132. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/version.rb +1 -1
  133. data/lib/gems/{dm-types-0.9.7 → dm-types-0.9.9}/lib/dm-types/yaml.rb +1 -2
  134. data/lib/gems/dm-types-0.9.9/tasks/install.rb +13 -0
  135. data/lib/gems/dm-types-0.9.9/tasks/spec.rb +25 -0
  136. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations.rb +1 -1
  137. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/absent_field_validator.rb +0 -0
  138. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/acceptance_validator.rb +0 -0
  139. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/auto_validate.rb +0 -0
  140. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/block_validator.rb +0 -0
  141. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/confirmation_validator.rb +0 -0
  142. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/contextual_validators.rb +2 -3
  143. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/custom_validator.rb +0 -0
  144. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/format_validator.rb +0 -0
  145. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/formats/email.rb +1 -0
  146. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/formats/url.rb +0 -0
  147. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/generic_validator.rb +0 -0
  148. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/length_validator.rb +0 -0
  149. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/method_validator.rb +0 -0
  150. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/numeric_validator.rb +0 -0
  151. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/primitive_validator.rb +0 -0
  152. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/required_field_validator.rb +0 -0
  153. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/support/object.rb +0 -0
  154. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/uniqueness_validator.rb +1 -1
  155. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/validation_errors.rb +0 -0
  156. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/version.rb +1 -1
  157. data/lib/gems/{dm-validations-0.9.7 → dm-validations-0.9.9}/lib/dm-validations/within_validator.rb +0 -0
  158. data/lib/gems/dm-validations-0.9.9/tasks/install.rb +13 -0
  159. data/lib/gems/dm-validations-0.9.9/tasks/spec.rb +25 -0
  160. data/lib/gems/json_pure-1.1.3/tools/fuzz.rb +140 -0
  161. data/lib/gems/json_pure-1.1.3/tools/server.rb +62 -0
  162. data/lib/mack-data_mapper/dm_patches/migrations.rb +22 -1
  163. data/lib/mack-data_mapper/migration_generator/templates/db/migrations/%=@migration_name%.rb.template +1 -1
  164. metadata +216 -172
  165. data/lib/gems/dm-aggregates-0.9.7/lib/dm-aggregates/version.rb +0 -7
  166. data/lib/gems/dm-core-0.9.7/lib/dm-core/version.rb +0 -3
  167. data/lib/gems/dm-core-0.9.7/script/all +0 -5
  168. data/lib/gems/dm-core-0.9.7/script/performance.rb +0 -284
  169. data/lib/gems/dm-core-0.9.7/script/profile.rb +0 -87
  170. data/lib/gems/dm-serializer-0.9.7/lib/dm-serializer.rb +0 -183
  171. data/lib/gems/dm-timestamps-0.9.7/lib/dm-timestamps.rb +0 -57
  172. data/lib/gems/dm-types-0.9.7/lib/dm-types.rb +0 -28
  173. data/lib/gems/dm-types-0.9.7/lib/dm-types/bcrypt_hash.rb +0 -31
  174. data/lib/gems/json_pure-1.1.3/GPL +0 -340
  175. data/lib/gems/uuidtools-1.0.3/lib/uuidtools.rb +0 -648
  176. data/lib/gems/uuidtools-1.0.3/lib/uuidtools/version.rb +0 -32
@@ -990,7 +990,8 @@ module Addressable
990
990
  end
991
991
  if ![String, ::Addressable::URI].include?(returning)
992
992
  raise TypeError,
993
- "Expected String or Addressable::URI, got #{returning.inspect}"
993
+ "Expected Class (String or Addressable::URI), " +
994
+ "got #{returning.inspect}"
994
995
  end
995
996
  result = uri.to_str.gsub(/%[0-9a-f]{2}/i) do |sequence|
996
997
  sequence[1..3].to_i(16).chr
@@ -1030,7 +1031,8 @@ module Addressable
1030
1031
  end
1031
1032
  if ![String, ::Addressable::URI].include?(returning)
1032
1033
  raise TypeError,
1033
- "Expected String or Addressable::URI, got #{returning.inspect}"
1034
+ "Expected Class (String or Addressable::URI), " +
1035
+ "got #{returning.inspect}"
1034
1036
  end
1035
1037
  uri_object = uri.kind_of?(self) ? uri : self.parse(uri.to_str)
1036
1038
  encoded_uri = Addressable::URI.new(
@@ -1077,7 +1079,8 @@ module Addressable
1077
1079
  end
1078
1080
  if ![String, ::Addressable::URI].include?(returning)
1079
1081
  raise TypeError,
1080
- "Expected String or Addressable::URI, got #{returning.inspect}"
1082
+ "Expected Class (String or Addressable::URI), " +
1083
+ "got #{returning.inspect}"
1081
1084
  end
1082
1085
  uri_object = uri.kind_of?(self) ? uri : self.parse(uri.to_str)
1083
1086
  components = {
@@ -1099,9 +1102,9 @@ module Addressable
1099
1102
  :scheme => self.encode_component(components[:scheme],
1100
1103
  Addressable::URI::CharacterClasses::SCHEME),
1101
1104
  :user => self.encode_component(components[:user],
1102
- Addressable::URI::CharacterClasses::AUTHORITY),
1105
+ Addressable::URI::CharacterClasses::UNRESERVED),
1103
1106
  :password => self.encode_component(components[:password],
1104
- Addressable::URI::CharacterClasses::AUTHORITY),
1107
+ Addressable::URI::CharacterClasses::UNRESERVED),
1105
1108
  :host => components[:host],
1106
1109
  :port => components[:port],
1107
1110
  :path => self.encode_component(components[:path],
@@ -1245,7 +1248,12 @@ module Addressable
1245
1248
  if self.scheme =~ /^\s*ssh\+svn\s*$/i
1246
1249
  "svn+ssh"
1247
1250
  else
1248
- self.scheme.strip.downcase
1251
+ Addressable::URI.encode_component(
1252
+ Addressable::IDNA.unicode_normalize_kc(
1253
+ Addressable::URI.unencode_component(
1254
+ self.scheme.strip.downcase)),
1255
+ Addressable::URI::CharacterClasses::SCHEME
1256
+ )
1249
1257
  end
1250
1258
  else
1251
1259
  nil
@@ -1284,7 +1292,11 @@ module Addressable
1284
1292
  (!self.password || self.password.strip == "")
1285
1293
  nil
1286
1294
  else
1287
- self.user.strip
1295
+ Addressable::URI.encode_component(
1296
+ Addressable::IDNA.unicode_normalize_kc(
1297
+ Addressable::URI.unencode_component(self.user.strip)),
1298
+ Addressable::URI::CharacterClasses::UNRESERVED
1299
+ )
1288
1300
  end
1289
1301
  else
1290
1302
  nil
@@ -1333,7 +1345,11 @@ module Addressable
1333
1345
  (!self.user || self.user.strip == "")
1334
1346
  nil
1335
1347
  else
1336
- self.password.strip
1348
+ Addressable::URI.encode_component(
1349
+ Addressable::IDNA.unicode_normalize_kc(
1350
+ Addressable::URI.unencode_component(self.password.strip)),
1351
+ Addressable::URI::CharacterClasses::UNRESERVED
1352
+ )
1337
1353
  end
1338
1354
  else
1339
1355
  nil
@@ -1608,6 +1624,9 @@ module Addressable
1608
1624
  #
1609
1625
  # @param [String, Integer, #to_s] new_port The new port component.
1610
1626
  def port=(new_port)
1627
+ if new_port != nil && new_port.respond_to?(:to_str)
1628
+ new_port = Addressable::URI.unencode_component(new_port.to_str)
1629
+ end
1611
1630
  if new_port != nil && !(new_port.to_s =~ /^\d+$/)
1612
1631
  raise InvalidURIError,
1613
1632
  "Invalid port number: #{new_port.inspect}"
@@ -1659,7 +1678,12 @@ module Addressable
1659
1678
  # @return [String] The path component, normalized.
1660
1679
  def normalized_path
1661
1680
  @normalized_path ||= (begin
1662
- result = self.class.normalize_path(self.path.strip)
1681
+ result = Addressable::URI.encode_component(
1682
+ Addressable::IDNA.unicode_normalize_kc(
1683
+ Addressable::URI.unencode_component(self.path.strip)),
1684
+ Addressable::URI::CharacterClasses::PATH
1685
+ )
1686
+ result = self.class.normalize_path(result)
1663
1687
  if result == "" &&
1664
1688
  ["http", "https", "ftp", "tftp"].include?(self.normalized_scheme)
1665
1689
  result = "/"
@@ -1714,7 +1738,17 @@ module Addressable
1714
1738
  #
1715
1739
  # @return [String] The query component, normalized.
1716
1740
  def normalized_query
1717
- @normalized_query ||= (self.query ? self.query.strip : nil)
1741
+ @normalized_query ||= (begin
1742
+ if self.query
1743
+ Addressable::URI.encode_component(
1744
+ Addressable::IDNA.unicode_normalize_kc(
1745
+ Addressable::URI.unencode_component(self.query.strip)),
1746
+ Addressable::URI::CharacterClasses::QUERY
1747
+ )
1748
+ else
1749
+ nil
1750
+ end
1751
+ end)
1718
1752
  end
1719
1753
 
1720
1754
  ##
@@ -1722,7 +1756,7 @@ module Addressable
1722
1756
  #
1723
1757
  # @param [String, #to_str] new_query The new query component.
1724
1758
  def query=(new_query)
1725
- @query = new_query.to_str
1759
+ @query = new_query ? new_query.to_str : nil
1726
1760
 
1727
1761
  # Reset dependant values
1728
1762
  @normalized_query = nil
@@ -1840,7 +1874,17 @@ module Addressable
1840
1874
  #
1841
1875
  # @return [String] The fragment component, normalized.
1842
1876
  def normalized_fragment
1843
- @normalized_fragment ||= (self.fragment ? self.fragment.strip : nil)
1877
+ @normalized_fragment ||= (begin
1878
+ if self.fragment
1879
+ Addressable::URI.encode_component(
1880
+ Addressable::IDNA.unicode_normalize_kc(
1881
+ Addressable::URI.unencode_component(self.fragment.strip)),
1882
+ Addressable::URI::CharacterClasses::FRAGMENT
1883
+ )
1884
+ else
1885
+ nil
1886
+ end
1887
+ end)
1844
1888
  end
1845
1889
 
1846
1890
  ##
@@ -2171,15 +2215,12 @@ module Addressable
2171
2215
  end
2172
2216
  end
2173
2217
 
2174
- return Addressable::URI.normalized_encode(
2175
- Addressable::URI.new(
2176
- :scheme => normalized_scheme,
2177
- :authority => normalized_authority,
2178
- :path => normalized_path,
2179
- :query => normalized_query,
2180
- :fragment => normalized_fragment
2181
- ),
2182
- ::Addressable::URI
2218
+ return Addressable::URI.new(
2219
+ :scheme => normalized_scheme,
2220
+ :authority => normalized_authority,
2221
+ :path => normalized_path,
2222
+ :query => normalized_query,
2223
+ :fragment => normalized_fragment
2183
2224
  )
2184
2225
  end
2185
2226
 
@@ -27,7 +27,7 @@ if !defined?(Addressable::VERSION)
27
27
  module VERSION #:nodoc:
28
28
  MAJOR = 2
29
29
  MINOR = 0
30
- TINY = 0
30
+ TINY = 1
31
31
 
32
32
  STRING = [MAJOR, MINOR, TINY].join('.')
33
33
  end
@@ -0,0 +1,2 @@
1
+ desc "Remove all build products"
2
+ task "clobber"
@@ -0,0 +1,68 @@
1
+ require "rake/gempackagetask"
2
+
3
+ namespace :gem do
4
+ GEM_SPEC = Gem::Specification.new do |s|
5
+ s.name = PKG_NAME
6
+ s.version = PKG_VERSION
7
+ s.summary = PKG_SUMMARY
8
+ s.description = PKG_DESCRIPTION
9
+
10
+ s.files = PKG_FILES.to_a
11
+
12
+ s.has_rdoc = true
13
+ s.extra_rdoc_files = %w( README )
14
+ s.rdoc_options.concat ["--main", "README"]
15
+
16
+ if !s.respond_to?(:add_development_dependency)
17
+ puts "Cannot build Gem with this version of RubyGems."
18
+ exit(1)
19
+ end
20
+
21
+ s.add_development_dependency("rake", ">= 0.7.3")
22
+ s.add_development_dependency("rspec", ">= 1.0.8")
23
+ s.add_development_dependency("launchy", ">= 0.3.2")
24
+
25
+ s.require_path = "lib"
26
+
27
+ s.author = "Bob Aman"
28
+ s.email = "bob@sporkmonger.com"
29
+ s.homepage = RUBY_FORGE_URL
30
+ s.rubyforge_project = RUBY_FORGE_PROJECT
31
+ end
32
+
33
+ Rake::GemPackageTask.new(GEM_SPEC) do |p|
34
+ p.gem_spec = GEM_SPEC
35
+ p.need_tar = true
36
+ p.need_zip = true
37
+ end
38
+
39
+ desc "Show information about the gem"
40
+ task :debug do
41
+ puts GEM_SPEC.to_ruby
42
+ end
43
+
44
+ desc "Install the gem"
45
+ task :install => ["clobber", "gem:package"] do
46
+ sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}"
47
+ end
48
+
49
+ desc "Uninstall the gem"
50
+ task :uninstall do
51
+ installed_list = Gem.source_index.find_name(PKG_NAME)
52
+ if installed_list &&
53
+ (installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
54
+ sh(
55
+ "#{SUDO} gem uninstall --version '#{PKG_VERSION}' " +
56
+ "--ignore-dependencies --executables #{PKG_NAME}"
57
+ )
58
+ end
59
+ end
60
+
61
+ desc "Reinstall the gem"
62
+ task :reinstall => [:uninstall, :install]
63
+ end
64
+
65
+ desc "Alias to gem:package"
66
+ task "gem" => "gem:package"
67
+
68
+ task "clobber" => ["gem:clobber_package"]
@@ -0,0 +1,40 @@
1
+ namespace :git do
2
+ namespace :tag do
3
+ desc "List tags from the Git repository"
4
+ task :list do
5
+ tags = `git tag -l`
6
+ tags.gsub!("\r", "")
7
+ tags = tags.split("\n").sort {|a, b| b <=> a }
8
+ puts tags.join("\n")
9
+ end
10
+
11
+ desc "Create a new tag in the Git repository"
12
+ task :create do
13
+ changelog = File.open("CHANGELOG", "r") { |file| file.read }
14
+ puts "-" * 80
15
+ puts changelog
16
+ puts "-" * 80
17
+ puts
18
+
19
+ v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
20
+ abort "Versions don't match #{v} vs #{PKG_VERSION}" if v != PKG_VERSION
21
+
22
+ tag = "#{PKG_NAME}-#{PKG_VERSION}"
23
+ msg = "Release #{PKG_NAME}-#{PKG_VERSION}"
24
+
25
+ existing_tags = `git tag -l instrument-*`.split("\n")
26
+ if existing_tags.include?(tag)
27
+ warn("Tag already exists, deleting...")
28
+ unless system "git tag -d #{tag}"
29
+ abort "Tag deletion failed."
30
+ end
31
+ end
32
+ puts "Creating git tag '#{tag}'..."
33
+ unless system "git tag -a -m \"#{msg}\" #{tag}"
34
+ abort "Tag creation failed."
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ task "gem:release" => "git:tag:create"
@@ -0,0 +1,22 @@
1
+ namespace :metrics do
2
+ task :lines do
3
+ lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
4
+ for file_name in FileList["lib/**/*.rb"]
5
+ f = File.open(file_name)
6
+ while line = f.gets
7
+ lines += 1
8
+ next if line =~ /^\s*$/
9
+ next if line =~ /^\s*#/
10
+ codelines += 1
11
+ end
12
+ puts "L: #{sprintf("%4d", lines)}, " +
13
+ "LOC #{sprintf("%4d", codelines)} | #{file_name}"
14
+ total_lines += lines
15
+ total_codelines += codelines
16
+
17
+ lines, codelines = 0, 0
18
+ end
19
+
20
+ puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
21
+ end
22
+ end
@@ -0,0 +1,29 @@
1
+ require "rake/rdoctask"
2
+
3
+ namespace :doc do
4
+ desc "Generate RDoc documentation"
5
+ Rake::RDocTask.new do |rdoc|
6
+ rdoc.rdoc_dir = "doc"
7
+ rdoc.title = "#{PKG_NAME}-#{PKG_VERSION} Documentation"
8
+ rdoc.options << "--line-numbers" << "--inline-source" <<
9
+ "--accessor" << "cattr_accessor=object" << "--charset" << "utf-8"
10
+ rdoc.template = "#{ENV["template"]}.rb" if ENV["template"]
11
+ rdoc.rdoc_files.include("README", "CHANGELOG", "LICENSE")
12
+ rdoc.rdoc_files.include("lib/**/*.rb")
13
+ end
14
+
15
+ desc "Generate ri locally for testing"
16
+ task :ri do
17
+ sh "rdoc --ri -o ri ."
18
+ end
19
+
20
+ desc "Remove ri products"
21
+ task :clobber_ri do
22
+ rm_r "ri" rescue nil
23
+ end
24
+ end
25
+
26
+ desc "Alias to doc:rdoc"
27
+ task "doc" => "doc:rdoc"
28
+
29
+ task "clobber" => ["doc:clobber_rdoc", "doc:clobber_ri"]
@@ -0,0 +1,89 @@
1
+ namespace :gem do
2
+ desc 'Package and upload to RubyForge'
3
+ task :release => ["gem:package"] do |t|
4
+ require 'rubyforge'
5
+
6
+ v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
7
+ abort "Versions don't match #{v} vs #{PROJ.version}" if v != PKG_VERSION
8
+ pkg = "pkg/#{GEM_SPEC.full_name}"
9
+
10
+ rf = RubyForge.new
11
+ rf.configure
12
+ puts 'Logging in...'
13
+ rf.login
14
+
15
+ c = rf.userconfig
16
+ changelog = File.open("CHANGELOG") { |file| file.read }
17
+ c['release_changes'] = changelog
18
+ c['preformatted'] = true
19
+
20
+ files = ["#{pkg}.tgz", "#{pkg}.zip", "#{pkg}.gem"]
21
+
22
+ puts "Releasing #{PKG_NAME} v. #{PKG_VERSION}"
23
+ rf.add_release RUBY_FORGE_PROJECT, PKG_NAME, PKG_VERSION, *files
24
+ end
25
+ end
26
+
27
+ namespace :doc do
28
+ desc "Publish RDoc to RubyForge"
29
+ task :release => ["doc:rdoc"] do
30
+ require "rake/contrib/sshpublisher"
31
+ require "yaml"
32
+
33
+ config = YAML.load(
34
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
35
+ )
36
+ host = "#{config['username']}@rubyforge.org"
37
+ remote_dir = RUBY_FORGE_PATH + "/api"
38
+ local_dir = "doc"
39
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
40
+ end
41
+ end
42
+
43
+ namespace :spec do
44
+ desc "Publish specdoc to RubyForge"
45
+ task :release => ["spec:specdoc"] do
46
+ require "rake/contrib/sshpublisher"
47
+ require "yaml"
48
+
49
+ config = YAML.load(
50
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
51
+ )
52
+ host = "#{config['username']}@rubyforge.org"
53
+ remote_dir = RUBY_FORGE_PATH + "/specdoc"
54
+ local_dir = "specdoc"
55
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
56
+ end
57
+
58
+ namespace :rcov do
59
+ desc "Publish coverage report to RubyForge"
60
+ task :release => ["spec:rcov"] do
61
+ require "rake/contrib/sshpublisher"
62
+ require "yaml"
63
+
64
+ config = YAML.load(
65
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
66
+ )
67
+ host = "#{config['username']}@rubyforge.org"
68
+ remote_dir = RUBY_FORGE_PATH + "/coverage"
69
+ local_dir = "coverage"
70
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
71
+ end
72
+ end
73
+ end
74
+
75
+ namespace :website do
76
+ desc "Publish website to RubyForge"
77
+ task :release => ["doc:release", "spec:release", "spec:rcov:release"] do
78
+ require "rake/contrib/sshpublisher"
79
+ require "yaml"
80
+
81
+ config = YAML.load(
82
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
83
+ )
84
+ host = "#{config['username']}@rubyforge.org"
85
+ remote_dir = RUBY_FORGE_PATH
86
+ local_dir = "website"
87
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
88
+ end
89
+ end
@@ -0,0 +1,64 @@
1
+ require 'spec/rake/verify_rcov'
2
+
3
+ namespace :spec do
4
+ Spec::Rake::SpecTask.new(:rcov) do |t|
5
+ t.spec_files = FileList['spec/**/*_spec.rb']
6
+ t.spec_opts = ['--color', '--format', 'specdoc']
7
+ if RCOV_ENABLED
8
+ t.rcov = true
9
+ else
10
+ t.rcov = false
11
+ end
12
+ t.rcov_opts = [
13
+ '--exclude', 'spec',
14
+ '--exclude', '1\\.8\\/gems',
15
+ '--exclude', '1\\.9\\/gems',
16
+ '--exclude', 'addressable\\/idna\\.rb', # unicode tables too big
17
+ ]
18
+ end
19
+
20
+ Spec::Rake::SpecTask.new(:normal) do |t|
21
+ t.spec_files = FileList['spec/**/*_spec.rb']
22
+ t.spec_opts = ['--color', '--format', 'specdoc']
23
+ t.rcov = false
24
+ end
25
+
26
+ if RCOV_ENABLED
27
+ RCov::VerifyTask.new(:verify) do |t|
28
+ t.threshold = 100.0
29
+ t.index_html = 'coverage/index.html'
30
+ end
31
+
32
+ task :verify => :rcov
33
+ end
34
+
35
+ desc "Generate HTML Specdocs for all specs"
36
+ Spec::Rake::SpecTask.new(:specdoc) do |t|
37
+ specdoc_path = File.expand_path(
38
+ File.join(File.dirname(__FILE__), '../specdoc/'))
39
+ Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
40
+
41
+ output_file = File.join(specdoc_path, 'index.html')
42
+ t.spec_files = FileList['spec/**/*_spec.rb']
43
+ t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
44
+ t.fail_on_error = false
45
+ end
46
+
47
+ namespace :rcov do
48
+ desc "Browse the code coverage report."
49
+ task :browse => "spec:rcov" do
50
+ require "launchy"
51
+ Launchy::Browser.run("coverage/index.html")
52
+ end
53
+ end
54
+ end
55
+
56
+ if RCOV_ENABLED
57
+ desc "Alias to spec:verify"
58
+ task "spec" => "spec:verify"
59
+ else
60
+ desc "Alias to spec:normal"
61
+ task "spec" => "spec:normal"
62
+ end
63
+
64
+ task "clobber" => ["spec:clobber_rcov"]