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 +4 -4
- data/.codeclimate.yml +0 -12
- data/.rubocop.yml +2 -12
- data/lib/idcf/cli/conf/const.rb +2 -2
- data/lib/idcf/cli/extend/update_file.rb +17 -6
- data/lib/idcf/cli/lib/document.rb +7 -4
- data/lib/idcf/cli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3d3cfdc208deae1c4f559b44a9cd91d1a745332
|
4
|
+
data.tar.gz: 6c4174fc3556f4065225c137a6a26d266a3c771d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
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
|
data/lib/idcf/cli/conf/const.rb
CHANGED
@@ -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 =
|
11
|
-
|
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 = "#{
|
63
|
+
log_msg = "#{BROKEN_JSON_SCHEMA}:#{e.message}"
|
55
64
|
Idcf::Cli::Lib::Util::CliLogger.error(log_msg)
|
56
|
-
raise Idcf::Cli::Error::CliError,
|
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'].
|
70
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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)
|
data/lib/idcf/cli/version.rb
CHANGED
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.
|
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-
|
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.
|
375
|
+
rubygems_version: 2.6.8
|
376
376
|
signing_key:
|
377
377
|
specification_version: 4
|
378
378
|
summary: IDCF Cli tools
|