tamagoya 0.1.0 → 0.1.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 +4 -4
- data/exe/tamagoya +2 -0
- data/lib/tamagoya/cli.rb +1 -38
- data/lib/tamagoya/version.rb +1 -1
- data/tamagoya.gemspec +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3bb2d7d88371e1175edf933ce04a41b5322781bc
|
|
4
|
+
data.tar.gz: 235c8e1a2f310c475722499daf15f83941e5821f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e10058811f9553163b8bceb0ea8437cd4ead9a6cb28feda60a2416e81100a119d9bef6517362c62587937df966e971a9d809bfe058ccce729344519ba4c0c560
|
|
7
|
+
data.tar.gz: 7c6ec4fc37cc85f2df53c54e7a7fbd346824c0ccfff63479779ef939c369d762f2e99b86f25c732d01520895ad27233f134ace3a6729e7556470430afc057790
|
data/exe/tamagoya
CHANGED
data/lib/tamagoya/cli.rb
CHANGED
|
@@ -5,7 +5,7 @@ require 'nokogiri'
|
|
|
5
5
|
require 'thor'
|
|
6
6
|
require 'active_support'
|
|
7
7
|
|
|
8
|
-
module
|
|
8
|
+
module Tamagoya
|
|
9
9
|
class CLI < Thor
|
|
10
10
|
default_command :menu
|
|
11
11
|
ROOT_URL = "http://www.tamagoyaya.co.jp/menu.html"
|
|
@@ -53,43 +53,6 @@ module tamagoya
|
|
|
53
53
|
say(msg)
|
|
54
54
|
|
|
55
55
|
end
|
|
56
|
-
|
|
57
|
-
# #実行
|
|
58
|
-
# desc "menu [day]", "get tamagoya menu"
|
|
59
|
-
# def menu(day = nil)
|
|
60
|
-
# if day.nil?
|
|
61
|
-
# day = Time.now.strftime("%H").to_i > BORDER_TIME ? (Date.today+1).strftime("%d").to_i : Date.today.strftime("%d").to_i
|
|
62
|
-
# else
|
|
63
|
-
# raise '引数には1 ~ 31で入力してくfださい' unless day.to_i >= 1 && day.to_i <= 31
|
|
64
|
-
# end
|
|
65
|
-
|
|
66
|
-
# html = open(ROOT_URL) do |f|
|
|
67
|
-
# f.read
|
|
68
|
-
# end
|
|
69
|
-
|
|
70
|
-
# doc = Nokogiri::HTML.parse(html, nil, 'utf-8')
|
|
71
|
-
# #メニューのリストを取得する
|
|
72
|
-
# doc.xpath('//div[@id="latestnews_txt"]/div[@class="menu_title"]').each do |node|
|
|
73
|
-
|
|
74
|
-
# check_day = get_day(node.xpath('./p').inner_text)
|
|
75
|
-
# #指定の日付ではない場合はスキップ
|
|
76
|
-
# if day != check_day
|
|
77
|
-
# next
|
|
78
|
-
# end
|
|
79
|
-
|
|
80
|
-
# node.xpath('./following-sibling::div[@class="menu_list"][1]/ul//li').each do |menu|
|
|
81
|
-
# say(menu.inner_text)
|
|
82
|
-
# end
|
|
83
|
-
|
|
84
|
-
# end
|
|
85
|
-
# end
|
|
86
|
-
|
|
87
|
-
#日付の文字列から日付だけを取り出す
|
|
88
|
-
private
|
|
89
|
-
def get_day(str)
|
|
90
|
-
day = str.match(/^(\d+)日/)[1]
|
|
91
|
-
return day.nil? ? nil : day.to_i
|
|
92
|
-
end
|
|
93
56
|
|
|
94
57
|
end
|
|
95
58
|
end
|
data/lib/tamagoya/version.rb
CHANGED
data/tamagoya.gemspec
CHANGED
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
|
|
23
23
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
24
24
|
spec.bindir = "exe"
|
|
25
|
-
spec.executables =
|
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
26
26
|
spec.require_paths = ["lib"]
|
|
27
27
|
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.10"
|
|
@@ -33,3 +33,4 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.add_dependency "nokogiri"
|
|
34
34
|
spec.add_dependency "activesupport"
|
|
35
35
|
end
|
|
36
|
+
|