public
Rubygem
Description: Makes http fun! Also, makes consuming restful web services dead easy.
Homepage:
Clone URL: git://github.com/jnunemaker/httparty.git
Click here to lend your support to: httparty and make a donation at www.pledgie.com !
Prepped for 0.2.5 release.
jnunemaker (author)
Sun Jan 04 22:46:36 -0800 2009
commit  78f0c846d89ab53c3730b059aa75ae1ea53abb2b
tree    c75b0a088905b8c76e73d610fdf6461c1d058714
parent  5615a4ba05e2d3b702faff84ad8b6f8d4323771d
...
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
0
@@ -1,3 +1,7 @@
0
+== 0.2.5 2009-01-05
0
+* 1 major enhancement
0
+  * Add command line interface to HTTParty (Alex Vollmer)
0
+  
0
 == 0.2.4 2008-12-23
0
 * 1 bug fix
0
   * Fixed that mimetype detection was failing if no mimetype was returned from service (skippy)
...
59
60
61
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
64
65
66
67
68
69
70
 
71
72
 
 
73
74
75
...
59
60
61
 
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 
86
87
88
89
 
90
91
 
92
93
94
95
96
0
@@ -59,17 +59,38 @@ if ARGV.empty?
0
   STDERR.puts "USAGE: #{$0} [options] [url]"
0
 end
0
 
0
-response = HTTParty.send(opts[:action], ARGV.first, opts)
0
+# 1.8.6 has mistyping of transitive in if statement
0
+module REXML
0
+  class Document < Element
0
+    def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
0
+      if xml_decl.encoding != "UTF-8" && !output.kind_of?(Output)
0
+        output = Output.new( output, xml_decl.encoding )
0
+      end
0
+      formatter = if indent > -1
0
+          if transitive
0
+            REXML::Formatters::Transitive.new( indent, ie_hack )
0
+          else
0
+            REXML::Formatters::Pretty.new( indent, ie_hack )
0
+          end
0
+        else
0
+          REXML::Formatters::Default.new( ie_hack )
0
+        end
0
+      formatter.write( self, output )
0
+    end
0
+  end
0
+end
0
+
0
+response = HTTParty.send(opts[:action], ARGV.first, opts.merge(:format => :plain))
0
 
0
 if opts[:pretty_print]
0
-  response.delete('_body')
0
   pp response
0
 else
0
   case opts[:format]
0
   when :json
0
-    puts JSON.pretty_generate(response['_body'])
0
+    puts JSON.pretty_generate(JSON.parse(response))
0
   when :xml
0
-    REXML::Document.new(response['_body']).write(STDOUT, 2)
0
+    REXML::Document.new(response).write(STDOUT, 2)
0
+    puts
0
   else
0
     puts response
0
   end
...
 
 
1
2
3
 
4
5
6
7
 
 
8
9
10
11
 
 
 
12
13
14
...
1
2
3
4
 
5
6
7
8
 
9
10
11
12
 
 
13
14
15
16
17
18
0
@@ -1,14 +1,18 @@
0
+# -*- encoding: utf-8 -*-
0
+
0
 Gem::Specification.new do |s|
0
   s.name = %q{httparty}
0
-  s.version = "0.2.4"
0
+  s.version = "0.2.5"
0
 
0
   s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
0
   s.authors = ["John Nunemaker"]
0
-  s.date = %q{2008-12-23}
0
+  s.date = %q{2009-01-05}
0
+  s.default_executable = %q{httparty}
0
   s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
0
   s.email = %q{nunemaker@gmail.com}
0
-  s.extra_rdoc_files = ["lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "README"]
0
-  s.files = ["examples/aaws.rb", "examples/basic.rb", "examples/delicious.rb", "examples/google.rb", "examples/rubyurl.rb", "examples/twitter.rb", "examples/whoismyrep.rb", "History", "httparty.gemspec", "lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README", "setup.rb", "spec/as_buggery_spec.rb", "spec/fixtures/delicious.xml", "spec/fixtures/google.html", "spec/fixtures/twitter.json", "spec/fixtures/twitter.xml", "spec/httparty/request_spec.rb", "spec/httparty_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "website/css/common.css", "website/index.html"]
0
+  s.executables = ["httparty"]
0
+  s.extra_rdoc_files = ["bin/httparty", "lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "README"]
0
+  s.files = ["bin/httparty", "examples/aaws.rb", "examples/basic.rb", "examples/delicious.rb", "examples/google.rb", "examples/rubyurl.rb", "examples/twitter.rb", "examples/whoismyrep.rb", "History", "httparty.gemspec", "lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README", "setup.rb", "spec/as_buggery_spec.rb", "spec/fixtures/delicious.xml", "spec/fixtures/google.html", "spec/fixtures/twitter.json", "spec/fixtures/twitter.xml", "spec/httparty/request_spec.rb", "spec/httparty_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "website/css/common.css", "website/index.html"]
0
   s.has_rdoc = true
0
   s.homepage = %q{http://httparty.rubyforge.org}
0
   s.post_install_message = %q{When you HTTParty, you must party hard!}
...
1
2
 
3
...
1
 
2
3
0
@@ -1,3 +1,3 @@
0
 module HTTParty
0
-  Version = '0.2.4'
0
+  Version = '0.2.5'
0
 end

Comments