ruboty-rokuyo 0.1.2 → 0.1.3

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: 1796e167820f53de1063666e36e69d95cd0fad59
4
- data.tar.gz: 1bb311d1f79e81d08c03352799ac86cd9f79cf36
3
+ metadata.gz: 469b44773c6554e10641ce73d67ff9ad4e23da02
4
+ data.tar.gz: 82bed940f89576967ec5f3b75b25cb2bbfbeb2c2
5
5
  SHA512:
6
- metadata.gz: 15220cf4be8f24612a3f4a30418d5e96d618e4d15b8e6947104755c0d28139ed9a808b48f55b2e067a871f76c5c0be21a715cbbb847d8da86f73acd75e9a773d
7
- data.tar.gz: cf6f2cbaf0ce3b3e62084df780a598419de28104333dc5736b2c6cf90e515275e2504cc3d68647a2f728d87fa4dc013cfcad71ab6c571ba5b617d1711c4fe999
6
+ metadata.gz: d5de7d8f093da6f1c0c56052ac2ede4f91b0ef89ec6ba76a93b7ba89d5cead7630aebf050f978cb00a7d3e0bcb9157400628009895efcec8cc862932e4001da7
7
+ data.tar.gz: 72c9d9262e6f35ff621145b9641685f2b259ecbf01ddf5d5b4326351c5d17612df385951702a81d761ff2c127a97140519cbd1311d04a0b22952924d1473584e
data/README.md CHANGED
@@ -1,39 +1,64 @@
1
1
  # Ruboty::Rokuyo
2
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/ruboty/rokuyo`. 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
- Add this line to your application's Gemfile:
3
+ ## Install
10
4
 
11
5
  ```ruby
6
+ # Gemfile
12
7
  gem 'ruboty-rokuyo'
13
8
  ```
14
9
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install ruboty-rokuyo
22
-
23
10
  ## Usage
24
11
 
25
- TODO: Write usage instructions here
12
+ ```
13
+ ruboty /(?:taian|大安)( (?<date>.+))?/ - output most recent 大安 date
14
+ ruboty /rokuyo( (?<date>.+))?/ - output rokuyo
26
15
 
27
- ## Development
16
+ ```
28
17
 
29
- 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.
18
+ Examples:
30
19
 
31
- 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).
20
+ ```
21
+ > @ruboty rokuyo
22
+ ☆2015/11/24の六曜☆
23
+
24
+ ====
25
+ 仏滅
26
+ ====
27
+ 「仏も滅するような大凶日」の意味。元は「空亡」「虚亡」と言っていたが、これを全てが虚しいと解釈して「物滅」と呼ぶようになり、これに近年になって「佛(仏)」の字が当てられたものである。
28
+ この日は六曜の中で最も凶の日とされ、婚礼などの祝儀を忌む習慣がある。この日に結婚式を挙げる人は少ない。そのため仏滅には料金の割引を行う結婚式場もある。他の六曜は読みが複数あるが、仏滅
29
+ は「ぶつめつ」としか読まれない。
30
+ 字面から仏陀(釈迦)が入滅した(亡くなった)日と解釈されることが多いが、上述のように本来は無関係である。釈迦の死んだ日とされる2月15日が旧暦では必ず仏滅になるのは、偶然そうなっただけである。
31
+ 「何事も遠慮する日、病めば長引く、仏事はよろしい」ともいわれる。
32
+ また『物滅』として「物が一旦滅び、新たに物事が始まる」とされ、「大安」よりも物事を始めるには良い日との解釈もある。
33
+ 出典:http://ja.wikipedia.org/wiki/%E5%85%AD%E6%9B%9C
34
+
35
+ > @ruboty rokuyo 2015/12/25
36
+ ☆2015/12/25の六曜☆
37
+
38
+ ====
39
+ 先勝
40
+ ====
41
+ 「先んずれば即ち勝つ」の意味。かつては「速喜」「即吉」とも書かれた。万事に急ぐことが良いとされる。
42
+ 「午前中は吉、午後二時より六時までは凶」と言われる。
43
+ 「せんしょう」「せんかち」「さきがち」「さきかち」などと読まれる。
44
+ 出典:http://ja.wikipedia.org/wiki/%E5%85%AD%E6%9B%9C
45
+
46
+ > @ruboty taian
47
+ ★直近の大安★
48
+ 2015/11/25
49
+
50
+ > @ruboty taian 2015/11/26
51
+ ★直近の大安★
52
+ 2015/12/01
53
+ ```
32
54
 
33
55
  ## Contributing
34
56
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruboty-rokuyo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
-
57
+ 1. Fork it ( https://github.com/[my-github-username]/ruboty-niftycloud/fork )
58
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
59
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
60
+ 4. Push to the branch (`git push origin my-new-feature`)
61
+ 5. Create a new Pull Request
37
62
 
38
63
  ## License
39
64
 
@@ -17,9 +17,16 @@ module Ruboty
17
17
  description: 'output rokuyo'
18
18
  )
19
19
 
20
+ on(
21
+ /(?:taian|大安)( (?<date>.+))?/,
22
+ name: 'taian',
23
+ description: 'output most recent 大安 date'
24
+ )
25
+
26
+
20
27
  def rokuyo(message)
21
28
  time = message[:date] ? Time.parse(message[:date]) : Time.now
22
- rokuyo = Qreki.calc(time.year, time.month, time.day).rokuyou
29
+ rokuyo = time2rokuyo(time)
23
30
  message.reply [
24
31
  "☆#{time.strftime('%Y/%m/%d')}の六曜\☆\n\n",
25
32
  " ====\n #{rokuyo}\n ====\n",
@@ -27,10 +34,24 @@ module Ruboty
27
34
  ].join
28
35
  end
29
36
 
37
+ def taian(message)
38
+ time = message[:date] ? Time.parse(message[:date]) : Time.now
39
+ rokuyo = time2rokuyo(time)
40
+ until rokuyo == '大安' do
41
+ time += 24 * 60 * 60
42
+ rokuyo = time2rokuyo(time)
43
+ end
44
+ message.reply "★直近の大安★ \n #{time.strftime('%Y/%m/%d')}"
45
+ end
46
+
30
47
  def description(name)
31
48
  rokuyo = @config.find{|rokuyo| rokuyo['rokuyo'] == name }
32
49
  rokuyo['description']
33
50
  end
51
+
52
+ def time2rokuyo(time)
53
+ Qreki.calc(time.year, time.month, time.day).rokuyou
54
+ end
34
55
  end
35
56
  end
36
57
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Rokuyo
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-rokuyo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tily
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-17 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty