ule_page 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 857824e4a022e82a0cf4d7d4d616dea01ad72a23
4
- data.tar.gz: 5b021aef48ef36da55f4e4d4c09dc7675a068908
3
+ metadata.gz: e65f28565e0f3af28604df08b479c7d1b9002a03
4
+ data.tar.gz: 32c8780a7e57eadda48defecbf145d57ea3e5387
5
5
  SHA512:
6
- metadata.gz: 41cab64b513ea09135059366027d87e6abecbc49713b0158613be2ebba0726a36980f81be1a3e2e3aa730041fdb2c7b308cadfe5843c65e681031d3e4af452a3
7
- data.tar.gz: bf345061ef09628c9e86f8479c21a3933500cdf98d4a523689ac0e438f1d5e31bcac0de00b9a16037ba86355aae95563a578e6bf6054c100c9b16a8403950542
6
+ metadata.gz: 8e9fb84072c2037e43666430e9cd4d927d0093b9f10699bb1661128ef95f72f056a03f58258978f0f7f39b5a3ff14d74c636ccd30d16a0c2c435a56a91f7ccbf
7
+ data.tar.gz: 443d1fc5472baf0a06fc83b383f0e91c613649f85ec1e241fa6f69560ec64d02949466ea629e07858ce29b63e92deed8c4ef4f7ee617842ee3b5c9712c737dd1
data/Gemfile.lock CHANGED
@@ -1,13 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ule_page (0.0.1)
5
- activerecord
6
- activesupport
7
- capybara
8
- capybara-webkit
4
+ ule_page (0.0.2)
5
+ activerecord (> 4.0)
6
+ activesupport (> 4.0)
7
+ capybara (>= 2.1, < 3.0)
9
8
  rspec (~> 3.0)
10
- site_prism
9
+ site_prism (> 2.1)
11
10
 
12
11
  GEM
13
12
  remote: https://ruby.taobao.org/
@@ -50,15 +49,13 @@ GEM
50
49
  addressable (2.4.0)
51
50
  arel (6.0.3)
52
51
  builder (3.2.2)
53
- capybara (2.5.0)
52
+ capybara (2.6.2)
53
+ addressable
54
54
  mime-types (>= 1.16)
55
55
  nokogiri (>= 1.3.3)
56
56
  rack (>= 1.0.0)
57
57
  rack-test (>= 0.5.4)
58
58
  xpath (~> 2.0)
59
- capybara-webkit (1.7.1)
60
- capybara (>= 2.3.0, < 2.6.0)
61
- json
62
59
  concurrent-ruby (1.0.0)
63
60
  cucumber (1.3.20)
64
61
  builder (>= 2.1.2)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # UlePage
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ule_page`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to UlePage gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ule_page`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
5
  Using UlePage, you can define page model object easily. e.g.
6
6
  ```ruby
@@ -30,26 +30,32 @@ gem 'ule_page'
30
30
 
31
31
  And then execute:
32
32
 
33
- $ bundle
33
+ $ bundle
34
34
 
35
35
  Or install it yourself as:
36
36
 
37
- $ gem install ule_page
37
+ $ gem install ule_page
38
38
 
39
39
  ## Usage
40
40
  Open your features/support/env.rb, add the following lines:
41
41
  ```ruby
42
42
  require 'ule_page'
43
- UlePage.setup do |config|
43
+ UlePage.setup do |config|
44
+ #add customised content
44
45
  end
45
46
  ```
47
+ # Important:
48
+ Make sure the above lines in front of the screenshot requiring, or you can not get screenshot when you get errors.
49
+ ```ruby
50
+ require 'capybara-screenshot/cucumber'
51
+ ```
46
52
  And in features/support/helper.rb, add lines:
47
53
  ```ruby
48
54
  include UlePage::Helper
49
55
 
50
56
  def pg
51
57
  special_maps = {
52
- '/' => Page::Homes::Index.new # or something eles, based on your page model
58
+ '/' => Page::Homes::Index.new # or something else, based on your page model
53
59
  }
54
60
 
55
61
  return UlePage::ModelMatch.get_current_page_with_wait special_maps
@@ -77,7 +83,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
77
83
 
78
84
  ## Contributing
79
85
 
80
- Bug reports and pull requests are welcome on GitHub at https://github.com/jerecui/ule_page. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
86
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jerecui/ule_page.
81
87
 
82
88
 
83
89
  ## License
@@ -5,9 +5,6 @@ module UlePage
5
5
 
6
6
  def wait_for_ajax
7
7
  page.has_css?('.pace-small .pace-inactive')
8
- # Timeout.timeout(Capybara.default_wait_time) do
9
- # loop until finished_all_ajax_requests?
10
- # end
11
8
  end
12
9
 
13
10
  def finished_all_ajax_requests?
@@ -18,24 +15,6 @@ module UlePage
18
15
  visit '/admin'
19
16
  end
20
17
 
21
- # def signin(user)
22
- # token = User.new_remember_token
23
-
24
- # if need_run_javascript
25
- # if Capybara.current_driver == :selenium
26
- # visit_admin_pages
27
- # page.driver.browser.manage.delete_all_cookies
28
- # Capybara.current_session.driver.browser.manage.add_cookie :name => 'remember_token', :value => token
29
- # else
30
- # page.driver.set_cookie("remember_token", token)
31
- # end
32
- # else
33
- # Capybara.current_session.driver.browser.set_cookie("remember_token=#{token}")
34
- # end
35
-
36
- # user.update_attribute(:remember_token, User.encrypt(token))
37
- # end
38
-
39
18
  def signout
40
19
  browser = Capybara.current_session.driver.browser
41
20
  if need_run_javascript
@@ -37,9 +37,9 @@ module UlePage
37
37
  pluralized = model.to_s.underscore.pluralize
38
38
  page_module_name = model.to_s.pluralize.camelize
39
39
 
40
- next unless Object.const_defined?("Page::#{page_module_name}")
40
+ next unless Object.const_defined?("#{UlePage.module_name}::#{page_module_name}")
41
41
 
42
- page_module = Object.const_get("Page").const_get(page_module_name)
42
+ page_module = Object.const_get(UlePage.module_name).const_get(page_module_name)
43
43
  UlePage.map["/#{pluralized}"] = page_module.const_get("Index").try(:new) rescue false
44
44
  UlePage.map["/#{pluralized}/new"] = page_module.const_get("Create").new rescue false
45
45
  UlePage.map["/#{pluralized}/:id"] = page_module.const_get("Details").new rescue false
@@ -1,3 +1,3 @@
1
1
  module UlePage
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/ule_page.rb CHANGED
@@ -26,6 +26,9 @@ module UlePage
26
26
  mattr_accessor :map_initialized
27
27
  @@map_initialized = false
28
28
 
29
+ mattr_accessor :module_name
30
+ @@module_name = "Page"
31
+
29
32
  def self.setup
30
33
  UlePage::Page.send(:include, Rails.application.routes.url_helpers) if defined? Rails
31
34
  UlePage::Page.send(:include, ActionView::Helpers::NumberHelper) if defined? ActionView
data/ule_page.gemspec CHANGED
@@ -32,24 +32,19 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency("activesupport")
33
33
 
34
34
 
35
- spec.add_dependency("site_prism")
36
- spec.add_dependency("capybara")
37
- spec.add_dependency("capybara-webkit")
38
- spec.add_dependency("rspec", "~> 3.0")
39
- spec.add_dependency("activesupport")
40
- spec.add_dependency("activerecord")
41
-
42
- spec.add_development_dependency("rails")
43
- spec.add_development_dependency("rspec-rails")
44
-
45
- spec.add_development_dependency("rspec-its", "~> 1.0")
46
- spec.add_development_dependency("cucumber", "~> 1.3.15")
47
- spec.add_development_dependency("simplecov")
48
- # spec.add_development_dependency("aruba")
49
- # spec.add_development_dependency("mocha", ">= 0.12.8")
50
- # spec.add_development_dependency("bourne")
51
- # spec.add_development_dependency("appraisal", "~> 2.1.0")
52
- spec.add_development_dependency("activerecord", ">= 3.0.0")
53
- spec.add_development_dependency("yard")
35
+ spec.add_dependency "site_prism", "> 2.1"
36
+ spec.add_dependency "capybara", ['>= 2.1', '< 3.0']
37
+ spec.add_dependency "rspec", "~> 3.0"
38
+ spec.add_dependency "activesupport", '> 4.0'
39
+ spec.add_dependency "activerecord", '> 4.0'
40
+
41
+ spec.add_development_dependency "rails"
42
+ spec.add_development_dependency "rspec-rails"
43
+
44
+ spec.add_development_dependency "rspec-its", "~> 1.0"
45
+ spec.add_development_dependency "cucumber", "~> 1.3.15"
46
+ spec.add_development_dependency "simplecov"
47
+ spec.add_development_dependency "activerecord", ">= 3.0.0"
48
+ spec.add_development_dependency "yard"
54
49
 
55
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ule_page
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Cui
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-18 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,44 +56,36 @@ dependencies:
56
56
  name: site_prism
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ">"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '2.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ">"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '2.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: capybara
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
75
+ version: '2.1'
76
+ - - "<"
81
77
  - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: capybara-webkit
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
78
+ version: '3.0'
90
79
  type: :runtime
91
80
  prerelease: false
92
81
  version_requirements: !ruby/object:Gem::Requirement
93
82
  requirements:
94
83
  - - ">="
95
84
  - !ruby/object:Gem::Version
96
- version: '0'
85
+ version: '2.1'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '3.0'
97
89
  - !ruby/object:Gem::Dependency
98
90
  name: rspec
99
91
  requirement: !ruby/object:Gem::Requirement
@@ -112,30 +104,30 @@ dependencies:
112
104
  name: activesupport
113
105
  requirement: !ruby/object:Gem::Requirement
114
106
  requirements:
115
- - - ">="
107
+ - - ">"
116
108
  - !ruby/object:Gem::Version
117
- version: '0'
109
+ version: '4.0'
118
110
  type: :runtime
119
111
  prerelease: false
120
112
  version_requirements: !ruby/object:Gem::Requirement
121
113
  requirements:
122
- - - ">="
114
+ - - ">"
123
115
  - !ruby/object:Gem::Version
124
- version: '0'
116
+ version: '4.0'
125
117
  - !ruby/object:Gem::Dependency
126
118
  name: activerecord
127
119
  requirement: !ruby/object:Gem::Requirement
128
120
  requirements:
129
- - - ">="
121
+ - - ">"
130
122
  - !ruby/object:Gem::Version
131
- version: '0'
123
+ version: '4.0'
132
124
  type: :runtime
133
125
  prerelease: false
134
126
  version_requirements: !ruby/object:Gem::Requirement
135
127
  requirements:
136
- - - ">="
128
+ - - ">"
137
129
  - !ruby/object:Gem::Version
138
- version: '0'
130
+ version: '4.0'
139
131
  - !ruby/object:Gem::Dependency
140
132
  name: rails
141
133
  requirement: !ruby/object:Gem::Requirement