idcfcloud 0.2.1 → 0.2.2

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: 006c01ce8038f63174fb320bc37e4ad21ad455e0
4
- data.tar.gz: 36bacb9aeebc05e83339f76ebc7a5a25f597bba5
3
+ metadata.gz: 09cbeede1098617cb40e566cd20f240d6b2d0404
4
+ data.tar.gz: d7a1709c7246eb5a56d83cb2b310830d40f4383a
5
5
  SHA512:
6
- metadata.gz: bc4302a93e69966e28aceb52c4c657ee8a0a5348f2c5485c7a9dd6f9ed92994b9c463cffc59769a0af2d178a416fa47a7e9d2004b4f43d4d7a64f7870dbdcebc
7
- data.tar.gz: e667b317e5cd40612bd101be4679cac8a3a829e54e28b76d9e76c95e4e2f9df5c44f61a92ddcad25580acc8f917db23816c29fbe87d0bcfa1e325125c8916f06
6
+ metadata.gz: e9f9c7a579f7772f72b190fce4e712e1b63dcb2144952b5e42d69faa31a7572e97aad5009b7ff933b9dd14ddc49f04f429dab5ba509c5bfc47a110cda1fcc8c1
7
+ data.tar.gz: 8374e4292620361ca1e6e2eb798316dcaeb852cf810549062493ab2643049c4d03e995b9534aff6dbce7d4af7c5df63d264527b8aa3e6c0a3e613c2d640a102e
data/.rubocop.yml CHANGED
@@ -28,7 +28,7 @@ LineLength:
28
28
  Exclude:
29
29
  - 'test/**/*'
30
30
  Style/ClassLength:
31
- Max: 130
31
+ Max: 150
32
32
  Exclude:
33
33
  - 'test/**/*'
34
34
  Style/ModuleLength:
@@ -12,18 +12,18 @@ module Idcf
12
12
  # morio command
13
13
  class Morio
14
14
  MORIO_TXT = <<-'EOS'.freeze
15
- -+sso+-
16
- .... -ssssssso`
17
- `-/ossssss+/. `ssssssso`
18
- `/ssssssssssssso- /sssss+
19
- .-:ossssssssssssssss` sssssss`
20
- `/sssssssssssssssssssss.+sssssss.
21
- `ossssssssssssssssssssss`osssssss`
22
- /sssssssssssssssssssssss-ossssss+
23
- :sssssssssssssssssssssssssssssso`
24
- /ssssssssssssssssssssssssssss+`
25
- ./osssssssssssssssssssssss+.
26
- `-:+oosssssssssssso+:.
15
+ -+sso+-
16
+ .... -ssssssso`
17
+ `-/ossssss+/. `ssssssso`
18
+ `/ssssssssssssso- /sssss+
19
+ .-:ossssssssssssssss` sssssss`
20
+ `/sssssssssssssssssssss.+sssssss.
21
+ `ossssssssssssssssssssss`osssssss`
22
+ /sssssssssssssssssssssss-ossssss+
23
+ :sssssssssssssssssssssssssssssso`
24
+ /ssssssssssssssssssssssssssss+`
25
+ ./osssssssssssssssssssssss+.
26
+ `-:+oosssssssssssso+:.
27
27
  ``````````
28
28
  EOS
29
29
  ATTRIBUTES_OFF = "\e[0m".freeze
@@ -60,7 +60,10 @@ module Idcf
60
60
  def register_schema_method(o)
61
61
  path = make_schema_path(o)
62
62
 
63
- return nil unless File.exist?(path)
63
+ unless File.exist?(path)
64
+ raise Idcf::Cli::Error::CliError, 'Run the command `update`' if self_call?
65
+ return nil
66
+ end
64
67
 
65
68
  analyst = Idcf::JsonHyperSchema::Analyst.new
66
69
  @links = analyst.load(path).links
@@ -69,6 +72,10 @@ module Idcf
69
72
  end
70
73
  end
71
74
 
75
+ def self_call?
76
+ ARGV.include?(name.underscore.split('/').pop)
77
+ end
78
+
72
79
  # service name
73
80
  #
74
81
  # @return String
@@ -29,6 +29,8 @@ module Idcf
29
29
  def init(arg)
30
30
  map COMMAND_MAPS
31
31
  sub_command_regist('controller', File.dirname(__FILE__), arg)
32
+ rescue Idcf::Cli::Error::CliError => e
33
+ error_exit(e)
32
34
  rescue => e
33
35
  error_exit(Idcf::Cli::Error::CliError.new(e.message))
34
36
  end
@@ -49,6 +49,7 @@ module Idcf
49
49
  # @return Idcf::JsonHyperSchema::Expands::LinkInfoBase
50
50
  def find_link(command)
51
51
  result = nil
52
+ return result if @links.blank?
52
53
  @links.each do |link|
53
54
  if link.title.to_s == command.to_s
54
55
  result = link
@@ -24,7 +24,7 @@ module Idcf
24
24
  def get_user_conf(name, profile = 'default')
25
25
  return config.find(name, profile) if config
26
26
  @config = load_user_conf
27
- msg = 'Run the command `configure`'
27
+ msg = 'Run the command `configure`'
28
28
  raise Idcf::Cli::Error::CliError, msg unless config
29
29
 
30
30
  config.find(name, profile)
@@ -42,7 +42,7 @@ module Idcf
42
42
  return get_user_conf(path, profile)
43
43
  rescue
44
44
  return code_config.find(path) if code_config
45
- f_path = Idcf::Cli::Conf::Const::CODE_CONF_PATH
45
+ f_path = Idcf::Cli::Conf::Const::CODE_CONF_PATH
46
46
  @code_config = Idcf::Cli::Lib::Util::YmlConf.new(f_path)
47
47
  code_config.find(path)
48
48
  end
@@ -1,5 +1,5 @@
1
1
  module Idcf
2
2
  module Cli
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.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: 0.2.1
4
+ version: 0.2.2
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: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler