seventeen_mon 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -10
- data/bin/seventeen +1 -0
- data/lib/seventeen_mon/ip.rb +2 -1
- data/lib/seventeen_mon/version.rb +1 -1
- data/spec/seventeen_mon_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5af503ff8c728eb599c1bf24f449d736e5ff58e9
|
4
|
+
data.tar.gz: a70035346ddb5d2d1f6c84034104b23ee5da86cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eb3f4953c7987a696aa0577ded94565bd696d326cade2d7d642e0932822ec47ce9fad625bd9c59ef401dc6be493ca09ef42fcfa4aaae00dd71dd99ac1135792
|
7
|
+
data.tar.gz: 0eb6cc971cacbd4551cf1636bf1bc7972541cd9bb2865a9965e3f916bb21f8ad74363396a4774e7b09d461836e396916048a200cd5b98c777dbec4305e514228
|
data/README.md
CHANGED
@@ -25,24 +25,26 @@ Or you can install simply by
|
|
25
25
|
|
26
26
|
### In Ruby
|
27
27
|
```(ruby)
|
28
|
-
SM.find_by_ip "
|
29
|
-
# => {:country=>"
|
28
|
+
SM.find_by_ip "119.75.216.20"
|
29
|
+
# => {:country=>"中国", :province=>"北京", :city=>"北京"}
|
30
30
|
|
31
|
-
SM.find_by_address "http://
|
32
|
-
# => {:country=>"
|
31
|
+
SM.find_by_address "http://taobao.com"
|
32
|
+
# => {:country=>"中国", :province=>"浙江", :city=>"杭州"}
|
33
33
|
```
|
34
34
|
|
35
35
|
### In Command Line
|
36
36
|
|
37
37
|
```(bash)
|
38
|
-
$ seventeen ip
|
39
|
-
Country:
|
40
|
-
|
38
|
+
$ seventeen ip 119.75.216.20
|
39
|
+
Country: 中国
|
40
|
+
Province: 北京
|
41
|
+
City: 北京
|
41
42
|
|
42
43
|
|
43
|
-
$ seventeen address
|
44
|
-
Country:
|
45
|
-
|
44
|
+
$ seventeen seventeen address http://taobao.com
|
45
|
+
Country: 中国
|
46
|
+
Province: 浙江
|
47
|
+
City: 杭州
|
46
48
|
```
|
47
49
|
|
48
50
|
## Contributing
|
data/bin/seventeen
CHANGED
data/lib/seventeen_mon/ip.rb
CHANGED
data/spec/seventeen_mon_spec.rb
CHANGED
@@ -19,12 +19,14 @@ describe SeventeenMon do
|
|
19
19
|
it "can find location by ip" do
|
20
20
|
result = SM.find_by_ip @ip_param
|
21
21
|
result.should include(:city)
|
22
|
+
result.should include(:province)
|
22
23
|
result.should include(:country)
|
23
24
|
end
|
24
25
|
|
25
26
|
it "can find location by address" do
|
26
27
|
result = SM.find_by_address @url_param
|
27
28
|
result.should include(:city)
|
29
|
+
result.should include(:province)
|
28
30
|
result.should include(:country)
|
29
31
|
end
|
30
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seventeen_mon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jingkai He
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|