rbytes 0.1.1 → 0.1.3
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 +8 -0
- data/README.md +12 -4
- data/lib/ruby_bytes/test_case.rb +4 -3
- data/lib/ruby_bytes/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3aaeb47c729c4b3246544749d77204d17ecd9b27319158770cd8047cbb4c284
|
4
|
+
data.tar.gz: 5d7da2c374643dad62d6047f406488ef092d7bb2f2464fc211a8fa35cd83f896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e288e3f5c61130bdc676ca3a8bf14e40e6c796366283c27b7067e3588057bf516a3d160cca8547216f91f805d614c5e646453f84382bd528f2d1973c0b8dffe4
|
7
|
+
data.tar.gz: 7b539e851f07d83a897477413c8ed4f1b2f399b985523085d037c123df6c01285de54702bd1c0392be146a7a7424f3654245641efbdd068f89c8f5d9776713fb
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.1.3 (2023-03-20)
|
6
|
+
|
7
|
+
- Fix preparing dummy to alwasy set destination.
|
8
|
+
|
9
|
+
## 0.1.2 (2023-03-20)
|
10
|
+
|
11
|
+
- Add missing `rbytes` executable to the gemspec.
|
12
|
+
|
5
13
|
## 0.1.1 (2023-03-20)
|
6
14
|
|
7
15
|
- Add Ruby Bytes project generator (see `templates/generator`).
|
data/README.md
CHANGED
@@ -53,7 +53,15 @@ You can also install Ruby Bytes as a plugin for Thor (see [Thor integration](#th
|
|
53
53
|
|
54
54
|
## Writing templates
|
55
55
|
|
56
|
-
|
56
|
+
The quickest way to get started with using Ruby Bytes to build templates is to use our generator to create a project:
|
57
|
+
|
58
|
+
```sh
|
59
|
+
$ rbytes install https://railsbytes.com/script/V2GsbB
|
60
|
+
|
61
|
+
...
|
62
|
+
```
|
63
|
+
|
64
|
+
### Splitting template into partials
|
57
65
|
|
58
66
|
Ruby Bytes adds partial support to Thor/Rails templates. For that, you can use `#include` and `#render` methods:
|
59
67
|
|
@@ -80,7 +88,7 @@ cable_adapter = ask? "Which AnyCable pub/sub adapter do you want to use?"
|
|
80
88
|
file "config/anycable.yml", <%= code("anycable.yml") %>
|
81
89
|
```
|
82
90
|
|
83
|
-
The compiled template will
|
91
|
+
The compiled template will look like this:
|
84
92
|
|
85
93
|
```erb
|
86
94
|
cable_adapter = ask? "Which AnyCable pub/sub adapter do you want to use?"
|
@@ -94,7 +102,7 @@ file "config/anycable.yml", ERB.new(
|
|
94
102
|
], trim_mode: "<>").result(binding)
|
95
103
|
```
|
96
104
|
|
97
|
-
**NOTE:** By default, we assume that partials are stored next to the template's
|
105
|
+
**NOTE:** By default, we assume that partials are stored next to the template's entry-point. Partials may have the "_" prefix and ".rb" or ".tt" suffixes.
|
98
106
|
|
99
107
|
### Compiling templates
|
100
108
|
|
@@ -251,7 +259,7 @@ Bug reports and pull requests are welcome on GitHub at [https://github.com/palka
|
|
251
259
|
|
252
260
|
## Credits
|
253
261
|
|
254
|
-
This gem is generated via [
|
262
|
+
This gem is generated via [`newgem` template](https://github.com/palkan/newgem) by [@palkan](https://github.com/palkan).
|
255
263
|
|
256
264
|
## License
|
257
265
|
|
data/lib/ruby_bytes/test_case.rb
CHANGED
@@ -88,14 +88,15 @@ module RubyBytes
|
|
88
88
|
dummy = self.class.dummy_app
|
89
89
|
return unless dummy
|
90
90
|
|
91
|
-
return if @dummy_prepared
|
92
|
-
|
93
91
|
raise ArgumentError, "Dummy app must be a directory" unless File.directory?(dummy)
|
94
92
|
|
95
93
|
tmp_dummy_path = File.join(TMP_DIR, "dummy")
|
94
|
+
self.destination = tmp_dummy_path
|
95
|
+
|
96
|
+
return if @dummy_prepared
|
97
|
+
|
96
98
|
FileUtils.rm_rf(tmp_dummy_path) if File.directory?(tmp_dummy_path)
|
97
99
|
FileUtils.cp_r(dummy, tmp_dummy_path)
|
98
|
-
self.destination = tmp_dummy_path
|
99
100
|
|
100
101
|
if block_given?
|
101
102
|
Dir.chdir(tmp_dummy_path) { yield }
|
data/lib/ruby_bytes/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbytes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -70,7 +70,8 @@ description: Ruby Bytes is a tool to build application templates for Ruby and Ra
|
|
70
70
|
applications
|
71
71
|
email:
|
72
72
|
- dementiev.vm@gmail.com
|
73
|
-
executables:
|
73
|
+
executables:
|
74
|
+
- rbytes
|
74
75
|
extensions: []
|
75
76
|
extra_rdoc_files: []
|
76
77
|
files:
|