ipgeobase_gem 0.1.0
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 +7 -0
- data/.github/workflows/main.yml +27 -0
- data/.gitignore +8 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +15 -0
- data/README.md +29 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/ipgeobase.gemspec +26 -0
- data/lib/ipgeobase/version.rb +5 -0
- data/lib/ipgeobase.rb +19 -0
- data/sig/ipgeobase.rbs +4 -0
- metadata +57 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 3b705dc7cb12951054a4a9d4ddc4b117cb9a99ae75e61f50d457da1d7ce63202
|
|
4
|
+
data.tar.gz: 4c13dc81b90c0fd5e2a2ae13eaa2936fcb5e62d29794a02c66f4b558b9fc556d
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b80c8d2e60ea3742637f663884e52ed14ea96235ca3ce360963bc8afaacf42e8a6803e8a54e717dae6b528553f571cdf573c17171693646543d3df129efbdffb
|
|
7
|
+
data.tar.gz: 6c4b3d46dada88055019eeaa308be8312d1726f93b3ae8854a6a72a382dcb47c5f43c080c56a9554ad75b2ec44510f0ed93bb36904f468f6fdae7484e828cc95
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Ruby
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
ruby:
|
|
17
|
+
- '3.0.2'
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v3
|
|
21
|
+
- name: Set up Ruby
|
|
22
|
+
uses: ruby/setup-ruby@v1
|
|
23
|
+
with:
|
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
|
25
|
+
bundler-cache: true
|
|
26
|
+
- name: Run the default task
|
|
27
|
+
run: bundle exec rake
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
# Specify your gem's dependencies in ipgeobase.gemspec
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
gem "rake", "~> 13.0"
|
|
9
|
+
|
|
10
|
+
gem "minitest", "~> 5.0"
|
|
11
|
+
|
|
12
|
+
gem 'nokogiri-happymapper', require: 'happymapper'
|
|
13
|
+
gem 'minitest-power_assert'
|
|
14
|
+
gem 'rubocop'
|
|
15
|
+
gem 'rubocop-minitest'
|
data/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Ipgeobase
|
|
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/ipgeobase`. 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
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Install the gem and add to the application's Gemfile by executing:
|
|
10
|
+
|
|
11
|
+
$ bundle add ipgeobase
|
|
12
|
+
|
|
13
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
|
14
|
+
|
|
15
|
+
$ gem install ipgeobase
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
TODO: Write usage instructions here
|
|
20
|
+
|
|
21
|
+
## Development
|
|
22
|
+
|
|
23
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
24
|
+
|
|
25
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
26
|
+
|
|
27
|
+
## Contributing
|
|
28
|
+
|
|
29
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ipgeobase.
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require "bundler/setup"
|
|
5
|
+
require "ipgeobase"
|
|
6
|
+
|
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
+
|
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
+
# require "pry"
|
|
12
|
+
# Pry.start
|
|
13
|
+
|
|
14
|
+
require "irb"
|
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/ipgeobase.gemspec
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require_relative "lib/ipgeobase/version"
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |spec|
|
|
5
|
+
spec.name = 'ipgeobase_gem'
|
|
6
|
+
spec.version = Ipgeobase::VERSION
|
|
7
|
+
spec.authors = ['Aleksandr Mihailov']
|
|
8
|
+
spec.email = ['mikhaylov.av22@gmail.com']
|
|
9
|
+
spec.summary = 'Example summary'
|
|
10
|
+
spec.description = 'Example description'
|
|
11
|
+
spec.homepage = 'https://github.com/MehPNZ/ruby-gems'
|
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.0.0')
|
|
13
|
+
|
|
14
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
15
|
+
spec.metadata['source_code_uri'] = 'https://github.com/MehPNZ/ruby-gems'
|
|
16
|
+
spec.metadata['changelog_uri'] = 'https://github.com/MehPNZ/ruby-gems'
|
|
17
|
+
|
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
22
|
+
end
|
|
23
|
+
spec.bindir = 'exe'
|
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
25
|
+
spec.require_paths = ['lib']
|
|
26
|
+
end
|
data/lib/ipgeobase.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'ipgeobase/version'
|
|
4
|
+
require_relative 'ipgeobase/ip'
|
|
5
|
+
require 'addressable/uri'
|
|
6
|
+
require 'net/http'
|
|
7
|
+
# DEGIN
|
|
8
|
+
module Ipgeobase
|
|
9
|
+
CURL = 'http://ip-api.com/xml/'
|
|
10
|
+
|
|
11
|
+
class Error < StandardError; end
|
|
12
|
+
|
|
13
|
+
def self.lookup(adress)
|
|
14
|
+
ip_adress = Addressable::URI.parse("#{CURL}#{adress}")
|
|
15
|
+
res = Net::HTTP.get(ip_adress)
|
|
16
|
+
Ip::InfoIp.parse(res)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
# END
|
data/sig/ipgeobase.rbs
ADDED
metadata
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ipgeobase_gem
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Aleksandr Mihailov
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2022-06-13 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Example description
|
|
14
|
+
email:
|
|
15
|
+
- mikhaylov.av22@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- ".github/workflows/main.yml"
|
|
21
|
+
- ".gitignore"
|
|
22
|
+
- CHANGELOG.md
|
|
23
|
+
- Gemfile
|
|
24
|
+
- README.md
|
|
25
|
+
- Rakefile
|
|
26
|
+
- bin/console
|
|
27
|
+
- bin/setup
|
|
28
|
+
- ipgeobase.gemspec
|
|
29
|
+
- lib/ipgeobase.rb
|
|
30
|
+
- lib/ipgeobase/version.rb
|
|
31
|
+
- sig/ipgeobase.rbs
|
|
32
|
+
homepage: https://github.com/MehPNZ/ruby-gems
|
|
33
|
+
licenses: []
|
|
34
|
+
metadata:
|
|
35
|
+
homepage_uri: https://github.com/MehPNZ/ruby-gems
|
|
36
|
+
source_code_uri: https://github.com/MehPNZ/ruby-gems
|
|
37
|
+
changelog_uri: https://github.com/MehPNZ/ruby-gems
|
|
38
|
+
post_install_message:
|
|
39
|
+
rdoc_options: []
|
|
40
|
+
require_paths:
|
|
41
|
+
- lib
|
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 3.0.0
|
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '0'
|
|
52
|
+
requirements: []
|
|
53
|
+
rubygems_version: 3.3.14
|
|
54
|
+
signing_key:
|
|
55
|
+
specification_version: 4
|
|
56
|
+
summary: Example summary
|
|
57
|
+
test_files: []
|