dynamic_fieldsets 0.0.7 → 0.0.8

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 CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.0.8
2
+
3
+ * Added controller and views generators
4
+
1
5
  == 0.0.7
2
6
 
3
7
  * Namespaced the models and tables in the install migration
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dynamic_fieldsets}
8
- s.version = "0.0.7"
8
+ s.version = "0.0.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Jeremiah Hemphill}, %q{Ethan Pemble}, %q{John Carter}]
12
- s.date = %q{2011-11-10}
12
+ s.date = %q{2012-01-18}
13
13
  s.description = %q{Dynamic fieldsets for rails controllers}
14
14
  s.email = %q{jeremiah@cloudspace.com}
15
15
  s.extra_rdoc_files = [
@@ -77,9 +77,11 @@ Gem::Specification.new do |s|
77
77
  "lib/dynamic_fieldsets/dynamic_fieldsets_in_model.rb",
78
78
  "lib/dynamic_fieldsets/engine.rb",
79
79
  "lib/dynamic_fieldsets/railtie.rb",
80
+ "lib/generators/dynamic_fieldsets/controllers_generator.rb",
80
81
  "lib/generators/dynamic_fieldsets/install_generator.rb",
81
82
  "lib/generators/dynamic_fieldsets/templates/config.rb",
82
83
  "lib/generators/dynamic_fieldsets/templates/migrations/install_migration.rb",
84
+ "lib/generators/dynamic_fieldsets/views_generator.rb",
83
85
  "spec/dummy/Rakefile",
84
86
  "spec/dummy/app/controllers/application_controller.rb",
85
87
  "spec/dummy/app/controllers/information_forms_controller.rb",
@@ -0,0 +1,33 @@
1
+ require 'rails/generators'
2
+
3
+ module DynamicFieldsets
4
+ module Generators
5
+ # Generator for copying the controllers into the project
6
+ #
7
+ # @author Jeremiah Hemphill
8
+ class ControllersGenerator < Rails::Generators::Base
9
+
10
+ source_root File.expand_path('../../../../app/controllers/dynamic_fieldsets/', __FILE__)
11
+
12
+ desc <<DESC
13
+ Description:
14
+ Copies over controllers for the multipart form system.
15
+ DESC
16
+
17
+ desc''
18
+ def copy_or_fetch #:nodoc:
19
+ return copy_all_controllers
20
+ end
21
+
22
+ private
23
+
24
+ # copies all controllers in the source_root to app/controllers/dynamic_fieldsets
25
+ def copy_all_controllers
26
+ filename_pattern = File.join self.class.source_root, "*.rb"
27
+ Dir.glob(filename_pattern).map { |f| File.basename f}.each do |f|
28
+ copy_file f, "app/controllers/dynamic_fieldsets/#{f}"
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,42 @@
1
+ require 'rails/generators'
2
+
3
+ module DynamicFieldsets
4
+ module Generators
5
+ # Generator for copying the views into the project
6
+ #
7
+ # @author Jeremiah Hemphill
8
+ class ViewsGenerator < Rails::Generators::Base
9
+
10
+ source_root File.expand_path('../../../../app/views/dynamic_fieldsets/', __FILE__)
11
+
12
+ desc <<DESC
13
+ Description:
14
+ Copies over controller and views for the multipart form system.
15
+ DESC
16
+
17
+ desc''
18
+ def copy_or_fetch#:nodoc:
19
+ view_directory :fields
20
+ view_directory :fieldset_associators
21
+ view_directory :fieldset_children
22
+ view_directory :fieldsets
23
+ view_directory :shared
24
+ end
25
+
26
+ private
27
+
28
+ # copy an indivindual directory to the target project
29
+ # @param [Symbol] name Name of the directory
30
+ # @param [String] _target_path Location of the directory
31
+ def view_directory(name, _target_path = nil)
32
+ directory name.to_s, _target_path || "#{target_path}/#{name}"
33
+ end
34
+
35
+ # base path to put the copied views into
36
+ def target_path
37
+ "app/views/dynamic_fieldsets"
38
+ end
39
+ end
40
+ end
41
+ end
42
+
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynamic_fieldsets
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jeremiah Hemphill
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-11-10 00:00:00 Z
15
+ date: 2012-01-18 00:00:00 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails
@@ -249,9 +249,11 @@ files:
249
249
  - lib/dynamic_fieldsets/dynamic_fieldsets_in_model.rb
250
250
  - lib/dynamic_fieldsets/engine.rb
251
251
  - lib/dynamic_fieldsets/railtie.rb
252
+ - lib/generators/dynamic_fieldsets/controllers_generator.rb
252
253
  - lib/generators/dynamic_fieldsets/install_generator.rb
253
254
  - lib/generators/dynamic_fieldsets/templates/config.rb
254
255
  - lib/generators/dynamic_fieldsets/templates/migrations/install_migration.rb
256
+ - lib/generators/dynamic_fieldsets/views_generator.rb
255
257
  - spec/dummy/Rakefile
256
258
  - spec/dummy/app/controllers/application_controller.rb
257
259
  - spec/dummy/app/controllers/information_forms_controller.rb
@@ -349,7 +351,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
349
351
  requirements:
350
352
  - - ">="
351
353
  - !ruby/object:Gem::Version
352
- hash: -3894794992591398947
354
+ hash: -2041176636100480395
353
355
  segments:
354
356
  - 0
355
357
  version: "0"