roxml 2.5.3 → 3.1.0

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.
Files changed (76) hide show
  1. data/.gitignore +7 -0
  2. data/.gitmodules +3 -0
  3. data/History.txt +38 -1
  4. data/README.rdoc +8 -5
  5. data/Rakefile +35 -36
  6. data/TODO +12 -35
  7. data/VERSION +1 -0
  8. data/examples/amazon.rb +8 -6
  9. data/examples/posts.rb +1 -1
  10. data/examples/{active_record.rb → rails.rb} +2 -2
  11. data/examples/twitter.rb +1 -1
  12. data/lib/roxml.rb +86 -151
  13. data/lib/roxml/definition.rb +64 -152
  14. data/lib/roxml/hash_definition.rb +5 -40
  15. data/lib/roxml/xml.rb +12 -9
  16. data/lib/roxml/xml/parsers/libxml.rb +22 -17
  17. data/lib/roxml/xml/parsers/nokogiri.rb +77 -0
  18. data/lib/roxml/xml/references.rb +66 -57
  19. data/roxml.gemspec +170 -19
  20. data/spec/definition_spec.rb +121 -198
  21. data/spec/examples/active_record_spec.rb +2 -2
  22. data/spec/examples/amazon_spec.rb +3 -2
  23. data/spec/examples/current_weather_spec.rb +2 -2
  24. data/spec/examples/dashed_elements_spec.rb +2 -2
  25. data/spec/examples/library_spec.rb +11 -6
  26. data/spec/examples/post_spec.rb +3 -3
  27. data/spec/examples/twitter_spec.rb +2 -2
  28. data/spec/roxml_spec.rb +15 -15
  29. data/spec/shared_specs.rb +1 -1
  30. data/spec/spec_helper.rb +8 -27
  31. data/spec/support/libxml.rb +3 -0
  32. data/spec/support/nokogiri.rb +3 -0
  33. data/spec/xml/attributes_spec.rb +36 -0
  34. data/spec/xml/namespace_spec.rb +240 -0
  35. data/spec/xml/namespaces_spec.rb +32 -0
  36. data/spec/xml/parser_spec.rb +9 -30
  37. data/tasks/rdoc.rake +13 -0
  38. data/tasks/rspec.rake +21 -17
  39. data/tasks/test.rake +13 -20
  40. data/test/mocks/dictionaries.rb +8 -7
  41. data/test/mocks/mocks.rb +20 -20
  42. data/test/support/fixtures.rb +11 -0
  43. data/test/test_helper.rb +3 -14
  44. data/test/unit/definition_test.rb +21 -95
  45. data/test/unit/deprecations_test.rb +1 -74
  46. data/test/unit/to_xml_test.rb +3 -3
  47. data/test/unit/xml_attribute_test.rb +1 -1
  48. data/test/unit/xml_block_test.rb +3 -3
  49. data/test/unit/xml_bool_test.rb +4 -4
  50. data/test/unit/xml_convention_test.rb +3 -3
  51. data/test/unit/xml_hash_test.rb +5 -14
  52. data/test/unit/xml_initialize_test.rb +2 -6
  53. data/test/unit/xml_name_test.rb +5 -24
  54. data/test/unit/xml_namespace_test.rb +1 -46
  55. data/test/unit/xml_object_test.rb +6 -6
  56. data/test/unit/xml_required_test.rb +3 -2
  57. data/test/unit/xml_text_test.rb +2 -2
  58. data/website/index.html +1 -1
  59. metadata +68 -51
  60. data/Manifest.txt +0 -106
  61. data/lib/roxml/extensions.rb +0 -6
  62. data/lib/roxml/extensions/array.rb +0 -13
  63. data/lib/roxml/extensions/array/conversions.rb +0 -35
  64. data/lib/roxml/extensions/deprecation.rb +0 -33
  65. data/lib/roxml/extensions/string.rb +0 -21
  66. data/lib/roxml/extensions/string/conversions.rb +0 -43
  67. data/lib/roxml/extensions/string/iterators.rb +0 -12
  68. data/lib/roxml/xml/parsers/rexml.rb +0 -84
  69. data/spec/string_spec.rb +0 -15
  70. data/test/bugs/rexml_bugs.rb +0 -15
  71. data/test/release/dependencies_test.rb +0 -32
  72. data/test/unit/xml_construct_test.rb +0 -77
  73. data/vendor/override_rake_task/README +0 -30
  74. data/vendor/override_rake_task/init.rb +0 -1
  75. data/vendor/override_rake_task/install.rb +0 -46
  76. data/vendor/override_rake_task/lib/override_rake_task.rb +0 -16
