jrhicks-static-generators 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
data/Manifest
CHANGED
@@ -74,6 +74,7 @@ rails_generators/static_gen_specs/templates/model_gen_specs.rb
|
|
74
74
|
rails_generators/static_gen_specs/USAGE
|
75
75
|
rails_generators/static_scaffold/static_scaffold_generator.rb
|
76
76
|
rails_generators/static_scaffold/templates/controller.rb
|
77
|
+
rails_generators/static_scaffold/templates/fake_data.rake
|
77
78
|
rails_generators/static_scaffold/templates/functional_test.rb
|
78
79
|
rails_generators/static_scaffold/templates/helper.rb
|
79
80
|
rails_generators/static_scaffold/templates/helper_test.rb
|
@@ -87,6 +88,7 @@ rails_generators/static_scaffold/templates/view_show.html.erb
|
|
87
88
|
rails_generators/static_scaffold/USAGE
|
88
89
|
Rakefile
|
89
90
|
README.md
|
91
|
+
static-generators.gemspec
|
90
92
|
tasks/deployment.rake
|
91
93
|
TODO
|
92
94
|
USAGE
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('static-generators', '0.3.
|
5
|
+
Echoe.new('static-generators', '0.3.2') do |p|
|
6
6
|
p.project = "staticgenerators"
|
7
7
|
p.description = "Generate attractive interfaces that are easy to edit."
|
8
8
|
p.url = "http://github.com/jrhicks/static-scaffolds"
|
@@ -67,6 +67,11 @@ class StaticScaffoldGenerator < Rails::Generator::NamedBase
|
|
67
67
|
m.template("paperclip_tokens.rb",
|
68
68
|
File.join("config","initializers","paperclip_tokens.rb"))
|
69
69
|
|
70
|
+
# Fake Data Populator
|
71
|
+
m.directory "lib/tasks"
|
72
|
+
m.template("fake_data.rake",
|
73
|
+
File.join("lib/tasks","#{controller_singular_name.downcase}_fake_data.rake"))
|
74
|
+
|
70
75
|
# Model
|
71
76
|
m.template(
|
72
77
|
"model.rb",
|
@@ -0,0 +1,71 @@
|
|
1
|
+
namespace :db do
|
2
|
+
desc "Add fake data to <%=gen_spec.plural_name%>"
|
3
|
+
require 'active_record'
|
4
|
+
require 'populator'
|
5
|
+
require 'faker'
|
6
|
+
|
7
|
+
task :populate_fake_<%=gen_spec.plural_name%> => :environment do
|
8
|
+
<%=gen_spec.model_name%>.populate 2000, :per_query=>1 do |<%=gen_spec.singular_name%>|
|
9
|
+
<%for attribute,options in gen_spec.column_specs -%>
|
10
|
+
<%case options[:type] -%>
|
11
|
+
<%when :integer -%>
|
12
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = 10..10000
|
13
|
+
<%when :text -%>
|
14
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Populator.sentences(2..5)
|
15
|
+
<%when :string -%>
|
16
|
+
<%if "first_name last_name firstname lastname fname lname full_name fname fullname".split.select {|x| attribute.to_s.match(x)}.first -%>
|
17
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Name.name
|
18
|
+
<%match=true -%>
|
19
|
+
<%end -%>
|
20
|
+
<%if "username login login_name".split.select {|x| attribute.to_s.match(x)}.first -%>
|
21
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Name.name.split.join.underscore.downcase
|
22
|
+
<%match=true -%>
|
23
|
+
<%end -%>
|
24
|
+
<%if "company firm organization agency employer school".split.select {|x| attribute.to_s.match(x) or (attribute.to_s=="name" and gen_spec.singular_name.to_s.match(x))}.first -%>
|
25
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Company.name
|
26
|
+
<%match=true -%>
|
27
|
+
<%end -%>
|
28
|
+
<%if "email".split.select {|x| attribute.to_s.match(x)}.first -%>
|
29
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Internet.name
|
30
|
+
<%match=true -%>
|
31
|
+
<%end -%>
|
32
|
+
<%if "phone cell pager".split.select {|x| attribute.to_s.match(x)}.first -%>
|
33
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::PhoneNumber.phone_number
|
34
|
+
<%match=true -%>
|
35
|
+
<%end -%>
|
36
|
+
<%if "street address".split.select {|x| attribute.to_s.match(x)}.first -%>
|
37
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Address.street_address
|
38
|
+
<%match=true -%>
|
39
|
+
<%end -%>
|
40
|
+
<%if "city".split.select {|x| attribute.to_s.match(x)}.first -%>
|
41
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Address.city
|
42
|
+
<%match=true -%>
|
43
|
+
<%end -%>
|
44
|
+
<%if "state".split.select {|x| attribute.to_s.match(x)}.first -%>
|
45
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Address.us_state_abbr
|
46
|
+
<%match=true -%>
|
47
|
+
<%end -%>
|
48
|
+
<%if "zip".split.select {|x| attribute.to_s.match(x)}.first -%>
|
49
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Faker::Address.zip_code
|
50
|
+
<%match=true -%>
|
51
|
+
<%end -%>
|
52
|
+
<%if not match -%>
|
53
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = Populator.words(2..5)
|
54
|
+
<%end -%>
|
55
|
+
<%when :decimal -%>
|
56
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = 100.0*rand
|
57
|
+
<%when :float -%>
|
58
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = 100.0*rand
|
59
|
+
<%when :foreign_key -%>
|
60
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = 1..100
|
61
|
+
<%when :file -%>
|
62
|
+
<%when :photo -%>
|
63
|
+
<%when :datetime -%>
|
64
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = 4.months.ago..Time.now
|
65
|
+
<%when :date -%>
|
66
|
+
<%=gen_spec.singular_name%>.<%=attribute%> = 4.months.ago..Time.now
|
67
|
+
<%end -%>
|
68
|
+
<%end -%>
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/static-generators.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{static-generators}
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jeffrey Hicks"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-09}
|
10
10
|
s.description = %q{Generate attractive interfaces that are easy to edit.}
|
11
11
|
s.email = %q{jrhicks (at) gmail (dot) com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "lib/static_generators.rb", "LICENSE", "README.md", "tasks/deployment.rake", "TODO"]
|
13
|
-
s.files = ["CHANGELOG", "lib/static_generators.rb", "LICENSE", "rails_generators/static_app/static_app_generator.rb", "rails_generators/static_app/templates/application_helper.rb", "rails_generators/static_app/templates/blueprint/grid.png", "rails_generators/static_app/templates/blueprint/ie.css", "rails_generators/static_app/templates/blueprint/LICENSE", "rails_generators/static_app/templates/blueprint/print.css", "rails_generators/static_app/templates/blueprint/screen.css", "rails_generators/static_app/templates/header_bg.png", "rails_generators/static_app/templates/icons/cross.png", "rails_generators/static_app/templates/icons/doc.png", "rails_generators/static_app/templates/icons/email.png", "rails_generators/static_app/templates/icons/external.png", "rails_generators/static_app/templates/icons/feed.png", "rails_generators/static_app/templates/icons/key.png", "rails_generators/static_app/templates/icons/pdf.png", "rails_generators/static_app/templates/icons/tick.png", "rails_generators/static_app/templates/icons/visited.png", "rails_generators/static_app/templates/icons/xls.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_217bc0_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_2e83ff_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_469bdd_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_6da8d5_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_cd0a0a_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_d8e7f3_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_f9bd01_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/jquery-ui-1.7.2.custom.css", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/index.html", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/js/jquery-1.3.2.min.js", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/js/jquery-ui-1.7.2.custom.min.js", "rails_generators/static_app/templates/jrails/jquery-ui.js", "rails_generators/static_app/templates/jrails/jquery.js", "rails_generators/static_app/templates/jrails/jrails.js", "rails_generators/static_app/templates/layout.html.erb", "rails_generators/static_app/templates/layout_helper.rb", "rails_generators/static_app/templates/navigation_bar_bg.gif", "rails_generators/static_app/templates/plugins/jrails/CHANGELOG", "rails_generators/static_app/templates/plugins/jrails/init.rb", "rails_generators/static_app/templates/plugins/jrails/install.rb", "rails_generators/static_app/templates/plugins/jrails/javascripts/jquery-ui.js", "rails_generators/static_app/templates/plugins/jrails/javascripts/jquery.js", "rails_generators/static_app/templates/plugins/jrails/javascripts/jrails.js", "rails_generators/static_app/templates/plugins/jrails/javascripts/sources/jrails.js", "rails_generators/static_app/templates/plugins/jrails/lib/jrails.rb", "rails_generators/static_app/templates/plugins/jrails/README", "rails_generators/static_app/templates/plugins/jrails/tasks/jrails.rake", "rails_generators/static_app/templates/sorttable/sorttable.js", "rails_generators/static_app/templates/standard_banner.html.erb", "rails_generators/static_app/templates/standard_footer.html.erb", "rails_generators/static_app/templates/standard_header.html.erb", "rails_generators/static_app/templates/standard_navigation.html.erb", "rails_generators/static_app/templates/static_style.css", "rails_generators/static_app/templates/uni-form/jquery.js", "rails_generators/static_app/templates/uni-form/uni-form-generic.css", "rails_generators/static_app/templates/uni-form/uni-form.css", "rails_generators/static_app/templates/uni-form/uni-form.jquery.js", "rails_generators/static_app/USAGE", "rails_generators/static_authorization/static_authorization_generator.rb", "rails_generators/static_authorization/templates/migration.rb", "rails_generators/static_authorization/USAGE", "rails_generators/static_gen_specs/static_gen_specs_generator.rb", "rails_generators/static_gen_specs/templates/generator_specs.rb", "rails_generators/static_gen_specs/templates/model_gen_specs.rb", "rails_generators/static_gen_specs/USAGE", "rails_generators/static_scaffold/static_scaffold_generator.rb", "rails_generators/static_scaffold/templates/controller.rb", "rails_generators/static_scaffold/templates/functional_test.rb", "rails_generators/static_scaffold/templates/helper.rb", "rails_generators/static_scaffold/templates/helper_test.rb", "rails_generators/static_scaffold/templates/layout.html.erb", "rails_generators/static_scaffold/templates/model.rb", "rails_generators/static_scaffold/templates/paperclip_tokens.rb", "rails_generators/static_scaffold/templates/view_edit.html.erb", "rails_generators/static_scaffold/templates/view_index.html.erb", "rails_generators/static_scaffold/templates/view_new.html.erb", "rails_generators/static_scaffold/templates/view_show.html.erb", "rails_generators/static_scaffold/USAGE", "Rakefile", "README.md", "tasks/deployment.rake", "TODO", "USAGE", "Manifest"
|
13
|
+
s.files = ["CHANGELOG", "lib/static_generators.rb", "LICENSE", "rails_generators/static_app/static_app_generator.rb", "rails_generators/static_app/templates/application_helper.rb", "rails_generators/static_app/templates/blueprint/grid.png", "rails_generators/static_app/templates/blueprint/ie.css", "rails_generators/static_app/templates/blueprint/LICENSE", "rails_generators/static_app/templates/blueprint/print.css", "rails_generators/static_app/templates/blueprint/screen.css", "rails_generators/static_app/templates/header_bg.png", "rails_generators/static_app/templates/icons/cross.png", "rails_generators/static_app/templates/icons/doc.png", "rails_generators/static_app/templates/icons/email.png", "rails_generators/static_app/templates/icons/external.png", "rails_generators/static_app/templates/icons/feed.png", "rails_generators/static_app/templates/icons/key.png", "rails_generators/static_app/templates/icons/pdf.png", "rails_generators/static_app/templates/icons/tick.png", "rails_generators/static_app/templates/icons/visited.png", "rails_generators/static_app/templates/icons/xls.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_217bc0_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_2e83ff_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_469bdd_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_6da8d5_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_cd0a0a_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_d8e7f3_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/images/ui-icons_f9bd01_256x240.png", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/css/redmond/jquery-ui-1.7.2.custom.css", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/index.html", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/js/jquery-1.3.2.min.js", "rails_generators/static_app/templates/jquery-ui-1.7.2.custom/js/jquery-ui-1.7.2.custom.min.js", "rails_generators/static_app/templates/jrails/jquery-ui.js", "rails_generators/static_app/templates/jrails/jquery.js", "rails_generators/static_app/templates/jrails/jrails.js", "rails_generators/static_app/templates/layout.html.erb", "rails_generators/static_app/templates/layout_helper.rb", "rails_generators/static_app/templates/navigation_bar_bg.gif", "rails_generators/static_app/templates/plugins/jrails/CHANGELOG", "rails_generators/static_app/templates/plugins/jrails/init.rb", "rails_generators/static_app/templates/plugins/jrails/install.rb", "rails_generators/static_app/templates/plugins/jrails/javascripts/jquery-ui.js", "rails_generators/static_app/templates/plugins/jrails/javascripts/jquery.js", "rails_generators/static_app/templates/plugins/jrails/javascripts/jrails.js", "rails_generators/static_app/templates/plugins/jrails/javascripts/sources/jrails.js", "rails_generators/static_app/templates/plugins/jrails/lib/jrails.rb", "rails_generators/static_app/templates/plugins/jrails/README", "rails_generators/static_app/templates/plugins/jrails/tasks/jrails.rake", "rails_generators/static_app/templates/sorttable/sorttable.js", "rails_generators/static_app/templates/standard_banner.html.erb", "rails_generators/static_app/templates/standard_footer.html.erb", "rails_generators/static_app/templates/standard_header.html.erb", "rails_generators/static_app/templates/standard_navigation.html.erb", "rails_generators/static_app/templates/static_style.css", "rails_generators/static_app/templates/uni-form/jquery.js", "rails_generators/static_app/templates/uni-form/uni-form-generic.css", "rails_generators/static_app/templates/uni-form/uni-form.css", "rails_generators/static_app/templates/uni-form/uni-form.jquery.js", "rails_generators/static_app/USAGE", "rails_generators/static_authorization/static_authorization_generator.rb", "rails_generators/static_authorization/templates/migration.rb", "rails_generators/static_authorization/USAGE", "rails_generators/static_gen_specs/static_gen_specs_generator.rb", "rails_generators/static_gen_specs/templates/generator_specs.rb", "rails_generators/static_gen_specs/templates/model_gen_specs.rb", "rails_generators/static_gen_specs/USAGE", "rails_generators/static_scaffold/static_scaffold_generator.rb", "rails_generators/static_scaffold/templates/controller.rb", "rails_generators/static_scaffold/templates/fake_data.rake", "rails_generators/static_scaffold/templates/functional_test.rb", "rails_generators/static_scaffold/templates/helper.rb", "rails_generators/static_scaffold/templates/helper_test.rb", "rails_generators/static_scaffold/templates/layout.html.erb", "rails_generators/static_scaffold/templates/model.rb", "rails_generators/static_scaffold/templates/paperclip_tokens.rb", "rails_generators/static_scaffold/templates/view_edit.html.erb", "rails_generators/static_scaffold/templates/view_index.html.erb", "rails_generators/static_scaffold/templates/view_new.html.erb", "rails_generators/static_scaffold/templates/view_show.html.erb", "rails_generators/static_scaffold/USAGE", "Rakefile", "README.md", "static-generators.gemspec", "tasks/deployment.rake", "TODO", "USAGE", "Manifest"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://github.com/jrhicks/static-scaffolds}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Static-generators", "--main", "README.md"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jrhicks-static-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey Hicks
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- rails_generators/static_gen_specs/USAGE
|
104
104
|
- rails_generators/static_scaffold/static_scaffold_generator.rb
|
105
105
|
- rails_generators/static_scaffold/templates/controller.rb
|
106
|
+
- rails_generators/static_scaffold/templates/fake_data.rake
|
106
107
|
- rails_generators/static_scaffold/templates/functional_test.rb
|
107
108
|
- rails_generators/static_scaffold/templates/helper.rb
|
108
109
|
- rails_generators/static_scaffold/templates/helper_test.rb
|
@@ -116,11 +117,11 @@ files:
|
|
116
117
|
- rails_generators/static_scaffold/USAGE
|
117
118
|
- Rakefile
|
118
119
|
- README.md
|
120
|
+
- static-generators.gemspec
|
119
121
|
- tasks/deployment.rake
|
120
122
|
- TODO
|
121
123
|
- USAGE
|
122
124
|
- Manifest
|
123
|
-
- static-generators.gemspec
|
124
125
|
has_rdoc: true
|
125
126
|
homepage: http://github.com/jrhicks/static-scaffolds
|
126
127
|
post_install_message:
|