metarman 0.0.1
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/.gitignore +3 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +35 -0
- data/LICENSE.txt +21 -0
- data/README.md +69 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/metarman/airports.csv +19085 -0
- data/lib/metarman/data.rb +20 -0
- data/lib/metarman/metar_parser.rb +46 -0
- data/lib/metarman/version.rb +3 -0
- data/lib/metarman/weather.rb +39 -0
- data/lib/metarman.rb +17 -0
- data/metarman.gemspec +42 -0
- metadata +100 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0d6f242d800b9cea312adace3d1f95593ad33fb000a81469f8a3f9cef599fe6f
|
|
4
|
+
data.tar.gz: 7a33680864c2f18be500d13e9b2c615d1c680d1e012cdbadf68af528475b9e62
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 18c98918e100f3496fbc9e31135fb01171ea251a99424ef8bc3b6ecfcc71b9b1279518cad738ae74ac50635984d3d0a2372784031e8d12b8b6c5f99fc823ce6d
|
|
7
|
+
data.tar.gz: 87c18706efcfc18b43cafa27f3f69385afe39f0f972002a71b8cd718624d214293f250451e1f283285855f0a0f4c748466ae7b6c5c497735a2b9bc1c2d9dd6ed
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
metarman (0.0.1)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
diff-lcs (1.3)
|
|
10
|
+
rake (10.5.0)
|
|
11
|
+
rspec (3.8.0)
|
|
12
|
+
rspec-core (~> 3.8.0)
|
|
13
|
+
rspec-expectations (~> 3.8.0)
|
|
14
|
+
rspec-mocks (~> 3.8.0)
|
|
15
|
+
rspec-core (3.8.0)
|
|
16
|
+
rspec-support (~> 3.8.0)
|
|
17
|
+
rspec-expectations (3.8.3)
|
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
19
|
+
rspec-support (~> 3.8.0)
|
|
20
|
+
rspec-mocks (3.8.0)
|
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
22
|
+
rspec-support (~> 3.8.0)
|
|
23
|
+
rspec-support (3.8.0)
|
|
24
|
+
|
|
25
|
+
PLATFORMS
|
|
26
|
+
ruby
|
|
27
|
+
|
|
28
|
+
DEPENDENCIES
|
|
29
|
+
bundler (~> 1.17)
|
|
30
|
+
metarman!
|
|
31
|
+
rake (~> 10.0)
|
|
32
|
+
rspec (~> 3.0)
|
|
33
|
+
|
|
34
|
+
BUNDLED WITH
|
|
35
|
+
1.17.2
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Keisuke Mori
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Metarman
|
|
2
|
+
|
|
3
|
+
This gem helps you to get weather of airport.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
What's METAR??
|
|
7
|
+
> METAR is a format for reporting weather information. A METAR weather report is predominantly used by pilots in fulfillment of a part of a pre-flight weather briefing, and by meteorologists, who use aggregated METAR information to assist in weather forecasting.
|
|
8
|
+
> (Wikipedia: https://en.wikipedia.org/wiki/METAR)
|
|
9
|
+
|
|
10
|
+
What's source of airport information??
|
|
11
|
+
> OpenFlights: https://openflights.org/
|
|
12
|
+
> Thank you for great data sets!!!
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Add this line to your application's Gemfile:
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
gem 'metarman'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
And then execute:
|
|
23
|
+
|
|
24
|
+
$ bundle
|
|
25
|
+
|
|
26
|
+
Or install it yourself as:
|
|
27
|
+
|
|
28
|
+
$ gem install metarman
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
#### Get METAR
|
|
33
|
+
```ruby
|
|
34
|
+
require 'Metarman'
|
|
35
|
+
Metarman.get_raw("RJFF") #=> RJFF is ICAO code. NOT IATA code.
|
|
36
|
+
#=> {
|
|
37
|
+
# :time=>"2019/06/07 08:00",
|
|
38
|
+
# :metar_raw=>"RJFF 070800Z 19015G26KT 9999 FEW020 SCT030 BKN040 25/18 Q1001 NOSIG RMK 1CU020 4CU030 6CU040 A2957"
|
|
39
|
+
# }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Get METAR, Airport Information and Human-readable weather
|
|
43
|
+
```ruby
|
|
44
|
+
require 'Metarman'
|
|
45
|
+
Metarman.get_with_info("RJFF") #=> RJFF is ICAO code. NOT IATA code.
|
|
46
|
+
#=> {
|
|
47
|
+
# :time=>"2019/06/07 08:00",
|
|
48
|
+
# :metar_raw=>"RJFF 070800Z 19015G26KT 9999 FEW020 SCT030 BKN040 25/18 Q1001 NOSIG RMK 1CU020 4CU030 6CU040 A2957",
|
|
49
|
+
# :airport=>{"id"=>"2305", "name"=>"Fukuoka Airport", "icao"=>"RJFF", "iata"=>"FUK", "country"=>"Japan", "city_name"=>"Fukuoka", "lat"=>"33.585899353027344", "lon"=>"130.4510040283203", "elev"=>"32", "utc"=>"9", "dst"=>"U", "timezone"=>"Asia/Tokyo"},
|
|
50
|
+
# :weather=>{:visibility=>"9999", :few=>"020", :sct=>"030", :bkn=>"040", :qnh=>"1001"}
|
|
51
|
+
# }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### NOTE
|
|
55
|
+
This METAR-parser ignore after "QNH".
|
|
56
|
+
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
60
|
+
|
|
61
|
+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
62
|
+
|
|
63
|
+
## Contributing
|
|
64
|
+
|
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/moririn772/metarman.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "metarman"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start(__FILE__)
|