RubyApp 0.0.57 → 0.0.58

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RubyApp (0.0.57)
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.5)
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
 
@@ -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 :chrome do |app|
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 = :chrome
15
+ Capybara.default_driver = :pike
10
16
  Capybara.app_host = 'http://localhost:8008'
11
17
 
12
18
  World(Capybara)
@@ -17,6 +17,13 @@ module RubyApp
17
17
  self.error('-' * 80)
18
18
  end
19
19
 
20
+ def duration(message)
21
+ start = Time.now
22
+ result = yield if block_given?
23
+ self.debug("#{message} duration=#{Time.now - start}s")
24
+ return result
25
+ end
26
+
20
27
  def self.get
21
28
  @@_log
22
29
  end
@@ -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
- [ RubyApp::Session.pages.last.render(format.to_sym) ]
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
 
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.0.57"
2
+ VERSION = "0.0.58"
3
3
  ROOT = File.expand_path(File.dirname(__FILE__))
4
4
  end
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: 109
4
+ hash: 107
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 57
10
- version: 0.0.57
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-08 00:00:00 Z
18
+ date: 2012-01-09 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  prerelease: false