prologue 0.2.0 → 0.3.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.
- data/Gemfile.lock +37 -37
- data/lib/prologue/version.rb +1 -1
- data/prologue.gemspec +1 -1
- data/templates/admin/cucumber.rb +0 -2
- data/templates/admin/dashboard_spec.rb +2 -0
- data/templates/admin/layout.rb +1 -1
- data/templates/admin/sass.rb +2 -62
- data/templates/admin/users.rb +1 -1
- data/templates/admin/users_spec.rb +2 -0
- data/templates/admin.rb +1 -6
- data/templates/application_layout.rb +1 -1
- data/templates/cancan.rb +9 -4
- data/templates/devise/cucumber.rb +47 -0
- data/templates/devise.rb +18 -1
- data/templates/gemfile.rb +8 -7
- data/templates/home_controller.rb +1 -5
- data/templates/initializers.rb +7 -1
- data/templates/jammit.rb +4 -1
- data/templates/js.rb +53 -4
- data/templates/sass.rb +72 -62
- data/templates/test_suite.rb +11 -1
- metadata +5 -7
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
prologue (0.
|
4
|
+
prologue (0.2.0)
|
5
5
|
rails (>= 3.0.0)
|
6
6
|
thor
|
7
7
|
|
@@ -9,12 +9,12 @@ GEM
|
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
11
|
abstract (1.0.0)
|
12
|
-
actionmailer (3.0.
|
13
|
-
actionpack (= 3.0.
|
12
|
+
actionmailer (3.0.1)
|
13
|
+
actionpack (= 3.0.1)
|
14
14
|
mail (~> 2.2.5)
|
15
|
-
actionpack (3.0.
|
16
|
-
activemodel (= 3.0.
|
17
|
-
activesupport (= 3.0.
|
15
|
+
actionpack (3.0.1)
|
16
|
+
activemodel (= 3.0.1)
|
17
|
+
activesupport (= 3.0.1)
|
18
18
|
builder (~> 2.1.2)
|
19
19
|
erubis (~> 2.6.6)
|
20
20
|
i18n (~> 0.4.1)
|
@@ -22,19 +22,19 @@ GEM
|
|
22
22
|
rack-mount (~> 0.6.12)
|
23
23
|
rack-test (~> 0.5.4)
|
24
24
|
tzinfo (~> 0.3.23)
|
25
|
-
activemodel (3.0.
|
26
|
-
activesupport (= 3.0.
|
25
|
+
activemodel (3.0.1)
|
26
|
+
activesupport (= 3.0.1)
|
27
27
|
builder (~> 2.1.2)
|
28
28
|
i18n (~> 0.4.1)
|
29
|
-
activerecord (3.0.
|
30
|
-
activemodel (= 3.0.
|
31
|
-
activesupport (= 3.0.
|
29
|
+
activerecord (3.0.1)
|
30
|
+
activemodel (= 3.0.1)
|
31
|
+
activesupport (= 3.0.1)
|
32
32
|
arel (~> 1.0.0)
|
33
33
|
tzinfo (~> 0.3.23)
|
34
|
-
activeresource (3.0.
|
35
|
-
activemodel (= 3.0.
|
36
|
-
activesupport (= 3.0.
|
37
|
-
activesupport (3.0.
|
34
|
+
activeresource (3.0.1)
|
35
|
+
activemodel (= 3.0.1)
|
36
|
+
activesupport (= 3.0.1)
|
37
|
+
activesupport (3.0.1)
|
38
38
|
arel (1.0.1)
|
39
39
|
activesupport (~> 3.0.0)
|
40
40
|
aruba (0.2.3)
|
@@ -42,10 +42,10 @@ GEM
|
|
42
42
|
cucumber (~> 0.9.0)
|
43
43
|
background_process (1.2)
|
44
44
|
builder (2.1.2)
|
45
|
-
cucumber (0.9.
|
45
|
+
cucumber (0.9.3)
|
46
46
|
builder (~> 2.1.2)
|
47
47
|
diff-lcs (~> 1.1.2)
|
48
|
-
gherkin (~> 2.2.
|
48
|
+
gherkin (~> 2.2.9)
|
49
49
|
json (~> 1.4.6)
|
50
50
|
term-ansicolor (~> 1.0.5)
|
51
51
|
diff-lcs (1.1.2)
|
@@ -67,30 +67,30 @@ GEM
|
|
67
67
|
rack (>= 1.0.0)
|
68
68
|
rack-test (0.5.6)
|
69
69
|
rack (>= 1.0)
|
70
|
-
rails (3.0.
|
71
|
-
actionmailer (= 3.0.
|
72
|
-
actionpack (= 3.0.
|
73
|
-
activerecord (= 3.0.
|
74
|
-
activeresource (= 3.0.
|
75
|
-
activesupport (= 3.0.
|
70
|
+
rails (3.0.1)
|
71
|
+
actionmailer (= 3.0.1)
|
72
|
+
actionpack (= 3.0.1)
|
73
|
+
activerecord (= 3.0.1)
|
74
|
+
activeresource (= 3.0.1)
|
75
|
+
activesupport (= 3.0.1)
|
76
76
|
bundler (~> 1.0.0)
|
77
|
-
railties (= 3.0.
|
78
|
-
railties (3.0.
|
79
|
-
actionpack (= 3.0.
|
80
|
-
activesupport (= 3.0.
|
77
|
+
railties (= 3.0.1)
|
78
|
+
railties (3.0.1)
|
79
|
+
actionpack (= 3.0.1)
|
80
|
+
activesupport (= 3.0.1)
|
81
81
|
rake (>= 0.8.4)
|
82
82
|
thor (~> 0.14.0)
|
83
83
|
rake (0.8.7)
|
84
|
-
rspec (2.0.
|
85
|
-
rspec-core (
|
86
|
-
rspec-expectations (
|
87
|
-
rspec-mocks (
|
88
|
-
rspec-core (2.0.
|
89
|
-
rspec-expectations (2.0.
|
84
|
+
rspec (2.0.1)
|
85
|
+
rspec-core (~> 2.0.1)
|
86
|
+
rspec-expectations (~> 2.0.1)
|
87
|
+
rspec-mocks (~> 2.0.1)
|
88
|
+
rspec-core (2.0.1)
|
89
|
+
rspec-expectations (2.0.1)
|
90
90
|
diff-lcs (>= 1.1.2)
|
91
|
-
rspec-mocks (2.0.
|
92
|
-
rspec-core (
|
93
|
-
rspec-expectations (
|
91
|
+
rspec-mocks (2.0.1)
|
92
|
+
rspec-core (~> 2.0.1)
|
93
|
+
rspec-expectations (~> 2.0.1)
|
94
94
|
term-ansicolor (1.0.5)
|
95
95
|
thor (0.14.3)
|
96
96
|
treetop (1.4.8)
|
@@ -106,5 +106,5 @@ DEPENDENCIES
|
|
106
106
|
cucumber
|
107
107
|
prologue!
|
108
108
|
rails (>= 3.0.0)
|
109
|
-
rspec (~> 2.0.0
|
109
|
+
rspec (~> 2.0.0)
|
110
110
|
thor
|
data/lib/prologue/version.rb
CHANGED
data/prologue.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_development_dependency "bundler", ">= 1.0.0"
|
20
20
|
s.add_development_dependency "cucumber"
|
21
21
|
s.add_development_dependency "aruba"
|
22
|
-
s.add_development_dependency "rspec", "~> 2.0.0
|
22
|
+
s.add_development_dependency "rspec", "~> 2.0.0"
|
23
23
|
|
24
24
|
s.files = `git ls-files`.split("\n")
|
25
25
|
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
data/templates/admin/cucumber.rb
CHANGED
@@ -35,7 +35,6 @@ Feature: Administer users
|
|
35
35
|
| name |
|
36
36
|
| Member |
|
37
37
|
|
38
|
-
@javascript
|
39
38
|
Scenario: Create, update, delete a user in the admin
|
40
39
|
Given a logged in admin user
|
41
40
|
When I am on the add user page
|
@@ -68,7 +67,6 @@ Feature: Administer users
|
|
68
67
|
And the "Admin" checkbox should be checked
|
69
68
|
Then I press "Save"
|
70
69
|
|
71
|
-
When I confirm a js popup on the next step
|
72
70
|
Then I follow "Delete"
|
73
71
|
Then I should see "User deleted."
|
74
72
|
And I should not see "Bigger Boi"
|
data/templates/admin/layout.rb
CHANGED
@@ -55,7 +55,7 @@ create_file 'app/views/layouts/admin.html.haml' do
|
|
55
55
|
%link{:rel => "shortcut icon", :href => "/images/favicon.ico", :type => "image/x-icon"}
|
56
56
|
/[if lt IE 9]
|
57
57
|
%script{:type => "text/javascript", :src => "/javascripts/shiv.js"}
|
58
|
-
=
|
58
|
+
= include_stylesheets :admin, :media => 'all'
|
59
59
|
= yield(:head)
|
60
60
|
/[if IE 7]
|
61
61
|
= stylesheet_link_tag 'ie7', :media => 'all'
|
data/templates/admin/sass.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
create_file 'public/stylesheets/sass/admin.scss' do
|
2
2
|
<<-FILE
|
3
|
+
@import "reset";
|
4
|
+
@import "common";
|
3
5
|
@mixin layout_base {
|
4
6
|
@include reset;
|
5
7
|
@include container;
|
@@ -9,68 +11,6 @@ create_file 'public/stylesheets/sass/admin.scss' do
|
|
9
11
|
@include layout_guide;
|
10
12
|
}
|
11
13
|
|
12
|
-
@mixin reset {
|
13
|
-
/*
|
14
|
-
html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
|
15
|
-
v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
|
16
|
-
html5doctor.com/html-5-reset-stylesheet/
|
17
|
-
*/
|
18
|
-
|
19
|
-
html, body, div, span, object, iframe,
|
20
|
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
21
|
-
abbr, address, cite, code,
|
22
|
-
del, dfn, em, img, ins, kbd, q, samp,
|
23
|
-
small, strong, sub, sup, var,
|
24
|
-
b, i,
|
25
|
-
dl, dt, dd, ol, ul, li,
|
26
|
-
fieldset, form, label, legend,
|
27
|
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
28
|
-
article, aside, canvas, details, figcaption, figure,
|
29
|
-
footer, header, hgroup, menu, nav, section, summary,
|
30
|
-
time, mark, audio, video {
|
31
|
-
margin:0;
|
32
|
-
padding:0;
|
33
|
-
border:0;
|
34
|
-
outline:0;
|
35
|
-
font-size:100%;
|
36
|
-
vertical-align:baseline;
|
37
|
-
background:transparent;
|
38
|
-
}
|
39
|
-
|
40
|
-
article, aside, details, figcaption, figure,
|
41
|
-
footer, header, hgroup, menu, nav, section {
|
42
|
-
display:block;
|
43
|
-
}
|
44
|
-
|
45
|
-
nav ul { list-style:none; }
|
46
|
-
|
47
|
-
blockquote, q { quotes:none; }
|
48
|
-
|
49
|
-
blockquote:before, blockquote:after,
|
50
|
-
q:before, q:after { content:''; content:none; }
|
51
|
-
|
52
|
-
a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }
|
53
|
-
|
54
|
-
ins { background-color:#ff9; color:#000; text-decoration:none; }
|
55
|
-
|
56
|
-
mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
|
57
|
-
|
58
|
-
del { text-decoration: line-through; }
|
59
|
-
|
60
|
-
abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; }
|
61
|
-
|
62
|
-
/* tables still need cellspacing="0" in the markup */
|
63
|
-
table { border-collapse:collapse; border-spacing:0; }
|
64
|
-
|
65
|
-
hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
|
66
|
-
|
67
|
-
input, select { vertical-align:middle; }
|
68
|
-
}
|
69
|
-
|
70
|
-
@mixin clear_left {
|
71
|
-
float: left; clear: both;
|
72
|
-
}
|
73
|
-
|
74
14
|
@mixin container($container_size: 950px) {
|
75
15
|
#container {
|
76
16
|
width: $container_size;
|
data/templates/admin/users.rb
CHANGED
data/templates/admin.rb
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
say "Building admin"
|
2
2
|
generate(:controller, "admin/dashboard index")
|
3
|
-
|
4
|
-
inject_into_file 'config/routes.rb', :after => "devise_for :users\n" do
|
5
|
-
<<-RUBY
|
6
|
-
match 'admin' => 'admin/dashboard#index'
|
7
|
-
RUBY
|
8
|
-
end
|
3
|
+
route("match 'admin' => 'admin/dashboard#index'")
|
9
4
|
|
10
5
|
# Do layout and SASS stuff
|
11
6
|
apply File.expand_path("../admin/sass.rb", __FILE__)
|
@@ -51,7 +51,7 @@ create_file 'app/views/layouts/application.html.haml' do
|
|
51
51
|
%link{:rel => "apple-touch-icon", :href => "/images/ati.png"}
|
52
52
|
/[if lt IE 9]
|
53
53
|
%script{:type => "text/javascript", :src => "/javascripts/shiv.js"}
|
54
|
-
=
|
54
|
+
= include_stylesheets :main, :media => 'all'
|
55
55
|
= yield(:head)
|
56
56
|
/[if IE 7]
|
57
57
|
= stylesheet_link_tag 'ie7', :media => 'all'
|
data/templates/cancan.rb
CHANGED
@@ -25,6 +25,10 @@ end
|
|
25
25
|
inject_into_file 'app/models/role.rb', :after => "class Role < ActiveRecord::Base\n" do
|
26
26
|
<<-RUBY
|
27
27
|
has_and_belongs_to_many :users
|
28
|
+
|
29
|
+
def self.sanitize role
|
30
|
+
role.to_s.humanize.split(' ').each{ |word| word.capitalize! }.join(' ')
|
31
|
+
end
|
28
32
|
RUBY
|
29
33
|
end
|
30
34
|
|
@@ -55,12 +59,13 @@ end
|
|
55
59
|
RUBY
|
56
60
|
end
|
57
61
|
|
58
|
-
inject_into_file 'app/models/user.rb', :before => "
|
62
|
+
inject_into_file 'app/models/user.rb', :before => "def destroy\n" do
|
59
63
|
<<-RUBY
|
60
64
|
|
61
65
|
def role?(role)
|
62
|
-
return !!self.roles.find_by_name(role
|
66
|
+
return !!self.roles.find_by_name( Role.sanitize role )
|
63
67
|
end
|
68
|
+
|
64
69
|
RUBY
|
65
70
|
end
|
66
71
|
|
@@ -108,8 +113,8 @@ end
|
|
108
113
|
|
109
114
|
append_file 'db/seeds.rb' do
|
110
115
|
<<-FILE
|
111
|
-
Role.create! :name => 'Admin'
|
112
|
-
Role.create! :name => 'Member'
|
116
|
+
Role.create! :name => 'Admin'
|
117
|
+
Role.create! :name => 'Member'
|
113
118
|
|
114
119
|
user1 = User.find_by_email('#{ENV['PROLOGUE_USER_EMAIL']}')
|
115
120
|
user1.role_ids = [1,2]
|
@@ -72,4 +72,51 @@ inject_into_file 'features/support/paths.rb', :after => "case page_name\n" do
|
|
72
72
|
when /login/
|
73
73
|
'/users/sign_in'
|
74
74
|
FILE
|
75
|
+
end
|
76
|
+
|
77
|
+
create_file 'features/forgot_password.feature' do
|
78
|
+
<<-'FILE'
|
79
|
+
Feature: Forgot password
|
80
|
+
As an user
|
81
|
+
I want to secure way to reset my password
|
82
|
+
So that I can still login if I forget it
|
83
|
+
|
84
|
+
Scenario: Follow forget your password link
|
85
|
+
Given the following user records
|
86
|
+
| email |
|
87
|
+
| forgot@quickleft.com |
|
88
|
+
When I am on the login page
|
89
|
+
And I follow "Forgot your password?"
|
90
|
+
And I fill in "Email" with "forgot@quickleft.com"
|
91
|
+
And I press "Send me reset password instructions"
|
92
|
+
Then I should see "You will receive an email with instructions about how to reset your password in a few minutes."
|
93
|
+
And 1 emails should be delivered to forgot@quickleft.com
|
94
|
+
When I click the first link in the email
|
95
|
+
And I fill in "Password" with "myNewP@ssword"
|
96
|
+
And I fill in "Password confirmation" with "myNewP@ssword"
|
97
|
+
And I press "Change my password"
|
98
|
+
Then I should see "Your password was changed successfully. You are now signed in."
|
99
|
+
FILE
|
100
|
+
end
|
101
|
+
|
102
|
+
create_file 'features/resend_verification_email.feature' do
|
103
|
+
<<-'FILE'
|
104
|
+
Feature: Resend Verification
|
105
|
+
As an user
|
106
|
+
I want to resend my verification email
|
107
|
+
So that I can activate my account if I lost the original email
|
108
|
+
|
109
|
+
Scenario: Follow resend verification email
|
110
|
+
Given the following user records
|
111
|
+
| email | confirmed_at |
|
112
|
+
| resend@quickleft.com | nil |
|
113
|
+
When I am on the login page
|
114
|
+
And I follow "Didn't receive confirmation instructions?"
|
115
|
+
And I fill in "Email" with "resend@quickleft.com"
|
116
|
+
And I press "Resend confirmation instructions"
|
117
|
+
Then I should see "You will receive an email with instructions about how to confirm your account in a few minutes."
|
118
|
+
And 2 emails should be delivered to resend@quickleft.com
|
119
|
+
When I click the first link in the email
|
120
|
+
Then I should see "Your account was successfully confirmed. You are now signed in."
|
121
|
+
FILE
|
75
122
|
end
|
data/templates/devise.rb
CHANGED
@@ -43,16 +43,33 @@ create_file 'app/models/user.rb' do
|
|
43
43
|
<<-RUBY
|
44
44
|
class User < ActiveRecord::Base
|
45
45
|
devise :database_authenticatable, :token_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :confirmable
|
46
|
+
default_scope :conditions => { :deleted_at => nil }
|
46
47
|
validates_presence_of :name
|
47
|
-
validates_uniqueness_of :name, :email, :case_sensitive => false
|
48
|
+
validates_uniqueness_of :name, :email, :case_sensitive => false, :scope => :deleted_at
|
48
49
|
attr_accessible :name, :email, :password, :password_confirmation, :remember_me
|
49
50
|
has_friendly_id :name, :use_slug => true, :strip_non_ascii => true
|
51
|
+
|
52
|
+
def destroy
|
53
|
+
self.update_attribute(:deleted_at, Time.now.utc)
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.find_with_destroyed *args
|
57
|
+
self.with_exclusive_scope { find(*args) }
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.find_only_destroyed
|
61
|
+
self.with_exclusive_scope :find => { :conditions => "deleted_at IS NOT NULL" } do
|
62
|
+
all
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
50
66
|
end
|
51
67
|
RUBY
|
52
68
|
end
|
53
69
|
|
54
70
|
generate(:migration, "AddNameToUsers name:string")
|
55
71
|
generate(:migration, "AddCachedSlugToUsers cached_slug:string")
|
72
|
+
generate(:migration, "AddDeletedAtToUsers deleted_at:datetime")
|
56
73
|
|
57
74
|
create_file 'app/views/devise/menu/_login_items.html.haml' do
|
58
75
|
<<-'FILE'
|
data/templates/gemfile.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
run 'rm Gemfile'
|
2
2
|
create_file 'Gemfile', "source 'http://rubygems.org'\n"
|
3
|
-
gem "rails", "3.0.0"
|
3
|
+
gem "rails", "~> 3.0.0"
|
4
4
|
gem "sqlite3-ruby", :require => "sqlite3"
|
5
5
|
if ENV['PROLOGUE_AUTH']
|
6
|
-
gem 'devise', ">= 1.1.
|
6
|
+
gem 'devise', ">= 1.1.3"
|
7
7
|
end
|
8
8
|
if ENV['PROLOGUE_ROLES']
|
9
9
|
gem 'cancan'
|
@@ -16,18 +16,19 @@ gem "haml", ">= 3.0.21"
|
|
16
16
|
gem "rails3-generators", :group => :development
|
17
17
|
gem "hpricot", :group => :development
|
18
18
|
gem "ruby_parser", :group => :development
|
19
|
-
gem "rspec-rails", "2.0.0
|
19
|
+
gem "rspec-rails", "~> 2.0.0", :group => [:test, :development]
|
20
20
|
gem "mocha", :group => [:test]
|
21
21
|
gem "factory_girl_rails", :group => [:test, :cucumber]
|
22
22
|
gem "faker", :group => [:test]
|
23
23
|
gem "autotest", :group => [:test]
|
24
24
|
gem "autotest-rails", :group => [:test]
|
25
25
|
gem "thin", :group => [:test, :cucumber, :development]
|
26
|
-
gem "cucumber", :
|
27
|
-
gem "database_cleaner", :
|
28
|
-
gem "cucumber-rails", :
|
29
|
-
gem "capybara", "0.
|
26
|
+
gem "cucumber", :group => [:cucumber]
|
27
|
+
gem "database_cleaner", :group => [:test, :cucumber]
|
28
|
+
gem "cucumber-rails", :group => [:cucumber]
|
29
|
+
gem "capybara", "0.4.0", :group => [:cucumber]
|
30
30
|
gem "launchy", :group => [:cucumber]
|
31
31
|
gem "timecop", :group => [:test, :cucumber]
|
32
|
+
gem "pickle", :group => [:test, :cucumber]
|
32
33
|
|
33
34
|
run 'bundle install'
|
data/templates/initializers.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
|
1
|
+
initializer('active_record.rb') do
|
2
2
|
<<-'FILE'
|
3
3
|
# This forces you to set attr_accessible in all your models
|
4
4
|
ActiveRecord::Base.send(:attr_accessible, nil)
|
5
5
|
FILE
|
6
|
+
end
|
7
|
+
|
8
|
+
initializer('haml.rb') do
|
9
|
+
<<-'FILE'
|
10
|
+
Haml::Template.options[:format] = :html5
|
11
|
+
FILE
|
6
12
|
end
|
data/templates/jammit.rb
CHANGED
data/templates/js.rb
CHANGED
@@ -2,9 +2,58 @@
|
|
2
2
|
get "http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", "public/javascripts/jquery.js"
|
3
3
|
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"
|
4
4
|
get "http://html5shiv.googlecode.com/svn/trunk/html5.js", "public/javascripts/shiv.js"
|
5
|
+
run 'rm public/javascripts/application.js'
|
5
6
|
|
6
|
-
|
7
|
-
<<-
|
8
|
-
|
9
|
-
|
7
|
+
create_file 'public/javascripts/core.js' do
|
8
|
+
<<-FILE
|
9
|
+
(function($){
|
10
|
+
var QL = QL || {};
|
11
|
+
|
12
|
+
QL = {
|
13
|
+
init: function QL_init(){
|
14
|
+
// some code that needs to be executed after doc ready
|
15
|
+
QL.bindEvents();
|
16
|
+
},
|
17
|
+
bindEvents: function QL_liveEvents(){
|
18
|
+
$('a[rel*=external]').live('click',function(){
|
19
|
+
window.open(this.href);
|
20
|
+
return false;
|
21
|
+
});
|
22
|
+
|
23
|
+
// more globally bound events
|
24
|
+
},
|
25
|
+
helpers: function QL_helpers(){
|
26
|
+
// helper for searching through arrays
|
27
|
+
QL.helpers.arraySearch = function(a){
|
28
|
+
var o = {};
|
29
|
+
for(var i=0;i<a.length;i++){
|
30
|
+
o[a[i]]='';
|
31
|
+
}
|
32
|
+
return o;
|
33
|
+
};
|
34
|
+
//j. resigs array remove overload
|
35
|
+
Array.prototype.remove = function(from, to) {
|
36
|
+
var rest = this.slice((to || from) + 1 || this.length);
|
37
|
+
this.length = from < 0 ? this.length + from : from;
|
38
|
+
return this.push.apply(this, rest);
|
39
|
+
};
|
40
|
+
// duck punch Array.indexOf into IE browsers
|
41
|
+
if(!Array.indexOf){
|
42
|
+
Array.prototype.indexOf = function(obj){
|
43
|
+
for(var i=0; i<this.length; i++){
|
44
|
+
if(this[i]==obj){
|
45
|
+
return i;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
return -1;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
};
|
53
|
+
|
54
|
+
window.QL = QL;
|
55
|
+
$(document).ready(QL.init);
|
56
|
+
|
57
|
+
})(jQuery);
|
58
|
+
FILE
|
10
59
|
end
|
data/templates/sass.rb
CHANGED
@@ -2,6 +2,8 @@ run 'mkdir public/stylesheets/sass'
|
|
2
2
|
|
3
3
|
create_file 'public/stylesheets/sass/main.scss' do
|
4
4
|
<<-FILE
|
5
|
+
@import "reset";
|
6
|
+
@import "common";
|
5
7
|
@mixin layout_base {
|
6
8
|
@include reset;
|
7
9
|
@include container;
|
@@ -11,68 +13,6 @@ create_file 'public/stylesheets/sass/main.scss' do
|
|
11
13
|
@include layout_guide;
|
12
14
|
}
|
13
15
|
|
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
16
|
@mixin container($container_size: 950px) {
|
77
17
|
#container {
|
78
18
|
width: $container_size;
|
@@ -139,4 +79,74 @@ create_file 'public/stylesheets/sass/main.scss' do
|
|
139
79
|
FILE
|
140
80
|
end
|
141
81
|
|
82
|
+
create_file 'public/stylesheets/sass/reset.scss' do
|
83
|
+
<<-FILE
|
84
|
+
@mixin reset {
|
85
|
+
/*
|
86
|
+
html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
|
87
|
+
v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
|
88
|
+
html5doctor.com/html-5-reset-stylesheet/
|
89
|
+
*/
|
90
|
+
|
91
|
+
html, body, div, span, object, iframe,
|
92
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
93
|
+
abbr, address, cite, code,
|
94
|
+
del, dfn, em, img, ins, kbd, q, samp,
|
95
|
+
small, strong, sub, sup, var,
|
96
|
+
b, i,
|
97
|
+
dl, dt, dd, ol, ul, li,
|
98
|
+
fieldset, form, label, legend,
|
99
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
100
|
+
article, aside, canvas, details, figcaption, figure,
|
101
|
+
footer, header, hgroup, menu, nav, section, summary,
|
102
|
+
time, mark, audio, video {
|
103
|
+
margin:0;
|
104
|
+
padding:0;
|
105
|
+
border:0;
|
106
|
+
outline:0;
|
107
|
+
font-size:100%;
|
108
|
+
vertical-align:baseline;
|
109
|
+
background:transparent;
|
110
|
+
}
|
111
|
+
|
112
|
+
article, aside, details, figcaption, figure,
|
113
|
+
footer, header, hgroup, menu, nav, section {
|
114
|
+
display:block;
|
115
|
+
}
|
116
|
+
|
117
|
+
nav ul { list-style:none; }
|
118
|
+
|
119
|
+
blockquote, q { quotes:none; }
|
120
|
+
|
121
|
+
blockquote:before, blockquote:after,
|
122
|
+
q:before, q:after { content:''; content:none; }
|
123
|
+
|
124
|
+
a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }
|
125
|
+
|
126
|
+
ins { background-color:#ff9; color:#000; text-decoration:none; }
|
127
|
+
|
128
|
+
mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
|
129
|
+
|
130
|
+
del { text-decoration: line-through; }
|
131
|
+
|
132
|
+
abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; }
|
133
|
+
|
134
|
+
/* tables still need cellspacing="0" in the markup */
|
135
|
+
table { border-collapse:collapse; border-spacing:0; }
|
136
|
+
|
137
|
+
hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
|
138
|
+
|
139
|
+
input, select { vertical-align:middle; }
|
140
|
+
}
|
141
|
+
FILE
|
142
|
+
end
|
143
|
+
|
144
|
+
create_file 'public/stylesheets/sass/common.scss' do
|
145
|
+
<<-FILE
|
146
|
+
@mixin clear_left {
|
147
|
+
float: left; clear: both;
|
148
|
+
}
|
149
|
+
FILE
|
150
|
+
end
|
151
|
+
|
142
152
|
run 'sass public/stylesheets/sass/main.scss public/stylesheets/main.css'
|
data/templates/test_suite.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
run 'rails generate rspec:install'
|
2
2
|
run 'rails generate cucumber:install --capybara --rspec'
|
3
|
-
|
3
|
+
run 'rails generate pickle --email'
|
4
|
+
|
5
|
+
inject_into_file 'config/application.rb', :after => "# Configure the default encoding used in templates for Ruby 1.9.\n" do
|
4
6
|
<<-RUBY
|
5
7
|
config.generators do |g|
|
6
8
|
g.test_framework :rspec
|
@@ -8,6 +10,14 @@ inject_into_file 'config/application.rb', :after => "# Configure the default enc
|
|
8
10
|
RUBY
|
9
11
|
end
|
10
12
|
|
13
|
+
inject_into_file 'features/support/env.rb', :after => "ENV[\"RAILS_ENV\"] ||= \"test\"\n" do
|
14
|
+
<<-RUBY
|
15
|
+
$VERBOSE = nil
|
16
|
+
RUBY
|
17
|
+
end
|
18
|
+
|
19
|
+
gsub_file 'features/support/env.rb',/require 'cucumber\/rails\/capybara_javascript_emulation'/,'#require \'cucumber/rails/capybara_javascript_emulation\''
|
20
|
+
|
11
21
|
run 'mkdir spec/factories'
|
12
22
|
|
13
23
|
create_file 'features/step_definitions/helper_steps.rb' do
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 3
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Quick Left
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-26 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -98,9 +98,7 @@ dependencies:
|
|
98
98
|
- 2
|
99
99
|
- 0
|
100
100
|
- 0
|
101
|
-
|
102
|
-
- 22
|
103
|
-
version: 2.0.0.beta.22
|
101
|
+
version: 2.0.0
|
104
102
|
type: :development
|
105
103
|
version_requirements: *id006
|
106
104
|
description: Generate a Rails 3 app with application templates Quick Left uses to start their projects off right!
|
@@ -186,6 +184,6 @@ rubyforge_project: prologue
|
|
186
184
|
rubygems_version: 1.3.7
|
187
185
|
signing_key:
|
188
186
|
specification_version: 3
|
189
|
-
summary: prologue-0.
|
187
|
+
summary: prologue-0.3.0
|
190
188
|
test_files: []
|
191
189
|
|