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.
- data/Gemfile +2 -0
- data/LICENSE +20 -0
- data/README.rdoc +69 -0
- data/Rakefile +3 -0
- data/lib/generators/fetty/layout/USAGE +26 -0
- data/lib/generators/fetty/layout/layout_generator.rb +44 -0
- data/lib/generators/fetty/layout/templates/application.js +55 -0
- data/lib/generators/fetty/layout/templates/error_messages_helper.rb +23 -0
- data/lib/generators/fetty/layout/templates/layout.html.erb +32 -0
- data/lib/generators/fetty/layout/templates/layout.html.haml +34 -0
- data/lib/generators/fetty/layout/templates/layout_helper.rb +22 -0
- data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.erb +23 -0
- data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.haml +23 -0
- data/lib/generators/fetty/layout/templates/stylesheet.css +166 -0
- data/lib/generators/fetty/layout/templates/stylesheet.sass +163 -0
- data/lib/generators/fetty/scaffold/USAGE +53 -0
- data/lib/generators/fetty/scaffold/scaffold_generator.rb +370 -0
- data/lib/generators/fetty/scaffold/templates/actions/create.rb +8 -0
- data/lib/generators/fetty/scaffold/templates/actions/destroy.rb +5 -0
- data/lib/generators/fetty/scaffold/templates/actions/edit.rb +3 -0
- data/lib/generators/fetty/scaffold/templates/actions/index.rb +10 -0
- data/lib/generators/fetty/scaffold/templates/actions/new.rb +3 -0
- data/lib/generators/fetty/scaffold/templates/actions/show.rb +3 -0
- data/lib/generators/fetty/scaffold/templates/actions/update.rb +8 -0
- data/lib/generators/fetty/scaffold/templates/controller.rb +7 -0
- data/lib/generators/fetty/scaffold/templates/fixtures.yml +9 -0
- data/lib/generators/fetty/scaffold/templates/helper.rb +2 -0
- data/lib/generators/fetty/scaffold/templates/migration.rb +16 -0
- data/lib/generators/fetty/scaffold/templates/model.rb +7 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/create.rb +11 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/destroy.rb +6 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/edit.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/index.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/new.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/show.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/update.rb +11 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/controller.rb +8 -0
- data/lib/generators/fetty/scaffold/templates/tests/rspec/model.rb +7 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/create.rb +13 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/destroy.rb +8 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/edit.rb +6 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/index.rb +6 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/new.rb +6 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/show.rb +6 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/update.rb +13 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/controller.rb +5 -0
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/model.rb +7 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/create.rb +11 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/destroy.rb +6 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/edit.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/index.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/new.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/show.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/update.rb +11 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/controller.rb +5 -0
- data/lib/generators/fetty/scaffold/templates/tests/testunit/model.rb +7 -0
- data/lib/generators/fetty/scaffold/templates/views/erb/_form.html.erb +22 -0
- data/lib/generators/fetty/scaffold/templates/views/erb/_table.html.erb +50 -0
- data/lib/generators/fetty/scaffold/templates/views/erb/edit.html.erb +12 -0
- data/lib/generators/fetty/scaffold/templates/views/erb/index.html.erb +13 -0
- data/lib/generators/fetty/scaffold/templates/views/erb/index.js.erb +1 -0
- data/lib/generators/fetty/scaffold/templates/views/erb/new.html.erb +9 -0
- data/lib/generators/fetty/scaffold/templates/views/erb/show.html.erb +26 -0
- data/lib/generators/fetty/scaffold/templates/views/haml/_form.html.haml +8 -0
- data/lib/generators/fetty/scaffold/templates/views/haml/_table.html.haml +33 -0
- data/lib/generators/fetty/scaffold/templates/views/haml/edit.html.haml +14 -0
- data/lib/generators/fetty/scaffold/templates/views/haml/index.html.haml +12 -0
- data/lib/generators/fetty/scaffold/templates/views/haml/index.js.haml +1 -0
- data/lib/generators/fetty/scaffold/templates/views/haml/new.html.haml +8 -0
- data/lib/generators/fetty/scaffold/templates/views/haml/show.html.haml +23 -0
- data/lib/generators/fetty/setup/USAGE +22 -0
- data/lib/generators/fetty/setup/setup_generator.rb +80 -0
- data/lib/generators/fetty/setup/templates/ability.rb +29 -0
- data/lib/generators/fetty.rb +38 -0
- 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
|
+
|