swivel 0.0.15 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -0
  2. data/lib/swivel.rb +7 -12
  3. metadata +11 -2
data/Rakefile CHANGED
@@ -64,6 +64,7 @@ spec =
64
64
 
65
65
  s.add_dependency 'activesupport'
66
66
  s.add_dependency 'cobravsmongoose'
67
+ s.add_dependency 'json'
67
68
  end
68
69
 
69
70
  Rake::GemPackageTask.new(spec) do |p|
@@ -345,14 +345,6 @@ module Swivel
345
345
  @retried = false
346
346
  self
347
347
  end
348
-
349
- def add_column! data_column
350
- # TODO
351
- end
352
-
353
- def remove_column! data_column
354
- # TODO
355
- end
356
348
  end
357
349
 
358
350
  # Encapsulates lists of resources. Typically, items contained within the list are
@@ -507,7 +499,7 @@ module Swivel
507
499
  # /rest/object_type or /rest/object_type/id
508
500
 
509
501
  def call path, params = Hash.new, method = :get
510
- xml =
502
+ response =
511
503
  Net::HTTP.start @config[:host], @config[:port] do |http|
512
504
  request = "Net::HTTP::#{method.to_s.camelize}".constantize.new path, @headers
513
505
  if [:delete, :post, :put].include? method
@@ -517,11 +509,14 @@ module Swivel
517
509
  http.read_timeout = @config[:timeout_down]
518
510
  http.request request
519
511
  end
520
- end.body
512
+ end
513
+ response.error! if response.code.to_i >= 300
514
+ xml = response.body
521
515
  doc = REXML::Document.new xml
522
516
  Response.class_for(doc.root.elements[1].name).new xml, self
523
517
  rescue Exception => e
524
- xml.blank? ? nil : xml
518
+ raise e
519
+ #xml.blank? ? nil : xml
525
520
  end
526
521
 
527
522
  %w/ data_columns data_sets graphs users /.each do |obj|
@@ -547,7 +542,7 @@ module Swivel
547
542
  DEFAULT_UPLOAD_OPTIONS = {
548
543
  :citation => 'swivel.rb',
549
544
  :citation_url => 'swivel.com/developer',
550
- :image_url => 'http://swivel.com/images/logo.png',
545
+ :image_url => 'http://www.swivel.com/images/logo.png',
551
546
  :image_source_url => 'http://swivel.com',
552
547
  :display_tags => 'swivel api swivel.rb'
553
548
  }
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: swivel
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.15
7
- date: 2007-07-01 00:00:00 -07:00
6
+ version: 0.0.20
7
+ date: 2007-08-08 00:00:00 -07:00
8
8
  summary: Ruby interface to the Swivel API.
9
9
  require_paths:
10
10
  - lib
@@ -73,3 +73,12 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: 0.0.0
75
75
  version:
76
+ - !ruby/object:Gem::Dependency
77
+ name: json
78
+ version_requirement:
79
+ version_requirements: !ruby/object:Gem::Version::Requirement
80
+ requirements:
81
+ - - ">"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.0.0
84
+ version: