runa 0.3.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/Gemfile.lock +2 -1
- data/README.md +19 -10
- data/exe/runa +17 -10
- 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/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,40 +10,52 @@ $ 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
44
|
$ runa run
|
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
|
40
54
|
Generate '.runa/runa_app'
|
41
55
|
'.runa/runa_app' is the script to run. Copy it to any location and use it.
|
42
56
|
|
43
57
|
$ chmod +x .runa/runa_app
|
44
|
-
|
45
58
|
$ cp .runa/runa_app path/to/bin
|
46
|
-
|
47
59
|
$ runa_app
|
48
60
|
Hello, World!
|
49
61
|
```
|
@@ -51,15 +63,12 @@ Hello, World!
|
|
51
63
|
Windows
|
52
64
|
|
53
65
|
```
|
54
|
-
PS> runa
|
66
|
+
PS> runa deploy
|
55
67
|
Generate '.runa/runa_load_path.rb'
|
56
68
|
Generate '.runa/runa_app.bat'
|
57
69
|
'.runa/runa_app.bat' is the script to run. Copy it to any location and use it.
|
58
70
|
|
59
71
|
PS> cp .runa\runa_app.bat path\to\bin
|
60
|
-
|
61
72
|
PS> runa_app
|
62
73
|
Hello, world!
|
63
74
|
```
|
64
|
-
|
65
|
-
|
data/exe/runa
CHANGED
@@ -31,12 +31,20 @@ class RunaCli < Thor
|
|
31
31
|
File.write("Gemfile", "# frozen_string_literal: true\n\nsource \"https://rubygems.org\"\n\n# gem \"rails\"\n")
|
32
32
|
File.write("main.rb", "require \"#{name}\"\n\nputs \"Hello, world!\"")
|
33
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
|
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
50
|
desc "run [ARGS]", "Run application with arguments"
|
@@ -45,23 +53,22 @@ class RunaCli < Thor
|
|
45
53
|
end
|
46
54
|
map "run" => "run_command"
|
47
55
|
|
48
|
-
desc "
|
49
|
-
def
|
56
|
+
desc "deploy", "Deploy scripts for production execution"
|
57
|
+
def deploy
|
50
58
|
root_dir = File.expand_path(".")
|
51
|
-
|
52
|
-
|
53
|
-
path = File.join(RUNA_DIR,
|
59
|
+
deploy_script_name = File.basename(root_dir)
|
60
|
+
deploy_load_path_script
|
61
|
+
path = File.join(RUNA_DIR, deploy_script_name)
|
54
62
|
path += ".bat" if OS.windows?
|
55
|
-
File.write(path,
|
63
|
+
File.write(path, deploy_script(root_dir))
|
56
64
|
puts "Generate '#{path}'\n'#{path}' is the script to run. Copy it to any location and use it."
|
57
65
|
end
|
58
|
-
map "gen" => "generate"
|
59
66
|
|
60
67
|
private
|
61
68
|
|
62
69
|
RUNA_DIR = ".runa"
|
63
70
|
|
64
|
-
def
|
71
|
+
def deploy_script(root_dir)
|
65
72
|
lib_dir = File.join(root_dir, "lib")
|
66
73
|
runa_dir = File.join(root_dir, RUNA_DIR)
|
67
74
|
main_rb = File.join(root_dir, "main.rb")
|
@@ -83,7 +90,7 @@ class RunaCli < Thor
|
|
83
90
|
end
|
84
91
|
end
|
85
92
|
|
86
|
-
def
|
93
|
+
def deploy_load_path_script
|
87
94
|
path = "#{RUNA_DIR}/runa_load_path.rb"
|
88
95
|
File.write(path, load_path_script)
|
89
96
|
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.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-06-
|
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
|