contact-data 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contact-data.rb +24 -5
- data/lib/contact-data/deprecated.rb +0 -2
- data/lib/contact-data/exception.rb +0 -1
- data/lib/contact-data/fetcher.rb +2 -0
- data/lib/contact-data/link.rb +1 -0
- data/lib/contact-data/text.rb +1 -0
- data/lib/contact-data/version.rb +1 -1
- metadata +2 -5
- data/lib/contact-data/options.rb +0 -2
- data/lib/hash.rb +0 -11
- data/lib/string.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fdbd300463e8faf65caf800a26911027f49528c
|
4
|
+
data.tar.gz: 4fa928a323b4ad62aa5c94873090864751fa08a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 779e92818d0f127cba4b65d1df5aa0697717d777420a3fb4012cbbe880f0f27ce495fabe8bcfcd24f416dc4ed59996c0d7d8af52ef5608c43f1a413a6519edc8
|
7
|
+
data.tar.gz: 980648841034f69ca805a787c5fab051bcaba30ba47a12c564318e5496980bebf1706f4d14fcece58303abcc4c768441c779339cd702b6322479c68b525f3e9b
|
data/lib/contact-data.rb
CHANGED
@@ -1,11 +1,30 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require 'addressable/uri'
|
3
|
-
require 'json'
|
4
|
-
require 'logger'
|
5
|
-
require 'hash'
|
6
|
-
require 'contact-data/options'
|
7
2
|
require 'contact-data/contact'
|
8
3
|
require 'contact-data/link'
|
9
4
|
require 'contact-data/text'
|
10
5
|
require 'contact-data/fetcher'
|
11
6
|
require 'contact-data/deprecated'
|
7
|
+
|
8
|
+
class Hash
|
9
|
+
def to_options(base, text = nil)
|
10
|
+
o = { base: base }
|
11
|
+
|
12
|
+
[:verbose, :url_base, :api_base, :format, :noformat].each { |k| o[k] = delete(k) if key?(k) }
|
13
|
+
|
14
|
+
o[:payload] = { text: text } if text
|
15
|
+
o[:params] = self unless empty?
|
16
|
+
o
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'addressable/uri'
|
21
|
+
|
22
|
+
class String
|
23
|
+
def encode_component
|
24
|
+
Addressable::URI.encode_component(self, Addressable::URI::CharacterClasses::PATH)
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_options(base)
|
28
|
+
{ url: self }.to_options(base)
|
29
|
+
end
|
30
|
+
end
|
data/lib/contact-data/fetcher.rb
CHANGED
data/lib/contact-data/link.rb
CHANGED
data/lib/contact-data/text.rb
CHANGED
data/lib/contact-data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contact-data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xenapto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -202,11 +202,8 @@ files:
|
|
202
202
|
- lib/contact-data/exception.rb
|
203
203
|
- lib/contact-data/fetcher.rb
|
204
204
|
- lib/contact-data/link.rb
|
205
|
-
- lib/contact-data/options.rb
|
206
205
|
- lib/contact-data/text.rb
|
207
206
|
- lib/contact-data/version.rb
|
208
|
-
- lib/hash.rb
|
209
|
-
- lib/string.rb
|
210
207
|
- spec/contact-data_contact_spec.rb
|
211
208
|
- spec/contact-data_deprecated_spec.rb
|
212
209
|
- spec/contact-data_link_spec.rb
|
data/lib/contact-data/options.rb
DELETED
data/lib/hash.rb
DELETED