httparty-concern 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/Gemfile +5 -0
- data/README.md +74 -0
- data/Rakefile +8 -0
- data/httparty-concern.gemspec +18 -0
- data/lib/httparty-concern.rb +6 -0
- data/spec/integration_spec.rb +22 -0
- metadata +95 -0
data/CHANGELOG.md
ADDED
data/README.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# httparty-concern
|
2
|
+
|
3
|
+
Allows HTTParty to work better with ActiveSupport::Concern.
|
4
|
+
|
5
|
+
## Before
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
module MyAwesomeModule
|
9
|
+
extend ActiveSupport::Concern
|
10
|
+
include HTTParty
|
11
|
+
|
12
|
+
included do
|
13
|
+
base_uri 'http://www.google.com'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# => NoMethodError: undefined method `base_uri' for #<Class:0x007f8b86d823b8>
|
18
|
+
```
|
19
|
+
|
20
|
+
## After
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
module MyAwesomeModule
|
24
|
+
extend ActiveSupport::Concern
|
25
|
+
include HTTParty
|
26
|
+
|
27
|
+
included do
|
28
|
+
base_uri 'http://www.google.com'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# => Nope, no NoMethodErrors at all! :)
|
33
|
+
```
|
34
|
+
|
35
|
+
## Installation
|
36
|
+
|
37
|
+
In your `Gemfile:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
gem 'httparty-concern'
|
41
|
+
```
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
1. Fork it
|
46
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
47
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
48
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
49
|
+
5. Create new Pull Request
|
50
|
+
|
51
|
+
## Copyright
|
52
|
+
|
53
|
+
(The MIT License)
|
54
|
+
|
55
|
+
Copyright (c) 2012 Mario Uher
|
56
|
+
|
57
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
58
|
+
a copy of this software and associated documentation files (the
|
59
|
+
"Software"), to deal in the Software without restriction, including
|
60
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
61
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
62
|
+
permit persons to whom the Software is furnished to do so, subject to
|
63
|
+
the following conditions:
|
64
|
+
|
65
|
+
The above copyright notice and this permission notice shall be
|
66
|
+
included in all copies or substantial portions of the Software.
|
67
|
+
|
68
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
69
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
70
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
71
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
72
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
73
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
74
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
gem.name = 'httparty-concern'
|
3
|
+
gem.version = '0.1.0'
|
4
|
+
gem.authors = 'Mario Uher'
|
5
|
+
gem.email = 'uher.mario@gmail.com'
|
6
|
+
gem.description = 'Allows HTTParty to work better with ActiveSupport::Concern.'
|
7
|
+
gem.summary = 'Concerned HTTParty.'
|
8
|
+
gem.homepage = 'http://haihappen.github.com/httparty-concern'
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split("\n")
|
11
|
+
gem.require_path = 'lib'
|
12
|
+
|
13
|
+
gem.add_dependency 'activesupport', '~> 3.0'
|
14
|
+
gem.add_dependency 'httparty'
|
15
|
+
|
16
|
+
gem.add_development_dependency 'minitest'
|
17
|
+
gem.add_development_dependency 'purdytest'
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'minitest/spec'
|
5
|
+
require 'purdytest'
|
6
|
+
require 'httparty-concern'
|
7
|
+
|
8
|
+
describe HTTParty do
|
9
|
+
it 'extends `ActiveSupport::Concern`' do
|
10
|
+
HTTParty.singleton_class.included_modules.must_include(ActiveSupport::Concern)
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
it 'responds to `included`' do
|
15
|
+
HTTParty.must_respond_to(:included)
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
it 'responds to `append_features`' do
|
20
|
+
HTTParty.must_respond_to(:append_features)
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: httparty-concern
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mario Uher
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: &70223722456360 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70223722456360
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: httparty
|
27
|
+
requirement: &70223722455960 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70223722455960
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: minitest
|
38
|
+
requirement: &70223722455500 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70223722455500
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: purdytest
|
49
|
+
requirement: &70223722455080 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70223722455080
|
58
|
+
description: Allows HTTParty to work better with ActiveSupport::Concern.
|
59
|
+
email: uher.mario@gmail.com
|
60
|
+
executables: []
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- CHANGELOG.md
|
65
|
+
- Gemfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- httparty-concern.gemspec
|
69
|
+
- lib/httparty-concern.rb
|
70
|
+
- spec/integration_spec.rb
|
71
|
+
homepage: http://haihappen.github.com/httparty-concern
|
72
|
+
licenses: []
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 1.8.11
|
92
|
+
signing_key:
|
93
|
+
specification_version: 3
|
94
|
+
summary: Concerned HTTParty.
|
95
|
+
test_files: []
|