grimen-dry_scaffold 0.2.4 → 0.2.5

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.
data/CHANGELOG.textile CHANGED
@@ -1,3 +1,16 @@
1
+ h1. 0.2.5 (2009-06-12)
2
+
3
+ * Fixed typo: Gem configuration instructions in README.
4
+ * Fixed bug: Re-generated gemspec - missing files. (cjheath)
5
+
6
+ h1. 0.2.4 (2009-05-19)
7
+
8
+ * Fixed bug: Causing generator to fail if test/unit/helpers path don't exist.
9
+
10
+ h1. 0.2.3 (2009-05-12)
11
+
12
+ * Fixed bug: Missing executables in gemspec.
13
+
1
14
  h1. 0.2.2 (2009-05-06)
2
15
 
3
16
  * Feature: Specifying actions new+ instead of new, then actions new/create. Same applies to edit+, i.e. edit/update.
data/README.textile CHANGED
@@ -188,7 +188,7 @@ h4. Gem (Recommended)
188
188
 
189
189
  ...and in config: @config/environments/development.rb@
190
190
 
191
- <pre>config.gem 'grimen-dry_scaffold', :lib => 'dry_scaffold', :source => 'http://gems.github.com'</pre>
191
+ <pre>config.gem 'grimen-dry_scaffold', :lib => false, :source => 'http://gems.github.com'</pre>
192
192
 
193
193
  h4. Plugin
194
194
 
@@ -0,0 +1,22 @@
1
+ ---
2
+ dry_scaffold:
3
+ args:
4
+ actions: index,show,new,edit,create,update,destroy
5
+ formats: html,js,xml,json
6
+ options:
7
+ formtastic: true
8
+ resourceful: true
9
+ pagination: true
10
+ views: true
11
+ helpers: true
12
+ tests: true
13
+ layout: false
14
+ dry_model:
15
+ options:
16
+ fixtures: false
17
+ fgirl: false
18
+ machinist: false
19
+ object_daddy: false
20
+ migration: true
21
+ timestamps: true
22
+ tests: true
@@ -0,0 +1,36 @@
1
+ module SetupHelper
2
+
3
+ # Add gem configuration to a specified Rails environment file
4
+ def config_gems(config_file, gems)
5
+ sentinel = 'Rails::Initializer.run do |config|'
6
+ config_line = ''
7
+
8
+ gems.each do |gem|
9
+ gem_info = gem.to_s.split('-')
10
+ if gem_info.size > 1
11
+ gem_owner = gem_info[0]
12
+ gem_lib = gem_info[1]
13
+ config_line = "config.gem '#{gem_owner}-#{gem_lib}', :lib => '#{gem_lib}'"
14
+ else
15
+ gem_lib = gem_info[0]
16
+ config_line = "config.gem '#{gem_lib}'"
17
+ end
18
+
19
+ gsub_file_if_missing config_file, /(#{Regexp.escape(sentinel)})/mi, config_line do |match|
20
+ "#{match}\n #{config_line}"
21
+ end
22
+ end
23
+ end
24
+
25
+ # Add info to specified file and beneath specified regex if the expression don't exist in the file.
26
+ def gsub_file_if_missing(path, regexp, new_exp, *args, &block)
27
+ existing_content = File.read(path)
28
+ unless existing_content =~ /(#{new_exp.strip}|#{new_exp.strip.tr('\'', '\"')})/
29
+ content = File.read(path).gsub(regexp, *args, &block)
30
+ else
31
+ content = existing_content
32
+ end
33
+ File.open(path, 'wb') { |file| file.write(content) }
34
+ end
35
+
36
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grimen-dry_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Grimfelt
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-19 00:00:00 -07:00
12
+ date: 2009-06-12 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -36,6 +36,7 @@ files:
36
36
  - bin/dry_model
37
37
  - bin/dry_scaffold
38
38
  - bin/dscaffold
39
+ - config/scaffold.yml
39
40
  - generators/dmodel/dmodel_generator.rb
40
41
  - generators/dry_model/USAGE
41
42
  - generators/dry_model/dry_model_generator.rb
@@ -82,6 +83,7 @@ files:
82
83
  - generators/dry_scaffold/templates/views/haml/new.html.haml
83
84
  - generators/dry_scaffold/templates/views/haml/show.html.haml
84
85
  - generators/dscaffold/dscaffold_generator.rb
86
+ - lib/setup_helper.rb
85
87
  - rails/init.rb
86
88
  - tasks/dry_scaffold.rake
87
89
  has_rdoc: false