runa 0.1.0 → 0.2.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 +3 -1
- data/LICENSE.txt +20 -0
- data/README.md +19 -19
- data/exe/runa +36 -1
- data/lib/runa/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 260b2cf570fb222aa1a71e6bd9eb44bd08194b878f11c9f58a80267e8fd49a58
|
4
|
+
data.tar.gz: 9c8ed4bc10a3013ea7d04bacdbb3eb039dc6503f6d2b3e58226ee698b11d36bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff244c05be35715fa140c7b9f5e800e295d07ac33c57cffe19ee9fd6f485bda88118dffedbfb4b9ed8d90e6a33c931331a40dd8449b2baa5dd3a5e7b89ac6971
|
7
|
+
data.tar.gz: 81ffcabaa804a8654966790ce260aabe41ee044587bdc33e10184062dfa0ed5063ebb2911e065afb3af2645e2071921eba533f28c63fa64ba98227f7c703eaef
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2023 ongaeshi
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
# Runa
|
2
2
|
|
3
|
-
|
3
|
+
Runa is a command line interface for easily creating Ruby applications.
|
4
4
|
|
5
|
-
|
5
|
+
## Install
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
Install the gem and add to the application's Gemfile by executing:
|
12
|
-
|
13
|
-
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
14
|
-
|
15
|
-
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
|
-
|
17
|
-
$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
7
|
+
```
|
8
|
+
$ gem install runa
|
9
|
+
```
|
18
10
|
|
19
11
|
## Usage
|
20
12
|
|
21
|
-
|
13
|
+
Create a new application.
|
22
14
|
|
23
|
-
|
15
|
+
```
|
16
|
+
$ runa new runa_app
|
17
|
+
$ cd runa_app
|
18
|
+
```
|
24
19
|
|
25
|
-
|
20
|
+
If you need a gem, Write it in the `Gemfile`.
|
26
21
|
|
27
|
-
|
22
|
+
```
|
23
|
+
$ code Gemfile
|
24
|
+
$ runa install
|
25
|
+
```
|
28
26
|
|
29
|
-
|
27
|
+
Run application.
|
30
28
|
|
31
|
-
|
29
|
+
```
|
30
|
+
$ runa run
|
31
|
+
```
|
data/exe/runa
CHANGED
@@ -24,7 +24,7 @@ class RunaCli < Thor
|
|
24
24
|
FileUtils.mkdir_p("lib/#{name}")
|
25
25
|
File.write("lib/#{name}.rb", "require \"#{name}/lib\"\n")
|
26
26
|
File.write("lib/#{name}/lib.rb", "module #{module_name}\nend\n")
|
27
|
-
File.write(".gitignore", "/vendor
|
27
|
+
File.write(".gitignore", "/vendor/\n/.runa/\n")
|
28
28
|
File.write("Gemfile", "# frozen_string_literal: true\n\nsource \"https://rubygems.org\"\n\n# gem \"rails\"\n")
|
29
29
|
File.write("main.rb", "require \"#{name}\"\n\nputs \"Hello, world!\"")
|
30
30
|
end
|
@@ -40,6 +40,41 @@ class RunaCli < Thor
|
|
40
40
|
system("bundle exec ruby -Ilib main.rb #{args.join(" ")}")
|
41
41
|
end
|
42
42
|
map "run" => "run_command"
|
43
|
+
|
44
|
+
desc "release", "Release scripts for production execution"
|
45
|
+
def release
|
46
|
+
root_dir = File.expand_path(".")
|
47
|
+
release_script_name = File.basename(root_dir)
|
48
|
+
FileUtils.mkdir_p(RUNA_DIR)
|
49
|
+
Dir.chdir(RUNA_DIR) do
|
50
|
+
File.write("runa_load_path.rb", load_path_script)
|
51
|
+
path = "#{release_script_name}.bat"
|
52
|
+
File.write(path, release_script(root_dir))
|
53
|
+
puts "'#{File.join(root_dir, RUNA_DIR, path)}' generated. It can be copied to any location."
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
RUNA_DIR = ".runa"
|
60
|
+
|
61
|
+
def release_script(root_dir)
|
62
|
+
# TODO: Linux
|
63
|
+
lib_dir = File.join(root_dir, "lib").tr("/", "\\")
|
64
|
+
runa_dir = File.join(root_dir, RUNA_DIR).tr("/", "\\")
|
65
|
+
main_rb = File.join(root_dir, "main.rb").tr("/", "\\")
|
66
|
+
|
67
|
+
<<~EOS
|
68
|
+
@ECHO OFF
|
69
|
+
@ruby -I"#{lib_dir}" -I"#{runa_dir}" -rruna_load_path #{main_rb} %*"
|
70
|
+
EOS
|
71
|
+
end
|
72
|
+
|
73
|
+
def load_path_script
|
74
|
+
str = `bundle exec ruby -e 'puts \$LOAD_PATH.grep(/vendor\\/bundle/)'`
|
75
|
+
paths = str.split("\n").map { |e| "\"#{e}\"" }.join(",")
|
76
|
+
"$LOAD_PATH.unshift(#{paths})\n"
|
77
|
+
end
|
43
78
|
end
|
44
79
|
|
45
80
|
RunaCli.start(ARGV)
|
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.2.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-05-
|
11
|
+
date: 2023-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- CHANGELOG.md
|
37
37
|
- Gemfile
|
38
38
|
- Gemfile.lock
|
39
|
+
- LICENSE.txt
|
39
40
|
- README.md
|
40
41
|
- Rakefile
|
41
42
|
- exe/runa
|