Skip to content

Commit

Permalink
Merge pull request #9 from jfitisoff/relax-versioning
Browse files Browse the repository at this point in the history
Relax versioning
  • Loading branch information
jfitisoff committed May 18, 2016
2 parents d88afb2 + 0b9b85a commit cafda18
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 37 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
source 'https://rubygems.org'

gem 'activesupport', '>= 4.0.0'
gem 'addressable', '~> 2.4', '>= 2.4.0'
gem 'activesupport'
gem 'addressable'
gem 'rspec'
gem 'watir'
gem 'rspec_junit_formatter', '0.2.2' # For CircleCI metadata collection.
gem 'coveralls' # For Coveralls.
gem 'simplecov', :require => false # For Coveralls.
gem 'rake'
35 changes: 9 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,46 +1,35 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.5.1)
activesupport (4.2.5.2)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
builder (3.2.2)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
commonwatir (4.0.0)
coveralls (0.8.10)
coveralls (0.8.13)
json (~> 1.8)
rest-client (>= 1.6.8, < 2)
simplecov (~> 0.11.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.20160128)
unf (>= 0.0.5, < 1.0.0)
ffi (1.9.10)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.7.0)
json (1.8.3)
mime-types (2.99)
minitest (5.8.4)
multi_json (1.11.2)
netrc (0.11.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rake (10.5.0)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-core (3.4.3)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
Expand All @@ -49,11 +38,8 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
rspec_junit_formatter (0.2.2)
builder (< 4)
rspec-core (>= 2, < 4, != 2.12.0)
rubyzip (1.1.7)
selenium-webdriver (2.51.0)
rubyzip (1.2.0)
selenium-webdriver (2.52.0)
childprocess (~> 0.5)
multi_json (~> 1.0)
rubyzip (~> 1.0)
Expand All @@ -70,9 +56,6 @@ GEM
tins (1.6.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
watir (5.0.0)
commonwatir (~> 4)
watir-webdriver
Expand All @@ -84,11 +67,11 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 4.0.0)
addressable (~> 2.4, >= 2.4.0)
activesupport
addressable
coveralls
rake
rspec
rspec_junit_formatter (= 0.2.2)
simplecov
watir

Expand Down
5 changes: 4 additions & 1 deletion lib/site-object.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
require 'active_support/all'
# require 'active_support/all'

require 'active_support'
require 'active_support/core_ext'
require 'addressable/template'

require "site-object/element_container"
Expand Down
17 changes: 14 additions & 3 deletions lib/site-object/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,18 @@
module PageObject

module PageClassMethods
cattr_accessor :page_features # Page features should be inheritable so that page templates work.

# Page features should be inheritable so that page templates work. So using cattr_accessor
# to allow that. Older versions of active_support were acting a little strange though --
# the cattr_accessor method wasn't getting recognized even though the requires were right.
# So the rescue block below is there to cover that case where cattr_accessor isn't
# getting recognized for some reason.
begin
cattr_accessor :page_features
rescue NoMethodError => e
Module.cattr_accessor :page_features
end

attr_reader :page_attributes, :page_elements, :page_url, :url_template, :url_matcher

# DEPRECATED. Use the set_attributes method instead.
Expand Down Expand Up @@ -438,9 +449,9 @@ def on_page?
end
else # There's no fragment in the URL template, strip the fragment out of the URL so that template matching works better.
if @browser.is_a? Watir::Browser
url = @browser.url.split('#')[0]
url = @browser.url.split(/(\?|#)/)[0]
elsif @browser.is_a? Selenium::WebDriver::Driver
url = @browser.current_url.split('#')[0]
url = @browser.current_url.split(/(\?|#)/)[0]
else
raise SiteObject::BrowserLibraryNotSupportedError, "Unsupported browser library: #{@browser.class}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/site-object/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def page
@pages.each do |p|
if p.url_matcher && p.url_matcher =~ url
found_page = p
elsif p.url_template.match url
elsif p.url_template.match url.split(/(\?|#)/)[0]
found_page = p
end

Expand Down
2 changes: 1 addition & 1 deletion lib/site-object/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SiteObject
VERSION = '0.4.3'
VERSION = '0.4.5'
end
4 changes: 2 additions & 2 deletions site-object.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ Gem::Specification.new do |s|
"lib/site-object/version.rb"
]
s.required_ruby_version = '>= 1.9.3'
s.add_runtime_dependency "activesupport", '>= 4.0.0'
s.add_runtime_dependency "addressable", '~> 2.4', '>= 2.4.0'
s.add_runtime_dependency "activesupport"
s.add_runtime_dependency "addressable"
end

0 comments on commit cafda18

Please sign in to comment.