buildless-app 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/buildless-app.gemspec +1 -0
- data/lib/buildless/rails_app.rb +9 -0
- data/lib/buildless/version.rb +1 -1
- data/lib/buildless-app.rb +42 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 219b856945bbbb1ac72ef8cadcb98d74e684c453671036748608628accd03b29
|
4
|
+
data.tar.gz: 74e038f78b8c93bbdf96ef6cad6b03575c0114685e29777d022eed69fd2944f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97c5bb077ed20824bd08acae3f45741b51181b8a21343c37e93e551527ab186ba155313da1760d34dfddb6310cec7ab9d33f7bcb9fe63b41133d34bd833b08b0
|
7
|
+
data.tar.gz: 1937ed9a6b2846316243888ce8a3fa7ded1133d245c13009618b5ac6b9a2c83fdef8183546dab3c6eb523ff37e852fc1d69a0f04c3619385f8479565f30e7029
|
data/buildless-app.gemspec
CHANGED
data/lib/buildless/version.rb
CHANGED
data/lib/buildless-app.rb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
require 'rest-client'
|
4
4
|
require 'json'
|
5
5
|
require 'fileutils'
|
6
|
+
require 'thor'
|
6
7
|
|
7
8
|
require 'buildless/cli/fetch_template'
|
8
9
|
require 'buildless/cli/processor'
|
9
10
|
require 'buildless/version'
|
11
|
+
require 'buildless/rails_app'
|
10
12
|
|
11
13
|
module Buildless
|
12
14
|
RailsNotInstalled = Class.new(StandardError)
|
@@ -16,6 +18,12 @@ module Buildless
|
|
16
18
|
verify_rails_installation
|
17
19
|
generate_project(template)
|
18
20
|
generate_files(template['files'])
|
21
|
+
run_bundle_commands(template['bundle_commands'])
|
22
|
+
clone_files(template['clones'])
|
23
|
+
inject_code(template['inject_code'])
|
24
|
+
append_code(template['append_code'])
|
25
|
+
|
26
|
+
puts 'Time for coding! 🚀'
|
19
27
|
end
|
20
28
|
|
21
29
|
private
|
@@ -40,5 +48,39 @@ module Buildless
|
|
40
48
|
File.write(file_path, file['content'])
|
41
49
|
end
|
42
50
|
end
|
51
|
+
|
52
|
+
def run_bundle_commands(commands)
|
53
|
+
commands.each do |command|
|
54
|
+
system command
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def inject_code(injections)
|
59
|
+
return if injections.nil? || injections.empty?
|
60
|
+
|
61
|
+
thor_app = ::Buildless::RailsApp.new
|
62
|
+
|
63
|
+
injections.each do |injection|
|
64
|
+
thor_app.inject_into_class(injection['file_path'], injection['class_name'], injection['content'])
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def append_code(appends)
|
69
|
+
return if appends.nil? || appends.empty?
|
70
|
+
|
71
|
+
thor_app = ::Buildless::RailsApp.new
|
72
|
+
|
73
|
+
appends.each do |append|
|
74
|
+
thor_app.append_to_file(append['file_path'], append['content'])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def clone_files(files)
|
79
|
+
return if files.nil? || files.empty?
|
80
|
+
|
81
|
+
files.each do |file|
|
82
|
+
FileUtils.cp(file['from'], file['to'])
|
83
|
+
end
|
84
|
+
end
|
43
85
|
end
|
44
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildless-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Dąbrowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.3.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.3.1
|
27
41
|
description: Speed up Rails app bootstraping
|
28
42
|
email:
|
29
43
|
- contact@paweldabrowski.com
|
@@ -38,6 +52,7 @@ files:
|
|
38
52
|
- lib/buildless-app.rb
|
39
53
|
- lib/buildless/cli/fetch_template.rb
|
40
54
|
- lib/buildless/cli/processor.rb
|
55
|
+
- lib/buildless/rails_app.rb
|
41
56
|
- lib/buildless/version.rb
|
42
57
|
homepage: https://buildless.app
|
43
58
|
licenses:
|