yao-yrb 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03a0eab1fc76fbbb9176fc2d53ea40258a817ab9a60d30d6ce2aec79a5135e23
4
- data.tar.gz: aabb46b4a5983e088366e7736a5a29d7b9529088f3ec445e193257f75daa0e4a
3
+ metadata.gz: '03974297e498e76dfb04b4c9603c3cb4e7866d5f2f96281f65f957c6f30fbbcf'
4
+ data.tar.gz: d1376851fd1ca871645b67e9af59c0cd4a95922da74cc883c173b2aec6626c6a
5
5
  SHA512:
6
- metadata.gz: 0cda37ba385c803184112a0f09977f316e9add204306b6954a709f2af3747f754377383e241509d8a612fd6c15e72efcacc2fd598d2e9296a76ac2b2c4da255a
7
- data.tar.gz: 52662b8a19ca90ff3a42380bd4dec8c0f7c10a93f4a5fc46f8e67208cf3f8c804641619728e3e2e7d5000f4fd69755da58527d83e3bee654b17fa82ebe394f7a
6
+ metadata.gz: f2dadc842acbc1cf337ab447c21b8b45e142c81183c78faddee2f98833b394a192169a62749a1172fc53fe95b251ee17ab6d4808b19450fcfb85880c80357faa
7
+ data.tar.gz: 33a744ffc7128cd9e1c1f1494ff2a07dfb8c69bf95a43161d4d03b5a27a7ab6e57ee64c4551f09638c52922f3122d47c7ae132a78e992bf039918d700fcda57f
@@ -0,0 +1,22 @@
1
+ name: rubocop
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby: [3.0, 2.7]
11
+ steps:
12
+ - uses: actions/checkout@master
13
+ - name: Set up Ruby
14
+ uses: actions/setup-ruby@v1
15
+ with:
16
+ ruby-version: ${{ matrix.ruby }}
17
+ - name: Install dependencies
18
+ run: |
19
+ gem install bundler --no-document
20
+ bundle install
21
+ - name: Run rubocop
22
+ run: bundle exec rubocop
data/.rubocop.yml ADDED
@@ -0,0 +1,16 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7
3
+ SuggestExtensions: false
4
+ NewCops: enable
5
+
6
+ Style/FrozenStringLiteralComment:
7
+ Enabled: false
8
+
9
+ Style/Documentation:
10
+ Enabled: false
11
+
12
+ Metrics/MethodLength:
13
+ Max: 15
14
+
15
+ Metrics/AbcSize:
16
+ Max: 27
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in yao-yrb.gemspec
4
4
  gemspec
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
+ t.test_files = FileList['test/**/*_test.rb']
8
8
  end
9
9
 
10
- task :default => :test
10
+ task default: :test
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "yao/yrb"
3
+ require 'bundler/setup'
4
+ require 'yao/yrb'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "yao/yrb"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start(__FILE__)
data/lib/yao/yrb/cli.rb CHANGED
@@ -1,59 +1,57 @@
1
- require 'irb'
2
- require 'irb/completion'
3
- require 'irb/ext/save-history'
4
1
  require 'clamp'
5
2
  require 'yao'
3
+ require 'irb'
6
4
 
7
5
  # [HACK] allow optional and multivalued parameters
8
6
  original_verbosity = $VERBOSE
9
7
  $VERBOSE = nil
10
- Clamp::Parameter::Definition::ELLIPSIS_SUFFIX = / \.\.\.\]?$/
8
+ Clamp::Parameter::Definition::ELLIPSIS_SUFFIX = / \.\.\.\]?$/.freeze
11
9
  $VERBOSE = original_verbosity
12
10
 
13
- module Yao::Yrb
14
- class Cli < Clamp::Command
15
- option '--version', :flag, 'Show version' do
16
- puts Yao::Yrb::VERSION
17
- exit(0)
18
- end
11
+ module Yao
12
+ module Yrb
13
+ class Cli < Clamp::Command
14
+ option '--version', :flag, 'Show version' do
15
+ puts Yao::Yrb::VERSION
16
+ exit(0)
17
+ end
19
18
 
20
- parameter '[FILE ...]', 'Execute the contents of FILE. If unset, run in Interpreter mode.',
21
- attribute_name: :script_mode
19
+ parameter '[FILE ...]', 'Execute the contents of FILE. If unset, run in Interpreter mode.',
20
+ attribute_name: :script_mode
22
21
 
23
- def execute
24
- Yao.configure do
25
- auth_url ENV['OS_AUTH_URL']
26
- tenant_name ENV['OS_TENANT_NAME']
27
- username ENV['OS_USERNAME']
28
- password ENV['OS_PASSWORD']
29
- client_cert ENV['OS_CERT']
30
- client_key ENV['OS_KEY']
31
- region_name ENV['OS_REGION_NAME']
32
- identity_api_version ENV['OS_IDENTITY_API_VERSION']
33
- user_domain_name ENV['OS_USER_DOMAIN_NAME']
34
- project_domain_name ENV['OS_PROJECT_DOMAIN_NAME']
35
- debug ENV['YAO_DEBUG']
36
- debug_record_response ENV['YAO_DEBUG_RECORD_RESPONSE']
37
- end
22
+ def execute
23
+ yao_setup
38
24
 
39
- if script_mode.size > 0
40
- script_file = script_mode.first
41
- load script_file
42
- else
43
- IRB.setup('yao')
44
- IRB.conf[:PROMPT] = { :YAO => {
45
- :PROMPT_I => 'yao(%m):%03n:%i> ',
46
- :PROMPT_N => 'yao(%m):%03n:%i> ',
47
- :PROMPT_S => 'yao(%m):%03n:%i%l ',
48
- :PROMPT_C => 'yao(%m):%03n:%i* ',
49
- :RETURN => "=> %s\n",
50
- }}
51
- IRB.conf[:PROMPT_MODE] = :YAO
52
- IRB.conf[:SAVE_HISTORY] = 1000
53
- IRB.conf[:HISTORY_FILE] = File.expand_path('~/.yrb_history')
54
- IRB::Irb.new.run(IRB.conf)
25
+ if script_mode.size
26
+ script_file = script_mode.first
27
+ load script_file
28
+ else
29
+ IRB.setup(__FILE__)
30
+ conf = IRB.conf
31
+ conf[:AP_NAME] = 'yrb'
32
+ conf[:IRB_NAME] = 'yrb'
33
+ irb = IRB::Irb.new
34
+ irb.run(conf)
35
+ end
55
36
  end
56
37
 
38
+ def yao_setup
39
+ Yao.configure do
40
+ auth_url ENV['OS_AUTH_URL']
41
+ tenant_name ENV['OS_TENANT_NAME']
42
+ username ENV['OS_USERNAME']
43
+ password ENV['OS_PASSWORD']
44
+ ca_cert ENV['OS_CACERT']
45
+ client_cert ENV['OS_CERT']
46
+ client_key ENV['OS_KEY']
47
+ region_name ENV['OS_REGION_NAME']
48
+ identity_api_version ENV['OS_IDENTITY_API_VERSION']
49
+ user_domain_name ENV['OS_USER_DOMAIN_NAME']
50
+ project_domain_name ENV['OS_PROJECT_DOMAIN_NAME']
51
+ debug ENV['YAO_DEBUG']
52
+ debug_record_response ENV['YAO_DEBUG_RECORD_RESPONSE']
53
+ end
54
+ end
57
55
  end
58
56
  end
59
57
  end
@@ -1,5 +1,5 @@
1
1
  module Yao
2
2
  module Yrb
3
- VERSION = '2.0.1'
3
+ VERSION = '3.0.0'.freeze
4
4
  end
5
5
  end
