idcfcloud 1.0.0 → 1.0.1

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: 6941bbdef01e10485802468bf365d7d105146ba1
4
- data.tar.gz: a32b22a5411de149cf8fd792e5b79c0df512ec89
3
+ metadata.gz: d3d3cfdc208deae1c4f559b44a9cd91d1a745332
4
+ data.tar.gz: 6c4174fc3556f4065225c137a6a26d266a3c771d
5
5
  SHA512:
6
- metadata.gz: 18b046b27be00e1770388bd6067b5d37748a5ed56862e27a5e68cc995fd944a1d15649a5a6206695708f5f61b360b439e1d9c82f210f71c21f892cd78d86e00e
7
- data.tar.gz: b1af470e7aac83d807b319e7308851e513541207b9993f65a4cf1ec5bd2047c7640d7bbde2b68c86596ed1731c13afb3a15c5f7726cbda7977ad3b1c91356fa3
6
+ metadata.gz: 944941bb9990a9b565df86a96331dec562f6a4851743d26a4f1092e909e0cc49e74007a8b43ea03d7fea751f54fcccdd87c9bbb615f9a20e67fc04cda81fc4b2
7
+ data.tar.gz: 3eabf9310ba92f4daa25a33287dd227c5d034a33bca51c5c78b69254677700b0850391c478b9583c5d913f5105d340773185176a33118fe5ba1ef210bd39ce78
data/.codeclimate.yml CHANGED
@@ -12,23 +12,11 @@ engines:
12
12
  enabled: true
13
13
  rubocop:
14
14
  enabled: true
15
- structure:
16
- exclude_paths:
17
- - 'test/**/*'
18
15
  ratings:
19
16
  paths:
20
17
  - "**.rb"
21
- checks:
22
- argument-count:
23
- config:
24
- threshold: 6
25
- method-complexity:
26
- config:
27
- threshold: 9
28
-
29
18
  exclude_paths:
30
19
  - vendor/bundle
31
20
  - .idea
32
21
  - bin
33
22
  - doc
34
- - output
data/.rubocop.yml CHANGED
@@ -28,7 +28,7 @@ LineLength:
28
28
  Exclude:
29
29
  - 'test/**/*'
30
30
  Style/ClassLength:
31
- Max: 160
31
+ Max: 150
32
32
  Exclude:
33
33
  - 'test/**/*'
34
34
  Style/ModuleLength:
@@ -38,14 +38,4 @@ Style/ModuleLength:
38
38
  ParameterLists:
39
39
  Max: 6
40
40
  Style/DoubleNegation:
41
- Enabled: false
42
- Style/SymbolArray:
43
- Exclude:
44
- - 'test/**/*'
45
- Style/IndentHeredoc:
46
- EnforcedStyle: active_support
47
- Style/PercentLiteralDelimiters:
48
- Exclude:
49
- - 'test/**/*'
50
- Lint/InterpolationCheck:
51
- Enabled: false
41
+ Enabled: false
@@ -5,10 +5,10 @@ module Idcf
5
5
  module Conf
6
6
  # const
7
7
  class Const
8
- DOCUMENT_URL = 'https://www.idcf.jp/api-docs/'.freeze
9
- DOCUMENT_ID_PREFIX = 'reference'.freeze
8
+ DOCUMENT_URL = 'https://www.idcf.jp/api-docs/apis/'.freeze
10
9
  DOCUMENT_ID_SEP = '_'.freeze
11
10
  DOCUMENT_SPACE_CONVERSION = '-'.freeze
11
+ DOCUMENT_ID_PREFIX_FORMAT = 'docs_%<service>s_reference%<version>s'.freeze
12
12
  VERSION_STR = "idcfcloud version #{Idcf::Cli::VERSION}".freeze
13
13
  now = Time.now.strftime('%Y%m%d%H%M%S%6N')
14
14
  dir_path = File.dirname(__FILE__)
@@ -7,8 +7,17 @@ module Idcf
7
7
  module Extend
8
8
  # update file
9
9
  module UpdateFile
10
- BROKEN_UPDATE_FILE = 'The update file is damaged. '\
11
- 'Please consult with the administrator.'.freeze
10
+ BROKEN_UPDATE_FILE = <<-TEXT.strip_heredoc.freeze
11
+ The update file is damaged.
12
+ Please consult with the administrator.
13
+ TEXT
14
+ BROKEN_JSON_SCHEMA = <<-TEXT.strip_heredoc.freeze
15
+ Failed to verify the update file.
16
+ Use the following commands to try updating the gem.
17
+
18
+ # gem update idcfcloud
19
+ # idcfcloud init
20
+ TEXT
12
21
 
13
22
  protected
14
23
 
@@ -51,9 +60,9 @@ module Idcf
51
60
  analyst.schema_links(j)
52
61
  rescue StandardError => e
53
62
  Idcf::Cli::Lib::Util::CliLogger.info('json-schema format error')
54
- log_msg = "#{BROKEN_UPDATE_FILE}:#{e.message}"
63
+ log_msg = "#{BROKEN_JSON_SCHEMA}:#{e.message}"
55
64
  Idcf::Cli::Lib::Util::CliLogger.error(log_msg)
56
- raise Idcf::Cli::Error::CliError, BROKEN_UPDATE_FILE
65
+ raise Idcf::Cli::Error::CliError, BROKEN_JSON_SCHEMA
57
66
  end
58
67
 
59
68
  def file_load(path)
@@ -66,8 +75,10 @@ module Idcf
66
75
  {}.tap do |result|
67
76
  Idcf::Cli::Lib::Configure.get_code_conf(cls.service_name).each do |k, v|
68
77
  regions = {}
69
- v['region'].each do |region, info|
70
- regions[region] = create_schema_url(info['schema'])
78
+ v['region'].each_key do |region|
79
+ target = "#{cls.service_name}.#{k}.region.#{region}.schema"
80
+ url = Idcf::Cli::Lib::Configure.get_code_conf(target)
81
+ regions[region] = create_schema_url(url)
71
82
  end
72
83
 
73
84
  result[k] = regions
@@ -27,10 +27,13 @@ module Idcf
27
27
  end
28
28
 
29
29
  def make_document_id(link)
30
- results = [Idcf::Cli::Conf::Const::DOCUMENT_ID_PREFIX]
31
- titles = link.parent_titles
32
- results << titles.shift.downcase
33
- results << (@region.present? && @region != 'default' ? @region : @version)
30
+ titles = link.parent_titles
31
+ service_str = titles.shift.downcase
32
+ version_str = "#{Idcf::Cli::Conf::Const::DOCUMENT_SPACE_CONVERSION}#{@version}"
33
+ version_str = (@region.present? && @region != 'default' ? '' : version_str)
34
+ id_format = Idcf::Cli::Conf::Const::DOCUMENT_ID_PREFIX_FORMAT
35
+ prefix = format(id_format, service: service_str, version: version_str)
36
+ results = [prefix]
34
37
  results.concat(titles)
35
38
  result = results.join(Idcf::Cli::Conf::Const::DOCUMENT_ID_SEP)
36
39
  result.gsub(/ /, Idcf::Cli::Conf::Const::DOCUMENT_SPACE_CONVERSION)
@@ -1,5 +1,5 @@
1
1
  module Idcf
2
2
  module Cli
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idcfcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - IDC Frontier Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-29 00:00:00.000000000 Z
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -372,7 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
372
372
  version: '0'
373
373
  requirements: []
374
374
  rubyforge_project:
375
- rubygems_version: 2.6.13
375
+ rubygems_version: 2.6.8
376
376
  signing_key:
377
377
  specification_version: 4
378
378
  summary: IDCF Cli tools