legionio 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -0
- data/lib/legion/cli/lex/templates/base/dockerfile.erb +5 -0
- data/lib/legion/cli/lex/templates/base/gemfile.erb +8 -1
- data/lib/legion/cli/lex/templates/base/gemspec.erb +10 -12
- data/lib/legion/cli/lex/templates/base/github_rspec.yml.erb +23 -0
- data/lib/legion/cli/lex/templates/base/github_rubocop.yml.erb +28 -0
- data/lib/legion/cli/lex/templates/base/lic.erb +1 -1
- data/lib/legion/cli/lex/templates/base/rubocop.yml.erb +1 -0
- data/lib/legion/cli/lex/templates/base/version.erb +1 -1
- data/lib/legion/extensions/data/migrator.rb +5 -4
- data/lib/legion/lex.rb +26 -3
- data/lib/legion/service.rb +5 -5
- data/lib/legion/version.rb +1 -1
- metadata +5 -3
- data/lib/legion/cli/lex/templates/base/rakefile.erb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27d7538852deb5d105fcd7e3be3d29f0681f3207d5ca3c93586360c7ac09caa2
|
4
|
+
data.tar.gz: 8ce104f2e2dc5c5908030ac9c4da10cef6a9b1bda25516794d116eaed9b7ca3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5249f3a26128f64b9d001a84838bfcb090fb73c7a095104f5bebb87230663e58d7830433506fe681dec7320ccac874916c94539f7bac290ea45e148692428f8
|
7
|
+
data.tar.gz: 7a489e733d2fa7b373f5aca7fee5ddd771a58ad1ea4d592a3d8590257e4c8ed13d7eb5fec0cab1ce2a8c3108cf9cdfc8624e9c517299252ed29ee972232a3d87
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -3,24 +3,22 @@ require_relative 'lib/legion/extensions/<%= config[:lex] %>/version'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'lex-<%= config[:lex] %>'
|
5
5
|
spec.version = Legion::Extensions::<%= config[:class_name] %>::VERSION
|
6
|
-
spec.authors = [
|
7
|
-
spec.email = [
|
6
|
+
spec.authors = []
|
7
|
+
spec.email = []
|
8
8
|
|
9
9
|
spec.summary = 'LEX::<%= config[:class_name] %>'
|
10
10
|
spec.description = 'Connects Legion to <%= config[:class_name] %>'
|
11
|
-
spec.homepage = 'https://
|
11
|
+
spec.homepage = 'https://github.com/LegionIO/lex-<%= config[:lex] %>'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
14
14
|
|
15
15
|
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
-
spec.metadata['source_code_uri'] = 'https://
|
17
|
-
spec.metadata['documentation_uri'] = 'https://
|
18
|
-
spec.metadata['changelog_uri'] = 'https://
|
19
|
-
spec.metadata['bug_tracker_uri'] = 'https://
|
16
|
+
spec.metadata['source_code_uri'] = 'https://github.com/LegionIO/lex-<%= config[:lex] %>/src'
|
17
|
+
spec.metadata['documentation_uri'] = 'https://github.com/LegionIO/lex-<%= config[:lex] %>/wiki'
|
18
|
+
spec.metadata['changelog_uri'] = 'https://github.com/LegionIO/lex-<%= config[:lex] %>'
|
19
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/LegionIO/lex-<%= config[:lex] %>'
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
end
|
20
23
|
spec.require_paths = ['lib']
|
21
|
-
|
22
|
-
spec.add_development_dependency 'rake'
|
23
|
-
spec.add_development_dependency 'rspec'
|
24
|
-
spec.add_development_dependency 'rubocop'
|
25
|
-
spec.add_development_dependency 'simplecov'
|
26
24
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: RSpec
|
2
|
+
on: [push, pull_request]
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
rspec:
|
6
|
+
strategy:
|
7
|
+
fail-fast: false
|
8
|
+
matrix:
|
9
|
+
os: [ubuntu-latest]
|
10
|
+
ruby: [2.7]
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
bundler-cache: true
|
18
|
+
- name: RSpec run
|
19
|
+
run: |
|
20
|
+
bash -c "
|
21
|
+
bundle exec rspec
|
22
|
+
[[ $? -ne 2 ]]
|
23
|
+
"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: Rubocop
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
rubocop:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
os: [ubuntu-latest]
|
9
|
+
ruby: [2.7]
|
10
|
+
runs-on: ${{ matrix.os }}
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: ruby/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: ${{ matrix.ruby }}
|
16
|
+
bundler-cache: true
|
17
|
+
- name: Install Rubocop
|
18
|
+
run: gem install rubocop code-scanning-rubocop
|
19
|
+
- name: Rubocop run --no-doc
|
20
|
+
run: |
|
21
|
+
bash -c "
|
22
|
+
rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
|
23
|
+
[[ $? -ne 2 ]]
|
24
|
+
"
|
25
|
+
- name: Upload Sarif output
|
26
|
+
uses: github/codeql-action/upload-sarif@v1
|
27
|
+
with:
|
28
|
+
sarif_file: rubocop.sarif
|
@@ -4,10 +4,11 @@ module Legion
|
|
4
4
|
module Extensions
|
5
5
|
module Data
|
6
6
|
class Migrator < Sequel::IntegerMigrator
|
7
|
-
def initialize(path, extension,
|
8
|
-
Legion::Logging.fatal @extension
|
7
|
+
def initialize(path, extension, lex_name, **)
|
9
8
|
@path = path
|
10
9
|
@extension = extension
|
10
|
+
@lex_name = lex_name
|
11
|
+
schema_dataset
|
11
12
|
super(Legion::Data::Connection.sequel, path)
|
12
13
|
end
|
13
14
|
|
@@ -21,9 +22,9 @@ module Legion
|
|
21
22
|
|
22
23
|
def schema_dataset
|
23
24
|
dataset = Legion::Data::Connection.sequel.from(default_schema_table).where(namespace: @extension)
|
24
|
-
return dataset
|
25
|
+
return dataset if dataset.count.positive?
|
25
26
|
|
26
|
-
Legion::
|
27
|
+
Legion::Data::Model::Extension.insert(active: 1, namespace: @extension, name: @lex_name)
|
27
28
|
Legion::Data::Connection.sequel.from(default_schema_table).where(namespace: @extension)
|
28
29
|
end
|
29
30
|
alias ds schema_dataset
|
data/lib/legion/lex.rb
CHANGED
@@ -63,16 +63,17 @@ module Legion
|
|
63
63
|
template('cli/lex/templates/base/gemspec.erb', "#{filename}/#{filename}.gemspec", vars)
|
64
64
|
template('cli/lex/templates/base/gemfile.erb', "#{filename}/Gemfile", vars)
|
65
65
|
template('cli/lex/templates/base/gitignore.erb', "#{filename}/.gitignore", vars)
|
66
|
-
template('cli/lex/templates/base/lic.erb', "#{filename}/LICENSE
|
67
|
-
template('cli/lex/templates/base/rakefile.erb', "#{filename}/Rakefile", vars)
|
66
|
+
template('cli/lex/templates/base/lic.erb', "#{filename}/LICENSE", vars)
|
68
67
|
template('cli/lex/templates/base/rubocop.yml.erb', "#{filename}/.rubocop.yml", vars)
|
69
68
|
template('cli/lex/templates/base/readme.md.erb', "#{filename}/README.md", **vars)
|
70
69
|
template('cli/lex/templates/base/lex.erb', "#{filename}/lib/legion/extensions/#{name}.rb", vars)
|
71
70
|
template('cli/lex/templates/base/version.erb', "#{filename}/lib/legion/extensions/#{name}/version.rb", vars)
|
72
|
-
template('cli/lex/templates/base/bitbucket.yml.erb', "#{filename}/bitbucket-pipelines.yml", vars) if options[:pipeline]
|
73
71
|
template('cli/lex/templates/base/spec_helper.rb.erb', "#{filename}/spec/spec_helper.rb", vars)
|
74
72
|
template('cli/lex/templates/base/lex_spec.erb', "#{filename}/spec/legion/#{name}_spec.rb", vars)
|
75
73
|
|
74
|
+
template('cli/lex/templates/base/github_rspec.yml.erb', "#{filename}/.github/workflows/rspec.yml", vars)
|
75
|
+
template('cli/lex/templates/base/github_rubocop.yml.erb', "#{filename}/.github/workflows/rubocop.yml", vars)
|
76
|
+
|
76
77
|
return if !options[:git_init] && !options[:bundle_install]
|
77
78
|
|
78
79
|
run("cd lex_gen-#{filename}")
|
@@ -84,6 +85,28 @@ module Legion
|
|
84
85
|
|
85
86
|
run('bundle update') if options[:bundle_install]
|
86
87
|
end
|
88
|
+
|
89
|
+
method_option github: true
|
90
|
+
method_option rubygems: true
|
91
|
+
method_option docker: true
|
92
|
+
desc 'deploy a lex to multiple places', 'deploys a lex'
|
93
|
+
def deploy
|
94
|
+
system 'gem build'
|
95
|
+
if options[:github_gem]
|
96
|
+
system "gh release create v#{version} '#{long_name}-#{version}.gem'"
|
97
|
+
system 'gh release create v1.1.1 lex-node-1.1.1.gem -n v1.1.1 -t v1.1.1'
|
98
|
+
system "gem push --key github --host https://rubygems.pkg.github.com/LegionIO"
|
99
|
+
end
|
100
|
+
|
101
|
+
if options[:rubygems]
|
102
|
+
system "gem push .gem"
|
103
|
+
end
|
104
|
+
|
105
|
+
if options[:docker]
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
87
110
|
end
|
88
111
|
end
|
89
112
|
end
|
data/lib/legion/service.rb
CHANGED
@@ -29,11 +29,11 @@ module Legion
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def setup_data
|
32
|
-
if RUBY_ENGINE == 'truffleruby'
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
32
|
+
# if RUBY_ENGINE == 'truffleruby'
|
33
|
+
# Legion::Logging.error 'Legion::Data does not support truffleruby, please use MRI for any LEX that require it '
|
34
|
+
# Legion::Settings[:data][:connected] = false
|
35
|
+
# return false
|
36
|
+
# end
|
37
37
|
|
38
38
|
require 'legion/data'
|
39
39
|
Legion::Settings.merge_settings(:data, Legion::Data::Settings.default)
|
data/lib/legion/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legionio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esity
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -237,13 +237,15 @@ files:
|
|
237
237
|
- lib/legion/cli/lex/templates/actor.erb
|
238
238
|
- lib/legion/cli/lex/templates/actor_spec.erb
|
239
239
|
- lib/legion/cli/lex/templates/base/bitbucket.yml.erb
|
240
|
+
- lib/legion/cli/lex/templates/base/dockerfile.erb
|
240
241
|
- lib/legion/cli/lex/templates/base/gemfile.erb
|
241
242
|
- lib/legion/cli/lex/templates/base/gemspec.erb
|
243
|
+
- lib/legion/cli/lex/templates/base/github_rspec.yml.erb
|
244
|
+
- lib/legion/cli/lex/templates/base/github_rubocop.yml.erb
|
242
245
|
- lib/legion/cli/lex/templates/base/gitignore.erb
|
243
246
|
- lib/legion/cli/lex/templates/base/lex.erb
|
244
247
|
- lib/legion/cli/lex/templates/base/lex_spec.erb
|
245
248
|
- lib/legion/cli/lex/templates/base/lic.erb
|
246
|
-
- lib/legion/cli/lex/templates/base/rakefile.erb
|
247
249
|
- lib/legion/cli/lex/templates/base/readme.md.erb
|
248
250
|
- lib/legion/cli/lex/templates/base/rubocop.yml.erb
|
249
251
|
- lib/legion/cli/lex/templates/base/spec_helper.rb.erb
|