fetty-generators 1.7.1

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.
Files changed (75) hide show
  1. data/Gemfile +2 -0
  2. data/LICENSE +20 -0
  3. data/README.rdoc +69 -0
  4. data/Rakefile +3 -0
  5. data/lib/generators/fetty/layout/USAGE +26 -0
  6. data/lib/generators/fetty/layout/layout_generator.rb +44 -0
  7. data/lib/generators/fetty/layout/templates/application.js +55 -0
  8. data/lib/generators/fetty/layout/templates/error_messages_helper.rb +23 -0
  9. data/lib/generators/fetty/layout/templates/layout.html.erb +32 -0
  10. data/lib/generators/fetty/layout/templates/layout.html.haml +34 -0
  11. data/lib/generators/fetty/layout/templates/layout_helper.rb +22 -0
  12. data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.erb +23 -0
  13. data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.haml +23 -0
  14. data/lib/generators/fetty/layout/templates/stylesheet.css +166 -0
  15. data/lib/generators/fetty/layout/templates/stylesheet.sass +163 -0
  16. data/lib/generators/fetty/scaffold/USAGE +53 -0
  17. data/lib/generators/fetty/scaffold/scaffold_generator.rb +370 -0
  18. data/lib/generators/fetty/scaffold/templates/actions/create.rb +8 -0
  19. data/lib/generators/fetty/scaffold/templates/actions/destroy.rb +5 -0
  20. data/lib/generators/fetty/scaffold/templates/actions/edit.rb +3 -0
  21. data/lib/generators/fetty/scaffold/templates/actions/index.rb +10 -0
  22. data/lib/generators/fetty/scaffold/templates/actions/new.rb +3 -0
  23. data/lib/generators/fetty/scaffold/templates/actions/show.rb +3 -0
  24. data/lib/generators/fetty/scaffold/templates/actions/update.rb +8 -0
  25. data/lib/generators/fetty/scaffold/templates/controller.rb +7 -0
  26. data/lib/generators/fetty/scaffold/templates/fixtures.yml +9 -0
  27. data/lib/generators/fetty/scaffold/templates/helper.rb +2 -0
  28. data/lib/generators/fetty/scaffold/templates/migration.rb +16 -0
  29. data/lib/generators/fetty/scaffold/templates/model.rb +7 -0
  30. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/create.rb +11 -0
  31. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/destroy.rb +6 -0
  32. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/edit.rb +4 -0
  33. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/index.rb +4 -0
  34. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/new.rb +4 -0
  35. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/show.rb +4 -0
  36. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/update.rb +11 -0
  37. data/lib/generators/fetty/scaffold/templates/tests/rspec/controller.rb +8 -0
  38. data/lib/generators/fetty/scaffold/templates/tests/rspec/model.rb +7 -0
  39. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/create.rb +13 -0
  40. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/destroy.rb +8 -0
  41. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/edit.rb +6 -0
  42. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/index.rb +6 -0
  43. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/new.rb +6 -0
  44. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/show.rb +6 -0
  45. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/update.rb +13 -0
  46. data/lib/generators/fetty/scaffold/templates/tests/shoulda/controller.rb +5 -0
  47. data/lib/generators/fetty/scaffold/templates/tests/shoulda/model.rb +7 -0
  48. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/create.rb +11 -0
  49. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/destroy.rb +6 -0
  50. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/edit.rb +4 -0
  51. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/index.rb +4 -0
  52. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/new.rb +4 -0
  53. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/show.rb +4 -0
  54. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/update.rb +11 -0
  55. data/lib/generators/fetty/scaffold/templates/tests/testunit/controller.rb +5 -0
  56. data/lib/generators/fetty/scaffold/templates/tests/testunit/model.rb +7 -0
  57. data/lib/generators/fetty/scaffold/templates/views/erb/_form.html.erb +22 -0
  58. data/lib/generators/fetty/scaffold/templates/views/erb/_table.html.erb +50 -0
  59. data/lib/generators/fetty/scaffold/templates/views/erb/edit.html.erb +12 -0
  60. data/lib/generators/fetty/scaffold/templates/views/erb/index.html.erb +13 -0
  61. data/lib/generators/fetty/scaffold/templates/views/erb/index.js.erb +1 -0
  62. data/lib/generators/fetty/scaffold/templates/views/erb/new.html.erb +9 -0
  63. data/lib/generators/fetty/scaffold/templates/views/erb/show.html.erb +26 -0
  64. data/lib/generators/fetty/scaffold/templates/views/haml/_form.html.haml +8 -0
  65. data/lib/generators/fetty/scaffold/templates/views/haml/_table.html.haml +33 -0
  66. data/lib/generators/fetty/scaffold/templates/views/haml/edit.html.haml +14 -0
  67. data/lib/generators/fetty/scaffold/templates/views/haml/index.html.haml +12 -0
  68. data/lib/generators/fetty/scaffold/templates/views/haml/index.js.haml +1 -0
  69. data/lib/generators/fetty/scaffold/templates/views/haml/new.html.haml +8 -0
  70. data/lib/generators/fetty/scaffold/templates/views/haml/show.html.haml +23 -0
  71. data/lib/generators/fetty/setup/USAGE +22 -0
  72. data/lib/generators/fetty/setup/setup_generator.rb +80 -0
  73. data/lib/generators/fetty/setup/templates/ability.rb +29 -0
  74. data/lib/generators/fetty.rb +38 -0
  75. metadata +137 -0
@@ -0,0 +1,38 @@
1
+ require 'rails/generators/base'
2
+
3
+ module Fetty
4
+ module Generators
5
+ class Base < Rails::Generators::Base #:nodoc:
6
+ def self.source_root
7
+ @_fetty_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'fetty', generator_name, 'templates'))
8
+ end
9
+
10
+ def self.banner
11
+ "rails generate fetty:#{generator_name} #{self.arguments.map{ |a| a.usage }.join(' ')} [options]"
12
+ end
13
+
14
+ protected
15
+
16
+ def add_gem(name, options = {})
17
+ gemfile_content = File.read(destination_path("Gemfile"))
18
+ File.open(destination_path("Gemfile"), 'a') { |f| f.write("\n") } unless gemfile_content =~ /\n\Z/
19
+ gem name, options unless gemfile_content.include? name
20
+ end
21
+
22
+ def destination_path(path)
23
+ File.join(destination_root, path)
24
+ end
25
+
26
+ def file_exists?(path)
27
+ File.exist? destination_path(path)
28
+ end
29
+
30
+ private
31
+
32
+ def print_usage
33
+ self.class.help(Thor::Base.shell.new)
34
+ exit
35
+ end
36
+ end
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fetty-generators
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 7
8
+ - 1
9
+ version: 1.7.1
10
+ platform: ruby
11
+ authors:
12
+ - Fajri Fachriansyah
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-04-12 00:00:00 +07:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: If you are the fan of Ryan bates screencasts show, use this scaffold generators for your rails application, this generators are inherited from nifty-generators, but change the form using simple-form and also create nice index page with feature like search, sort column and paginate.
22
+ email: fajrif@hotmail.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - lib/generators/fetty.rb
31
+ - lib/generators/fetty/scaffold/USAGE
32
+ - lib/generators/fetty/scaffold/scaffold_generator.rb
33
+ - lib/generators/fetty/scaffold/templates/migration.rb
34
+ - lib/generators/fetty/scaffold/templates/model.rb
35
+ - lib/generators/fetty/scaffold/templates/views/erb/edit.html.erb
36
+ - lib/generators/fetty/scaffold/templates/views/erb/_form.html.erb
37
+ - lib/generators/fetty/scaffold/templates/views/erb/index.html.erb
38
+ - lib/generators/fetty/scaffold/templates/views/erb/show.html.erb
39
+ - lib/generators/fetty/scaffold/templates/views/erb/_table.html.erb
40
+ - lib/generators/fetty/scaffold/templates/views/erb/index.js.erb
41
+ - lib/generators/fetty/scaffold/templates/views/erb/new.html.erb
42
+ - lib/generators/fetty/scaffold/templates/views/haml/edit.html.haml
43
+ - lib/generators/fetty/scaffold/templates/views/haml/_form.html.haml
44
+ - lib/generators/fetty/scaffold/templates/views/haml/index.html.haml
45
+ - lib/generators/fetty/scaffold/templates/views/haml/_table.html.haml
46
+ - lib/generators/fetty/scaffold/templates/views/haml/new.html.haml
47
+ - lib/generators/fetty/scaffold/templates/views/haml/show.html.haml
48
+ - lib/generators/fetty/scaffold/templates/views/haml/index.js.haml
49
+ - lib/generators/fetty/scaffold/templates/controller.rb
50
+ - lib/generators/fetty/scaffold/templates/fixtures.yml
51
+ - lib/generators/fetty/scaffold/templates/helper.rb
52
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/model.rb
53
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/controller.rb
54
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/actions/index.rb
55
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/actions/new.rb
56
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/actions/update.rb
57
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/actions/destroy.rb
58
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/actions/edit.rb
59
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/actions/create.rb
60
+ - lib/generators/fetty/scaffold/templates/tests/shoulda/actions/show.rb
61
+ - lib/generators/fetty/scaffold/templates/tests/testunit/model.rb
62
+ - lib/generators/fetty/scaffold/templates/tests/testunit/controller.rb
63
+ - lib/generators/fetty/scaffold/templates/tests/testunit/actions/index.rb
64
+ - lib/generators/fetty/scaffold/templates/tests/testunit/actions/new.rb
65
+ - lib/generators/fetty/scaffold/templates/tests/testunit/actions/update.rb
66
+ - lib/generators/fetty/scaffold/templates/tests/testunit/actions/destroy.rb
67
+ - lib/generators/fetty/scaffold/templates/tests/testunit/actions/edit.rb
68
+ - lib/generators/fetty/scaffold/templates/tests/testunit/actions/create.rb
69
+ - lib/generators/fetty/scaffold/templates/tests/testunit/actions/show.rb
70
+ - lib/generators/fetty/scaffold/templates/tests/rspec/model.rb
71
+ - lib/generators/fetty/scaffold/templates/tests/rspec/controller.rb
72
+ - lib/generators/fetty/scaffold/templates/tests/rspec/actions/index.rb
73
+ - lib/generators/fetty/scaffold/templates/tests/rspec/actions/new.rb
74
+ - lib/generators/fetty/scaffold/templates/tests/rspec/actions/update.rb
75
+ - lib/generators/fetty/scaffold/templates/tests/rspec/actions/destroy.rb
76
+ - lib/generators/fetty/scaffold/templates/tests/rspec/actions/edit.rb
77
+ - lib/generators/fetty/scaffold/templates/tests/rspec/actions/create.rb
78
+ - lib/generators/fetty/scaffold/templates/tests/rspec/actions/show.rb
79
+ - lib/generators/fetty/scaffold/templates/actions/index.rb
80
+ - lib/generators/fetty/scaffold/templates/actions/new.rb
81
+ - lib/generators/fetty/scaffold/templates/actions/update.rb
82
+ - lib/generators/fetty/scaffold/templates/actions/destroy.rb
83
+ - lib/generators/fetty/scaffold/templates/actions/edit.rb
84
+ - lib/generators/fetty/scaffold/templates/actions/create.rb
85
+ - lib/generators/fetty/scaffold/templates/actions/show.rb
86
+ - lib/generators/fetty/setup/USAGE
87
+ - lib/generators/fetty/setup/templates/ability.rb
88
+ - lib/generators/fetty/setup/setup_generator.rb
89
+ - lib/generators/fetty/layout/USAGE
90
+ - lib/generators/fetty/layout/layout_generator.rb
91
+ - lib/generators/fetty/layout/templates/error_messages_helper.rb
92
+ - lib/generators/fetty/layout/templates/layout.html.erb
93
+ - lib/generators/fetty/layout/templates/stylesheet.sass
94
+ - lib/generators/fetty/layout/templates/layout_helper.rb
95
+ - lib/generators/fetty/layout/templates/no-devise-links-layout.html.erb
96
+ - lib/generators/fetty/layout/templates/stylesheet.css
97
+ - lib/generators/fetty/layout/templates/application.js
98
+ - lib/generators/fetty/layout/templates/layout.html.haml
99
+ - lib/generators/fetty/layout/templates/no-devise-links-layout.html.haml
100
+ - LICENSE
101
+ - Rakefile
102
+ - README.rdoc
103
+ - Gemfile
104
+ has_rdoc: true
105
+ homepage: http://github.com/fajrif/fetty-generators
106
+ licenses: []
107
+
108
+ post_install_message:
109
+ rdoc_options: []
110
+
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ segments:
119
+ - 0
120
+ version: "0"
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ segments:
127
+ - 0
128
+ version: "0"
129
+ requirements: []
130
+
131
+ rubyforge_project: fetty-generators
132
+ rubygems_version: 1.3.7
133
+ signing_key:
134
+ specification_version: 3
135
+ summary: This is a scaffold generators for you who working regularly with Devise, CanCan, simple-form, meta_search and jQuery-rails in Rails 3
136
+ test_files: []
137
+