runa 0.3.0 → 0.5.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +2 -1
- data/README.md +23 -17
- data/exe/runa +34 -17
- data/lib/runa/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 271c1000bf8af7eccc88aa0be7a0aa4b33e5bea595f594aa37e6c2401a829c86
|
4
|
+
data.tar.gz: 4c5fa2123e0b5035dca582cc373762d83e5160d98721f5a98278276b5ab5b7d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aae1569645d9695a2d447fb1a4fe899a6fcc53fb9bebac390b517be9f42c338f21178fa6fb1c7a70615b372f2f16574c5ecc8c6b51ab42487bdb3cf56eeea65
|
7
|
+
data.tar.gz: 8ef6ea23f1a42d11d0f7f502125d47b45bc4ae045686ef9768a2c2a7aa376d6e55545e8e687609d4b11ec05dc60c88d144d7954f4acdb7399ee4e988e160fda0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,40 +10,51 @@ $ gem install runa
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
-
Create a new application
|
13
|
+
### Create a new application
|
14
14
|
|
15
15
|
```
|
16
16
|
$ runa new runa_app
|
17
|
+
Created 'runa_app' application.
|
17
18
|
$ cd runa_app
|
18
19
|
```
|
19
20
|
|
21
|
+
### Add gems
|
20
22
|
If you need a gem, Write it in the `Gemfile`.
|
21
23
|
|
22
24
|
```
|
23
25
|
$ code Gemfile
|
24
26
|
$ runa install
|
27
|
+
.
|
28
|
+
.
|
29
|
+
Generate '.runa/runa_load_path.rb'
|
30
|
+
```
|
31
|
+
|
32
|
+
Or use gem_add command.
|
33
|
+
|
34
|
+
```
|
35
|
+
$ runa gem_add launchy
|
36
|
+
.
|
37
|
+
.
|
38
|
+
Generate '.runa/runa_load_path.rb'
|
25
39
|
```
|
26
40
|
|
27
|
-
Run application
|
41
|
+
### Run application
|
28
42
|
|
29
43
|
```
|
30
|
-
$ runa run
|
44
|
+
$ runa run runa_app.rb
|
31
45
|
Hello, World!
|
32
46
|
```
|
33
47
|
|
34
|
-
|
48
|
+
### Deploy scripts for production execution
|
35
49
|
|
36
50
|
Mac/Linux/WSL
|
37
51
|
|
38
52
|
```
|
39
|
-
$ runa
|
53
|
+
$ runa deploy runa_app.rb path/to/bin
|
40
54
|
Generate '.runa/runa_app'
|
41
|
-
|
42
|
-
|
43
|
-
$ chmod +x .runa/runa_app
|
44
|
-
|
45
|
-
$ cp .runa/runa_app path/to/bin
|
55
|
+
Deploy execution script to 'path/to/bin/runa_app'.
|
46
56
|
|
57
|
+
$ chmod +x path/to/bin/runa_app
|
47
58
|
$ runa_app
|
48
59
|
Hello, World!
|
49
60
|
```
|
@@ -51,15 +62,10 @@ Hello, World!
|
|
51
62
|
Windows
|
52
63
|
|
53
64
|
```
|
54
|
-
PS> runa
|
65
|
+
PS> runa deploy runa_app.rb path\to\bin
|
55
66
|
Generate '.runa/runa_load_path.rb'
|
56
|
-
|
57
|
-
'.runa/runa_app.bat' is the script to run. Copy it to any location and use it.
|
58
|
-
|
59
|
-
PS> cp .runa\runa_app.bat path\to\bin
|
67
|
+
Deploy execution script to 'path\to\bin\runa_app.bat'.
|
60
68
|
|
61
69
|
PS> runa_app
|
62
70
|
Hello, world!
|
63
71
|
```
|
64
|
-
|
65
|
-
|
data/exe/runa
CHANGED
@@ -29,42 +29,59 @@ class RunaCli < Thor
|
|
29
29
|
File.write("lib/#{name}/lib.rb", "module #{module_name}\nend\n")
|
30
30
|
File.write(".gitignore", "/vendor/\n/.runa/*\n!/.runa/.gitkeep\n")
|
31
31
|
File.write("Gemfile", "# frozen_string_literal: true\n\nsource \"https://rubygems.org\"\n\n# gem \"rails\"\n")
|
32
|
-
File.write("
|
32
|
+
File.write("#{name}.rb", "require \"#{name}\"\n\nputs \"Hello, world!\"")
|
33
33
|
end
|
34
|
+
|
35
|
+
puts "Created '#{name}' application."
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "gem_add [GEMS]", "Add gems"
|
39
|
+
def gem_add(*gems)
|
40
|
+
system("bundle add #{gems.join(" ")}")
|
41
|
+
deploy_load_path_script
|
34
42
|
end
|
35
43
|
|
36
44
|
desc "install", "Install gems"
|
37
45
|
def install
|
38
46
|
system("bundle install")
|
39
|
-
|
47
|
+
deploy_load_path_script
|
40
48
|
end
|
41
49
|
|
42
|
-
desc "run [ARGS]", "Run application with arguments"
|
43
|
-
def run_command(*args)
|
44
|
-
system("bundle exec ruby -Ilib
|
50
|
+
desc "run SCRIPT_FILE [ARGS]", "Run application with arguments"
|
51
|
+
def run_command(script_file, *args)
|
52
|
+
system("bundle exec ruby -Ilib #{script_file} #{args.join(" ")}")
|
45
53
|
end
|
46
54
|
map "run" => "run_command"
|
47
55
|
|
48
|
-
desc "
|
49
|
-
def
|
56
|
+
desc "deploy SCRIPT_FILE DEPLOY_PATH", "Deploy scripts for production execution"
|
57
|
+
def deploy(script_file, deploy_path)
|
50
58
|
root_dir = File.expand_path(".")
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
59
|
+
deploy_load_path_script
|
60
|
+
path = nil
|
61
|
+
if File.directory?(deploy_path)
|
62
|
+
deploy_script_name = File.basename(script_file, ".*")
|
63
|
+
path = File.join(deploy_path, deploy_script_name)
|
64
|
+
path += ".bat" if OS.windows?
|
65
|
+
else
|
66
|
+
path = deploy_path
|
67
|
+
end
|
68
|
+
if !File.exist?(path)
|
69
|
+
File.write(path, deploy_script(root_dir, script_file))
|
70
|
+
puts "Deploy execution script to '#{path}'."
|
71
|
+
else
|
72
|
+
puts "Error: '#{path}' is already exists."
|
73
|
+
exit(1)
|
74
|
+
end
|
57
75
|
end
|
58
|
-
map "gen" => "generate"
|
59
76
|
|
60
77
|
private
|
61
78
|
|
62
79
|
RUNA_DIR = ".runa"
|
63
80
|
|
64
|
-
def
|
81
|
+
def deploy_script(root_dir, script_file)
|
65
82
|
lib_dir = File.join(root_dir, "lib")
|
66
83
|
runa_dir = File.join(root_dir, RUNA_DIR)
|
67
|
-
main_rb = File.join(root_dir,
|
84
|
+
main_rb = File.join(root_dir, script_file)
|
68
85
|
|
69
86
|
if OS.windows?
|
70
87
|
lib_dir = lib_dir.tr("/", "\\")
|
@@ -83,7 +100,7 @@ class RunaCli < Thor
|
|
83
100
|
end
|
84
101
|
end
|
85
102
|
|
86
|
-
def
|
103
|
+
def deploy_load_path_script
|
87
104
|
path = "#{RUNA_DIR}/runa_load_path.rb"
|
88
105
|
File.write(path, load_path_script)
|
89
106
|
puts "Generate '#{path}'"
|
data/lib/runa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ongaeshi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: os
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: Runa is a command line interface for easily creating Ruby applications.
|
28
42
|
email:
|
29
43
|
- ongaeshi0621@gmail.com
|