mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Prepped for 0.2.5 release.
This commit is contained in:
parent
5615a4ba05
commit
78f0c846d8
4 changed files with 38 additions and 9 deletions
4
History
4
History
|
@ -1,3 +1,7 @@
|
|||
== 0.2.5 2009-01-05
|
||||
* 1 major enhancement
|
||||
* Add command line interface to HTTParty (Alex Vollmer)
|
||||
|
||||
== 0.2.4 2008-12-23
|
||||
* 1 bug fix
|
||||
* Fixed that mimetype detection was failing if no mimetype was returned from service (skippy)
|
||||
|
|
29
bin/httparty
29
bin/httparty
|
@ -59,17 +59,38 @@ if ARGV.empty?
|
|||
STDERR.puts "USAGE: #{$0} [options] [url]"
|
||||
end
|
||||
|
||||
response = HTTParty.send(opts[:action], ARGV.first, opts)
|
||||
# 1.8.6 has mistyping of transitive in if statement
|
||||
module REXML
|
||||
class Document < Element
|
||||
def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
|
||||
if xml_decl.encoding != "UTF-8" && !output.kind_of?(Output)
|
||||
output = Output.new( output, xml_decl.encoding )
|
||||
end
|
||||
formatter = if indent > -1
|
||||
if transitive
|
||||
REXML::Formatters::Transitive.new( indent, ie_hack )
|
||||
else
|
||||
REXML::Formatters::Pretty.new( indent, ie_hack )
|
||||
end
|
||||
else
|
||||
REXML::Formatters::Default.new( ie_hack )
|
||||
end
|
||||
formatter.write( self, output )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
response = HTTParty.send(opts[:action], ARGV.first, opts.merge(:format => :plain))
|
||||
|
||||
if opts[:pretty_print]
|
||||
response.delete('_body')
|
||||
pp response
|
||||
else
|
||||
case opts[:format]
|
||||
when :json
|
||||
puts JSON.pretty_generate(response['_body'])
|
||||
puts JSON.pretty_generate(JSON.parse(response))
|
||||
when :xml
|
||||
REXML::Document.new(response['_body']).write(STDOUT, 2)
|
||||
REXML::Document.new(response).write(STDOUT, 2)
|
||||
puts
|
||||
else
|
||||
puts response
|
||||
end
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = %q{httparty}
|
||||
s.version = "0.2.4"
|
||||
s.version = "0.2.5"
|
||||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["John Nunemaker"]
|
||||
s.date = %q{2008-12-23}
|
||||
s.date = %q{2009-01-05}
|
||||
s.default_executable = %q{httparty}
|
||||
s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
|
||||
s.email = %q{nunemaker@gmail.com}
|
||||
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"]
|
||||
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"]
|
||||
s.executables = ["httparty"]
|
||||
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"]
|
||||
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"]
|
||||
s.has_rdoc = true
|
||||
s.homepage = %q{http://httparty.rubyforge.org}
|
||||
s.post_install_message = %q{When you HTTParty, you must party hard!}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module HTTParty
|
||||
Version = '0.2.4'
|
||||
Version = '0.2.5'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue