integratedscaffold 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +6 -0
- data/Manifest +85 -0
- data/README +1 -0
- data/README.rdoc +1 -0
- data/Rakefile +14 -0
- data/integratedscaffold.gemspec +38 -0
- data/lib/integratedscaffold.rb +289 -0
- data/lib/templates/actions/create.rb +8 -0
- data/lib/templates/actions/destroy.rb +5 -0
- data/lib/templates/actions/edit.rb +4 -0
- data/lib/templates/actions/index.rb +5 -0
- data/lib/templates/actions/new.rb +4 -0
- data/lib/templates/actions/parse_save_from_excel.rb +45 -0
- data/lib/templates/actions/show.rb +5 -0
- data/lib/templates/actions/update.rb +8 -0
- data/lib/templates/assets/images/background.jpg +0 -0
- data/lib/templates/assets/images/download.png +0 -0
- data/lib/templates/assets/images/inner_texture.jpeg +0 -0
- data/lib/templates/assets/images/logo.png +0 -0
- data/lib/templates/assets/images/new.png +0 -0
- data/lib/templates/assets/images/upload.png +0 -0
- data/lib/templates/assets/images/welcome_icon_1.png +0 -0
- data/lib/templates/assets/images/welcome_icon_2.png +0 -0
- data/lib/templates/assets/images/welcome_icon_3.png +0 -0
- data/lib/templates/assets/images/welcome_icon_4.png +0 -0
- data/lib/templates/assets/images/welcome_image.png +0 -0
- data/lib/templates/assets/javascripts/exclusions/fiddletabs.js +233 -0
- data/lib/templates/assets/javascripts/exclusions/jquery.mousewheel.min.js +12 -0
- data/lib/templates/assets/javascripts/exclusions/jquery.pageslide.js +202 -0
- data/lib/templates/assets/javascripts/jquery.dataTables.min.js +2475 -0
- data/lib/templates/assets/stylesheets/base_classes.css.scss +107 -0
- data/lib/templates/assets/stylesheets/exclusions/fiddletabs.css +77 -0
- data/lib/templates/assets/stylesheets/exclusions/images/Sorting icons.psd +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/back_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/back_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/favicon.ico +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/forward_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/forward_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_asc.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_asc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_both.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_desc.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_desc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/jquery_data_table.css +513 -0
- data/lib/templates/assets/stylesheets/images/Sorting icons.psd +0 -0
- data/lib/templates/assets/stylesheets/images/back_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/back_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/favicon.ico +0 -0
- data/lib/templates/assets/stylesheets/images/forward_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/forward_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/sort_asc.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_asc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_both.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_desc.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_desc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_222222_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_454545_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_888888_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/information_page.css.scss +3 -0
- data/lib/templates/assets/stylesheets/jquery_data_table.css +513 -0
- data/lib/templates/controller.rb +4 -0
- data/lib/templates/file_uploader.rb +48 -0
- data/lib/templates/helper.rb +2 -0
- data/lib/templates/layouts/application.html.erb +69 -0
- data/lib/templates/layouts/dummy_data.html.erb +80 -0
- data/lib/templates/layouts/information_page.html.erb +81 -0
- data/lib/templates/layouts/pageslide_form_at.html.erb +2 -0
- data/lib/templates/layouts/welcome.html.erb +71 -0
- data/lib/templates/migration.rb +18 -0
- data/lib/templates/model.rb +7 -0
- data/lib/templates/views/erb/_form.html.erb +32 -0
- data/lib/templates/views/erb/edit.html.erb +11 -0
- data/lib/templates/views/erb/index.html.erb +216 -0
- data/lib/templates/views/erb/new.html.erb +11 -0
- data/lib/templates/views/erb/show.html.erb +0 -0
- metadata +271 -0
data/Manifest
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
Gemfile
|
2
|
+
Manifest
|
3
|
+
README
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
integratedscaffold.gemspec
|
7
|
+
lib/integratedscaffold.rb
|
8
|
+
lib/templates/actions/create.rb
|
9
|
+
lib/templates/actions/destroy.rb
|
10
|
+
lib/templates/actions/edit.rb
|
11
|
+
lib/templates/actions/index.rb
|
12
|
+
lib/templates/actions/new.rb
|
13
|
+
lib/templates/actions/parse_save_from_excel.rb
|
14
|
+
lib/templates/actions/show.rb
|
15
|
+
lib/templates/actions/update.rb
|
16
|
+
lib/templates/assets/images/background.jpg
|
17
|
+
lib/templates/assets/images/download.png
|
18
|
+
lib/templates/assets/images/inner_texture.jpeg
|
19
|
+
lib/templates/assets/images/logo.png
|
20
|
+
lib/templates/assets/images/new.png
|
21
|
+
lib/templates/assets/images/upload.png
|
22
|
+
lib/templates/assets/images/welcome_icon_1.png
|
23
|
+
lib/templates/assets/images/welcome_icon_2.png
|
24
|
+
lib/templates/assets/images/welcome_icon_3.png
|
25
|
+
lib/templates/assets/images/welcome_icon_4.png
|
26
|
+
lib/templates/assets/images/welcome_image.png
|
27
|
+
lib/templates/assets/javascripts/exclusions/fiddletabs.js
|
28
|
+
lib/templates/assets/javascripts/exclusions/jquery.mousewheel.min.js
|
29
|
+
lib/templates/assets/javascripts/exclusions/jquery.pageslide.js
|
30
|
+
lib/templates/assets/javascripts/jquery.dataTables.min.js
|
31
|
+
lib/templates/assets/stylesheets/base_classes.css.scss
|
32
|
+
lib/templates/assets/stylesheets/exclusions/fiddletabs.css
|
33
|
+
lib/templates/assets/stylesheets/exclusions/images/Sorting icons.psd
|
34
|
+
lib/templates/assets/stylesheets/exclusions/images/back_disabled.jpg
|
35
|
+
lib/templates/assets/stylesheets/exclusions/images/back_enabled.jpg
|
36
|
+
lib/templates/assets/stylesheets/exclusions/images/favicon.ico
|
37
|
+
lib/templates/assets/stylesheets/exclusions/images/forward_disabled.jpg
|
38
|
+
lib/templates/assets/stylesheets/exclusions/images/forward_enabled.jpg
|
39
|
+
lib/templates/assets/stylesheets/exclusions/images/sort_asc.png
|
40
|
+
lib/templates/assets/stylesheets/exclusions/images/sort_asc_disabled.png
|
41
|
+
lib/templates/assets/stylesheets/exclusions/images/sort_both.png
|
42
|
+
lib/templates/assets/stylesheets/exclusions/images/sort_desc.png
|
43
|
+
lib/templates/assets/stylesheets/exclusions/images/sort_desc_disabled.png
|
44
|
+
lib/templates/assets/stylesheets/exclusions/jquery_data_table.css
|
45
|
+
lib/templates/assets/stylesheets/images/Sorting icons.psd
|
46
|
+
lib/templates/assets/stylesheets/images/back_disabled.jpg
|
47
|
+
lib/templates/assets/stylesheets/images/back_enabled.jpg
|
48
|
+
lib/templates/assets/stylesheets/images/favicon.ico
|
49
|
+
lib/templates/assets/stylesheets/images/forward_disabled.jpg
|
50
|
+
lib/templates/assets/stylesheets/images/forward_enabled.jpg
|
51
|
+
lib/templates/assets/stylesheets/images/sort_asc.png
|
52
|
+
lib/templates/assets/stylesheets/images/sort_asc_disabled.png
|
53
|
+
lib/templates/assets/stylesheets/images/sort_both.png
|
54
|
+
lib/templates/assets/stylesheets/images/sort_desc.png
|
55
|
+
lib/templates/assets/stylesheets/images/sort_desc_disabled.png
|
56
|
+
lib/templates/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png
|
57
|
+
lib/templates/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png
|
58
|
+
lib/templates/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png
|
59
|
+
lib/templates/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png
|
60
|
+
lib/templates/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png
|
61
|
+
lib/templates/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png
|
62
|
+
lib/templates/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png
|
63
|
+
lib/templates/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
64
|
+
lib/templates/assets/stylesheets/images/ui-icons_222222_256x240.png
|
65
|
+
lib/templates/assets/stylesheets/images/ui-icons_2e83ff_256x240.png
|
66
|
+
lib/templates/assets/stylesheets/images/ui-icons_454545_256x240.png
|
67
|
+
lib/templates/assets/stylesheets/images/ui-icons_888888_256x240.png
|
68
|
+
lib/templates/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png
|
69
|
+
lib/templates/assets/stylesheets/information_page.css.scss
|
70
|
+
lib/templates/assets/stylesheets/jquery_data_table.css
|
71
|
+
lib/templates/controller.rb
|
72
|
+
lib/templates/file_uploader.rb
|
73
|
+
lib/templates/helper.rb
|
74
|
+
lib/templates/layouts/application.html.erb
|
75
|
+
lib/templates/layouts/dummy_data.html.erb
|
76
|
+
lib/templates/layouts/information_page.html.erb
|
77
|
+
lib/templates/layouts/pageslide_form_at.html.erb
|
78
|
+
lib/templates/layouts/welcome.html.erb
|
79
|
+
lib/templates/migration.rb
|
80
|
+
lib/templates/model.rb
|
81
|
+
lib/templates/views/erb/_form.html.erb
|
82
|
+
lib/templates/views/erb/edit.html.erb
|
83
|
+
lib/templates/views/erb/index.html.erb
|
84
|
+
lib/templates/views/erb/new.html.erb
|
85
|
+
lib/templates/views/erb/show.html.erb
|
data/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
This file was created by JetBrains RubyMine 3.2.4 for binding GitHub repository
|
data/README.rdoc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
This is some summary
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'echoe'
|
4
|
+
|
5
|
+
Echoe.new('integratedscaffold', '1.0.4') do |p|
|
6
|
+
p.description = "Creat a custom scaffold for your rails application"
|
7
|
+
p.url = "http://rushabhhathi.com"
|
8
|
+
p.author = "Rushabh Hathi"
|
9
|
+
p.email = "rushabh@ptotem.com"
|
10
|
+
p.ignore_pattern = ["tmp/*", "script/*"]
|
11
|
+
p.development_dependencies = []
|
12
|
+
end
|
13
|
+
|
14
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "integratedscaffold"
|
5
|
+
s.version = "1.0.4"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Rushabh Hathi"]
|
9
|
+
s.date = "2012-01-26"
|
10
|
+
s.description = "Creat a custom scaffold for your rails application"
|
11
|
+
s.email = "rushabh@ptotem.com"
|
12
|
+
s.extra_rdoc_files = ["README", "README.rdoc", "lib/integratedscaffold.rb", "lib/templates/actions/create.rb", "lib/templates/actions/destroy.rb", "lib/templates/actions/edit.rb", "lib/templates/actions/index.rb", "lib/templates/actions/new.rb", "lib/templates/actions/parse_save_from_excel.rb", "lib/templates/actions/show.rb", "lib/templates/actions/update.rb", "lib/templates/assets/images/background.jpg", "lib/templates/assets/images/download.png", "lib/templates/assets/images/inner_texture.jpeg", "lib/templates/assets/images/logo.png", "lib/templates/assets/images/new.png", "lib/templates/assets/images/upload.png", "lib/templates/assets/images/welcome_icon_1.png", "lib/templates/assets/images/welcome_icon_2.png", "lib/templates/assets/images/welcome_icon_3.png", "lib/templates/assets/images/welcome_icon_4.png", "lib/templates/assets/images/welcome_image.png", "lib/templates/assets/javascripts/exclusions/fiddletabs.js", "lib/templates/assets/javascripts/exclusions/jquery.mousewheel.min.js", "lib/templates/assets/javascripts/exclusions/jquery.pageslide.js", "lib/templates/assets/javascripts/jquery.dataTables.min.js", "lib/templates/assets/stylesheets/base_classes.css.scss", "lib/templates/assets/stylesheets/exclusions/fiddletabs.css", "lib/templates/assets/stylesheets/exclusions/images/Sorting icons.psd", "lib/templates/assets/stylesheets/exclusions/images/back_disabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/back_enabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/favicon.ico", "lib/templates/assets/stylesheets/exclusions/images/forward_disabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/forward_enabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/sort_asc.png", "lib/templates/assets/stylesheets/exclusions/images/sort_asc_disabled.png", "lib/templates/assets/stylesheets/exclusions/images/sort_both.png", "lib/templates/assets/stylesheets/exclusions/images/sort_desc.png", "lib/templates/assets/stylesheets/exclusions/images/sort_desc_disabled.png", "lib/templates/assets/stylesheets/exclusions/jquery_data_table.css", "lib/templates/assets/stylesheets/images/Sorting icons.psd", "lib/templates/assets/stylesheets/images/back_disabled.jpg", "lib/templates/assets/stylesheets/images/back_enabled.jpg", "lib/templates/assets/stylesheets/images/favicon.ico", "lib/templates/assets/stylesheets/images/forward_disabled.jpg", "lib/templates/assets/stylesheets/images/forward_enabled.jpg", "lib/templates/assets/stylesheets/images/sort_asc.png", "lib/templates/assets/stylesheets/images/sort_asc_disabled.png", "lib/templates/assets/stylesheets/images/sort_both.png", "lib/templates/assets/stylesheets/images/sort_desc.png", "lib/templates/assets/stylesheets/images/sort_desc_disabled.png", "lib/templates/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png", "lib/templates/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png", "lib/templates/assets/stylesheets/images/ui-icons_222222_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_2e83ff_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_454545_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_888888_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png", "lib/templates/assets/stylesheets/information_page.css.scss", "lib/templates/assets/stylesheets/jquery_data_table.css", "lib/templates/controller.rb", "lib/templates/file_uploader.rb", "lib/templates/helper.rb", "lib/templates/layouts/application.html.erb", "lib/templates/layouts/dummy_data.html.erb", "lib/templates/layouts/information_page.html.erb", "lib/templates/layouts/pageslide_form_at.html.erb", "lib/templates/layouts/welcome.html.erb", "lib/templates/migration.rb", "lib/templates/model.rb", "lib/templates/views/erb/_form.html.erb", "lib/templates/views/erb/edit.html.erb", "lib/templates/views/erb/index.html.erb", "lib/templates/views/erb/new.html.erb", "lib/templates/views/erb/show.html.erb"]
|
13
|
+
s.files = ["Gemfile", "Manifest", "README", "README.rdoc", "Rakefile", "integratedscaffold.gemspec", "lib/integratedscaffold.rb", "lib/templates/actions/create.rb", "lib/templates/actions/destroy.rb", "lib/templates/actions/edit.rb", "lib/templates/actions/index.rb", "lib/templates/actions/new.rb", "lib/templates/actions/parse_save_from_excel.rb", "lib/templates/actions/show.rb", "lib/templates/actions/update.rb", "lib/templates/assets/images/background.jpg", "lib/templates/assets/images/download.png", "lib/templates/assets/images/inner_texture.jpeg", "lib/templates/assets/images/logo.png", "lib/templates/assets/images/new.png", "lib/templates/assets/images/upload.png", "lib/templates/assets/images/welcome_icon_1.png", "lib/templates/assets/images/welcome_icon_2.png", "lib/templates/assets/images/welcome_icon_3.png", "lib/templates/assets/images/welcome_icon_4.png", "lib/templates/assets/images/welcome_image.png", "lib/templates/assets/javascripts/exclusions/fiddletabs.js", "lib/templates/assets/javascripts/exclusions/jquery.mousewheel.min.js", "lib/templates/assets/javascripts/exclusions/jquery.pageslide.js", "lib/templates/assets/javascripts/jquery.dataTables.min.js", "lib/templates/assets/stylesheets/base_classes.css.scss", "lib/templates/assets/stylesheets/exclusions/fiddletabs.css", "lib/templates/assets/stylesheets/exclusions/images/Sorting icons.psd", "lib/templates/assets/stylesheets/exclusions/images/back_disabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/back_enabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/favicon.ico", "lib/templates/assets/stylesheets/exclusions/images/forward_disabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/forward_enabled.jpg", "lib/templates/assets/stylesheets/exclusions/images/sort_asc.png", "lib/templates/assets/stylesheets/exclusions/images/sort_asc_disabled.png", "lib/templates/assets/stylesheets/exclusions/images/sort_both.png", "lib/templates/assets/stylesheets/exclusions/images/sort_desc.png", "lib/templates/assets/stylesheets/exclusions/images/sort_desc_disabled.png", "lib/templates/assets/stylesheets/exclusions/jquery_data_table.css", "lib/templates/assets/stylesheets/images/Sorting icons.psd", "lib/templates/assets/stylesheets/images/back_disabled.jpg", "lib/templates/assets/stylesheets/images/back_enabled.jpg", "lib/templates/assets/stylesheets/images/favicon.ico", "lib/templates/assets/stylesheets/images/forward_disabled.jpg", "lib/templates/assets/stylesheets/images/forward_enabled.jpg", "lib/templates/assets/stylesheets/images/sort_asc.png", "lib/templates/assets/stylesheets/images/sort_asc_disabled.png", "lib/templates/assets/stylesheets/images/sort_both.png", "lib/templates/assets/stylesheets/images/sort_desc.png", "lib/templates/assets/stylesheets/images/sort_desc_disabled.png", "lib/templates/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png", "lib/templates/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png", "lib/templates/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png", "lib/templates/assets/stylesheets/images/ui-icons_222222_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_2e83ff_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_454545_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_888888_256x240.png", "lib/templates/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png", "lib/templates/assets/stylesheets/information_page.css.scss", "lib/templates/assets/stylesheets/jquery_data_table.css", "lib/templates/controller.rb", "lib/templates/file_uploader.rb", "lib/templates/helper.rb", "lib/templates/layouts/application.html.erb", "lib/templates/layouts/dummy_data.html.erb", "lib/templates/layouts/information_page.html.erb", "lib/templates/layouts/pageslide_form_at.html.erb", "lib/templates/layouts/welcome.html.erb", "lib/templates/migration.rb", "lib/templates/model.rb", "lib/templates/views/erb/_form.html.erb", "lib/templates/views/erb/edit.html.erb", "lib/templates/views/erb/index.html.erb", "lib/templates/views/erb/new.html.erb", "lib/templates/views/erb/show.html.erb"]
|
14
|
+
s.homepage = "http://rushabhhathi.com"
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Integratedscaffold", "--main", "README"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = "integratedscaffold"
|
18
|
+
s.rubygems_version = "1.8.10"
|
19
|
+
s.summary = "Creat a custom scaffold for your rails application"
|
20
|
+
|
21
|
+
s.add_dependency 'railties', '3.1.3'
|
22
|
+
s.add_dependency 'twitter-bootstrap-rails'
|
23
|
+
s.add_dependency 'gritter'
|
24
|
+
s.add_dependency 'spreadsheet'
|
25
|
+
s.add_dependency 'carrierwave'
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
if s.respond_to? :specification_version then
|
31
|
+
s.specification_version = 3
|
32
|
+
|
33
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
34
|
+
else
|
35
|
+
end
|
36
|
+
else
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,289 @@
|
|
1
|
+
# Require the RAILS generators to be able to extend Rails:Generators::NamedBase
|
2
|
+
require 'rails/generators'
|
3
|
+
|
4
|
+
module Twitter_bootstrap_scaffold
|
5
|
+
# If you use the NamedBase inheritance, a 'name' parameter has to follow the 'rails g integratedscaffold'. Won't work otherwise. If you don't want this, use ::Base
|
6
|
+
class Integratedscaffold < Rails::Generators::NamedBase
|
7
|
+
|
8
|
+
# Method in the 'thor' library which gives you access to the accessor methods
|
9
|
+
no_tasks { attr_accessor :model_attributes, :controller_actions }
|
10
|
+
|
11
|
+
# This captures the arguments that the generator can take after "rails g integratedscaffold name"
|
12
|
+
argument :g_parameters, :type => :array, :default => [], :banner => "field:type field:type"
|
13
|
+
|
14
|
+
# this sets the path where the code looks for templates within the gem
|
15
|
+
def self.source_root
|
16
|
+
File.expand_path("../templates", __FILE__)
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(*args, &block)
|
20
|
+
|
21
|
+
# This is a standard initializer
|
22
|
+
|
23
|
+
super # Call parent class
|
24
|
+
@model_attributes = [] # Initialize empty array for 'thor' attributes
|
25
|
+
|
26
|
+
# This method splits the name:type arguments in the parameters list
|
27
|
+
g_parameters.each do |arg|
|
28
|
+
@model_attributes << Rails::Generators::GeneratedAttribute.new(*arg.split(':'))
|
29
|
+
end
|
30
|
+
|
31
|
+
# Creates a list of all the standard actions in the controller
|
32
|
+
@controller_actions=all_actions
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def create_model
|
38
|
+
|
39
|
+
# creates the model using the 'model.rb' template and puts it into the rails app
|
40
|
+
template 'model.rb', "app/models/#{model_path}.rb"
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
def create_controller
|
45
|
+
|
46
|
+
# creates the controller using the 'controller.rb' template and puts it into the rails app
|
47
|
+
template 'controller.rb', "app/controllers/#{plural_name}_controller.rb"
|
48
|
+
end
|
49
|
+
|
50
|
+
def create_migration
|
51
|
+
|
52
|
+
# creates the migration file using the 'migration.rb' template and puts it into the rails app with a time stamp
|
53
|
+
template 'migration.rb', "db/migrate/#{Time.now.utc.strftime("%Y%m%d%H%M%S")}_create_#{model_path.pluralize.gsub('/', '_')}.rb"
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
def create_helper
|
58
|
+
|
59
|
+
# creates the helper using the 'helper.rb' template and puts it into the rails app
|
60
|
+
template 'helper.rb', "app/helpers/#{plural_name}_helper.rb"
|
61
|
+
end
|
62
|
+
|
63
|
+
def create_routes
|
64
|
+
|
65
|
+
# adds the routes for the gem into the routes file
|
66
|
+
namespaces = plural_name.split('/')
|
67
|
+
resource = namespaces.pop
|
68
|
+
route namespaces.reverse.inject("resources :#{resource}") { |acc, namespace|
|
69
|
+
"namespace(:#{namespace}){ #{acc} }"
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
def create_views
|
75
|
+
|
76
|
+
# creates the standard views using the '[action].html.erb' templates and puts it into the rails app
|
77
|
+
controller_actions.each do |action|
|
78
|
+
if action!="show" and action!="create" and action!="update" and action!="destroy" and action!="parse_save_from_excel"
|
79
|
+
template "views/erb/#{action}.html.erb", "app/views/#{plural_name}/#{action}.html.erb"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
if form_partial?
|
83
|
+
template "views/erb/_form.html.erb", "app/views/#{plural_name}/_form.html.erb"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
def class_name
|
90
|
+
name.camelize
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
def model_path
|
95
|
+
name.underscore
|
96
|
+
end
|
97
|
+
|
98
|
+
def controller_methods(dir_name)
|
99
|
+
controller_actions.map do |action|
|
100
|
+
read_template("#{dir_name}/#{action}.rb")
|
101
|
+
end.join("\n").strip
|
102
|
+
end
|
103
|
+
|
104
|
+
def read_template(relative_path)
|
105
|
+
ERB.new(File.read(find_in_source_paths(relative_path)), nil, '-').result(binding)
|
106
|
+
end
|
107
|
+
|
108
|
+
def instance_name
|
109
|
+
if @namespace_model
|
110
|
+
singular_name.gsub('/', '_')
|
111
|
+
else
|
112
|
+
singular_name.split('/').last
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def instances_name
|
117
|
+
instance_name.pluralize
|
118
|
+
end
|
119
|
+
|
120
|
+
def all_actions
|
121
|
+
%w[index show new create edit update destroy]
|
122
|
+
end
|
123
|
+
|
124
|
+
def item_resource
|
125
|
+
name.underscore.gsub('/', '_')
|
126
|
+
end
|
127
|
+
|
128
|
+
def items_path
|
129
|
+
if action? :index
|
130
|
+
"#{item_resource.pluralize}_path"
|
131
|
+
else
|
132
|
+
"root_path"
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def item_path(options = {})
|
137
|
+
name = options[:instance_variable] ? "@#{instance_name}" : instance_name
|
138
|
+
suffix = options[:full_url] ? "url" : "path"
|
139
|
+
if options[:action].to_s == "new"
|
140
|
+
"new_#{item_resource}_#{suffix}"
|
141
|
+
elsif options[:action].to_s == "edit"
|
142
|
+
"edit_#{item_resource}_#{suffix}(#{name})"
|
143
|
+
else
|
144
|
+
if name.include?('::') && !@namespace_model
|
145
|
+
namespace = singular_name.split('/')[0..-2]
|
146
|
+
"[:#{namespace.join(', :')}, #{name}]"
|
147
|
+
else
|
148
|
+
name
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def item_url
|
154
|
+
if action? :show
|
155
|
+
item_path(:full_url => true, :instance_variable => true)
|
156
|
+
else
|
157
|
+
items_url
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def items_url
|
162
|
+
if action? :index
|
163
|
+
item_resource.pluralize + '_url'
|
164
|
+
else
|
165
|
+
"root_url"
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
def plural_name
|
171
|
+
name.underscore.pluralize
|
172
|
+
end
|
173
|
+
|
174
|
+
def form_partial?
|
175
|
+
actions? :new, :edit
|
176
|
+
end
|
177
|
+
|
178
|
+
def all_actions
|
179
|
+
%w[index show new create edit update destroy parse_save_from_excel]
|
180
|
+
end
|
181
|
+
|
182
|
+
def action?(name)
|
183
|
+
controller_actions.include? name.to_s
|
184
|
+
end
|
185
|
+
|
186
|
+
def actions?(*names)
|
187
|
+
names.all? { |name| action? name }
|
188
|
+
end
|
189
|
+
|
190
|
+
def add_gem(name, options = {})
|
191
|
+
gemfile_content = File.read(destination_path("Gemfile"))
|
192
|
+
File.open(destination_path("Gemfile"), 'a') { |f| f.write("\n") } unless gemfile_content =~ /\n\Z/
|
193
|
+
gem name, options unless gemfile_content.include? name
|
194
|
+
end
|
195
|
+
|
196
|
+
def destination_path(path)
|
197
|
+
File.join(destination_root, path)
|
198
|
+
end
|
199
|
+
|
200
|
+
|
201
|
+
# If you use the NamedBase inheritance, a 'name' parameter has to follow the 'rails g integratedscaffold'. Won't work otherwise. If you don't want this, use ::Base
|
202
|
+
|
203
|
+
|
204
|
+
end
|
205
|
+
#endd of class
|
206
|
+
|
207
|
+
class Install < Rails::Generators::Base
|
208
|
+
|
209
|
+
def self.source_root
|
210
|
+
File.expand_path("../templates", __FILE__)
|
211
|
+
end
|
212
|
+
|
213
|
+
|
214
|
+
def initialize(*args, &block)
|
215
|
+
super
|
216
|
+
#now we invokde generators off twitter boootstrap and gritter
|
217
|
+
Rails::Generators.invoke('bootstrap:install')
|
218
|
+
Rails::Generators.invoke('gritter:locale')
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
def create_uploader
|
226
|
+
#creates the uploader ruby file using carrierwave
|
227
|
+
template 'file_uploader.rb', "app/uploaders/file_uploader.rb"
|
228
|
+
end
|
229
|
+
|
230
|
+
def create_images
|
231
|
+
|
232
|
+
# copies the standard images into the assets/images folder
|
233
|
+
@images=Array.new
|
234
|
+
@images= Dir.entries("#{Integratedscaffold.source_root}/assets/images")
|
235
|
+
@images.each do |image|
|
236
|
+
|
237
|
+
if image!=".." and image !="."
|
238
|
+
copy_file "assets/images/#{image.to_s}", "app/assets/images/#{image}"
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
def create_javascripts
|
246
|
+
|
247
|
+
# copies the standard javascripts into the assets/javascripts folder - Currently hard-coded
|
248
|
+
# TODO : Remove the hardcoding for the javascripts inclusion
|
249
|
+
|
250
|
+
copy_file "#{Integratedscaffold.source_root}/assets/javascripts/jquery.dataTables.min.js", "app/assets/javascripts/jquery.dataTables.min.js"
|
251
|
+
|
252
|
+
end
|
253
|
+
|
254
|
+
def create_stylesheets_exclusions
|
255
|
+
|
256
|
+
# copies the sequenced css into the assets/stylesheets/exclusions folder
|
257
|
+
directory "#{Integratedscaffold.source_root}/assets/stylesheets/exclusions", "app/assets/stylesheets/exclusions"
|
258
|
+
end
|
259
|
+
|
260
|
+
def create_javascript_exclusions
|
261
|
+
|
262
|
+
# copies the sequenced javascript into the assets/javascripts/exclusions folder
|
263
|
+
directory "#{Integratedscaffold.source_root}/assets/javascripts/exclusions", "app/assets/javascripts/exclusions"
|
264
|
+
end
|
265
|
+
|
266
|
+
def create_stylesheet_images
|
267
|
+
|
268
|
+
# copies the dependent css images into the assets/stylesheets/images folder
|
269
|
+
directory "#{Integratedscaffold.source_root}/assets/stylesheets/images", "app/assets/stylesheets/images"
|
270
|
+
|
271
|
+
end
|
272
|
+
|
273
|
+
|
274
|
+
def create_layouts
|
275
|
+
#TODO :remove hardcoding and make a loop for including all files in this folder
|
276
|
+
remove_file "app/views/layouts/application.html.erb"
|
277
|
+
template "#{Integratedscaffold.source_root}/layouts/application.html.erb", "app/views/layouts/application.html.erb"
|
278
|
+
template "#{Integratedscaffold.source_root}/layouts//dummy_data.html.erb", "app/views/layouts/scaffold.html.erb"
|
279
|
+
template "#{Integratedscaffold.source_root}/layouts/information_page.html.erb", "app/views/layouts/information_page.html.erb"
|
280
|
+
template "#{Integratedscaffold.source_root}/layouts/pageslide_form_at.html.erb", "app/views/layouts/pageslide_form_at.html.erb"
|
281
|
+
template "#{Integratedscaffold.source_root}/layouts/welcome.html.erb", "app/views/layouts/welcome.html.erb"
|
282
|
+
|
283
|
+
end
|
284
|
+
|
285
|
+
|
286
|
+
end
|
287
|
+
|
288
|
+
|
289
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
def create
|
2
|
+
@<%= instance_name %> = <%= class_name %>.new(params[:<%= instance_name %>])
|
3
|
+
if @<%= instance_name %>.save
|
4
|
+
redirect_to <%= items_url %>, :notice => "Successfully created <%= class_name.underscore.humanize.downcase %>."
|
5
|
+
else
|
6
|
+
render :new
|
7
|
+
end
|
8
|
+
end
|