mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Adjusted post install. Tweaked example. Created gemspec for github. Uncommented extra dependencies in hoe.
This commit is contained in:
parent
f8ce6cd36e
commit
e221365029
4 changed files with 40 additions and 13 deletions
|
@ -1,7 +1 @@
|
|||
|
||||
For more information on httparty, see http://httparty.rubyforge.org
|
||||
|
||||
NOTE: Change this information in PostInstall.txt
|
||||
You can also delete it if you don't want it.
|
||||
|
||||
|
||||
When you HTTParty, you must party hard!
|
10
README.txt
10
README.txt
|
@ -16,12 +16,12 @@ Makes http fun again!
|
|||
The following is a simple example of wrapping Twitter's API for posting updates.
|
||||
|
||||
class Twitter
|
||||
include HTTParty
|
||||
base_uri 'twitter.com'
|
||||
basic_auth 'username', 'password'
|
||||
include HTTParty
|
||||
base_uri 'twitter.com'
|
||||
basic_auth 'username', 'password'
|
||||
end
|
||||
|
||||
Twitter.post('/statuses/udpate.json', :query => {:status => "It's an HTTParty and everyone is invited!"})
|
||||
|
||||
Twitter.post('/statuses/update.json', :query => {:status => "It's an HTTParty and everyone is invited!"})
|
||||
|
||||
That is really it! The object returned is a ruby hash that is decoded from Twitter's json response. JSON parsing is used because of the .json extension in the path of the request. You can also explicitly set a format (see the examples).
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|||
|
||||
# == Optional
|
||||
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
||||
#p.extra_deps = EXTRA_DEPENDENCIES
|
||||
p.extra_deps = EXTRA_DEPENDENCIES
|
||||
|
||||
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
||||
end
|
||||
|
|
33
httparty.gemspec
Normal file
33
httparty.gemspec
Normal file
|
@ -0,0 +1,33 @@
|
|||
Gem::Specification.new do |s|
|
||||
s.name = %q{httparty}
|
||||
s.version = "0.1.0"
|
||||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["John Nunemaker"]
|
||||
s.date = %q{2008-07-28}
|
||||
s.description = %q{Makes http fun again!}
|
||||
s.email = ["nunemaker@gmail.com"]
|
||||
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt"]
|
||||
s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "examples/aaws.rb", "examples/delicious.rb", "examples/twitter.rb", "lib/httparty.rb", "lib/httparty/core_ext.rb", "lib/httparty/core_ext/hash.rb", "lib/httparty/version.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "spec/hash_spec.rb", "spec/httparty_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake"]
|
||||
s.has_rdoc = true
|
||||
s.homepage = %q{http://httparty.rubyforge.org}
|
||||
s.post_install_message = %q{When you HTTParty, you must party hard!}
|
||||
s.rdoc_options = ["--main", "README.txt"]
|
||||
s.require_paths = ["lib"]
|
||||
s.rubyforge_project = %q{httparty}
|
||||
s.rubygems_version = %q{1.2.0}
|
||||
s.summary = %q{Makes http fun again!}
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
||||
s.specification_version = 2
|
||||
|
||||
if current_version >= 3 then
|
||||
s.add_runtime_dependency(%q<activesupport>, [">= 2.1"])
|
||||
else
|
||||
s.add_dependency(%q<activesupport>, [">= 2.1"])
|
||||
end
|
||||
else
|
||||
s.add_dependency(%q<activesupport>, [">= 2.1"])
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue