capybara_spa 0.4.0 → 0.5.0

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
  SHA256:
3
- metadata.gz: ee0028ff6473dfd7ee60d23ed3ca3f3a07e1412fa11beed4faf28a7da1e110b1
4
- data.tar.gz: faa416fd1f5adb9cf61be4b465351c67771229f9bbb393fea143d46a39214fe2
3
+ metadata.gz: ad8de84ee5fc55314261a0b31adb83704dd6221e9cf6926d652461797e2d3b31
4
+ data.tar.gz: 4a106b49fdebcca51da9634d19f1f3e2bb4387ee9f54c6dfce3baa9b6f95cee7
5
5
  SHA512:
6
- metadata.gz: b0a7cf1c8f639162f80e6040c8f3d20766aa80e8aec827002e53561ea87bed3ace6d3141f05b6741de842d5fdc952bd12a12b0c5af14181fd53293c8f74ac0ff
7
- data.tar.gz: 6e810df6910e92e214a76a93242b4e62b331a26ca3dd7a35f2af002c719d04f938ac1d7d92d5b5a9ec115236eaa5aade1afd818fd30448b0930969689b154d3a
6
+ metadata.gz: 8606efd9d87995891b81a5c9f5205baf045a5824cc5596ff2c2cf34a43ccc15ba4e6dd27d09e6cbf6955a762777804d8454ccc33ad5a8dcb3937f4d284c7413c
7
+ data.tar.gz: da0d24d2c6604fb062ba9a315d2cd820c3ae45146b714e2af6fb8a43de86833f603135fa2b5c2c2e0b13d4d30398f75a0382ca8d52972923e08bc3447860fe13
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capybara_spa (0.4.0)
4
+ capybara_spa (0.5.0)
5
5
  capybara (~> 3.0)
6
6
 
7
7
  GEM
@@ -13,13 +13,13 @@ GEM
13
13
  io-like (~> 0.3.0)
14
14
  bump (0.6.0)
15
15
  byebug (10.0.2)
16
- capybara (3.1.0)
16
+ capybara (3.5.0)
17
17
  addressable
18
18
  mini_mime (>= 0.1.3)
19
19
  nokogiri (~> 1.8)
20
20
  rack (>= 1.6.0)
21
21
  rack-test (>= 0.6.3)
22
- xpath (~> 3.0)
22
+ xpath (~> 3.1)
23
23
  childprocess (0.9.0)
24
24
  ffi (~> 1.0, >= 1.0.11)
25
25
  chromedriver-helper (1.2.0)
@@ -44,7 +44,7 @@ GEM
44
44
  pry (~> 0.10)
45
45
  public_suffix (3.0.2)
46
46
  rack (2.0.5)
47
- rack-test (1.0.0)
47
+ rack-test (1.1.0)
48
48
  rack (>= 1.0, < 3)
49
49
  rake (10.5.0)
50
50
  rspec (3.7.0)
@@ -69,7 +69,7 @@ GEM
69
69
  json (>= 1.8, < 3)
70
70
  simplecov-html (~> 0.10.0)
71
71
  simplecov-html (0.10.2)
72
- xpath (3.0.0)
72
+ xpath (3.1.0)
73
73
  nokogiri (~> 1.8)
74
74
 
75
75
  PLATFORMS
@@ -26,6 +26,7 @@ module CapybaraSpa
26
26
  def initialize(build_path: nil, http_server_bin_path: nil, log_file: CapybaraSpa.log_file, pid_file: nil, port: nil)
27
27
  build_path ||= ENV.fetch('NG_BUILD_PATH', nil)
28
28
  @build_path = File.expand_path(build_path) if build_path
29
+ @built = false
29
30
  @http_server_bin_path = http_server_bin_path || ENV.fetch('NG_HTTP_SERVER_BIN') { find_http_server_bin_path }
30
31
  @log_file = log_file
31
32
  @pid_file = pid_file || ENV.fetch('NG_PID_FILE', '/tmp/angular-process.pid')
@@ -33,6 +34,17 @@ module CapybaraSpa
33
34
  @started = false
34
35
  end
35
36
 
37
+ def build(&blk)
38
+ @built ||= begin
39
+ yield
40
+ true
41
+ end
42
+ end
43
+
44
+ def built?
45
+ @built
46
+ end
47
+
36
48
  def started?
37
49
  @started
38
50
  end
@@ -112,7 +124,11 @@ module CapybaraSpa
112
124
  error_message = <<-ERROR.gsub(/^\s*\|/, '')
113
125
  |#{File.expand_path(build_path)} directory not found! Make sure the angular app is being built:
114
126
  |
115
- |E.g. ng build --aot --environment integration-tests --target=development --output-path=public/app/
127
+ |Angular 5 example:
128
+ | ng build --aot --environment e2e --target=development --output-path=public/app/
129
+ |
130
+ |Angular 6 example:
131
+ | ng build --aot --configuration e2e --output-path=public/app/
116
132
  |
117
133
  ERROR
118
134
  raise NgAppNotFound, error_message
@@ -125,7 +141,6 @@ module CapybaraSpa
125
141
  # if no http-server found in default PATH then try to find it in node_modules
126
142
  if http_server_bin_path.length == 0
127
143
  http_server_bin_path = File.join(node_modules_path, '.bin', 'angular-http-server')
128
- else
129
144
  end
130
145
 
131
146
  File.expand_path(http_server_bin_path) if http_server_bin_path
@@ -1,3 +1,3 @@
1
1
  module CapybaraSpa
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara_spa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Dennis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-14 00:00:00.000000000 Z
11
+ date: 2018-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara