typhoeus-simple 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ lib/**/*.rb
2
+ README.rdoc
3
+ ChangeLog.rdoc
4
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
@@ -0,0 +1,4 @@
1
+ === 0.1.0 / 2011-06-01
2
+
3
+ * Initial release:
4
+
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'rake', '~> 0.8.7'
7
+ gem 'ore-tasks', '~> 0.4'
8
+ gem 'rspec', '~> 2.4'
9
+ end
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Ezekiel Templin
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,26 @@
1
+ = typhoeus-simple
2
+
3
+ * {Homepage}[http://rubygems.org/gems/typhoeus-simple]
4
+ * {Documentation}[http://rubydoc.info/gems/typhoeus-simple/frames]
5
+
6
+ == Description
7
+
8
+ TODO: Description
9
+
10
+ == Features
11
+
12
+ == Examples
13
+
14
+ require 'typhoeus/simple'
15
+
16
+ == Requirements
17
+
18
+ == Install
19
+
20
+ $ gem install typhoeus-simple
21
+
22
+ == Copyright
23
+
24
+ Copyright (c) 2011 Ezekiel Templin
25
+
26
+ See LICENSE.txt for details.
@@ -0,0 +1,35 @@
1
+ require 'rubygems'
2
+
3
+ begin
4
+ require 'bundler'
5
+ rescue LoadError => e
6
+ STDERR.puts e.message
7
+ STDERR.puts "Run `gem install bundler` to install Bundler."
8
+ exit e.status_code
9
+ end
10
+
11
+ begin
12
+ Bundler.setup(:development)
13
+ rescue Bundler::BundlerError => e
14
+ STDERR.puts e.message
15
+ STDERR.puts "Run `bundle install` to install missing gems."
16
+ exit e.status_code
17
+ end
18
+
19
+ require 'rake'
20
+
21
+ require 'ore/tasks'
22
+ Ore::Tasks.new
23
+
24
+ require 'rake/rdoctask'
25
+ Rake::RDocTask.new do |rdoc|
26
+ rdoc.title = "typhoeus-simple"
27
+ end
28
+ task :doc => :rdoc
29
+
30
+ require 'rspec/core/rake_task'
31
+ RSpec::Core::RakeTask.new
32
+
33
+ task :test => :spec
34
+ task :default => :spec
35
+
@@ -0,0 +1,14 @@
1
+ name: typhoeus-simple
2
+ summary: "Adds get and get_parsed methods to Kernel for clean code."
3
+ description: "I like the open method provided by open-uri, so I copied it for use with Typhoeus and Nokogiri."
4
+ license: MIT
5
+ authors: Ezekiel Templin
6
+ email: ezkl@me.com
7
+ homepage: http://github.com/ezkl/typhoeus-simple
8
+
9
+ runtime_dependencies:
10
+ typhoeus: ~> 0.2.4
11
+ nokogiri: ~> 1.4.4
12
+
13
+ development_dependencies:
14
+ bundler: ~> 1.0.0
@@ -0,0 +1,14 @@
1
+ require 'typhoeus'
2
+ require 'nokogiri'
3
+
4
+ require 'typhoeus/simple/version'
5
+
6
+ module Kernel
7
+ def get uri, params = {}
8
+ Typhoeus::Request.get(uri, params)
9
+ end unless method_defined?(:get)
10
+
11
+ def get_parsed uri, params = {}, encoding = "UTF-8"
12
+ Nokogiri::HTML(get(uri, params).body, uri, encoding)
13
+ end unless method_defined?(:get_parsed)
14
+ end
@@ -0,0 +1,6 @@
1
+ module Typhoeus
2
+ module Simple
3
+ # typhoeus-simple version
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+ require 'typhoeus/simple'
3
+
4
+ describe Typhoeus::Simple do
5
+ it "should have a VERSION constant" do
6
+ subject.const_get('VERSION').should_not be_empty
7
+ end
8
+
9
+ it "should add get and get_parsed methods to Kernel" do
10
+ Kernel.method_defined?(:get).should be_true
11
+ Kernel.method_defined?(:get_parsed).should be_true
12
+ end
13
+
14
+ end
@@ -0,0 +1,4 @@
1
+ require 'rspec'
2
+ require 'typhoeus/simple/version'
3
+
4
+ include Typhoeus::Simple
@@ -0,0 +1,15 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ begin
4
+ Ore::Specification.new do |gemspec|
5
+ # custom logic here
6
+ end
7
+ rescue NameError
8
+ begin
9
+ require 'ore/specification'
10
+ retry
11
+ rescue LoadError
12
+ STDERR.puts "The '#{__FILE__}' file requires Ore."
13
+ STDERR.puts "Run `gem install ore-core` to install Ore."
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: typhoeus-simple
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.1.0
6
+ platform: ruby
7
+ authors:
8
+ - Ezekiel Templin
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-01 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: typhoeus
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 0.2.4
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: nokogiri
28
+ requirement: &id002 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: bundler
39
+ requirement: &id003 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: 1.0.0
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *id003
48
+ description: I like the open method provided by open-uri, so I copied it for use with Typhoeus and Nokogiri.
49
+ email:
50
+ - ezkl@me.com
51
+ executables: []
52
+
53
+ extensions: []
54
+
55
+ extra_rdoc_files:
56
+ - README.rdoc
57
+ files:
58
+ - .document
59
+ - .rspec
60
+ - ChangeLog.rdoc
61
+ - Gemfile
62
+ - LICENSE.txt
63
+ - README.rdoc
64
+ - Rakefile
65
+ - gemspec.yml
66
+ - lib/typhoeus/simple.rb
67
+ - lib/typhoeus/simple/version.rb
68
+ - spec/simple_spec.rb
69
+ - spec/spec_helper.rb
70
+ - typhoeus-simple.gemspec
71
+ homepage: http://github.com/ezkl/typhoeus-simple
72
+ licenses:
73
+ - MIT
74
+ post_install_message:
75
+ rdoc_options: []
76
+
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 1.3.6
91
+ requirements: []
92
+
93
+ rubyforge_project: typhoeus-simple
94
+ rubygems_version: 1.7.2
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: Adds get and get_parsed methods to Kernel for clean code.
98
+ test_files:
99
+ - spec/simple_spec.rb