tw_hospital 0.0.1.8 → 0.0.1.9

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
  SHA1:
3
- metadata.gz: 8f2eec1f48d064ba5ea1718bd4f799d5df29f3fe
4
- data.tar.gz: ebe93466eefd29173338b5f3ad60344654f56767
3
+ metadata.gz: 48b5ad567ddb11ed563e1cb83e1981061b75f434
4
+ data.tar.gz: f069975044405b0444b176aff1ab39900f3689eb
5
5
  SHA512:
6
- metadata.gz: c37409c01757c8a7cfeec38b8b13c8bc0c9306c1647081fc750f8ea83a266bb41a76e0eaa45a8e4d76ee6732ea3b77a2c032997ed6294841ddc43593ff297e98
7
- data.tar.gz: 7cca3139f6e453d267b2195a798fa0571b8ef964e82f275c39a9003d40e8737119b29fda67b473769951cf5fdb01942160b3241369582e1d3e6d63ba566ca7f9
6
+ metadata.gz: 77f96e176545691a3a53ffccf5cdba07dba185164afdef8ff9ae47d5f2a8f4338a8afc7d47b0cadd439821578411173df6d796604cd2639a1a1ffc52dedd4f3f
7
+ data.tar.gz: 5a7d46de5db3be034b523b0fc4077c9214bc5738dbe9e773a2695ed8e42a0fe2a773ac946cececb50a6b05cf1586ae86670b3a6cfacadcbbc8d77a3496606a6e
@@ -0,0 +1,12 @@
1
+ require 'thor'
2
+ require "tw_hospital"
3
+
4
+ module Cli
5
+ class Application < Thor
6
+ default_task :help
7
+ desc 'Fetch all file', 'Fetch all hospital file'
8
+ def build(file)
9
+ TwHospital.fetch_all
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module TwHospital
2
- VERSION = "0.0.1.8"
2
+ VERSION = "0.0.1.9"
3
3
  end
data/lib/tw_hospital.rb CHANGED
@@ -35,7 +35,7 @@ require 'module/cgmh_ks'
35
35
  require 'module/tzuchi_hl'
36
36
 
37
37
  module TwHospital
38
- def TwHospital.fetch_all
38
+ def TwHospital.fetch_all(filename=nil)
39
39
  json = []
40
40
  json << Pohai.crawl
41
41
  json << Cgmh_kl.crawl
@@ -65,8 +65,8 @@ module TwHospital
65
65
  json << Edah.crawl
66
66
  json << Cgmh_ks.crawl
67
67
  json << Tzuchi_hl.crawl
68
- time = Time.now.strftime("%Y-%m-%d %H:%M:%S")
69
- File.open("#{time}.json", "w") do |f|
68
+ filename = Time.now.strftime("%Y-%m-%d %H:%M:%S") unless filename
69
+ File.open("#{filename}.json", "w") do |f|
70
70
  f.write(JSON.pretty_generate(json))
71
71
  end
72
72
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tw_hospital
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.8
4
+ version: 0.0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - JackHou
@@ -111,6 +111,7 @@ files:
111
111
  - lib/module/vghtpe.rb
112
112
  - lib/module/wanfang.rb
113
113
  - lib/tw_hospital.rb
114
+ - lib/tw_hospital/cli/fetch.rb
114
115
  - lib/tw_hospital/version.rb
115
116
  - tw_hospital.gemspec
116
117
  homepage: ''