railsbuilder 0.1.15 → 0.1.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9994a3ff9f6e6de413c233e14c04fbc53e53533
4
- data.tar.gz: 2874fe55180335cf9fcf54d58295242cb23bf1c7
3
+ metadata.gz: 0542d81aceec2bf0ed09cc7705e73e4f0b5efb7f
4
+ data.tar.gz: 7e580cafc11d40047a12d07bd637e8d0db138eaa
5
5
  SHA512:
6
- metadata.gz: 7bcbbc4b40286bd54bd38d1c4946e3394df983f8c2b8807a49af511206f18c0a13832b75ed858b43b1cac384f4bd033c06001713afb60bf79c4f8eb48587e969
7
- data.tar.gz: b8196fc24190011b77d710668f129358e5679ada6793f7d74c30f0841a1146956244e130ccaa230db34e7f87aa857d0d95cd0469584f7939fa16e528561a197e
6
+ metadata.gz: ed064ac04fb8209dd9aaa2d276bdc5c2b44a9760556fc3f3c576fcb27a0edc8df041409e4a8a530331887ec734344271e55168efeda7453bc5acf60249aa3b8f
7
+ data.tar.gz: 0f6f804ebbb4f6d52ea520f544ba97efbeb27b6b65c9f5d263939988c7f9956bf0b9f86b2568fe3207b3cb994b2b806e1985eec681f178b992eb61dc0966d2d0
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- "G;5#�ӦT̫��
2
- O�|g�7T�r�Զϫe���t3��%���+��o�������{�5ۮk�\R�}��Ixb��*�� ���m�y�Ae�2ݬd *�����?�r��fx:j[�[an�&�@���/������"W=�
1
+ W#��Hӎ0r^ ���Q�E��{K�Yo��Q��W���H/�>�L�=�t�1 �8��|k!�^ʬ�-�^̰ d��?�C]���?�:���:�(���Y��T<�4s3�JR�A%ř�.��`>�^s�fM!��תϳJ�qk�M����)��!�Gq,w 9��cNZ���
2
+ ]@��٤r����0c��
3
+ ��`O�]c�?BSP L��HK�I��h��gM�:�F[z��t_w��N�}/s��A\�D
data/lib/railsbuilder.rb CHANGED
@@ -17,7 +17,7 @@ class RailsBuilder
17
17
 
18
18
  def initialize(filepath=nil, journal: false)
19
19
 
20
- @config, _ = RXFHelper.read(filepath) if filepath
20
+ @config = RXFHelper.read(filepath)[0].gsub(/^(\s{,5})#/,'\1;') 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, @config.gsub(/^(\s{,5})#/,'\1;'))
39
+ xml = parse(patterns, @config)
40
40
  @doc = Rexle.new xml
41
41
 
42
42
  @parent_path = Dir.pwd
@@ -44,7 +44,7 @@ class RailsBuilder
44
44
 
45
45
  end
46
46
 
47
- def build(auto: false)
47
+ def build(auto: false, desc: nil)
48
48
 
49
49
  doc = @doc.root
50
50
  @auto_override = auto
@@ -146,7 +146,7 @@ class RailsBuilder
146
146
 
147
147
  shell command
148
148
 
149
- trigger = "config: resources entry has been changed"
149
+ trigger = "config: model found for a controller which " + "doesn't yet exist"
150
150
  activity = "file: created app/controllers/posts_controller.rb"
151
151
  @notifications << [trigger, activity]
152
152
  end
@@ -322,7 +322,7 @@ class RailsBuilder
322
322
  end # / child iterator
323
323
  end
324
324
 
325
- snapshot() if @journal and @notifications.any?
325
+ snapshot(desc) if @journal and @notifications.any?
326
326
  Dir.chdir @parent_path
327
327
  @notifications.to_yaml
328
328
  end
@@ -340,11 +340,11 @@ class RailsBuilder
340
340
 
341
341
  level = 0 if a.length < 2
342
342
  record = a[level]
343
- path = record.desc
343
+ path = a[level].desc[/^[^;]+/]
344
344
 
345
345
  FileUtils.rm_rf @app_path
346
346
  FileUtils.copy_entry File.join(base, path), @app_path, preserve=true
347
- record.delete
347
+ a.last.delete
348
348
  dx.save
349
349
 
350
350
  path + ' app restored'
@@ -401,15 +401,18 @@ EOF
401
401
  end
402
402
  end
403
403
 
404
- def snapshot()
404
+ def snapshot(desc=nil)
405
405
 
406
- d, t = Time.now.strftime("%d-%b").downcase, Time.now.strftime("%H%M_%S")
406
+ d = Time.now.strftime("%d-%b").downcase
407
+ t = Time.now.strftime("%H%M_%S.%2N")
407
408
  snapshot_path = File.join(@tmp_path, 'railsbuilder', @app, d,t)
408
409
  FileUtils.mkdir_p snapshot_path
409
410
 
410
411
  FileUtils.copy_entry @app_path, snapshot_path, preserve=true
411
412
  al = ActivityLogger.new File.join(@tmp_path, 'railsbuilder', @app)
412
- al.create File.join(d,t)
413
+ s = File.join(d,t)
414
+ s << '; ' + desc if desc
415
+ al.create s
413
416
 
414
417
  self.save snapshot_path
415
418
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railsbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  bNcCWso1cJhifoTCytPAyf9YVuyU4HjqC3eqx3p00NCg0VoELwMEkyhkpvYOGz2l
32
32
  NSkTRB6yCN+xzQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-03-15 00:00:00.000000000 Z
34
+ date: 2014-03-16 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
metadata.gz.sig CHANGED
Binary file