runa 0.2.0 → 0.4.0
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/Gemfile.lock +5 -1
- data/README.md +45 -2
- data/exe/runa +46 -20
- 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: a522391930171e4e77161f28e2291cf2be945d88338ccfed28c7870e74a5ddf7
|
4
|
+
data.tar.gz: b2c43a43fa11ac1a7945a3930e52c1773d2947955bc9acd519dc8bde01f8974e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb319f1f1c8053dce8f794fc793e3f0f7b23a56aacd94bf9bf1b0a66a267c3c723b54b719f09d81f2b5ddd59b4482dfac87cb37117e17d8e6f78171673e8e243
|
7
|
+
data.tar.gz: d36be1c15076965e1a75dd485244f4d29f8692ac1b8fe25be57c70e8f4fda32c3c621893c37ddeb9934ec774159d225680b1688f9957d3e5660b1ed6e3f70c67
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
runa (0.
|
4
|
+
runa (0.3.0)
|
5
|
+
os
|
5
6
|
thor
|
6
7
|
|
7
8
|
GEM
|
@@ -11,6 +12,7 @@ GEM
|
|
11
12
|
json (2.6.3)
|
12
13
|
language_server-protocol (3.17.0.3)
|
13
14
|
lint_roller (1.0.0)
|
15
|
+
os (1.1.4)
|
14
16
|
parallel (1.23.0)
|
15
17
|
parser (3.2.2.1)
|
16
18
|
ast (~> 2.4.1)
|
@@ -53,8 +55,10 @@ GEM
|
|
53
55
|
|
54
56
|
PLATFORMS
|
55
57
|
x64-mingw-ucrt
|
58
|
+
x86_64-linux
|
56
59
|
|
57
60
|
DEPENDENCIES
|
61
|
+
os (~> 1.1)
|
58
62
|
rake (~> 13.0)
|
59
63
|
runa!
|
60
64
|
standard (~> 1.3)
|
data/README.md
CHANGED
@@ -10,22 +10,65 @@ $ 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'
|
25
30
|
```
|
26
31
|
|
27
|
-
|
32
|
+
Or use gem_add command.
|
33
|
+
|
34
|
+
```
|
35
|
+
$ runa gem_add launchy
|
36
|
+
.
|
37
|
+
.
|
38
|
+
Generate '.runa/runa_load_path.rb'
|
39
|
+
```
|
40
|
+
|
41
|
+
### Run application
|
28
42
|
|
29
43
|
```
|
30
44
|
$ runa run
|
45
|
+
Hello, World!
|
46
|
+
```
|
47
|
+
|
48
|
+
### Deploy scripts for production execution
|
49
|
+
|
50
|
+
Mac/Linux/WSL
|
51
|
+
|
52
|
+
```
|
53
|
+
$ runa deploy
|
54
|
+
Generate '.runa/runa_app'
|
55
|
+
'.runa/runa_app' is the script to run. Copy it to any location and use it.
|
56
|
+
|
57
|
+
$ chmod +x .runa/runa_app
|
58
|
+
$ cp .runa/runa_app path/to/bin
|
59
|
+
$ runa_app
|
60
|
+
Hello, World!
|
61
|
+
```
|
62
|
+
|
63
|
+
Windows
|
64
|
+
|
65
|
+
```
|
66
|
+
PS> runa deploy
|
67
|
+
Generate '.runa/runa_load_path.rb'
|
68
|
+
Generate '.runa/runa_app.bat'
|
69
|
+
'.runa/runa_app.bat' is the script to run. Copy it to any location and use it.
|
70
|
+
|
71
|
+
PS> cp .runa\runa_app.bat path\to\bin
|
72
|
+
PS> runa_app
|
73
|
+
Hello, world!
|
31
74
|
```
|
data/exe/runa
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "runa"
|
4
4
|
require "thor"
|
5
5
|
require "fileutils"
|
6
|
+
require "os"
|
6
7
|
|
7
8
|
class RunaCli < Thor
|
8
9
|
def self.exit_on_failure?
|
@@ -19,20 +20,31 @@ class RunaCli < Thor
|
|
19
20
|
|
20
21
|
FileUtils.mkdir_p(name)
|
21
22
|
Dir.chdir(name) do
|
23
|
+
FileUtils.mkdir_p(RUNA_DIR)
|
24
|
+
File.write("#{RUNA_DIR}/.gitkeep", "")
|
22
25
|
FileUtils.mkdir_p(".bundle")
|
23
26
|
File.write(".bundle/config", "---\nBUNDLE_PATH: \"vendor/bundle\"\n")
|
24
27
|
FileUtils.mkdir_p("lib/#{name}")
|
25
28
|
File.write("lib/#{name}.rb", "require \"#{name}/lib\"\n")
|
26
29
|
File.write("lib/#{name}/lib.rb", "module #{module_name}\nend\n")
|
27
|
-
File.write(".gitignore", "/vendor/\n/.runa
|
30
|
+
File.write(".gitignore", "/vendor/\n/.runa/*\n!/.runa/.gitkeep\n")
|
28
31
|
File.write("Gemfile", "# frozen_string_literal: true\n\nsource \"https://rubygems.org\"\n\n# gem \"rails\"\n")
|
29
32
|
File.write("main.rb", "require \"#{name}\"\n\nputs \"Hello, world!\"")
|
30
33
|
end
|
34
|
+
|
35
|
+
puts "Created '#{name}' application."
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "gem_add", "Add gems"
|
39
|
+
def gem_add(*gems)
|
40
|
+
system("bundle add #{gems.join(" ")}")
|
41
|
+
deploy_load_path_script
|
31
42
|
end
|
32
43
|
|
33
44
|
desc "install", "Install gems"
|
34
45
|
def install
|
35
46
|
system("bundle install")
|
47
|
+
deploy_load_path_script
|
36
48
|
end
|
37
49
|
|
38
50
|
desc "run [ARGS]", "Run application with arguments"
|
@@ -41,33 +53,47 @@ class RunaCli < Thor
|
|
41
53
|
end
|
42
54
|
map "run" => "run_command"
|
43
55
|
|
44
|
-
desc "
|
45
|
-
def
|
56
|
+
desc "deploy", "Deploy scripts for production execution"
|
57
|
+
def deploy
|
46
58
|
root_dir = File.expand_path(".")
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
puts "'#{File.join(root_dir, RUNA_DIR, path)}' generated. It can be copied to any location."
|
54
|
-
end
|
59
|
+
deploy_script_name = File.basename(root_dir)
|
60
|
+
deploy_load_path_script
|
61
|
+
path = File.join(RUNA_DIR, deploy_script_name)
|
62
|
+
path += ".bat" if OS.windows?
|
63
|
+
File.write(path, deploy_script(root_dir))
|
64
|
+
puts "Generate '#{path}'\n'#{path}' is the script to run. Copy it to any location and use it."
|
55
65
|
end
|
56
66
|
|
57
67
|
private
|
58
68
|
|
59
69
|
RUNA_DIR = ".runa"
|
60
70
|
|
61
|
-
def
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
71
|
+
def deploy_script(root_dir)
|
72
|
+
lib_dir = File.join(root_dir, "lib")
|
73
|
+
runa_dir = File.join(root_dir, RUNA_DIR)
|
74
|
+
main_rb = File.join(root_dir, "main.rb")
|
75
|
+
|
76
|
+
if OS.windows?
|
77
|
+
lib_dir = lib_dir.tr("/", "\\")
|
78
|
+
runa_dir = runa_dir.tr("/", "\\")
|
79
|
+
main_rb = main_rb.tr("/", "\\")
|
80
|
+
|
81
|
+
<<~EOS
|
82
|
+
@ECHO OFF
|
83
|
+
@ruby -I"#{lib_dir}" -I"#{runa_dir}" -rruna_load_path #{main_rb} %*
|
84
|
+
EOS
|
85
|
+
else
|
86
|
+
<<~EOS
|
87
|
+
#!/bin/sh
|
88
|
+
ruby -I"#{lib_dir}" -I"#{runa_dir}" -rruna_load_path #{main_rb} $@
|
89
|
+
EOS
|
90
|
+
end
|
91
|
+
end
|
66
92
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
93
|
+
def deploy_load_path_script
|
94
|
+
path = "#{RUNA_DIR}/runa_load_path.rb"
|
95
|
+
File.write(path, load_path_script)
|
96
|
+
puts "Generate '#{path}'"
|
71
97
|
end
|
72
98
|
|
73
99
|
def load_path_script
|
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.4.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-
|
11
|
+
date: 2023-06-23 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
|