rails_config_model_generator 1.1.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,8 +1,16 @@
1
+ == 1.2.1 / 2009-04-21
2
+
3
+ * Delete protection code uses count instead of find(:all).size. Man that was dumb.
4
+
5
+ == 1.2.0 / 2008-01-23
6
+
7
+ * Now generates html.erb instead of .rhtml for the edit form.
8
+
1
9
  == 1.1.0 / 2007-07-16
2
10
 
3
11
  * Specify model name and migration fields via generator
4
12
  * Updated tests
5
- * fixed syntax error in the conroller template
13
+ * fixed syntax error in the controller template
6
14
  * Rewrote the generator
7
15
  * Refactored configuration creation on load
8
16
  * updated tests
data/Manifest.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  History.txt
2
2
  Manifest.txt
3
- README.txt
3
+ README.rdoc
4
4
  Rakefile
5
5
  lib/rails_config_model.rb
6
6
  rails_config_model_generator.rb
@@ -63,7 +63,7 @@ Or save new values
63
63
 
64
64
  == INSTALL:
65
65
 
66
- Download and sudo gem install rails_config_model
66
+ Download and sudo gem install rails_config_model_generator
67
67
 
68
68
  == LICENSE:
69
69
 
data/Rakefile CHANGED
@@ -17,9 +17,12 @@ Hoe.new('rails_config_model_generator', RailsConfigModel::VERSION) do |p|
17
17
  p.rubyforge_name = 'rconfig'
18
18
  p.name = "rails_config_model_generator"
19
19
  p.author = ["Brian Hogan"]
20
+ p.email = "info@napcs.com"
20
21
  #p.remote_rdoc_dir = ''
21
22
  # p.summary = 'FIX'
22
- p.description = p.paragraphs_of('README.txt', 2..10).join("\n\n")
23
+ p.readme_file= "README.rdoc"
24
+ p.extra_rdoc_files = FileList['*.rdoc']
25
+ p.description = p.paragraphs_of('README.rdoc', 2..10).join("\n\n")
23
26
  p.url = "http://rconfig.rubyforge.org/"
24
27
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
25
28
  p.remote_rdoc_dir = ""
@@ -1,3 +1,3 @@
1
1
  class RailsConfigModel
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -44,7 +44,7 @@ class RailsConfigModelGenerator < Rails::Generator::NamedBase
44
44
  'configuration_controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
45
45
  )
46
46
 
