namira 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -8
- data/lib/namira/version.rb +1 -1
- data/namira.gemspec +14 -14
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73a718a6245b965921781bcabdf93ce29f5e892a
|
4
|
+
data.tar.gz: 427e8a0b459c7c48103faacc44576272ffe3a661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 842ea8719b57163910152d814a01193882b7d5f0d24c9d463cb6d456c4436ed90c774fe51b60bbbdab751389779210623f77ed01444d4adbc91909811456b309
|
7
|
+
data.tar.gz: 1322d55a14aa409eb316dd91791f07a00abd886ec8373ab1e97c2b0cd7a66a9a9e79e04bf0bb904d9f897dfbda9f42c0aef4f9a425d5844a582abe658a666e32
|
data/README.md
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# Namira
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/namira`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
5
|
Add this line to your application's Gemfile:
|
@@ -22,7 +18,39 @@ Or install it yourself as:
|
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
21
|
+
Sending a basic `GET` request
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
# Create a request
|
25
|
+
request = Namira::Request.new(uri: 'https://httpbin.org/headers')
|
26
|
+
|
27
|
+
# Send the request
|
28
|
+
response = request.response
|
29
|
+
|
30
|
+
# Parse a JSON response
|
31
|
+
response.from_json
|
32
|
+
```
|
33
|
+
|
34
|
+
#### Configuration
|
35
|
+
|
36
|
+
There are a few settings you can pass.
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
Namira.configure do |config|
|
40
|
+
# Total number of times to follow a redirect
|
41
|
+
config.max_redirect = 3
|
42
|
+
|
43
|
+
# How long each portion of a request should wait before timeout
|
44
|
+
config.timeout = 5.0
|
45
|
+
|
46
|
+
# A non-default User-Agent
|
47
|
+
config.user_agent = 'my_app_user_agent'
|
48
|
+
|
49
|
+
# Any additional HTTP headers for a request. If headers are passed to the request itself they will override these settings
|
50
|
+
config.headers.accept = 'application/json' # Will become Accept
|
51
|
+
config.headers.content_type = 'application/json' # Will become Content-Type
|
52
|
+
end
|
53
|
+
```
|
26
54
|
|
27
55
|
## Development
|
28
56
|
|
@@ -32,10 +60,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
60
|
|
33
61
|
## Contributing
|
34
62
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
36
|
-
|
63
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/skylarsch/namira.
|
37
64
|
|
38
65
|
## License
|
39
66
|
|
40
67
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/lib/namira/version.rb
CHANGED
data/namira.gemspec
CHANGED
@@ -4,15 +4,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'namira/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'namira'
|
8
8
|
spec.version = Namira::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Skylar Schipper']
|
10
|
+
spec.email = ['ss@schipp.co']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
12
|
+
spec.summary = 'A simple wrapper around HTTP'
|
13
|
+
spec.description = 'This is a simple wrapper around HTTP'
|
14
|
+
spec.homepage = 'https://github.com/skylarsch/namira'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
18
|
# delete this section to allow pushing this gem to any host.
|
@@ -23,13 +23,13 @@ Gem::Specification.new do |spec|
|
|
23
23
|
end
|
24
24
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
-
spec.bindir =
|
26
|
+
spec.bindir = 'exe'
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
32
|
-
spec.add_development_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_dependency 'http', '
|
30
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
31
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
|
+
spec.add_development_dependency 'pry'
|
34
|
+
spec.add_dependency 'http', '>= 2.0.0', '< 2.1'
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Skylar Schipper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,16 +70,22 @@ dependencies:
|
|
70
70
|
name: http
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 2.0.0
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '2.1'
|
76
79
|
type: :runtime
|
77
80
|
prerelease: false
|
78
81
|
version_requirements: !ruby/object:Gem::Requirement
|
79
82
|
requirements:
|
80
|
-
- - "
|
83
|
+
- - ">="
|
81
84
|
- !ruby/object:Gem::Version
|
82
85
|
version: 2.0.0
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '2.1'
|
83
89
|
description: This is a simple wrapper around HTTP
|
84
90
|
email:
|
85
91
|
- ss@schipp.co
|