@@ -1,30 +0,0 @@
1
- OverrideRakeTask plugin by Eugene Bolshakov, eugene.bolshakov@gmail.com, http://www.taknado.com
2
-
3
- This plugin is based on the Matthew Bass's idea described here:
4
- http://matthewbass.com/2007/03/07/overriding-existing-rake-tasks/
5
-
6
- The installation script is based on the one found in the app_config plugin
7
- by Daniel Owsianski, http://jarmark.org/projects/app-config/
8
-
9
- When using rake with rails it loads the task in the following order:
10
-
11
- 1. Default rails tasks (like db:migrate)
12
- 2. The tasks in your app's lib/tasks directory
13
- 3. The tasks in your vendor/plugins directory
14
-
15
- This plugin will allow to override rake tasks that were defined earlier. It means that
16
- you'll be able to override default rails tasks with lib/tasks & plugins tasks and
17
- override the taksks in lib/tasks with the tasks defined in plugins.
18
-
19
- In order to override a task you need to define it as usual, but using "override_task"
20
- method instead of "task":
21
-
22
- namespace :db do
23
- override_task :migrate do
24
- ...
25
- end
26
- end
27
-
28
- In order to make this work the plugin should be loaded before the tasks and the install script
29
- supplied with the plugin adds a line to load itself to the Rakefile. If it won't be able to
30
- modify your Rakefile, it will let you know and you'll have to modify it manually.
@@ -1 +0,0 @@
1
- # Include hook code here
@@ -1,46 +0,0 @@
1
- # Insert line: [require "#{RAILS_ROOT}/vendor/plugins/override_rake_task/lib/override_rake_task.rb"]
2
- # before "require 'rake'" in Rakefile
3
- # stolen from app_confing plugin :) http://jarmark.org/projects/app-config/
4
-
5
- file = File.join(File.dirname(__FILE__), '../../../Rakefile')
6
- unless File.exists?(file)
7
- STDERR.puts("ERROR: Could not locate Rakefile")
8
- exit(1)
9
- end
10
-
11
- # Tip from http://pleac.sourceforge.net/pleac_ruby/fileaccess.html
12
- # 'Modifying a File in Place Without a Temporary File'
13
- output= ""
14
- inserted = false
15
- line_to_insert = %q{require "#{RAILS_ROOT}/vendor/plugins/override_rake_task/lib/override_rake_task.rb"}
16
- line_to_find = "require 'rake'"
17
-
18
- File.open(file, 'r+') do |f| # open file for update
19
- # read into array of lines and iterate through lines
20
- f.readlines.each do |line|
21
- unless inserted
22
- if line.gsub(/#.*/, '').include?(line_to_insert)
23
- inserted = true
24
- elsif line.gsub(/#.*/, '').include?(line_to_find)
25
- output << line_to_insert
26
- output << "\n\n"
27
- inserted = true
28
- end
29
- end
30
- output << line
31
- end
32
- f.pos = 0 # back to start
33
- f.print output # write out modified lines
34
- f.truncate(f.pos) # truncate to new length
35
- end
36
-
37
- unless inserted
38
- STDERR.puts <<END
39
- ERROR: Could not update Rakefile
40
- To finish installation please add the following line to
41
- Rakefile manually:
42
- \t#{line_to_insert}
43
- NOTE: line must be inserted before #{line_to_find}
44
- END
45
- exit(1)
46
- end
@@ -1,16 +0,0 @@
1
- # OverrideRakeTask
2
- Rake::TaskManager.class_eval do
3
- def remove_task(task_name)
4
- @tasks.delete(task_name.to_s)
5
- end
6
- end
7
-
8
- def remove_task(task_name)
9
- Rake.application.remove_task(task_name)
10
- end
11
-
12
- def override_task(*args, &block)
13
- name, params, deps = Rake.application.resolve_args(args)
14
- remove_task Rake.application[name].name
15
- Rake::Task.define_task({name => deps}, &block)
16
- end