weatai 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d682b0b8a4da5d7b1c4edebf144d802289d9085
4
- data.tar.gz: 03180097e8f7e141813e38e7236c9591cb7704a7
3
+ metadata.gz: 6ea59eca779227e54ebbc5e15338a56b3a6d28c6
4
+ data.tar.gz: 49a1c61b67442fd7f6b5f6616b6cf355824a40b2
5
5
  SHA512:
6
- metadata.gz: b87ebb35a54ec6962b88d10107a777eca4cf4ddfd4c5cd366ab92a0f50dffaf6b8d29cbb7520000bb070e58f15955a94aacf990f317bc0ff18d377a97bdb0814
7
- data.tar.gz: e9f8da1a9a7c6c570118a8e8e3b875b50936a51b2d36ab34eac197cac5805238d4b6d771dfecf333d47c245877d16b7ff2ba3ec346c40890fc5fef3603dc4393
6
+ metadata.gz: 172cd46e400685628ef734bd3e2bac8e4fd1c70a3586e68976e7e07ab1c88cd2c50a77f959646c483caafae3b556f1ef16f3f17c90495a4d1645d84d6d487f29
7
+ data.tar.gz: 04e2ac1d685e126620ab9d5250820e14ccbb69ef927b69e669ddf89788668cff29e830a228602839234e892148dac902f2bc0491f4b7083c87c504d165fafcdd
data/.travis.yml CHANGED
@@ -1,12 +1,15 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.1
4
- - 2.2
5
- - 2.1
6
- branches:
7
- only:
8
- - master
9
- script: bundle exec rake spec
10
- env:
11
- -DATA_ID=O-A0003-001
12
- -AUTH_KEY=CWB-88ABAD26-6BC8-497A-80E2-2A159654CBF6
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.1
4
+ - 2.2
5
+ - 2.1
6
+ branches:
7
+ only:
8
+ - master
9
+ script: bundle exec rake spec
10
+ env:
11
+ -DATA_ID1=O-A0003-001
12
+ -DATA_ID2=O-A0002-001
13
+ -AUTH_KEY=CWB-88ABAD26-6BC8-497A-80E2-2A159654CBF6
14
+ -FORMAT=xml
15
+ -TOKEN=YxZhGGgNtUyzW7oi6EPpKQ
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (5.0.0.1)
4
+ activesupport (>=4.2.6)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.2)
6
6
  i18n (~> 0.7)
7
7
  minitest (~> 5.1)
data/README.md CHANGED
@@ -1,34 +1,36 @@
1
- # weatai Gem
2
-
3
- [![Gem Version](https://badge.fury.io/rb/weatai.svg)](https://badge.fury.io/rb/weatai)
4
- [![Build Status](https://travis-ci.org/soainfinite888/weatai.svg?branch=master)](https://travis-ci.org/ISS-SOA/weatai)
5
-
6
- weatai is a gem that specializes in getting data from Central Weather Bureau(Taiwan).
7
-
8
- ## Installation
9
-
10
- If you are working on a project, add this to your Gemfile: `gem 'weatai'`
11
-
12
- For ad hoc installation from command line:
13
-
14
- ```$ gem install weatai```
15
-
16
- ## Setup Central Weather Bureau(Taiwan) Credentials
17
-
18
- Please setup your Central Weather Bureau credentials by creating an account on Central Weather Bureau Website: http://www.cwb.gov.tw – creating an CWB member account
19
- and go to :http://opendata.cwb.gov.tw - login by CWB member account and get credentials (資料使用說明->取得驗證碼)
20
-
21
- ## Usage
22
-
23
- Require weatai gem in your code: `require 'weatai'`
24
-
25
- Supply your CWB credentials to our library in one of two ways:
26
- - Setup environment variables: `ENV['DATA_ID']` and `ENV['KEY']`
27
- - or, provide them directly to weatai:
28
-
29
- ```
30
- weatai::Config = { dataid: ENV['DATA_ID'],
31
-                   key: ENV['KEY'] }
32
- ```
33
-
34
- See the following example code for more usage details:
1
+ # weatai Gem
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/weatai.svg)](https://badge.fury.io/rb/weatai)
4
+ [![Build Status](https://travis-ci.org/soainfinite888/weatai.svg?branch=master)](https://travis-ci.org/ISS-SOA/weatai)
5
+
6
+ weatai is a gem that specializes in getting data from Central Weather Bureau(Taiwan).
7
+
8
+ ## Installation
9
+
10
+ If you are working on a project, add this to your Gemfile: `gem 'weatai'`
11
+
12
+ For ad hoc installation from command line:
13
+
14
+ ```$ gem install weatai```
15
+
16
+ ## Setup Central Weather Bureau(Taiwan) Credentials
17
+
18
+ Please setup your Central Weather Bureau credentials by creating an account on Central Weather Bureau Website: http://www.cwb.gov.tw – creating an CWB member account
19
+ and go to :http://opendata.cwb.gov.tw - login by CWB member account and get credentials (資料使用說明->取得驗證碼)
20
+
21
+ ## Usage
22
+
23
+ Require weatai gem in your code: `require 'weatai'`
24
+
25
+ Supply your CWB credentials to our library in one of two ways:
26
+ - Setup environment variables: `ENV['DATA_ID1']` , `ENV['DATA_ID2']`,`ENV['AUTH_KEY']`,`ENV['FORMAT']`,`ENV['TOKEN']`
27
+ - Or, provide them directly to weatai:
28
+
29
+ ```
30
+ weatai::Config = { dataid1: ENV['DATA_ID1'],
31
+ dataid2: ENV['DATA_ID2'],
32
+ key: ENV['AUTH_KEY'],
33
+ format: ENV['FORMAT'],
34
+ token: ENV['TOKEN']}
35
+ ```
36
+
data/bin/weatai CHANGED
@@ -3,9 +3,9 @@
3
3
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w(.. lib))
4
4
  require 'weatai'
5
5
 
6
- dataid = ARGV[0] || ENV['DATA_ID']
7
- unless dataid
8
- puts 'USAGE: weatai [dataid]'
6
+ dataid1 = ARGV[0] || ENV['DATA_ID1']
7
+ unless dataid1
8
+ puts 'USAGE: weatai [dataid1]'
9
9
  exit(1)
10
10
  end
11
11
 
@@ -15,7 +15,6 @@ unless key
15
15
  exit(1)
16
16
  end
17
17
 
18
- weather = CWB::Weather.find(dataid: dataid)
19
- raw_data = weather.instant_weather
20
- puts raw_data
21
- File.write('data.yml', raw_data.to_yaml)
18
+ weather = CWB::INSTANT.instant
19
+ puts weather.to_yaml
20
+ File.write('data.yml', weather.to_yaml)