47
- m.template("edit.rhtml", File.join("app/views", controller_class_path, controller_file_name, "edit.rhtml"))
47
+ m.template("edit.rhtml", File.join("app/views", controller_class_path, controller_file_name, "edit.html.erb"))
48
48
  m.template('functional_test.rb', File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
49
49
  m.template('unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb"))
50
50
  m.template('fixtures.yml', File.join('test/fixtures', "#{table_name}.yml"))
@@ -29,6 +29,6 @@ class <%=class_name %> < ActiveRecord::Base
29
29
 
30
30
  # Prevents the destruction or creation of more than one record.
31
31
  def check_for_existing
32
- return false if <%=class_name %>.find(:all).size >= 1
32
+ return false if <%=class_name %>.count >= 1
33
33
  end
34
34
  end
File without changes
data/templates/edit.rhtml CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,37 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: rails_config_model_generator
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.1.0
7
- date: 2007-10-25 00:00:00 -05:00
8
- summary: The author was too lazy to write a summary
9
- require_paths:
10
- - lib
11
- email: ryand-ruby@zenspider.com
12
- homepage: http://rconfig.rubyforge.org/
13
- rubyforge_project: rconfig
14
- description: "== DESCRIPTION: Creates a configuration controller and model that can be used to quickly create configuration table for your system so you can store system-wide variables that you'd like the user to be able to set. This gem contains a generator to create a simple configuration model, migration, and interface for your application, complete with working tests. == FEATURES * Generates the controller, model, and the associated files. * You can specify the model name and set the fields for the migrations via the generator. == SYNOPSIS: === Setup and overview Generate a new configuration system for your application by executing the generator from the root of your application. ruby script\\generate rails_config_model Configuration You can also specify the model fields much like the scaffold_resource generator ruby script/generate rails_config_model Configuration contact_email:string site_name:string welcome_message:text max_number_of_events:integer Once installed, you modify the generated migration to include the fields you want to configure. There are a few defaults there to give you an idea. The generator will create a controller mounted at /configuration so you can edit your configurations. Modify this as needed to provide for security. === The Edit form The application's edit form uses the *form* helper method to auto-generate the fields. This may not be optimal and you may wish to actually write your own view instead. See app/views/configuration/edit.rhtml for more details. === Usage Configuration is simply a model for this table. It is designed to handle a single row of a table, and so additional rows cannot be created. If you have a table that looks like this: id contact_email site_name welcome_message max_number_of_events You simply grab the row from the table @configuration = Configuration.load and then grab the values out. email = @configuration.contact_email Or save new values @configuration = Configuration.load @configuration.welcome_message = \"This is the default message.\" @configuraiton.save"
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.2.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Brian Hogan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-04-22 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hoe
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.12.2
24
+ version:
25
+ description: "== DESCRIPTION: Creates a configuration controller and model that can be used to quickly create configuration table for your system so you can store system-wide variables that you'd like the user to be able to set. This gem contains a generator to create a simple configuration model, migration, and interface for your application, complete with working tests. == FEATURES * Generates the controller, model, and the associated files. * You can specify the model name and set the fields for the migrations via the generator. == SYNOPSIS: === Setup and overview Generate a new configuration system for your application by executing the generator from the root of your application. ruby script\\generate rails_config_model Configuration You can also specify the model fields much like the scaffold_resource generator ruby script/generate rails_config_model Configuration contact_email:string site_name:string welcome_message:text max_number_of_events:integer Once installed, you modify the generated migration to include the fields you want to configure. There are a few defaults there to give you an idea. The generator will create a controller mounted at /configuration so you can edit your configurations. Modify this as needed to provide for security. === The Edit form The application's edit form uses the *form* helper method to auto-generate the fields. This may not be optimal and you may wish to actually write your own view instead. See app/views/configuration/edit.rhtml for more details. === Usage Configuration is simply a model for this table. It is designed to handle a single row of a table, and so additional rows cannot be created. If you have a table that looks like this: id contact_email site_name welcome_message max_number_of_events You simply grab the row from the table @configuration = Configuration.load and then grab the values out. email = @configuration.contact_email Or save new values @configuration = Configuration.load @configuration.welcome_message = \"This is the default message.\" @configuraiton.save"
26
+ email: info@napcs.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - History.txt
33
+ - Manifest.txt
34
+ - README.rdoc
31
35
  files:
32
36
  - History.txt
33
37
  - Manifest.txt
34
- - README.txt
38
+ - README.rdoc
35
39
  - Rakefile
36
40
  - lib/rails_config_model.rb
37
41
  - rails_config_model_generator.rb
@@ -42,20 +46,32 @@ files:
42
46
  - templates/functional_test.rb
43
47
  - templates/migration.rb
44
48
  - templates/unit_test.rb
45
- test_files:
46
- - test/test_rails_config_model.rb
49
+ has_rdoc: true
50
+ homepage: http://rconfig.rubyforge.org/
51
+ post_install_message:
47
52
  rdoc_options:
48
53
  - --main
49
- - README.txt
50
- extra_rdoc_files:
51
- - History.txt
52
- - Manifest.txt
53
- - README.txt
54
- executables: []
55
-
56
- extensions: []
57
-
54
+ - README.rdoc
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ version:
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
58
69
  requirements: []
59
70
 
60
- dependencies: []
61
-
71
+ rubyforge_project: rconfig
72
+ rubygems_version: 1.3.1
73
+ signing_key:
74
+ specification_version: 2
75
+ summary: Creates a configuration controller and model that can be used to quickly create configuration table for your system so you can store system-wide variables that you'd like the user to be able to set
76
+ test_files:
77
+ - test/test_rails_config_model.rb