RubyApp 0.0.57 → 0.0.58
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/features/step_definitions/default_steps.rb +0 -2
- data/features/support/env.rb +9 -3
- data/lib/ruby_app/log.rb +7 -0
- data/lib/ruby_app/rack/route.rb +9 -5
- data/lib/ruby_app/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
RubyApp (0.0.
|
4
|
+
RubyApp (0.0.58)
|
5
5
|
BlueCloth
|
6
6
|
chronic
|
7
7
|
chronic_duration
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
rack-test (>= 0.5.4)
|
32
32
|
selenium-webdriver (~> 2.0)
|
33
33
|
xpath (~> 0.1.4)
|
34
|
-
childprocess (0.2.
|
34
|
+
childprocess (0.2.6)
|
35
35
|
ffi (~> 1.0.6)
|
36
36
|
chronic (0.6.6)
|
37
37
|
chronic_duration (0.9.6)
|
@@ -16,14 +16,12 @@ end
|
|
16
16
|
|
17
17
|
When /^I click "([^"]*)"$/ do |text|
|
18
18
|
click_on(text)
|
19
|
-
#sleep 1
|
20
19
|
end
|
21
20
|
|
22
21
|
When /^I fill in the "([^"]*)" field with "([^"]*)"( and I change focus)?$/ do |field, value, change_focus|
|
23
22
|
fill_in(field, :with => value)
|
24
23
|
if change_focus
|
25
24
|
find('body').click
|
26
|
-
#sleep 1
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
data/features/support/env.rb
CHANGED
@@ -1,12 +1,18 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib]))
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
5
|
+
|
1
6
|
require 'capybara'
|
2
7
|
require 'capybara/cucumber'
|
3
8
|
require 'capybara/dsl'
|
9
|
+
require 'capybara/rspec/matchers'
|
4
10
|
|
5
|
-
Capybara.register_driver :
|
6
|
-
Capybara::Selenium::Driver.new(app, :browser => :firefox)
|
11
|
+
Capybara.register_driver :pike do |app|
|
12
|
+
Capybara::Selenium::Driver.new(app, :browser => :firefox, :resynchronize => true)
|
7
13
|
end
|
8
14
|
|
9
|
-
Capybara.default_driver = :
|
15
|
+
Capybara.default_driver = :pike
|
10
16
|
Capybara.app_host = 'http://localhost:8008'
|
11
17
|
|
12
18
|
World(Capybara)
|
data/lib/ruby_app/log.rb
CHANGED
data/lib/ruby_app/rack/route.rb
CHANGED
@@ -24,7 +24,7 @@ module RubyApp
|
|
24
24
|
end
|
25
25
|
|
26
26
|
route(RubyApp::Mixins::RouteMixin::GET, /\/quit/) do |method, path|
|
27
|
-
RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect}")
|
27
|
+
#RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect}")
|
28
28
|
begin
|
29
29
|
[
|
30
30
|
200,
|
@@ -38,7 +38,7 @@ module RubyApp
|
|
38
38
|
end
|
39
39
|
|
40
40
|
route(RubyApp::Mixins::RouteMixin::GET, /\/elements\/([^\.]+)\.([^\.\?]+)/) do |method, path, element_id, format|
|
41
|
-
RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect} element_id=#{element_id.inspect} format=#{format.to_sym.inspect}")
|
41
|
+
#RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect} element_id=#{element_id.inspect} format=#{format.to_sym.inspect}")
|
42
42
|
begin
|
43
43
|
[
|
44
44
|
200,
|
@@ -56,12 +56,16 @@ module RubyApp
|
|
56
56
|
end
|
57
57
|
|
58
58
|
route(RubyApp::Mixins::RouteMixin::GET, /\.([^\.\?]+)/) do |method, path, format|
|
59
|
-
RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect} format=#{format.to_sym.inspect}")
|
59
|
+
#RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect} format=#{format.to_sym.inspect}")
|
60
60
|
begin
|
61
61
|
[
|
62
62
|
200,
|
63
63
|
{ 'content-type' => RubyApp::Rack::Route.get_content_type(format) },
|
64
|
-
[
|
64
|
+
[
|
65
|
+
RubyApp::Log.duration("#{self}##{__method__} method=#{method.inspect} path=#{path.inspect} format=#{format.to_sym.inspect}") do
|
66
|
+
RubyApp::Session.pages.last.render(format.to_sym)
|
67
|
+
end
|
68
|
+
]
|
65
69
|
]
|
66
70
|
rescue Exception => exception
|
67
71
|
RubyApp::Log.exception(exception)
|
@@ -70,7 +74,7 @@ module RubyApp
|
|
70
74
|
end
|
71
75
|
|
72
76
|
route(RubyApp::Mixins::RouteMixin::GET, /.*/) do |method, path|
|
73
|
-
RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect}")
|
77
|
+
#RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect}")
|
74
78
|
do_route(RubyApp::Mixins::RouteMixin::GET, '/.html')
|
75
79
|
end
|
76
80
|
|
data/lib/ruby_app/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RubyApp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 107
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 58
|
10
|
+
version: 0.0.58
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Frank G. Ficnar
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-09 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
prerelease: false
|