prologue 0.1.0

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.
@@ -0,0 +1,32 @@
1
+ run 'rm Gemfile'
2
+ create_file 'Gemfile', "source 'http://rubygems.org'\n"
3
+ gem "rails", "3.0.0"
4
+ gem "sqlite3-ruby", :require => "sqlite3"
5
+ if ENV['PROLOGUE_AUTH']
6
+ gem 'devise', ">= 1.1.2"
7
+ end
8
+ if ENV['PROLOGUE_ROLES']
9
+ gem 'cancan'
10
+ end
11
+ gem "hoptoad_notifier"
12
+ gem "jammit"
13
+ gem "friendly_id", "~> 3.1"
14
+ gem "will_paginate", "~> 3.0.pre2"
15
+ gem "haml", ">= 3.0.21"
16
+ gem "rails3-generators", :group => :development
17
+ gem "hpricot", :group => :development
18
+ gem "ruby_parser", :group => :development
19
+ gem "rspec-rails", "2.0.0.beta.22", :group => [:test, :development]
20
+ gem "mocha", :group => [:test]
21
+ gem "factory_girl_rails", :group => [:test, :cucumber]
22
+ gem "faker", :group => [:test]
23
+ gem "autotest", :group => [:test]
24
+ gem "thin", :group => [:test, :cucumber, :development]
25
+ gem "cucumber", :git => "git://github.com/aslakhellesoy/cucumber.git", :group => [:cucumber]
26
+ gem "database_cleaner", :git => "git://github.com/bmabey/database_cleaner.git", :group => [:test, :cucumber]
27
+ gem "cucumber-rails", :git => "git://github.com/aslakhellesoy/cucumber-rails.git", :group => [:cucumber]
28
+ gem "capybara", "0.3.9", :group => [:cucumber]
29
+ gem "launchy", :group => [:cucumber]
30
+ gem "timecop", :group => [:test, :cucumber]
31
+
32
+ run 'bundle install'
@@ -0,0 +1,7 @@
1
+ inject_into_file 'config/application.rb', :after => "# Configure the default encoding used in templates for Ruby 1.9.\n" do
2
+ <<-RUBY
3
+ config.generators do |g|
4
+ g.template_engine :haml
5
+ end
6
+ RUBY
7
+ end
@@ -0,0 +1,13 @@
1
+ generate(:controller, "home index")
2
+
3
+ create_file 'app/views/home/index.html.haml' do
4
+ <<-FILE
5
+ %h1 #{app_name.humanize}
6
+ FILE
7
+ end
8
+
9
+ inject_into_file 'config/routes.rb', :after => "# root :to => \"welcome#index\"\n" do
10
+ <<-RUBY
11
+ root :to => "home#index"
12
+ RUBY
13
+ end
@@ -0,0 +1,13 @@
1
+ create_file 'config/assets.yml' do
2
+ <<-FILE
3
+ embed_assets: on
4
+
5
+ javascripts:
6
+ common:
7
+ - public/javascriptsjquery.js
8
+
9
+ stylesheets:
10
+ common:
11
+ - public/stylesheets/main.css
12
+ FILE
13
+ end
data/templates/js.rb ADDED
@@ -0,0 +1,10 @@
1
+
2
+ get "http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", "public/javascripts/jquery.js"
3
+ get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"
4
+ get "http://html5shiv.googlecode.com/svn/trunk/html5.js", "public/javascripts/shiv.js"
5
+
6
+ inject_into_file 'config/application.rb', :after => "# JavaScript files you want as :defaults (application.js is always included).\n" do
7
+ <<-RUBY
8
+ config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
9
+ RUBY
10
+ end
@@ -0,0 +1,7 @@
1
+ run 'rm public/index.html'
2
+ run 'rm public/images/rails.png'
3
+ run 'rm README'
4
+ run 'touch README'
5
+ run 'rm public/favicon.ico'
6
+ get "http://www.quickleft.com/favicon.ico", "public/images/favicon.ico"
7
+ # get "http://www.quickleft.com/ati.png", "public/images/ati.png"
@@ -0,0 +1,3 @@
1
+ run 'rm -rf spec/views/*'
2
+ run 'rm -rf spec/models/*'
3
+ run 'rm -rf spec/helpers/*'
data/templates/sass.rb ADDED
@@ -0,0 +1,142 @@
1
+ run 'mkdir public/stylesheets/sass'
2
+
3
+ create_file 'public/stylesheets/sass/main.scss' do
4
+ <<-FILE
5
+ @mixin layout_base {
6
+ @include reset;
7
+ @include container;
8
+ @include user_nav;
9
+ @include main_nav;
10
+ //uncomment for a handy layout guide
11
+ @include layout_guide;
12
+ }
13
+
14
+ @mixin reset {
15
+ /*
16
+ html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
17
+ v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
18
+ html5doctor.com/html-5-reset-stylesheet/
19
+ */
20
+
21
+ html, body, div, span, object, iframe,
22
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
23
+ abbr, address, cite, code,
24
+ del, dfn, em, img, ins, kbd, q, samp,
25
+ small, strong, sub, sup, var,
26
+ b, i,
27
+ dl, dt, dd, ol, ul, li,
28
+ fieldset, form, label, legend,
29
+ table, caption, tbody, tfoot, thead, tr, th, td,
30
+ article, aside, canvas, details, figcaption, figure,
31
+ footer, header, hgroup, menu, nav, section, summary,
32
+ time, mark, audio, video {
33
+ margin:0;
34
+ padding:0;
35
+ border:0;
36
+ outline:0;
37
+ font-size:100%;
38
+ vertical-align:baseline;
39
+ background:transparent;
40
+ }
41
+
42
+ article, aside, details, figcaption, figure,
43
+ footer, header, hgroup, menu, nav, section {
44
+ display:block;
45
+ }
46
+
47
+ nav ul { list-style:none; }
48
+
49
+ blockquote, q { quotes:none; }
50
+
51
+ blockquote:before, blockquote:after,
52
+ q:before, q:after { content:''; content:none; }
53
+
54
+ a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }
55
+
56
+ ins { background-color:#ff9; color:#000; text-decoration:none; }
57
+
58
+ mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
59
+
60
+ del { text-decoration: line-through; }
61
+
62
+ abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; }
63
+
64
+ /* tables still need cellspacing="0" in the markup */
65
+ table { border-collapse:collapse; border-spacing:0; }
66
+
67
+ hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
68
+
69
+ input, select { vertical-align:middle; }
70
+ }
71
+
72
+ @mixin clear_left {
73
+ float: left; clear: both;
74
+ }
75
+
76
+ @mixin container($container_size: 950px) {
77
+ #container {
78
+ width: $container_size;
79
+ clear:both;
80
+ padding: 0 20px;
81
+ min-height: 100%;
82
+ height: auto !important;
83
+ height: 100%;
84
+ margin: 0 auto -80px;
85
+ }
86
+ #main_header {
87
+ width: $container_size;
88
+ height: 60px;
89
+ @include clear_left;
90
+ h1 {
91
+ float: left;
92
+ padding: 20px 0 0 0;
93
+ font-size: 24px;
94
+ font-weight: bold;
95
+ }
96
+ }
97
+ #content {
98
+ width: $container_size;
99
+ @include clear_left;
100
+ padding: 10px 0 20px 0;
101
+ }
102
+ #main_footer, #pusher {
103
+ height: 80px;
104
+ clear:both;
105
+ }
106
+ }
107
+
108
+ @mixin user_nav {
109
+ #user_nav {
110
+ float: right;
111
+ padding: 20px 0 0 0;
112
+ }
113
+ }
114
+
115
+ @mixin main_nav {
116
+ #main_nav {
117
+ width: 950px;
118
+ @include clear_left;
119
+ padding: 10px 0;
120
+ ul {
121
+ @include clear_left;
122
+ li {
123
+ float: left;
124
+ padding: 0 15px 0 0;
125
+ }
126
+ }
127
+ }
128
+ }
129
+
130
+ @mixin layout_guide {
131
+ #container { background-color: #e8e6e6; }
132
+ #main_header { background-color: #f7dddd; }
133
+ #main_nav { background-color: #f4ddf7; }
134
+ #content { background-color: #f2f7dd; }
135
+ #main_footer .inner { background-color: #ddf7e7; }
136
+ }
137
+
138
+ @include layout_base;
139
+ FILE
140
+ end
141
+
142
+ run 'sass public/stylesheets/sass/main.scss public/stylesheets/main.css'
@@ -0,0 +1,97 @@
1
+ create_file 'lib/sort_index.rb' do
2
+ <<-'FILE'
3
+ module SortIndex
4
+
5
+ SORT_KEY_ASC = 'asc'
6
+ SORT_KEY_DESC = 'desc'
7
+
8
+ SORT_DIRECTION_MAP = {
9
+ SORT_KEY_DESC => 'DESC',
10
+ SORT_KEY_ASC => 'ASC'
11
+ }
12
+
13
+ class Config
14
+ attr_accessor :columns
15
+ attr_accessor :default_direction
16
+
17
+ def default
18
+ return @default
19
+ end
20
+
21
+ def initialize(default, columns, default_direction = nil)
22
+ @columns = columns
23
+ @default_direction = default_direction || SORT_KEY_DESC
24
+
25
+ raise "default only supports 1 pair" if default.length != 1
26
+ default.each_pair { |key, value|
27
+ @default = value
28
+ @columns[key] = value
29
+ }
30
+ end
31
+ end
32
+
33
+ class Sortable
34
+
35
+ def initialize(params, config, index_url = nil)
36
+ @config = config
37
+ @params = params
38
+ @index_url = index_url || params[:controller]
39
+
40
+ # sets up for building the sql order by
41
+ @sort_direction = SORT_DIRECTION_MAP[@params[:sort_direction]] || @config.default_direction
42
+ @sort_by = @config.columns[@params[:sort_by]] || @config.default
43
+ end
44
+
45
+ def order
46
+ specified_sort_by || "#{@sort_by} #{@sort_direction}"
47
+ end
48
+
49
+ def header_link(sort_key, display, sortable = true, element_id = '')
50
+
51
+ if @config.columns[sort_key].nil? and sortable then
52
+ raise "Sort key of '#{sort_key}' not found. Check your controllers SortIndex::Config variable"
53
+ end
54
+
55
+ id_attr = ""
56
+ if element_id != '' then
57
+ id_attr = "id=\"#{element_id}\""
58
+ end
59
+
60
+ class_attr = ""
61
+ if @config.columns[sort_key] == @sort_by then
62
+ class_attr = " class='current-sort-#{@sort_direction.downcase}'"
63
+ end
64
+
65
+ a_href = "<a#{class_attr} href=\"/#{@index_url}?sort_by=#{sort_key}&amp;sort_direction=#{next_direction}\" title=\"#{display}\" #{id_attr}>#{display}</a>"
66
+ if sortable == false then
67
+ a_href = "<span>#{display}</span>"
68
+ end
69
+
70
+ return "#{a_href}".html_safe
71
+ end
72
+
73
+ def next_direction
74
+ sort_direction = SORT_KEY_ASC
75
+ if (@params[:sort_direction].nil?) then
76
+ sort_direction = (@sort_direction == SORT_KEY_ASC) ? SORT_KEY_DESC : SORT_KEY_ASC
77
+ elsif (@params[:sort_direction] == SORT_KEY_ASC) then
78
+ sort_direction = SORT_KEY_DESC
79
+ end
80
+ return sort_direction
81
+ end
82
+
83
+ def specified_sort_by
84
+ sort = @config.columns[@params[:sort_by]]
85
+ return nil if sort.nil?
86
+ return sort.split(',').map {|order_criteria| "#{order_criteria} #{@sort_direction}"}.join(',')
87
+ end
88
+ end
89
+ end
90
+ FILE
91
+ end
92
+
93
+ inject_into_file 'config/application.rb', :after => "# Custom directories with classes and modules you want to be autoloadable.\n" do
94
+ <<-'FILE'
95
+ config.autoload_paths += %W(#{config.root}/lib)
96
+ FILE
97
+ end
@@ -0,0 +1,11 @@
1
+ run 'rails generate rspec:install'
2
+ run 'rails generate cucumber:install --capybara --rspec'
3
+ inject_into_file 'config/application.rb', :after => "# Configure the default encoding used in templates for Ruby 1.9.\n" do
4
+ <<-RUBY
5
+ config.generators do |g|
6
+ g.test_framework :rspec
7
+ end
8
+ RUBY
9
+ end
10
+
11
+ run 'mkdir spec/factories'
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: prologue
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Quick Left
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-10-19 00:00:00 -06:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: thor
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ type: :runtime
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: rails
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 3
43
+ - 0
44
+ - 0
45
+ version: 3.0.0
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: bundler
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 1
58
+ - 0
59
+ - 0
60
+ version: 1.0.0
61
+ type: :development
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: cucumber
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ type: :development
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: aruba
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ type: :development
88
+ version_requirements: *id005
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec
91
+ prerelease: false
92
+ requirement: &id006 !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ~>
96
+ - !ruby/object:Gem::Version
97
+ segments:
98
+ - 2
99
+ - 0
100
+ - 0
101
+ - beta
102
+ - 22
103
+ version: 2.0.0.beta.22
104
+ type: :development
105
+ version_requirements: *id006
106
+ description: Generate a Rails 3 app with application templates Quick Left uses to start their projects off right!
107
+ email:
108
+ - info@quickleft.com
109
+ executables:
110
+ - prologue
111
+ extensions: []
112
+
113
+ extra_rdoc_files: []
114
+
115
+ files:
116
+ - .gitignore
117
+ - Gemfile
118
+ - Gemfile.lock
119
+ - LICENSE
120
+ - README.md
121
+ - Rakefile
122
+ - bin/prologue
123
+ - features/new.feature
124
+ - features/support/setup.rb
125
+ - lib/prologue.rb
126
+ - lib/prologue/cli.rb
127
+ - lib/prologue/version.rb
128
+ - prologue.gemspec
129
+ - templates/admin.rb
130
+ - templates/admin/dashboard_spec.rb
131
+ - templates/admin/layout.rb
132
+ - templates/admin/sass.rb
133
+ - templates/admin/users.rb
134
+ - templates/admin/users_spec.rb
135
+ - templates/application_layout.rb
136
+ - templates/bootstrap.rb
137
+ - templates/cancan.rb
138
+ - templates/clean_routes.rb
139
+ - templates/db.rb
140
+ - templates/db_seed.rb
141
+ - templates/devise.rb
142
+ - templates/devise/cucumber.rb
143
+ - templates/dynamic_form.rb
144
+ - templates/friendly_id.rb
145
+ - templates/gemfile.rb
146
+ - templates/haml_generator.rb
147
+ - templates/home_controller.rb
148
+ - templates/jammit.rb
149
+ - templates/js.rb
150
+ - templates/rails_clean.rb
151
+ - templates/rspec_clean.rb
152
+ - templates/sass.rb
153
+ - templates/sorter_lib.rb
154
+ - templates/test_suite.rb
155
+ has_rdoc: true
156
+ homepage: http://github.com/quickleft/prologue
157
+ licenses: []
158
+
159
+ post_install_message:
160
+ rdoc_options: []
161
+
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ none: false
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ segments:
170
+ - 0
171
+ version: "0"
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
173
+ none: false
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ segments:
178
+ - 1
179
+ - 3
180
+ - 6
181
+ version: 1.3.6
182
+ requirements: []
183
+
184
+ rubyforge_project: prologue
185
+ rubygems_version: 1.3.7
186
+ signing_key:
187
+ specification_version: 3
188
+ summary: prologue-0.1.0
189
+ test_files: []
190
+