furikake 0.0.5 → 0.0.6

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
  SHA256:
3
- metadata.gz: 1d12e5b484c07dcdeaf258f2438846f60a1151b0b3c864c20254d353678ac4a9
4
- data.tar.gz: 76c513b01eac7cbd335c402f0d823ddd0ce08cba43a214a1f8fd18bb20131101
3
+ metadata.gz: a48a8d087b6d3f13f9721174b8720b2981cdbf555c0e00672fee4d73228977b0
4
+ data.tar.gz: 99c71d756ea80ee8dbc2f93422fe5ce801126f8d27aa0a465f3cfe8864e1b49b
5
5
  SHA512:
6
- metadata.gz: aeae1c8f97ec5a72bab2c8089f175c1b6b06db0e8d92f3055fac2b2c88c3eefc98801d8a8bcb2bcabfbc6dd4075e15e0ceb61734ee640777829633272f60e98e
7
- data.tar.gz: 9c7218ed97f33e66d293d9918ae33035c52f6448cb67d31c7cfa494a00860a281a93154ec2b570bf5ff9e3f139c78bdb71745b6ad63ddbbde9ea34277ce71342
6
+ metadata.gz: 80c734f4f02e18888202b9035a97a75e713999bbf85092a62690871a0db90d34f179482e50be7852fb98ab389eeae8011ba7d9b845ebeadcc799cc726a6f3598
7
+ data.tar.gz: a853e642726214479882d9e64e10c40e7d1fad89a626217481735e85860afa146c2553eaf2a152284626cec5c2d2f2247c7aed5eccb923393ee73b6dbed27d4a
data/.gitignore CHANGED
@@ -16,3 +16,4 @@
16
16
  vendor/
17
17
  .DS_Store
18
18
  test.*
19
+ spec/tmp/furikake.yml.test
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- furikake (0.0.5)
4
+ furikake (0.0.6)
5
5
  aws-sdk
6
6
  backlog_kit
7
7
  markdown-tables
data/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
  * 利用している AWS リソースを Backlog の Wiki ページ (Markdown フォーマットのみ) に良しなに纏めてドキュメント化してくれるコマンドラインツールです
7
7
  * 簡単なコードを追加することで, 取得する AWS リソースを増やすことが出来るようにはしています
8
8
  * Backlog Wiki 以外にも登録出来るようにはしています
9
+ * Docker で実行出来るようにもしました (https://github.com/inokappa/furikake-docker)
9
10
 
10
11
  ## Install
11
12
 
@@ -4,13 +4,11 @@ module Furikake
4
4
  class Report
5
5
  include Furikake::Config
6
6
 
7
- def initialize
8
- @params = read_furikake_yaml
9
- @resource = Furikake::Resource.generate
10
- end
7
+ def initialize; end
11
8
 
12
9
  def show
13
- @params['backlog']['projects'].each do |p|
10
+ params = read_furikake_yaml
11
+ params['backlog']['projects'].each do |p|
14
12
  header = insert_published_by(p['header'])
15
13
  footer = p['footer']
16
14
  puts generate(header, footer)
@@ -18,26 +16,40 @@ module Furikake
18
16
  end
19
17
 
20
18
  def publish
21
- @params['backlog']['projects'].each do |p|
19
+ params = read_furikake_yaml
20
+ params['backlog']['projects'].each do |p|
22
21
  header = insert_published_by(p['header'])
23
22
  footer = p['footer']
24
23
  document = generate(header, footer)
25
24
  p['wiki_contents'] = document
26
- Furikake::Reporters::Backlog.new(p).publish
25
+ param = check_api_key(p)
26
+ Furikake::Reporters::Backlog.new(param).publish
27
27
  end
28
28
  end
29
29
 
30
30
  private
31
31
 
32
32
  def generate(header, footer)
33
+ resource = Furikake::Resource.generate
33
34
  documents = <<"EOS"
34
35
  #{header}
35
- #{@resource}
36
+ #{resource}
36
37
  #{footer}
37
38
  EOS
38
39
  documents
39
40
  end
40
41
 
42
+ def check_api_key(param)
43
+ if !param.has_key?(:api_key) or !param['api_key'].nil?
44
+ if !ENV['BACKLOG_API_KEY'].nil? or !ENV['BACKLOG_API_KEY'] == ''
45
+ param['api_key'] = ENV['BACKLOG_API_KEY']
46
+ return param
47
+ end
48
+ raise 'API キーを読み込むことが出来ませんでした.'
49
+ end
50
+ param
51
+ end
52
+
41
53
  def insert_published_by(header)
42
54
  headers = header.split("\n")
43
55
  headers.insert(1, published_by)
@@ -1,3 +1,3 @@
1
1
  module Furikake
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: furikake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - inokappa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-20 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler