timecop-console 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 50657f0790921ea73ec6cc14df79c8f4f6b39a36
4
+ data.tar.gz: 44915f3caf225202462d13ea2a8f0907ac656f9a
5
+ SHA512:
6
+ metadata.gz: b61f83cd1c1f04531af5afdef7e5dfaf06ef490eff4fdb26e0c0f9c572fc706a595a8868b12e94d70b2ee9d5236c8da0cf9f1ea508aac2d3b9e8623159620634
7
+ data.tar.gz: acdb2a90cbd87a051c730143fe811f92a9242b82be39bb1584c9d5a8281dd9e499ba4a4241b6d193c99aa08e534071f43429b6ddaa87a38f4c205245cc7be2f9
data/Gemfile CHANGED
@@ -1,3 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ group :test do
4
+ gem 'simplecov', :require => false
5
+ gem 'rspec-rails'
6
+ end
7
+
8
+ group :development, :test do
9
+ gem 'pry'
10
+ end
11
+
3
12
  gemspec
data/README.rdoc CHANGED
@@ -15,7 +15,11 @@ truly give you a powerful QA tool.
15
15
 
16
16
  Add to your `Gemfile`:
17
17
 
18
- gem 'timecop-console', :github => 'jtrupiano/timecop-console', :require => 'timecop_console'
18
+ group :development, :staging do
19
+ gem 'timecop-console', '~> 0.2', :require => 'timecop_console'
20
+ end
21
+
22
+ Protip: avoid having `timecop-console` gem as part of `test` group if you use Timecop in your tests to avoid any hard-to-debug exceptions.
19
23
 
20
24
  By requiring this dependency, it will open up ActionController::Base and inject an around_filter that will manage Time.now and friends for you.
21
25
 
data/Rakefile CHANGED
@@ -8,8 +8,7 @@ task :test => :spec
8
8
  task :default => :spec
9
9
  namespace :spec do
10
10
  task :coverage do
11
- # TODO - setup simplecov
12
- #ENV['INVOKE_SIMPLECOV'] = 'true'
11
+ ENV['INVOKE_SIMPLECOV'] = 'true'
13
12
  Rake::Task[:spec].invoke
14
13
  end
15
14
  end
@@ -33,7 +33,7 @@ module TimecopConsole
33
33
 
34
34
  # http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-date_select
35
35
  def date_select_format?
36
- params['timecop']['current_time(1i)'].present?
36
+ params['timecop'].present? && params['timecop']['current_time(1i)'].present?
37
37
  end
38
38
  end
39
39
  end
@@ -0,0 +1,21 @@
1
+ module TimecopConsole
2
+ module MainHelper
3
+ def time_travel_to(date)
4
+ unless date.respond_to?(:year) && date.respond_to?(:month) && date.respond_to?(:day)
5
+ raise ArgumentError, "Argument must be a Date object"
6
+ end
7
+
8
+ update_path = timecop_console.update_path(timecop: {
9
+ 'current_time(1i)' => date.year,
10
+ 'current_time(2i)' => date.month,
11
+ 'current_time(3i)' => date.day,
12
+ 'current_time(4i)' => 12,
13
+ 'current_time(5i)' => 0
14
+ })
15
+
16
+ button_to(date.strftime("%B %d, %Y"),
17
+ update_path,
18
+ method: :post)
19
+ end
20
+ end
21
+ end
@@ -5,5 +5,8 @@ require 'timecop_console'
5
5
  module TimecopConsole
6
6
  class Engine < Rails::Engine
7
7
  isolate_namespace TimecopConsole
8
+ config.to_prepare do
9
+ ApplicationController.helper(MainHelper)
10
+ end
8
11
  end
9
12
  end
@@ -1,17 +1,13 @@
1
1
  module TimecopConsole
2
2
  class Version
3
- MAJOR = 0 unless defined? MAJOR
4
- MINOR = 2 unless defined? MINOR
5
- PATCH = 0 unless defined? PATCH
3
+ MAJOR ||= 0
4
+ MINOR ||= 3
5
+ PATCH ||= 0
6
6
 
7
7
  class << self
8
-
9
- # @return [String]
10
8
  def to_s
11
9
  [MAJOR, MINOR, PATCH].compact.join('.')
12
10
  end
13
-
14
11
  end
15
-
16
12
  end
17
13
  end
@@ -20,7 +20,19 @@ describe TimecopConsole::MainController do
20
20
  post :update, :timecop => timecop_param, :use_route => :timecop_console
21
21
 
22
22
  response.should redirect_to("where_i_came_from")
23
- end
23
+ end
24
+
25
+ context "with backward compatible format" do
26
+ let(:date_params) do
27
+ { year: 2013, month: 8, day: 22, hour: 12, min: 0, sec: 0 }
28
+ end
29
+
30
+ it 'redirects back' do
31
+ post :update, date_params.merge(use_route: :timecop_console)
32
+
33
+ response.should redirect_to("where_i_came_from")
34
+ end
35
+ end
24
36
  end
25
37
 
26
38
  describe "GET to :reset" do
@@ -28,6 +28,6 @@ describe SampleController do
28
28
  session[TimecopConsole::SESSION_KEY_NAME] = frozen_time
29
29
 
30
30
  expect { get :index }.to raise_error(frozen_time.to_s)
31
- end
31
+ end
32
32
  end
33
33
  end
@@ -8,7 +8,8 @@
8
8
  </head>
9
9
  <body>
10
10
 
11
- <%= yield %>
11
+ <%= yield %>
12
+ <%= time_travel_to(Date.parse("December 31, 1999")) %>
12
13
 
13
14
  </body>
14
15
  </html>
@@ -3,8 +3,8 @@ require File.expand_path('../boot', __FILE__)
3
3
  # Pick the frameworks you want:
4
4
  # require "active_record/railtie"
5
5
  require "action_controller/railtie"
6
- require "action_mailer/railtie"
7
- require "active_resource/railtie"
6
+ #require "action_mailer/railtie"
7
+ #require "active_resource/railtie"
8
8
  # require "sprockets/railtie"
9
9
  # require "rails/test_unit/railtie"
10
10
 
@@ -6,15 +6,12 @@ DummyApp::Application.configure do
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
9
  # Show full error reports and disable caching
13
10
  config.consider_all_requests_local = true
14
11
  config.action_controller.perform_caching = false
15
12
 
16
13
  # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
14
+ # config.action_mailer.raise_delivery_errors = false
18
15
 
19
16
  # Print deprecation notices to the Rails logger
20
17
  config.active_support.deprecation = :log
@@ -22,5 +19,6 @@ DummyApp::Application.configure do
22
19
  # Only use best-standards-support built into browsers
23
20
  config.action_dispatch.best_standards_support = :builtin
24
21
 
22
+ config.eager_load = false
25
23
 
26
24
  end
@@ -48,4 +48,5 @@ DummyApp::Application.configure do
48
48
  # Send deprecation notices to registered listeners
49
49
  config.active_support.deprecation = :notify
50
50
 
51
+ config.eager_load = true
51
52
  end
@@ -11,9 +11,6 @@ DummyApp::Application.configure do
11
11
  config.serve_static_assets = true
12
12
  config.static_cache_control = "public, max-age=3600"
13
13
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
-
17
14
  # Show full error reports and disable caching
18
15
  config.consider_all_requests_local = true
19
16
  config.action_controller.perform_caching = false
@@ -27,9 +24,11 @@ DummyApp::Application.configure do
27
24
  # Tell Action Mailer not to deliver emails to the real world.
28
25
  # The :test delivery method accumulates sent emails in the
29
26
  # ActionMailer::Base.deliveries array.
30
- config.action_mailer.delivery_method = :test
27
+ #config.action_mailer.delivery_method = :test
31
28
 
32
29
 
33
30
  # Print deprecation notices to the stderr
34
31
  config.active_support.deprecation = :stderr
32
+
33
+ config.eager_load = false
35
34
  end
@@ -1,3 +1,4 @@
1
1
  DummyApp::Application.routes.draw do
2
2
  mount TimecopConsole::Engine => '/timecop_console'
3
+ root 'sample#index'
3
4
  end
@@ -3,230 +3,14 @@ Processing by TimecopConsole::MainController#update as HTML
3
3
  Redirected to where_i_came_from
4
4
  Completed 302 Found in 1ms
5
5
  Processing by TimecopConsole::MainController#update as HTML
6
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
7
- Redirected to where_i_came_from
8
- Completed 302 Found in 1ms
9
- Processing by TimecopConsole::MainController#update as HTML
10
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
11
- Redirected to where_i_came_from
12
- Completed 302 Found in 1ms
13
- Processing by TimecopConsole::MainController#update as HTML
14
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
15
- Redirected to where_i_came_from
16
- Completed 302 Found in 1ms
17
- Processing by TimecopConsole::MainController#reset as HTML
18
- Redirected to where_i_came_from
19
- Completed 302 Found in 0ms
20
- Processing by TimecopConsole::MainController#update as HTML
21
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
22
- Redirected to where_i_came_from
23
- Completed 302 Found in 1ms
24
- Processing by TimecopConsole::MainController#update as HTML
25
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
26
- Redirected to where_i_came_from
27
- Completed 302 Found in 1ms
28
- Processing by TimecopConsole::MainController#reset as HTML
29
- Redirected to where_i_came_from
30
- Completed 302 Found in 0ms
31
- Processing by TimecopConsole::MainController#update as HTML
32
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
33
- Redirected to where_i_came_from
34
- Completed 302 Found in 1ms
35
- Processing by TimecopConsole::MainController#reset as HTML
36
- Redirected to where_i_came_from
37
- Completed 302 Found in 1ms
38
- Processing by TimecopConsole::MainController#update as HTML
39
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
40
- Redirected to where_i_came_from
41
- Completed 302 Found in 1ms
42
- Processing by TimecopConsole::MainController#reset as HTML
43
- Redirected to where_i_came_from
44
- Completed 302 Found in 0ms
45
- Processing by TimecopConsole::MainController#update as HTML
46
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
47
- Redirected to where_i_came_from
48
- Completed 302 Found in 1ms
49
- Processing by TimecopConsole::MainController#reset as HTML
50
- Redirected to where_i_came_from
51
- Completed 302 Found in 1ms
52
- Processing by TimecopConsole::MainController#update as HTML
53
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
54
- Redirected to where_i_came_from
55
- Completed 302 Found in 1ms
56
- Processing by TimecopConsole::MainController#reset as HTML
57
- Redirected to where_i_came_from
58
- Completed 302 Found in 1ms
59
- Processing by TimecopConsole::MainController#update as HTML
60
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
61
- Redirected to where_i_came_from
62
- Completed 302 Found in 1ms
63
- Processing by TimecopConsole::MainController#reset as HTML
64
- Redirected to where_i_came_from
65
- Completed 302 Found in 1ms
66
- Processing by TimecopConsole::MainController#update as HTML
67
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
68
- Redirected to where_i_came_from
69
- Completed 302 Found in 1ms
70
- Processing by TimecopConsole::MainController#reset as HTML
71
- Redirected to where_i_came_from
72
- Completed 302 Found in 1ms
73
- Processing by TimecopConsole::MainController#update as HTML
74
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
75
- Redirected to where_i_came_from
76
- Completed 302 Found in 1ms
77
- Processing by TimecopConsole::MainController#reset as HTML
78
- Redirected to where_i_came_from
79
- Completed 302 Found in 1ms
80
- Processing by TimecopConsole::MainController#update as HTML
81
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
82
- Redirected to where_i_came_from
83
- Completed 302 Found in 1ms
84
- Processing by TimecopConsole::MainController#reset as HTML
6
+ Parameters: {"year"=>"2013", "month"=>"8", "day"=>"22", "hour"=>"12", "min"=>"0", "sec"=>"0"}
85
7
  Redirected to where_i_came_from
86
8
  Completed 302 Found in 0ms
87
- Processing by TimecopConsole::MainController#update as HTML
88
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
89
- Redirected to where_i_came_from
90
- Completed 302 Found in 1ms
91
- Processing by TimecopConsole::MainController#reset as HTML
92
- Redirected to where_i_came_from
93
- Completed 302 Found in 0ms
94
- Processing by AnonymousController#index as HTML
95
- Completed 200 OK in 86ms (Views: 85.3ms)
96
- Processing by TimecopConsole::MainController#update as HTML
97
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
98
- Redirected to where_i_came_from
99
- Completed 302 Found in 1ms
100
- Processing by TimecopConsole::MainController#reset as HTML
101
- Redirected to where_i_came_from
102
- Completed 302 Found in 1ms
103
- Processing by AnonymousController#index as HTML
104
- Completed 200 OK in 8ms (Views: 8.1ms)
105
- Processing by TimecopConsole::MainController#update as HTML
106
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
107
- Redirected to where_i_came_from
108
- Completed 302 Found in 1ms
109
- Processing by TimecopConsole::MainController#reset as HTML
110
- Redirected to where_i_came_from
111
- Completed 302 Found in 0ms
112
- Processing by AnonymousController#index as HTML
113
- Completed 200 OK in 8ms (Views: 7.6ms)
114
- Processing by TimecopConsole::MainController#update as HTML
115
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
116
- Redirected to where_i_came_from
117
- Completed 302 Found in 1ms
118
- Processing by TimecopConsole::MainController#reset as HTML
119
- Redirected to where_i_came_from
120
- Completed 302 Found in 0ms
121
- Processing by AnonymousController#index as HTML
122
- Completed 200 OK in 15ms (Views: 15.0ms)
123
- Processing by TimecopConsole::MainController#update as HTML
124
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
125
- Redirected to where_i_came_from
126
- Completed 302 Found in 1ms
127
- Processing by TimecopConsole::MainController#reset as HTML
128
- Redirected to where_i_came_from
129
- Completed 302 Found in 0ms
130
- Processing by AnonymousController#index as HTML
131
- Completed 200 OK in 9ms (Views: 8.9ms)
132
- Processing by TimecopConsole::MainController#update as HTML
133
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
134
- Redirected to where_i_came_from
135
- Completed 302 Found in 1ms
136
- Processing by TimecopConsole::MainController#reset as HTML
137
- Redirected to where_i_came_from
138
- Completed 302 Found in 0ms
139
- Processing by AnonymousController#index as HTML
140
- Completed 200 OK in 11ms (Views: 10.5ms)
141
- Processing by TimecopConsole::MainController#update as HTML
142
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
143
- Redirected to where_i_came_from
144
- Completed 302 Found in 1ms
145
- Processing by TimecopConsole::MainController#reset as HTML
146
- Redirected to where_i_came_from
147
- Completed 302 Found in 1ms
148
- Processing by TimecopConsole::MainController#update as HTML
149
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
150
- Redirected to where_i_came_from
151
- Completed 302 Found in 1ms
152
- Processing by TimecopConsole::MainController#reset as HTML
153
- Redirected to where_i_came_from
154
- Completed 302 Found in 0ms
155
- Processing by AnonymousController#index as HTML
156
- [timecop-console] Time traveling to 2012-11-08 06:30:01 UTC
157
- Completed 500 Internal Server Error in 259199988ms
158
- Processing by TimecopConsole::MainController#update as HTML
159
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
160
- Redirected to where_i_came_from
161
- Completed 302 Found in 1ms
162
- Processing by TimecopConsole::MainController#reset as HTML
163
- Redirected to where_i_came_from
164
- Completed 302 Found in 1ms
165
- Processing by AnonymousController#index as HTML
166
- [timecop-console] Time traveling to 2012-11-08 06:30:14 UTC
167
- Completed 500 Internal Server Error in 259199996ms
168
- Processing by TimecopConsole::MainController#update as HTML
169
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
170
- Redirected to where_i_came_from
171
- Completed 302 Found in 1ms
172
- Processing by TimecopConsole::MainController#reset as HTML
173
- Redirected to where_i_came_from
174
- Completed 302 Found in 0ms
175
- Processing by AnonymousController#index as HTML
176
- Completed 500 Internal Server Error in 0ms
177
- Processing by TimecopConsole::MainController#update as HTML
178
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
179
- Redirected to where_i_came_from
180
- Completed 302 Found in 1ms
181
- Processing by TimecopConsole::MainController#reset as HTML
182
- Redirected to where_i_came_from
183
- Completed 302 Found in 0ms
184
- Processing by AnonymousController#index as HTML
185
- Completed 200 OK in 0ms
186
- Processing by TimecopConsole::MainController#update as HTML
187
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
188
- Redirected to where_i_came_from
189
- Completed 302 Found in 1ms
190
- Processing by TimecopConsole::MainController#reset as HTML
191
- Redirected to where_i_came_from
192
- Completed 302 Found in 0ms
193
- Processing by AnonymousController#index as HTML
194
- [timecop-console] Time traveling to 2012-11-08 06:32:35 UTC
195
- [timecop-console] Resetting session to: 2012-11-08 07:32:38 +0100
196
- Completed 200 OK in 259200005ms (Views: 7.9ms)
197
- Processing by TimecopConsole::MainController#update as HTML
198
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
199
- Redirected to where_i_came_from
200
- Completed 302 Found in 1ms
201
- Processing by TimecopConsole::MainController#reset as HTML
202
- Redirected to where_i_came_from
203
- Completed 302 Found in 0ms
204
- Processing by AnonymousController#index as HTML
205
- Completed 200 OK in 0ms
206
- Processing by AnonymousController#index as HTML
207
- [timecop-console] Time traveling to 2013-11-05 06:38:11 UTC
208
- Completed 500 Internal Server Error in 31535999981ms
209
- Processing by TimecopConsole::MainController#update as HTML
210
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
211
- Redirected to where_i_came_from
212
- Completed 302 Found in 1ms
213
- Processing by TimecopConsole::MainController#reset as HTML
214
- Redirected to where_i_came_from
215
- Completed 302 Found in 0ms
216
- Processing by AnonymousController#index as HTML
217
- Completed 200 OK in 0ms
218
- Processing by AnonymousController#index as HTML
219
- [timecop-console] Time traveling to 2013-11-05 06:38:40 UTC
220
- Completed 500 Internal Server Error in 31535999996ms
221
- Processing by TimecopConsole::MainController#update as HTML
222
- Parameters: {"timecop"=>{"current_time(1i)"=>"2012", "current_time(2i)"=>"11", "current_time(3i)"=>"30", "current_time(4i)"=>"22", "current_time(5i)"=>"1"}}
223
- Redirected to where_i_came_from
224
- Completed 302 Found in 1ms
225
9
  Processing by TimecopConsole::MainController#reset as HTML
226
10
  Redirected to where_i_came_from
227
11
  Completed 302 Found in 0ms
228
12
  Processing by AnonymousController#index as HTML
229
13
  Completed 200 OK in 0ms
230
14
  Processing by AnonymousController#index as HTML
231
- [timecop-console] Time traveling to 2013-11-05 06:39:08 UTC
232
- Completed 500 Internal Server Error in 31535999996ms
15
+ [timecop-console] Time traveling to 2015-02-27 03:07:17 UTC
16
+ Completed 500 Internal Server Error in 31535999995ms
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe TimecopConsole::MainHelper do
4
+ describe "#time_travel_to" do
5
+ context "when a Date object is passed" do
6
+ let(:date) { Date.parse('Dec 12, 1950') }
7
+
8
+ it 'should return a link with timecop console route' do
9
+ helper.time_travel_to(date).should == "<form action=\"/timecop_console/update?timecop%5Bcurrent_time%281i%29%5D=1950&amp;timecop%5Bcurrent_time%282i%29%5D=12&amp;timecop%5Bcurrent_time%283i%29%5D=12&amp;timecop%5Bcurrent_time%284i%29%5D=12&amp;timecop%5Bcurrent_time%285i%29%5D=0\" class=\"button_to\" method=\"post\"><div><input type=\"submit\" value=\"December 12, 1950\" /></div></form>"
10
+ end
11
+ end
12
+ context "when a string is passed" do
13
+ let(:date) { "12-12-1950" }
14
+ it "should raise an ArgumentError" do
15
+ expect { helper.time_travel_to(date) }.to raise_error(ArgumentError, "Argument must be a Date object")
16
+ end
17
+ end
18
+ end
19
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,16 @@
1
1
  # Configure Rails Envinronment
2
- ENV["RAILS_ENV"] = "test"
3
-
2
+ ENV["RAILS_ENV"] ||= "test"
4
3
  require File.expand_path('../dummy_app/config/environment', __FILE__)
5
-
6
4
  require 'rspec/rails'
5
+ require 'rspec/autorun'
6
+
7
+ require 'simplecov'
8
+ SimpleCov.start do
9
+ add_filter '/config/'
10
+ add_group 'Controllers', 'app/controllers'
11
+ add_group 'Libraries', 'lib'
12
+ add_group 'Specs', 'spec'
13
+ end
7
14
 
8
15
  RSpec.configure do |config|
9
16
  config.include TimecopConsole::Engine.routes.url_helpers
metadata CHANGED
@@ -1,49 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timecop-console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - John Trupiano
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-14 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: &70274154688200 !ruby/object:Gem::Requirement
17
- none: false
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '3.1'
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *70274154688200
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
30
+ - - <
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
25
33
  - !ruby/object:Gem::Dependency
26
34
  name: timecop
27
- requirement: &70274154687580 !ruby/object:Gem::Requirement
28
- none: false
35
+ requirement: !ruby/object:Gem::Requirement
29
36
  requirements:
30
- - - ~>
37
+ - - '>='
31
38
  - !ruby/object:Gem::Version
32
39
  version: '0.5'
33
40
  type: :runtime
34
41
  prerelease: false
35
- version_requirements: *70274154687580
36
- - !ruby/object:Gem::Dependency
37
- name: rspec-rails
38
- requirement: &70274154687200 !ruby/object:Gem::Requirement
39
- none: false
42
+ version_requirements: !ruby/object:Gem::Requirement
40
43
  requirements:
41
- - - ! '>='
44
+ - - '>='
42
45
  - !ruby/object:Gem::Version
43
- version: '0'
44
- type: :development
45
- prerelease: false
46
- version_requirements: *70274154687200
46
+ version: '0.5'
47
47
  description: TimecopConsole manipulates Time.now using Timecop gem.
48
48
  email:
49
49
  - jtrupiano@gmail.com
@@ -56,6 +56,7 @@ files:
56
56
  - README.rdoc
57
57
  - Rakefile
58
58
  - app/controllers/timecop_console/main_controller.rb
59
+ - app/helpers/timecop_console/main_helper.rb
59
60
  - config/routes.rb
60
61
  - lib/timecop_console/controller_methods.rb
61
62
  - lib/timecop_console/engine.rb
@@ -87,43 +88,39 @@ files:
87
88
  - spec/dummy_app/config.ru
88
89
  - spec/dummy_app/db/seeds.rb
89
90
  - spec/dummy_app/doc/README_FOR_APP
90
- - spec/dummy_app/Gemfile
91
- - spec/dummy_app/Gemfile.lock
92
- - spec/dummy_app/log/development.log
93
91
  - spec/dummy_app/log/test.log
94
92
  - spec/dummy_app/public/404.html
95
93
  - spec/dummy_app/public/422.html
96
94
  - spec/dummy_app/public/500.html
97
95
  - spec/dummy_app/public/favicon.ico
98
- - spec/dummy_app/public/index.html
99
96
  - spec/dummy_app/public/robots.txt
100
97
  - spec/dummy_app/Rakefile
101
98
  - spec/dummy_app/README.rdoc
102
99
  - spec/dummy_app/script/rails
100
+ - spec/helpers/main_helper_spec.rb
103
101
  - spec/spec_helper.rb
104
- homepage: https://github.com/jtrupiano/timecop-console
102
+ homepage: https://github.com/ferndopolis/timecop-console
105
103
  licenses: []
104
+ metadata: {}
106
105
  post_install_message:
107
106
  rdoc_options: []
108
107
  require_paths:
109
108
  - lib
110
109
  required_ruby_version: !ruby/object:Gem::Requirement
111
- none: false
112
110
  requirements:
113
- - - ! '>='
111
+ - - '>='
114
112
  - !ruby/object:Gem::Version
115
113
  version: '0'
116
114
  required_rubygems_version: !ruby/object:Gem::Requirement
117
- none: false
118
115
  requirements:
119
- - - ! '>='
116
+ - - '>='
120
117
  - !ruby/object:Gem::Version
121
118
  version: 1.3.6
122
119
  requirements: []
123
120
  rubyforge_project:
124
- rubygems_version: 1.8.17
121
+ rubygems_version: 2.0.2
125
122
  signing_key:
126
- specification_version: 3
123
+ specification_version: 4
127
124
  summary: Expose Timecop's capabilities to the UI in your rails app, allowing QA to
128
125
  take advantage of it.
129
126
  test_files:
@@ -153,17 +150,15 @@ test_files:
153
150
  - spec/dummy_app/config.ru
154
151
  - spec/dummy_app/db/seeds.rb
155
152
  - spec/dummy_app/doc/README_FOR_APP
156
- - spec/dummy_app/Gemfile
157
- - spec/dummy_app/Gemfile.lock
158
- - spec/dummy_app/log/development.log
159
153
  - spec/dummy_app/log/test.log
160
154
  - spec/dummy_app/public/404.html
161
155
  - spec/dummy_app/public/422.html
162
156
  - spec/dummy_app/public/500.html
163
157
  - spec/dummy_app/public/favicon.ico
164
- - spec/dummy_app/public/index.html
165
158
  - spec/dummy_app/public/robots.txt
166
159
  - spec/dummy_app/Rakefile
167
160
  - spec/dummy_app/README.rdoc
168
161
  - spec/dummy_app/script/rails
162
+ - spec/helpers/main_helper_spec.rb
169
163
  - spec/spec_helper.rb
164
+ has_rdoc:
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 3.2'
4
-
5
- gem 'timecop-console', :path => '../../', :require => 'timecop_console'
@@ -1,93 +0,0 @@
1
- PATH
2
- remote: ../../
3
- specs:
4
- timecop-console (0.1.0)
5
- timecop (~> 0.5)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actionmailer (3.2.8)
11
- actionpack (= 3.2.8)
12
- mail (~> 2.4.4)
13
- actionpack (3.2.8)
14
- activemodel (= 3.2.8)
15
- activesupport (= 3.2.8)
16
- builder (~> 3.0.0)
17
- erubis (~> 2.7.0)
18
- journey (~> 1.0.4)
19
- rack (~> 1.4.0)
20
- rack-cache (~> 1.2)
21
- rack-test (~> 0.6.1)
22
- sprockets (~> 2.1.3)
23
- activemodel (3.2.8)
24
- activesupport (= 3.2.8)
25
- builder (~> 3.0.0)
26
- activerecord (3.2.8)
27
- activemodel (= 3.2.8)
28
- activesupport (= 3.2.8)
29
- arel (~> 3.0.2)
30
- tzinfo (~> 0.3.29)
31
- activeresource (3.2.8)
32
- activemodel (= 3.2.8)
33
- activesupport (= 3.2.8)
34
- activesupport (3.2.8)
35
- i18n (~> 0.6)
36
- multi_json (~> 1.0)
37
- arel (3.0.2)
38
- builder (3.0.4)
39
- erubis (2.7.0)
40
- hike (1.2.1)
41
- i18n (0.6.1)
42
- journey (1.0.4)
43
- json (1.7.5)
44
- mail (2.4.4)
45
- i18n (>= 0.4.0)
46
- mime-types (~> 1.16)
47
- treetop (~> 1.4.8)
48
- mime-types (1.19)
49
- multi_json (1.3.6)
50
- polyglot (0.3.3)
51
- rack (1.4.1)
52
- rack-cache (1.2)
53
- rack (>= 0.4)
54
- rack-ssl (1.3.2)
55
- rack
56
- rack-test (0.6.2)
57
- rack (>= 1.0)
58
- rails (3.2.8)
59
- actionmailer (= 3.2.8)
60
- actionpack (= 3.2.8)
61
- activerecord (= 3.2.8)
62
- activeresource (= 3.2.8)
63
- activesupport (= 3.2.8)
64
- bundler (~> 1.0)
65
- railties (= 3.2.8)
66
- railties (3.2.8)
67
- actionpack (= 3.2.8)
68
- activesupport (= 3.2.8)
69
- rack-ssl (~> 1.3.2)
70
- rake (>= 0.8.7)
71
- rdoc (~> 3.4)
72
- thor (>= 0.14.6, < 2.0)
73
- rake (0.9.2.2)
74
- rdoc (3.12)
75
- json (~> 1.4)
76
- sprockets (2.1.3)
77
- hike (~> 1.2)
78
- rack (~> 1.0)
79
- tilt (~> 1.1, != 1.3.0)
80
- thor (0.16.0)
81
- tilt (1.3.3)
82
- timecop (0.5.2)
83
- treetop (1.4.11)
84
- polyglot
85
- polyglot (>= 0.3.1)
86
- tzinfo (0.3.33)
87
-
88
- PLATFORMS
89
- ruby
90
-
91
- DEPENDENCIES
92
- rails (~> 3.2)
93
- timecop-console!
@@ -1,91 +0,0 @@
1
-
2
-
3
- Started GET "/timecop_console/reset" for 127.0.0.1 at 2012-11-04 23:26:09 +0100
4
- Processing by TimecopConsole::MainController#reset as */*
5
- Redirected to
6
- Completed 500 Internal Server Error in 1ms
7
-
8
- ActionController::RedirectBackError (No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called successfully. If this is a test, make sure to specify request.env["HTTP_REFERER"].):
9
- actionpack (3.2.8) lib/action_controller/metal/redirecting.rb:100:in `_compute_redirect_to_location'
10
- actionpack (3.2.8) lib/action_controller/metal/redirecting.rb:74:in `redirect_to'
11
- actionpack (3.2.8) lib/action_controller/metal/flash.rb:25:in `redirect_to'
12
- actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:60:in `block in redirect_to'
13
- activesupport (3.2.8) lib/active_support/notifications.rb:123:in `block in instrument'
14
- activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
15
- activesupport (3.2.8) lib/active_support/notifications.rb:123:in `instrument'
16
- actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:59:in `redirect_to'
17
- /Users/user/Projects/Ruby/gems/timecop-console/app/controllers/timecop_console/main_controller.rb:29:in `reset'
18
- actionpack (3.2.8) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
19
- actionpack (3.2.8) lib/abstract_controller/base.rb:167:in `process_action'
20
- actionpack (3.2.8) lib/action_controller/metal/rendering.rb:10:in `process_action'
21
- actionpack (3.2.8) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
22
- activesupport (3.2.8) lib/active_support/callbacks.rb:414:in `_run__1282082217528020919__process_action__2587926962013094874__callbacks'
23
- activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
24
- activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
25
- activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
26
- actionpack (3.2.8) lib/abstract_controller/callbacks.rb:17:in `process_action'
27
- actionpack (3.2.8) lib/action_controller/metal/rescue.rb:29:in `process_action'
28
- actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
29
- activesupport (3.2.8) lib/active_support/notifications.rb:123:in `block in instrument'
30
- activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
31
- activesupport (3.2.8) lib/active_support/notifications.rb:123:in `instrument'
32
- actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
33
- actionpack (3.2.8) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
34
- actionpack (3.2.8) lib/abstract_controller/base.rb:121:in `process'
35
- actionpack (3.2.8) lib/abstract_controller/rendering.rb:45:in `process'
36
- actionpack (3.2.8) lib/action_controller/metal.rb:203:in `dispatch'
37
- actionpack (3.2.8) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
38
- actionpack (3.2.8) lib/action_controller/metal.rb:246:in `block in action'
39
- actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in `call'
40
- actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
41
- actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:36:in `call'
42
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
43
- journey (1.0.4) lib/journey/router.rb:56:in `each'
44
- journey (1.0.4) lib/journey/router.rb:56:in `call'
45
- actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:600:in `call'
46
- railties (3.2.8) lib/rails/engine.rb:479:in `call'
47
- railties (3.2.8) lib/rails/railtie/configurable.rb:30:in `method_missing'
48
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
49
- journey (1.0.4) lib/journey/router.rb:56:in `each'
50
- journey (1.0.4) lib/journey/router.rb:56:in `call'
51
- actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:600:in `call'
52
- actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
53
- rack (1.4.1) lib/rack/etag.rb:23:in `call'
54
- rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
55
- actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in `call'
56
- actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
57
- actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in `call'
58
- rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
59
- rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
60
- actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in `call'
61
- actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
62
- activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__2417632332746792915__call__2167111651493779171__callbacks'
63
- activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
64
- activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
65
- activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
66
- actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
67
- actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:65:in `call'
68
- actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
69
- actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
70
- actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
71
- railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
72
- railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
73
- actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
74
- rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
75
- rack (1.4.1) lib/rack/runtime.rb:17:in `call'
76
- activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
77
- rack (1.4.1) lib/rack/lock.rb:15:in `call'
78
- actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
79
- railties (3.2.8) lib/rails/engine.rb:479:in `call'
80
- railties (3.2.8) lib/rails/application.rb:223:in `call'
81
- rack (1.4.1) lib/rack/content_length.rb:14:in `call'
82
- railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call'
83
- rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
84
- /Users/user/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
85
- /Users/user/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
86
- /Users/user/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
87
-
88
-
89
- Rendered /Users/user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
90
- Rendered /Users/user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.2ms)
91
- Rendered /Users/user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (19.0ms)
@@ -1,241 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Ruby on Rails: Welcome aboard</title>
5
- <style type="text/css" media="screen">
6
- body {
7
- margin: 0;
8
- margin-bottom: 25px;
9
- padding: 0;
10
- background-color: #f0f0f0;
11
- font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
12
- font-size: 13px;
13
- color: #333;
14
- }
15
-
16
- h1 {
17
- font-size: 28px;
18
- color: #000;
19
- }
20
-
21
- a {color: #03c}
22
- a:hover {
23
- background-color: #03c;
24
- color: white;
25
- text-decoration: none;
26
- }
27
-
28
-
29
- #page {
30
- background-color: #f0f0f0;
31
- width: 750px;
32
- margin: 0;
33
- margin-left: auto;
34
- margin-right: auto;
35
- }
36
-
37
- #content {
38
- float: left;
39
- background-color: white;
40
- border: 3px solid #aaa;
41
- border-top: none;
42
- padding: 25px;
43
- width: 500px;
44
- }
45
-
46
- #sidebar {
47
- float: right;
48
- width: 175px;
49
- }
50
-
51
- #footer {
52
- clear: both;
53
- }
54
-
55
- #header, #about, #getting-started {
56
- padding-left: 75px;
57
- padding-right: 30px;
58
- }
59
-
60
-
61
- #header {
62
- background-image: url("assets/rails.png");
63
- background-repeat: no-repeat;
64
- background-position: top left;
65
- height: 64px;
66
- }
67
- #header h1, #header h2 {margin: 0}
68
- #header h2 {
69
- color: #888;
70
- font-weight: normal;
71
- font-size: 16px;
72
- }
73
-
74
-
75
- #about h3 {
76
- margin: 0;
77
- margin-bottom: 10px;
78
- font-size: 14px;
79
- }
80
-
81
- #about-content {
82
- background-color: #ffd;
83
- border: 1px solid #fc0;
84
- margin-left: -55px;
85
- margin-right: -10px;
86
- }
87
- #about-content table {
88
- margin-top: 10px;
89
- margin-bottom: 10px;
90
- font-size: 11px;
91
- border-collapse: collapse;
92
- }
93
- #about-content td {
94
- padding: 10px;
95
- padding-top: 3px;
96
- padding-bottom: 3px;
97
- }
98
- #about-content td.name {color: #555}
99
- #about-content td.value {color: #000}
100
-
101
- #about-content ul {
102
- padding: 0;
103
- list-style-type: none;
104
- }
105
-
106
- #about-content.failure {
107
- background-color: #fcc;
108
- border: 1px solid #f00;
109
- }
110
- #about-content.failure p {
111
- margin: 0;
112
- padding: 10px;
113
- }
114
-
115
-
116
- #getting-started {
117
- border-top: 1px solid #ccc;
118
- margin-top: 25px;
119
- padding-top: 15px;
120
- }
121
- #getting-started h1 {
122
- margin: 0;
123
- font-size: 20px;
124
- }
125
- #getting-started h2 {
126
- margin: 0;
127
- font-size: 14px;
128
- font-weight: normal;
129
- color: #333;
130
- margin-bottom: 25px;
131
- }
132
- #getting-started ol {
133
- margin-left: 0;
134
- padding-left: 0;
135
- }
136
- #getting-started li {
137
- font-size: 18px;
138
- color: #888;
139
- margin-bottom: 25px;
140
- }
141
- #getting-started li h2 {
142
- margin: 0;
143
- font-weight: normal;
144
- font-size: 18px;
145
- color: #333;
146
- }
147
- #getting-started li p {
148
- color: #555;
149
- font-size: 13px;
150
- }
151
-
152
-
153
- #sidebar ul {
154
- margin-left: 0;
155
- padding-left: 0;
156
- }
157
- #sidebar ul h3 {
158
- margin-top: 25px;
159
- font-size: 16px;
160
- padding-bottom: 10px;
161
- border-bottom: 1px solid #ccc;
162
- }
163
- #sidebar li {
164
- list-style-type: none;
165
- }
166
- #sidebar ul.links li {
167
- margin-bottom: 5px;
168
- }
169
-
170
- .filename {
171
- font-style: italic;
172
- }
173
- </style>
174
- <script type="text/javascript">
175
- function about() {
176
- info = document.getElementById('about-content');
177
- if (window.XMLHttpRequest)
178
- { xhr = new XMLHttpRequest(); }
179
- else
180
- { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
181
- xhr.open("GET","rails/info/properties",false);
182
- xhr.send("");
183
- info.innerHTML = xhr.responseText;
184
- info.style.display = 'block'
185
- }
186
- </script>
187
- </head>
188
- <body>
189
- <div id="page">
190
- <div id="sidebar">
191
- <ul id="sidebar-items">
192
- <li>
193
- <h3>Browse the documentation</h3>
194
- <ul class="links">
195
- <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
196
- <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
197
- <li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
198
- <li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
199
- </ul>
200
- </li>
201
- </ul>
202
- </div>
203
-
204
- <div id="content">
205
- <div id="header">
206
- <h1>Welcome aboard</h1>
207
- <h2>You&rsquo;re riding Ruby on Rails!</h2>
208
- </div>
209
-
210
- <div id="about">
211
- <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
212
- <div id="about-content" style="display: none"></div>
213
- </div>
214
-
215
- <div id="getting-started">
216
- <h1>Getting started</h1>
217
- <h2>Here&rsquo;s how to get rolling:</h2>
218
-
219
- <ol>
220
- <li>
221
- <h2>Use <code>rails generate</code> to create your models and controllers</h2>
222
- <p>To see all available options, run it without parameters.</p>
223
- </li>
224
-
225
- <li>
226
- <h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
227
- <p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
228
- </li>
229
-
230
- <li>
231
- <h2>Create your database</h2>
232
- <p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
233
- </li>
234
- </ol>
235
- </div>
236
- </div>
237
-
238
- <div id="footer">&nbsp;</div>
239
- </div>
240
- </body>
241
- </html>