railsbuilder 0.1.14 → 0.1.15
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/railsbuilder.rb +31 -5
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9994a3ff9f6e6de413c233e14c04fbc53e53533
|
4
|
+
data.tar.gz: 2874fe55180335cf9fcf54d58295242cb23bf1c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bcbbc4b40286bd54bd38d1c4946e3394df983f8c2b8807a49af511206f18c0a13832b75ed858b43b1cac384f4bd033c06001713afb60bf79c4f8eb48587e969
|
7
|
+
data.tar.gz: b8196fc24190011b77d710668f129358e5679ada6793f7d74c30f0841a1146956244e130ccaa230db34e7f87aa857d0d95cd0469584f7939fa16e528561a197e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/railsbuilder.rb
CHANGED
@@ -17,7 +17,7 @@ class RailsBuilder
|
|
17
17
|
|
18
18
|
def initialize(filepath=nil, journal: false)
|
19
19
|
|
20
|
-
|
20
|
+
@config, _ = RXFHelper.read(filepath) if filepath
|
21
21
|
@tmp_path = @journal = journal == true ? Dir.tmpdir : journal if journal
|
22
22
|
|
23
23
|
patterns = [
|
@@ -36,7 +36,7 @@ class RailsBuilder
|
|
36
36
|
[:all, /^\s*;/, :comment]
|
37
37
|
]
|
38
38
|
|
39
|
-
xml = parse(patterns,
|
39
|
+
xml = parse(patterns, @config.gsub(/^(\s{,5})#/,'\1;'))
|
40
40
|
@doc = Rexle.new xml
|
41
41
|
|
42
42
|
@parent_path = Dir.pwd
|
@@ -64,10 +64,14 @@ class RailsBuilder
|
|
64
64
|
+ "exist as a file directory"
|
65
65
|
activity = "new Rails app created"
|
66
66
|
@notifications << [trigger,activity]
|
67
|
+
|
68
|
+
else
|
69
|
+
|
67
70
|
end
|
68
71
|
|
69
72
|
@app_path = app_path = doc.element('app_path/@app_path') ||
|
70
|
-
|
73
|
+
File.join(@parent_path, app)
|
74
|
+
|
71
75
|
Dir.chdir app_path
|
72
76
|
|
73
77
|
# select the :resource records
|
@@ -327,14 +331,34 @@ class RailsBuilder
|
|
327
331
|
@notifications.to_yaml
|
328
332
|
end
|
329
333
|
|
330
|
-
def
|
331
|
-
|
334
|
+
def restore(level=-2)
|
335
|
+
|
336
|
+
base = File.join(@tmp_path, 'railsbuilder', @app)
|
337
|
+
dx = Dynarex.new File.join(base, 'dynarexdaily.xml')
|
338
|
+
a = dx.all
|
339
|
+
return 'no restore points available' if a.length < 1
|
340
|
+
|
341
|
+
level = 0 if a.length < 2
|
342
|
+
record = a[level]
|
343
|
+
path = record.desc
|
344
|
+
|
345
|
+
FileUtils.rm_rf @app_path
|
346
|
+
FileUtils.copy_entry File.join(base, path), @app_path, preserve=true
|
347
|
+
record.delete
|
348
|
+
dx.save
|
349
|
+
|
350
|
+
path + ' app restored'
|
351
|
+
end
|
352
|
+
|
353
|
+
def save(filepath=@parent_path)
|
354
|
+
File.write File.join(filepath, "#{@app}.cfg"), @config
|
332
355
|
end
|
333
356
|
|
334
357
|
def to_doc()
|
335
358
|
@doc
|
336
359
|
end
|
337
360
|
|
361
|
+
|
338
362
|
private
|
339
363
|
|
340
364
|
def parse(patterns, s=nil)
|
@@ -386,6 +410,8 @@ EOF
|
|
386
410
|
FileUtils.copy_entry @app_path, snapshot_path, preserve=true
|
387
411
|
al = ActivityLogger.new File.join(@tmp_path, 'railsbuilder', @app)
|
388
412
|
al.create File.join(d,t)
|
413
|
+
|
414
|
+
self.save snapshot_path
|
389
415
|
end
|
390
416
|
|
391
417
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|