kokki 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c4a9dbfae1ec276cef2d3d34847f2b388c33e5e77adcf786eaa3632d800a6f1
4
- data.tar.gz: ce43acc978c9a883764875763b3644851ed8f4f4dd7bf7eb89b66510cd5a90f5
3
+ metadata.gz: 5c2c83c5f3ff4759a6f79d02d164a11b56773e15ca13396150856486ce7e2685
4
+ data.tar.gz: a3dd417445e9724a640875ce2b1ab55a30835387fb51c75166d96c300b16f3c6
5
5
  SHA512:
6
- metadata.gz: 4d013a6c530c203c51fb30687fcdd68bf05f7539304de62cde1ee69d8711305397db32b8ec078ab977def68e0a7b28d02ae73eb2e6848f865efc5b3803d4b84e
7
- data.tar.gz: 3605cc3efee40bc90acfe969646c7f65478423e1ad1cc880da4c1076b1481313610998f1a74a63f7c7340e65d971cf939811de53a1c64b13d4633610b81625a0
6
+ metadata.gz: b8fb83e290ac1b2c2987d257539bcb33e715c9bad2716f9836f73efc16262cab862603ff6d5dd52d6dbefbee1164cb8d0684fcf176e60e173a86cf3834f47517
7
+ data.tar.gz: 578ac0d77f752558f47612017c21e7ff92a25e421d13099ab1b3e3f903e4b96a4c1a8cfd9707c89fada1d210335916160693fd0eeb3f658a315f30181f884c6b
data/README.md CHANGED
@@ -26,6 +26,11 @@ $ kokki japan
26
26
  🇯🇵
27
27
  $ kokki 202.214.194.147
28
28
  🇯🇵
29
+ # it suports a defanged ip as an input
30
+ $ kokki 1.1.1[.]1
31
+ 🇦🇺
32
+ $ kokki "1.1.1(.)1"
33
+ 🇦🇺
29
34
  ```
30
35
 
31
36
  ### As a library
@@ -0,0 +1,11 @@
1
+ FROM ruby:2.6-alpine3.10
2
+ RUN apk --no-cache add git build-base ruby-dev \
3
+ && cd /tmp/ \
4
+ && git clone https://github.com/ninoseki/kokki.git \
5
+ && cd kokki \
6
+ && gem build kokki.gemspec -o kokki.gem \
7
+ && gem install kokki.gem \
8
+ && rm -rf /tmp/kokki \
9
+ && apk del --purge git build-base ruby-dev
10
+
11
+ ENTRYPOINT ["kokki"]
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "rake", "~> 12.3"
30
30
  spec.add_development_dependency "rspec", "~> 3.8"
31
31
  spec.add_development_dependency "vcr", "~> 5.0"
32
- spec.add_development_dependency "webmock", "~> 3.6"
32
+ spec.add_development_dependency "webmock", "~> 3.7"
33
33
  end
@@ -36,8 +36,12 @@ module Kokki
36
36
 
37
37
  private
38
38
 
39
+ def refang(input)
40
+ input.gsub("[.]", ".").gsub("(.)", ".")
41
+ end
42
+
39
43
  def convert_as_ip_address(ip_address)
40
- ip = IPAddress.new(ip_address)
44
+ ip = IPAddress.new(refang(ip_address))
41
45
  dict.lookup_by_alpha_2_code ip.country_code
42
46
  end
43
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kokki
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kokki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-21 00:00:00.000000000 Z
11
+ date: 2019-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.6'
89
+ version: '3.7'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.6'
96
+ version: '3.7'
97
97
  description: Convert a country name / code & IP address to an emoji flag
98
98
  email:
99
99
  - manabu.niseki@gmail.com
@@ -111,6 +111,7 @@ files:
111
111
  - Rakefile
112
112
  - bin/console
113
113
  - bin/setup
114
+ - docker/Dockerfile
114
115
  - exe/kokki
115
116
  - kokki.gemspec
116
117
  - lib/kokki.rb
@@ -141,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
142
  - !ruby/object:Gem::Version
142
143
  version: '0'
143
144
  requirements: []
144
- rubygems_version: 3.0.3
145
+ rubygems_version: 3.0.4
145
146
  signing_key:
146
147
  specification_version: 4
147
148
  summary: Convert a country name / code & IP address to an emoji flag