smg 0.2.1 → 0.2.2

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 (42) hide show
  1. data/README.rdoc +1 -1
  2. data/lib/smg/http.rb +23 -24
  3. data/lib/smg/http/exceptions.rb +5 -9
  4. data/lib/smg/http/hooks.rb +43 -0
  5. data/lib/smg/http/request.rb +23 -2
  6. data/lib/smg/mapping.rb +1 -3
  7. data/lib/smg/mapping/element.rb +1 -5
  8. data/lib/smg/mapping/typecasts.rb +1 -1
  9. data/lib/smg/model.rb +4 -4
  10. data/lib/smg/version.rb +1 -1
  11. metadata +32 -37
  12. data/examples/crazy.rb +0 -37
  13. data/examples/discogs/label.rb +0 -62
  14. data/examples/discogs/search.rb +0 -60
  15. data/examples/helper.rb +0 -10
  16. data/examples/plant.rb +0 -88
  17. data/examples/twitter.rb +0 -38
  18. data/examples/weather.rb +0 -147
  19. data/spec/collect_spec.rb +0 -272
  20. data/spec/context_spec.rb +0 -189
  21. data/spec/extract_spec.rb +0 -219
  22. data/spec/filtering_spec.rb +0 -164
  23. data/spec/fixtures/discogs/948224.xml +0 -1
  24. data/spec/fixtures/discogs/Enzyme+Records.xml +0 -9
  25. data/spec/fixtures/discogs/Genosha+Recordings.xml +0 -13
  26. data/spec/fixtures/discogs/Ophidian.xml +0 -6
  27. data/spec/fixtures/fake/malus.xml +0 -18
  28. data/spec/fixtures/fake/valve.xml +0 -8
  29. data/spec/fixtures/twitter/pipopolam.xml +0 -46
  30. data/spec/fixtures/yahoo.weather.com.xml +0 -50
  31. data/spec/http/request_spec.rb +0 -186
  32. data/spec/http/shared/automatic.rb +0 -43
  33. data/spec/http/shared/non_automatic.rb +0 -36
  34. data/spec/http/shared/redirectable.rb +0 -30
  35. data/spec/http_spec.rb +0 -76
  36. data/spec/lib/helpers/http_helpers.rb +0 -27
  37. data/spec/lib/matchers/instance_methods.rb +0 -38
  38. data/spec/mapping/element_spec.rb +0 -241
  39. data/spec/mapping/typecasts_spec.rb +0 -52
  40. data/spec/resource_spec.rb +0 -30
  41. data/spec/root_spec.rb +0 -26
  42. data/spec/spec_helper.rb +0 -23
@@ -1,26 +0,0 @@
1
- require File.expand_path File.join(File.dirname(__FILE__), 'spec_helper')
2
-
3
- describe SMG::Model, ".root" do
4
-
5
- before :each do
6
- @klass = Class.new { include SMG::Resource }
7
- end
8
-
9
- it "defines the root tag for further mapping" do
10
- @klass.root 'foo'
11
- @klass.extract 'a'
12
- @klass.mapping.elements.should have_key ['foo','a']
13
- end
14
-
15
- it "could be redefined on-the-fly" do
16
- @klass.root 'foo'
17
- @klass.extract 'a'
18
- @klass.root 'bar'
19
- @klass.extract 'b'
20
- @klass.mapping.elements.should have_key ['foo','a']
21
- @klass.mapping.elements.should have_key ['bar','b']
22
- end
23
-
24
- end
25
-
26
- # EOF
@@ -1,23 +0,0 @@
1
- require 'pathname'
2
- require 'rubygems'
3
-
4
- begin
5
-
6
- gem 'rspec', '>=1.2'
7
- require 'spec'
8
-
9
- SPEC_ROOT = Pathname(__FILE__).dirname.expand_path
10
-
11
- require SPEC_ROOT + 'lib/matchers/instance_methods'
12
- require SPEC_ROOT + 'lib/helpers/http_helpers'
13
-
14
- FIXTURES_DIR = SPEC_ROOT + 'fixtures'
15
-
16
- dir = SPEC_ROOT.parent.join('lib').to_s
17
- $:.unshift(dir) unless $:.include?(dir)
18
- require 'smg'
19
-
20
- rescue LoadError
21
- end
22
-
23
- # EOF