data/yao-yrb.gemspec CHANGED
@@ -1,43 +1,48 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path('./lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "yao/yrb/version"
3
+ require 'yao/yrb/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "yao-yrb"
6
+ spec.name = 'yao-yrb'
8
7
  spec.version = Yao::Yrb::VERSION
9
- spec.authors = ["Yuki Koya"]
10
- spec.email = ["buty4649@gmail.com"]
8
+ spec.authors = ['Yuki Koya']
9
+ spec.email = ['buty4649@gmail.com']
11
10
 
12
- spec.summary = %q{irb with yao}
13
- spec.description = %q{irb with yao (https://github.com/yaocloud/yao)}
14
- spec.homepage = "https://github.com/buty4649/yao-yrb"
11
+ spec.summary = 'irb with yao'
12
+ spec.description = 'irb with yao (https://github.com/yaocloud/yao)'
13
+ spec.homepage = 'https://github.com/buty4649/yao-yrb'
15
14
 
16
15
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
16
  # to allow pushing to a single host or delete this section to allow pushing to any host.
18
17
  if spec.respond_to?(:metadata)
19
18
 
20
- spec.metadata["homepage_uri"] = spec.homepage
21
- spec.metadata["source_code_uri"] = "https://github.com/buty4649/yao-yrb"
22
- spec.metadata["changelog_uri"] = "https://github.com/buty4649/yao-yrb"
19
+ spec.metadata['rubygems_mfa_required'] = 'true'
20
+ spec.metadata['homepage_uri'] = spec.homepage
21
+ spec.metadata['source_code_uri'] = 'https://github.com/buty4649/yao-yrb'
22
+ spec.metadata['changelog_uri'] = 'https://github.com/buty4649/yao-yrb'
23
23
  else
24
- raise "RubyGems 2.0 or newer is required to protect against " \
25
- "public gem pushes."
24
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
25
+ 'public gem pushes.'
26
26
  end
27
27
 
28
28
  # Specify which files should be added to the gem when it is released.
29
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
30
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
31
31
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
32
  end
33
- spec.bindir = "exe"
33
+ spec.bindir = 'exe'
34
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
- spec.require_paths = ["lib"]
35
+ spec.require_paths = ['lib']
36
+
37
+ spec.required_ruby_version = '>= 2.7.0'
36
38
 
37
39
  spec.add_dependency 'yao'
40
+
38
41
  spec.add_dependency 'clamp', '~> 1.3.1'
42
+ spec.add_dependency 'pry', '~> 0.13.1'
39
43
 
40
- spec.add_development_dependency "bundler", "~> 2.0"
41
- spec.add_development_dependency "rake", "~> 10.0"
42
- spec.add_development_dependency "minitest", "~> 5.0"
44
+ spec.add_development_dependency 'bundler', '~> 2.0'
45
+ spec.add_development_dependency 'minitest', '~> 5.0'
46
+ spec.add_development_dependency 'rake', '>= 12.3.3'
47
+ spec.add_development_dependency 'rubocop'
43
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yao-yrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki Koya
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-02 00:00:00.000000000 Z
11
+ date: 2021-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yao
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.3.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
48
- type: :development
47
+ version: 0.13.1
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: 0.13.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '2.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '2.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,34 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '5.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 12.3.3
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 12.3.3
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: irb with yao (https://github.com/yaocloud/yao)
84
112
  email:
85
113
  - buty4649@gmail.com
@@ -88,8 +116,9 @@ executables:
88
116
  extensions: []
89
117
  extra_rdoc_files: []
90
118
  files:
119
+ - ".github/workflows/rubocop.yml"
91
120
  - ".gitignore"
92
- - ".travis.yml"
121
+ - ".rubocop.yml"
93
122
  - CODE_OF_CONDUCT.md
94
123
  - Gemfile
95
124
  - LICENSE
@@ -105,10 +134,11 @@ files:
105
134
  homepage: https://github.com/buty4649/yao-yrb
106
135
  licenses: []
107
136
  metadata:
137
+ rubygems_mfa_required: 'true'
108
138
  homepage_uri: https://github.com/buty4649/yao-yrb
109
139
  source_code_uri: https://github.com/buty4649/yao-yrb
110
140
  changelog_uri: https://github.com/buty4649/yao-yrb
111
- post_install_message:
141
+ post_install_message:
112
142
  rdoc_options: []
113
143
  require_paths:
114
144
  - lib
@@ -116,15 +146,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
146
  requirements:
117
147
  - - ">="
118
148
  - !ruby/object:Gem::Version
119
- version: '0'
149
+ version: 2.7.0
120
150
  required_rubygems_version: !ruby/object:Gem::Requirement
121
151
  requirements:
122
152
  - - ">="
123
153
  - !ruby/object:Gem::Version
124
154
  version: '0'
125
155
  requirements: []
126
- rubygems_version: 3.0.3
127
- signing_key:
156
+ rubygems_version: 3.2.32
157
+ signing_key:
128
158
  specification_version: 4
129
159
  summary: irb with yao
130
160
  test_files: []
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.3
7
- before_install: gem install bundler -v 2.0.1