railsbuilder 0.1.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e05e883a20532668f30074d5eabece34972b3933
4
- data.tar.gz: 9de0dcdc915379e03e79c818cc088a962294596d
3
+ metadata.gz: 6a3d4230fc6b0c21d1f52713b437c026b1341909
4
+ data.tar.gz: 7441ed3b3b1a4dba56709765cf70d750b680b91b
5
5
  SHA512:
6
- metadata.gz: 03bfd2520060e7a9bab38b962ccdafdfb2f972a14cd4cf97d06effb3138b566a256d0b68227914b6a41d3d481c4decd632e3aa1b0f72797ab2de49a2bbe5d028
7
- data.tar.gz: 203e991dd7c2128d8ab50a3e9e98dc607f4778c6c34c3deff60b01addd1d1f3bebc276e8a2b6be34954a5b589f8170adbb874dc4f6c5910c761a58aaddbac278
6
+ metadata.gz: ec7c6d5db236e66c2d068e0a22a89350a1d6bd02c42547689cbe162ef58c92d206c7454f10244b769d1b4c959128347180f869a9953fad71fecb328f6b174d1c
7
+ data.tar.gz: 42742008fe6040b01c221b735c32c5576484391662edc7bdc87e66830677b0b578267cb5394ef546201e434e89863613c737f8e9bce193dd43ed490bed9efdf3
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/railsbuilder.rb CHANGED
@@ -34,8 +34,11 @@ class RailsBuilder
34
34
  def build()
35
35
 
36
36
  @app = @h[:app][0][1][':app']
37
+ app_path = @h[:app][0][1][':app_path']
38
+ Dir.chdir app_path if app_path
37
39
 
38
40
  unless File.exists? @app then
41
+
39
42
  command = 'rails new ' + @app
40
43
  puts ":: preparing to execute shell command: `#{command}`"
41
44
  puts 'Are you sure you want to build a new app? (Y/n)'
@@ -46,6 +49,21 @@ class RailsBuilder
46
49
  Dir.chdir @app
47
50
 
48
51
  # select the :resource records
52
+ root = @h[:root][0][1][":root"]
53
+
54
+ if root then
55
+
56
+ # check if the config/routes.rb file needs updated
57
+ routes = File.join('config','routes.rb')
58
+ buffer = File.read routes
59
+
60
+ regex = / #( root 'welcome#index')/
61
+
62
+ if buffer[regex] then
63
+ puts ':: updating ' + routes
64
+ File.write routes, buffer.sub(regex, ' \1').sub('welcome#index',root)
65
+ end
66
+ end
49
67
 
50
68
  @h[:resource].each do |raw_resource|
51
69
 
@@ -104,6 +122,7 @@ app: #{dir}
104
122
  # resources: posts
105
123
  EOF
106
124
  end
125
+
107
126
  @config = s
108
127
  a = LineParser.new(patterns).parse s
109
128
  a.group_by(&:first)
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file