t-minus 0.2.3 → 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.
- metadata +35 -134
- data/app/controllers/prelaunch_controller.rb +0 -19
- data/app/models/prelaunch_subscriber.rb +0 -21
- data/app/views/layouts/prelaunch.html.erb +0 -12
- data/app/views/prelaunch/new.html.erb +0 -17
- data/config/cucumber.yml +0 -1
- data/config/initializers/load_prelaunch_config.rb +0 -8
- data/config/routes.rb +0 -15
- data/lib/generators/erb/t_minus_generator.rb +0 -20
- data/lib/generators/haml/t_minus_generator.rb +0 -20
- data/lib/generators/haml/templates/new.html.haml +0 -12
- data/lib/generators/haml/templates/prelaunch.html.haml +0 -9
- data/lib/generators/rspec/t_minus_generator.rb +0 -40
- data/lib/generators/rspec/templates/view_spec.erb +0 -14
- data/lib/generators/t_minus/controller_generator.rb +0 -12
- data/lib/generators/t_minus/install_generator.rb +0 -37
- data/lib/generators/t_minus/model_generator.rb +0 -12
- data/lib/generators/t_minus/templates/migration.rb +0 -12
- data/lib/generators/t_minus/templates/prelaunch_config.yml +0 -10
- data/lib/generators/test_unit/t_minus_generator.rb +0 -31
- data/lib/generators/test_unit/templates/view_test.erb +0 -16
- data/lib/t-minus.rb +0 -1
- data/lib/t-minus/engine.rb +0 -8
- data/lib/t-minus/test_helper.rb +0 -9
- data/spec/controllers/prelaunch_controller_spec.rb +0 -25
- data/spec/models/prelaunch_subscriber_spec.rb +0 -24
- data/spec/views/prelaunch/new.html.erb_spec.rb +0 -11
- data/spec/views/prelaunch/new.html.haml_spec.rb +0 -12
metadata
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: t-minus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash: 17
|
|
5
4
|
prerelease: false
|
|
6
5
|
segments:
|
|
7
6
|
- 0
|
|
8
|
-
- 2
|
|
9
7
|
- 3
|
|
10
|
-
|
|
8
|
+
- 0
|
|
9
|
+
version: 0.3.0
|
|
11
10
|
platform: ruby
|
|
12
11
|
authors:
|
|
13
12
|
- John Grimes
|
|
@@ -15,23 +14,21 @@ autorequire:
|
|
|
15
14
|
bindir: bin
|
|
16
15
|
cert_chain: []
|
|
17
16
|
|
|
18
|
-
date: 2011-01-
|
|
17
|
+
date: 2011-01-17 00:00:00 +10:00
|
|
19
18
|
default_executable:
|
|
20
19
|
dependencies:
|
|
21
20
|
- !ruby/object:Gem::Dependency
|
|
22
|
-
name:
|
|
21
|
+
name: createsend
|
|
23
22
|
prerelease: false
|
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
24
|
none: false
|
|
26
25
|
requirements:
|
|
27
|
-
- -
|
|
26
|
+
- - ~>
|
|
28
27
|
- !ruby/object:Gem::Version
|
|
29
|
-
hash: 35
|
|
30
28
|
segments:
|
|
31
29
|
- 0
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
version: 0.15.0
|
|
30
|
+
- 2
|
|
31
|
+
version: "0.2"
|
|
35
32
|
type: :runtime
|
|
36
33
|
version_requirements: *id001
|
|
37
34
|
- !ruby/object:Gem::Dependency
|
|
@@ -40,149 +37,83 @@ dependencies:
|
|
|
40
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
|
41
38
|
none: false
|
|
42
39
|
requirements:
|
|
43
|
-
- -
|
|
40
|
+
- - ~>
|
|
44
41
|
- !ruby/object:Gem::Version
|
|
45
|
-
hash: 23
|
|
46
42
|
segments:
|
|
47
43
|
- 1
|
|
48
|
-
|
|
49
|
-
- 0
|
|
50
|
-
version: 1.0.0
|
|
44
|
+
version: "1"
|
|
51
45
|
type: :development
|
|
52
46
|
version_requirements: *id002
|
|
53
47
|
- !ruby/object:Gem::Dependency
|
|
54
|
-
name: rspec
|
|
48
|
+
name: rspec-rails
|
|
55
49
|
prerelease: false
|
|
56
50
|
requirement: &id003 !ruby/object:Gem::Requirement
|
|
57
51
|
none: false
|
|
58
52
|
requirements:
|
|
59
|
-
- -
|
|
53
|
+
- - ~>
|
|
60
54
|
- !ruby/object:Gem::Version
|
|
61
|
-
hash: 62196431
|
|
62
55
|
segments:
|
|
63
56
|
- 2
|
|
64
|
-
|
|
65
|
-
- 0
|
|
66
|
-
- beta
|
|
67
|
-
- 22
|
|
68
|
-
version: 2.0.0.beta.22
|
|
57
|
+
version: "2"
|
|
69
58
|
type: :development
|
|
70
59
|
version_requirements: *id003
|
|
71
|
-
- !ruby/object:Gem::Dependency
|
|
72
|
-
name: rspec-rails
|
|
73
|
-
prerelease: false
|
|
74
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
|
75
|
-
none: false
|
|
76
|
-
requirements:
|
|
77
|
-
- - ">="
|
|
78
|
-
- !ruby/object:Gem::Version
|
|
79
|
-
hash: 62196431
|
|
80
|
-
segments:
|
|
81
|
-
- 2
|
|
82
|
-
- 0
|
|
83
|
-
- 0
|
|
84
|
-
- beta
|
|
85
|
-
- 22
|
|
86
|
-
version: 2.0.0.beta.22
|
|
87
|
-
type: :development
|
|
88
|
-
version_requirements: *id004
|
|
89
60
|
- !ruby/object:Gem::Dependency
|
|
90
61
|
name: mocha
|
|
91
62
|
prerelease: false
|
|
92
|
-
requirement: &
|
|
63
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
93
64
|
none: false
|
|
94
65
|
requirements:
|
|
95
|
-
- -
|
|
66
|
+
- - ~>
|
|
96
67
|
- !ruby/object:Gem::Version
|
|
97
|
-
hash: 43
|
|
98
68
|
segments:
|
|
99
69
|
- 0
|
|
100
70
|
- 9
|
|
101
|
-
|
|
102
|
-
version: 0.9.8
|
|
71
|
+
version: "0.9"
|
|
103
72
|
type: :development
|
|
104
|
-
version_requirements: *
|
|
105
|
-
- !ruby/object:Gem::Dependency
|
|
106
|
-
name: cucumber
|
|
107
|
-
prerelease: false
|
|
108
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
|
109
|
-
none: false
|
|
110
|
-
requirements:
|
|
111
|
-
- - ">="
|
|
112
|
-
- !ruby/object:Gem::Version
|
|
113
|
-
hash: 53
|
|
114
|
-
segments:
|
|
115
|
-
- 0
|
|
116
|
-
- 8
|
|
117
|
-
- 5
|
|
118
|
-
version: 0.8.5
|
|
119
|
-
type: :development
|
|
120
|
-
version_requirements: *id006
|
|
73
|
+
version_requirements: *id004
|
|
121
74
|
- !ruby/object:Gem::Dependency
|
|
122
75
|
name: cucumber-rails
|
|
123
76
|
prerelease: false
|
|
124
|
-
requirement: &
|
|
77
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
125
78
|
none: false
|
|
126
79
|
requirements:
|
|
127
|
-
- -
|
|
80
|
+
- - ~>
|
|
128
81
|
- !ruby/object:Gem::Version
|
|
129
|
-
hash: 23
|
|
130
82
|
segments:
|
|
131
83
|
- 0
|
|
132
84
|
- 3
|
|
133
|
-
|
|
134
|
-
version: 0.3.2
|
|
85
|
+
version: "0.3"
|
|
135
86
|
type: :development
|
|
136
|
-
version_requirements: *
|
|
87
|
+
version_requirements: *id005
|
|
137
88
|
- !ruby/object:Gem::Dependency
|
|
138
89
|
name: webrat
|
|
139
90
|
prerelease: false
|
|
140
|
-
requirement: &
|
|
91
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
|
141
92
|
none: false
|
|
142
93
|
requirements:
|
|
143
|
-
- -
|
|
94
|
+
- - ~>
|
|
144
95
|
- !ruby/object:Gem::Version
|
|
145
|
-
hash: 1
|
|
146
96
|
segments:
|
|
147
97
|
- 0
|
|
148
98
|
- 7
|
|
149
|
-
|
|
150
|
-
version: 0.7.1
|
|
99
|
+
version: "0.7"
|
|
151
100
|
type: :development
|
|
152
|
-
version_requirements: *
|
|
101
|
+
version_requirements: *id006
|
|
153
102
|
- !ruby/object:Gem::Dependency
|
|
154
103
|
name: nokogiri
|
|
155
104
|
prerelease: false
|
|
156
|
-
requirement: &
|
|
105
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
|
157
106
|
none: false
|
|
158
107
|
requirements:
|
|
159
|
-
- -
|
|
108
|
+
- - ~>
|
|
160
109
|
- !ruby/object:Gem::Version
|
|
161
|
-
hash: 113
|
|
162
110
|
segments:
|
|
163
111
|
- 1
|
|
164
112
|
- 4
|
|
165
113
|
- 3
|
|
166
|
-
|
|
167
|
-
version: 1.4.3.1
|
|
114
|
+
version: 1.4.3
|
|
168
115
|
type: :development
|
|
169
|
-
version_requirements: *
|
|
170
|
-
- !ruby/object:Gem::Dependency
|
|
171
|
-
name: jeweler
|
|
172
|
-
prerelease: false
|
|
173
|
-
requirement: &id010 !ruby/object:Gem::Requirement
|
|
174
|
-
none: false
|
|
175
|
-
requirements:
|
|
176
|
-
- - ">="
|
|
177
|
-
- !ruby/object:Gem::Version
|
|
178
|
-
hash: 7
|
|
179
|
-
segments:
|
|
180
|
-
- 1
|
|
181
|
-
- 4
|
|
182
|
-
- 0
|
|
183
|
-
version: 1.4.0
|
|
184
|
-
type: :development
|
|
185
|
-
version_requirements: *id010
|
|
116
|
+
version_requirements: *id007
|
|
186
117
|
description: Rails engine and generators that make it easier to create a prelaunch page for your application that can collect email addresses of interested visitors.
|
|
187
118
|
email: john@smallspark.com.au
|
|
188
119
|
executables: []
|
|
@@ -193,35 +124,8 @@ extra_rdoc_files:
|
|
|
193
124
|
- LICENSE
|
|
194
125
|
- README.markdown
|
|
195
126
|
files:
|
|
196
|
-
- app/controllers/prelaunch_controller.rb
|
|
197
|
-
- app/models/prelaunch_subscriber.rb
|
|
198
|
-
- app/views/layouts/prelaunch.html.erb
|
|
199
|
-
- app/views/prelaunch/new.html.erb
|
|
200
|
-
- config/cucumber.yml
|
|
201
|
-
- config/initializers/load_prelaunch_config.rb
|
|
202
|
-
- config/routes.rb
|
|
203
|
-
- lib/generators/erb/t_minus_generator.rb
|
|
204
|
-
- lib/generators/haml/t_minus_generator.rb
|
|
205
|
-
- lib/generators/haml/templates/new.html.haml
|
|
206
|
-
- lib/generators/haml/templates/prelaunch.html.haml
|
|
207
|
-
- lib/generators/rspec/t_minus_generator.rb
|
|
208
|
-
- lib/generators/rspec/templates/view_spec.erb
|
|
209
|
-
- lib/generators/t_minus/controller_generator.rb
|
|
210
|
-
- lib/generators/t_minus/install_generator.rb
|
|
211
|
-
- lib/generators/t_minus/model_generator.rb
|
|
212
|
-
- lib/generators/t_minus/templates/migration.rb
|
|
213
|
-
- lib/generators/t_minus/templates/prelaunch_config.yml
|
|
214
|
-
- lib/generators/test_unit/t_minus_generator.rb
|
|
215
|
-
- lib/generators/test_unit/templates/view_test.erb
|
|
216
|
-
- lib/t-minus.rb
|
|
217
|
-
- lib/t-minus/engine.rb
|
|
218
|
-
- lib/t-minus/test_helper.rb
|
|
219
127
|
- LICENSE
|
|
220
128
|
- README.markdown
|
|
221
|
-
- spec/controllers/prelaunch_controller_spec.rb
|
|
222
|
-
- spec/models/prelaunch_subscriber_spec.rb
|
|
223
|
-
- spec/views/prelaunch/new.html.erb_spec.rb
|
|
224
|
-
- spec/views/prelaunch/new.html.haml_spec.rb
|
|
225
129
|
has_rdoc: true
|
|
226
130
|
homepage: http://github.com/johngrimes/t-minus
|
|
227
131
|
licenses: []
|
|
@@ -236,7 +140,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
236
140
|
requirements:
|
|
237
141
|
- - ">="
|
|
238
142
|
- !ruby/object:Gem::Version
|
|
239
|
-
hash: 3
|
|
240
143
|
segments:
|
|
241
144
|
- 0
|
|
242
145
|
version: "0"
|
|
@@ -245,19 +148,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
245
148
|
requirements:
|
|
246
149
|
- - ">="
|
|
247
150
|
- !ruby/object:Gem::Version
|
|
248
|
-
hash: 3
|
|
249
151
|
segments:
|
|
250
|
-
-
|
|
251
|
-
|
|
152
|
+
- 1
|
|
153
|
+
- 3
|
|
154
|
+
- 6
|
|
155
|
+
version: 1.3.6
|
|
252
156
|
requirements: []
|
|
253
157
|
|
|
254
158
|
rubyforge_project:
|
|
255
159
|
rubygems_version: 1.3.7
|
|
256
160
|
signing_key:
|
|
257
161
|
specification_version: 3
|
|
258
|
-
summary:
|
|
259
|
-
test_files:
|
|
260
|
-
|
|
261
|
-
- spec/models/prelaunch_subscriber_spec.rb
|
|
262
|
-
- spec/views/prelaunch/new.html.erb_spec.rb
|
|
263
|
-
- spec/views/prelaunch/new.html.haml_spec.rb
|
|
162
|
+
summary: Rails engine and generators that make it easier to create a prelaunch page for your application that can collect email addresses of interested visitors.
|
|
163
|
+
test_files: []
|
|
164
|
+
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
class PrelaunchController < ActionController::Base
|
|
2
|
-
layout 'prelaunch'
|
|
3
|
-
|
|
4
|
-
def new
|
|
5
|
-
@prelaunch_subscriber = PrelaunchSubscriber.new
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
def create
|
|
9
|
-
@prelaunch_subscriber = PrelaunchSubscriber.new(params[:prelaunch_subscriber])
|
|
10
|
-
if @prelaunch_subscriber.save
|
|
11
|
-
redirect_to root_url, :notice => <<NOTICE
|
|
12
|
-
<p>Thank you for your interest.</p>
|
|
13
|
-
<p>We have sent you an email to confirm your subscription to our prelaunch mailing list.</p>
|
|
14
|
-
NOTICE
|
|
15
|
-
else
|
|
16
|
-
render :action => 'new'
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
class PrelaunchSubscriber < ActiveRecord::Base
|
|
2
|
-
validates_presence_of :email, :message => 'Please enter your email address first.'
|
|
3
|
-
validates_uniqueness_of :email, :message => 'That email is already on the list.'
|
|
4
|
-
validates_format_of :email,
|
|
5
|
-
:with => /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i,
|
|
6
|
-
:message => 'That email address doesn\'t look right.'
|
|
7
|
-
|
|
8
|
-
after_save :add_to_campaign_monitor, :if => :campaign_monitor_configured?
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
def add_to_campaign_monitor
|
|
13
|
-
subscriber = Campaigning::Subscriber.new(email)
|
|
14
|
-
subscriber.add_and_resubscribe!(PRELAUNCH_CONFIG[:campaign_monitor_list_id])
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def campaign_monitor_configured?
|
|
18
|
-
!(PRELAUNCH_CONFIG[:campaign_monitor_api_key].blank? ||
|
|
19
|
-
PRELAUNCH_CONFIG[:campaign_monitor_list_id].blank?)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8"/>
|
|
5
|
-
<title><%= Rails.application.class.to_s.split('::').first.titleize %></title>
|
|
6
|
-
<%= stylesheet_link_tag 'prelaunch' %>
|
|
7
|
-
<%= csrf_meta_tag %>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<%= yield %>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<% if flash[:notice] %>
|
|
2
|
-
<%= flash[:notice].html_safe %>
|
|
3
|
-
<% else %>
|
|
4
|
-
<p>Our new website is launching soon.</p>
|
|
5
|
-
<p>Add your name to the list and you will be the first to know when we are ready.</p>
|
|
6
|
-
<%= form_for @prelaunch_subscriber, :url => prelaunch_path do |f| %>
|
|
7
|
-
<div class="field">
|
|
8
|
-
<%= f.text_field :email %>
|
|
9
|
-
<% if @prelaunch_subscriber.errors[:email] %>
|
|
10
|
-
<div class="form-error"><%= @prelaunch_subscriber.errors[:email].first %></div>
|
|
11
|
-
<% end %>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="actions">
|
|
14
|
-
<%= f.submit 'Add me to the list' %>
|
|
15
|
-
</div>
|
|
16
|
-
<% end %>
|
|
17
|
-
<% end %>
|
data/config/cucumber.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
default: --format pretty
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
prelaunch_config_path = "#{Rails.root}/config/prelaunch_config.yml"
|
|
2
|
-
if File.exists?(prelaunch_config_path)
|
|
3
|
-
raw_config = File.read(prelaunch_config_path)
|
|
4
|
-
PRELAUNCH_CONFIG = YAML.load(raw_config)[Rails.env].symbolize_keys
|
|
5
|
-
CAMPAIGN_MONITOR_API_KEY = PRELAUNCH_CONFIG[:campaign_monitor_api_key]
|
|
6
|
-
else
|
|
7
|
-
PRELAUNCH_CONFIG = {}
|
|
8
|
-
end
|
data/config/routes.rb
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module TMinus
|
|
2
|
-
module Routes
|
|
3
|
-
def Routes.map
|
|
4
|
-
Rails.application.routes.draw do
|
|
5
|
-
post '/' => 'prelaunch#create', :as => :prelaunch
|
|
6
|
-
root :to => 'prelaunch#new'
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
if PRELAUNCH_CONFIG[:active]
|
|
13
|
-
Rails.application.routes.clear!
|
|
14
|
-
TMinus::Routes.map
|
|
15
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module Erb
|
|
2
|
-
module Generators
|
|
3
|
-
class TMinusGenerator < Rails::Generators::Base
|
|
4
|
-
desc 'Generates ERB view template for T-Minus'
|
|
5
|
-
source_root File.expand_path('../../../../app/views/', __FILE__)
|
|
6
|
-
|
|
7
|
-
def create_prelaunch_directory
|
|
8
|
-
empty_directory 'app/views/prelaunch'
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def copy_view_file
|
|
12
|
-
copy_file 'prelaunch/new.html.erb', 'app/views/prelaunch/new.html.erb'
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def copy_layout_file
|
|
16
|
-
copy_file 'layouts/prelaunch.html.erb', 'app/views/layouts/prelaunch.html.erb'
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module Haml
|
|
2
|
-
module Generators
|
|
3
|
-
class TMinusGenerator < ::Rails::Generators::Base
|
|
4
|
-
desc 'Generates Haml view template for T-Minus'
|
|
5
|
-
source_root File.expand_path('../templates', __FILE__)
|
|
6
|
-
|
|
7
|
-
def create_prelaunch_directory
|
|
8
|
-
empty_directory 'app/views/prelaunch'
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def copy_view_file
|
|
12
|
-
copy_file 'new.html.haml', 'app/views/prelaunch/new.html.haml'
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def copy_layout_file
|
|
16
|
-
copy_file 'prelaunch.html.haml', 'app/views/layouts/prelaunch.html.haml'
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
- if flash[:notice]
|
|
2
|
-
= flash[:notice].html_safe
|
|
3
|
-
- else
|
|
4
|
-
%p Our new website is launching soon.
|
|
5
|
-
%p Add your name to the list and you will be the first to know when we are ready.
|
|
6
|
-
= form_for @prelaunch_subscriber, :url => prelaunch_path do |f|
|
|
7
|
-
.field
|
|
8
|
-
= f.text_field :email
|
|
9
|
-
- if @prelaunch_subscriber.errors[:email]
|
|
10
|
-
.form-error= @prelaunch_subscriber.errors[:email].first
|
|
11
|
-
.actions
|
|
12
|
-
= f.submit 'Add me to the list'
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module Rspec
|
|
2
|
-
module Generators
|
|
3
|
-
class TMinusGenerator < ::Rails::Generators::Base
|
|
4
|
-
desc 'Generates view spec for T-Minus'
|
|
5
|
-
source_root File.expand_path('../templates', __FILE__)
|
|
6
|
-
class_option :template_engine
|
|
7
|
-
|
|
8
|
-
def create_view_spec_directory
|
|
9
|
-
empty_directory 'spec/views/prelaunch'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def copy_view_file
|
|
13
|
-
template 'view_spec.erb',
|
|
14
|
-
"spec/views/prelaunch/new.html.#{options[:template_engine]}_spec.rb"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def include_test_helper
|
|
18
|
-
if File.exists? File.expand_path('spec/spec_helper.rb', @_source_root)
|
|
19
|
-
append_file 'spec/spec_helper.rb', "require 't-minus/test_helper'"
|
|
20
|
-
else
|
|
21
|
-
create_file 'spec/spec_helper.rb', <<-FILE
|
|
22
|
-
ENV['RAILS_ENV'] ||= 'test'
|
|
23
|
-
require File.expand_path('../../config/environment', __FILE__)
|
|
24
|
-
require 'rspec/rails'
|
|
25
|
-
|
|
26
|
-
Dir[Rails.root.join('spec/support/**/*.rb')].each {|f| require f}
|
|
27
|
-
|
|
28
|
-
RSpec.configure do |config|
|
|
29
|
-
config.mock_with :rspec
|
|
30
|
-
config.fixture_path = "\#{::Rails.root}/spec/fixtures"
|
|
31
|
-
config.use_transactional_fixtures = true
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
require 't-minus/test_helper'
|
|
35
|
-
FILE
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe 'prelaunch/new.html.<%= options[:template_engine] %>' do
|
|
4
|
-
before do
|
|
5
|
-
simulate_prelaunch_routes
|
|
6
|
-
assign(:prelaunch_subscriber, PrelaunchSubscriber.new)
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it 'should render successfully' do
|
|
10
|
-
render
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
after { restore_routes }
|
|
14
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module TMinus
|
|
2
|
-
module Generators
|
|
3
|
-
class ControllerGenerator < Rails::Generators::Base
|
|
4
|
-
desc 'Generates the PrelaunchController for T-Minus'
|
|
5
|
-
source_root File.expand_path('../../../../app/controllers/', __FILE__)
|
|
6
|
-
|
|
7
|
-
def copy_controller_file
|
|
8
|
-
copy_file 'prelaunch_controller.rb', 'app/controllers/prelaunch_controller.rb'
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
require 'rails/generators/active_record'
|
|
2
|
-
|
|
3
|
-
module TMinus
|
|
4
|
-
module Generators
|
|
5
|
-
class InstallGenerator < Rails::Generators::Base
|
|
6
|
-
include Rails::Generators::Migration
|
|
7
|
-
|
|
8
|
-
desc 'Generates configuration and migration files for T-Minus'
|
|
9
|
-
source_root File.expand_path('../templates', __FILE__)
|
|
10
|
-
|
|
11
|
-
hook_for :template_engine, :as => :t_minus
|
|
12
|
-
hook_for :test_framework, :as => :t_minus
|
|
13
|
-
|
|
14
|
-
def copy_configuration_file
|
|
15
|
-
copy_file 'prelaunch_config.yml', 'config/prelaunch_config.yml'
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def generate_migration
|
|
19
|
-
migration_template 'migration.rb', "db/migrate/create_#{table_name}"
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def create_css_file
|
|
23
|
-
create_file 'public/stylesheets/prelaunch.css'
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def self.next_migration_number(dirname)
|
|
27
|
-
ActiveRecord::Generators::Base.next_migration_number(dirname)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
def table_name
|
|
33
|
-
'prelaunch_subscribers'
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module TMinus
|
|
2
|
-
module Generators
|
|
3
|
-
class ModelGenerator < Rails::Generators::Base
|
|
4
|
-
desc 'Generates the PrelaunchSubscriber model for T-Minus'
|
|
5
|
-
source_root File.expand_path('../../../../app/models/', __FILE__)
|
|
6
|
-
|
|
7
|
-
def copy_controller_file
|
|
8
|
-
copy_file 'prelaunch_subscriber.rb', 'app/models/prelaunch_subscriber.rb'
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module TestUnit
|
|
2
|
-
module Generators
|
|
3
|
-
class TMinusGenerator < ::Rails::Generators::Base
|
|
4
|
-
desc 'Generates view spec for T-Minus'
|
|
5
|
-
source_root File.expand_path('../templates', __FILE__)
|
|
6
|
-
class_option :template_engine
|
|
7
|
-
|
|
8
|
-
def create_view_test_directory
|
|
9
|
-
empty_directory 'test/views/prelaunch'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def copy_view_file
|
|
13
|
-
template 'view_test.erb',
|
|
14
|
-
"test/views/prelaunch/new.html.#{options[:template_engine]}_test.rb"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def include_test_helper
|
|
18
|
-
if File.exists? File.expand_path('test/test_helper.rb', @_source_root)
|
|
19
|
-
append_file 'test/test_helper.rb', "require 't-minus/test_helper'"
|
|
20
|
-
else
|
|
21
|
-
create_file 'test/test_helper.rb', <<-FILE
|
|
22
|
-
ENV['RAILS_ENV'] = 'test'
|
|
23
|
-
require File.expand_path('../../config/environment', __FILE__)
|
|
24
|
-
require 'rails/test_help'
|
|
25
|
-
require 't-minus/test_helper'
|
|
26
|
-
FILE
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
|
|
3
|
-
class PrelaunchNewViewTest < ActionView::TestCase
|
|
4
|
-
def setup
|
|
5
|
-
simulate_prelaunch_routes
|
|
6
|
-
@prelaunch_subscriber = PrelaunchSubscriber.new
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
test 'should render successfully' do
|
|
10
|
-
render :template => 'prelaunch/new'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def teardown
|
|
14
|
-
restore_routes
|
|
15
|
-
end
|
|
16
|
-
end
|
data/lib/t-minus.rb
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require 't-minus/engine' if defined?(Rails)
|
data/lib/t-minus/engine.rb
DELETED
data/lib/t-minus/test_helper.rb
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe PrelaunchController do
|
|
4
|
-
describe 'new action' do
|
|
5
|
-
it 'should be successful' do
|
|
6
|
-
get :new
|
|
7
|
-
assigns(:prelaunch_subscriber).should be_a(PrelaunchSubscriber)
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
describe 'create action' do
|
|
12
|
-
it 'should be successful' do
|
|
13
|
-
PrelaunchSubscriber.any_instance.expects(:save).returns(true)
|
|
14
|
-
post :create
|
|
15
|
-
flash[:notice].should_not be_nil
|
|
16
|
-
response.should redirect_to(root_url)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'should render new template if unsuccessful' do
|
|
20
|
-
PrelaunchSubscriber.any_instance.expects(:save).returns(false)
|
|
21
|
-
post :create
|
|
22
|
-
response.should render_template('prelaunch/new')
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe PrelaunchSubscriber do
|
|
4
|
-
before do
|
|
5
|
-
@prelaunch_subscriber = PrelaunchSubscriber.new(:email => 'bob@somedomain.com')
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
it 'should be valid' do
|
|
9
|
-
@prelaunch_subscriber.should be_valid
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
describe 'add_to_campaign_monitor' do
|
|
13
|
-
it 'should be successful' do
|
|
14
|
-
Campaigning::Subscriber.any_instance.expects(:add_and_resubscribe!).returns(true)
|
|
15
|
-
@prelaunch_subscriber.send(:add_to_campaign_monitor)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
describe 'campaign_monitor_configured?' do
|
|
20
|
-
it 'should be successful' do
|
|
21
|
-
@prelaunch_subscriber.send(:campaign_monitor_configured?).should == true
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe 'prelaunch/new.html.haml' do
|
|
4
|
-
before do
|
|
5
|
-
assign(:prelaunch_subscriber, PrelaunchSubscriber.new)
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
it 'should render successfully' do
|
|
9
|
-
append_view_path File.expand_path('../../../../lib/generators/haml/templates', __FILE__)
|
|
10
|
-
render :template => 'new.html.haml'
|
|
11
|
-
end
|
|
12
|
-
end
|