rails_edge_test 0.6.0 → 0.7.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 482aee87febf42d143b36ed056beb0a52cae16f0
4
- data.tar.gz: 917a3166590701a07ae2f1128762bcbe88837c79
3
+ metadata.gz: b4fefbd744936eb26a15aeb82c6e8699f07dbd20
4
+ data.tar.gz: d359ef87f86c089387e30be212c3ab97201945fc
5
5
  SHA512:
6
- metadata.gz: 2e5d272612542e5518d5c71e631e9c87f422e4b820d339c1354ed8749280c4c7c0065b3ed93c69ceddefdda06e96da4a9ffe123e5260390a3f0f81aa511c1191
7
- data.tar.gz: 70c44e9bc4f5dfa448675dacb45cf18a9566720a272f798f02e5c434732cb1a5470b253c15c8f36f8c47dec9830c13752c8e89744802b0ca141dad2231cb0044
6
+ metadata.gz: 9fee2b82450ddbd6eab5fcf70fd522b216c3bb1295488fe369fb4fec924e09dd45fa8a9a9331808e4e0f452037edd63e5b75357a4b298868c91f2ac8ecfb05c6
7
+ data.tar.gz: 4c3f8dc2910f74bb48f7d72ea7e0c9436014c37146b7ae144bd725e56b6d3e7684ea33e0fd2dc632c7570d0ef7b812066e76068bd2e4d742ebf6973359297652
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # The Changelog
2
2
 
3
+ ## Version 0.7.0: Dec 5, 2018
4
+
5
+ - We can now pass a real path to the generate_edges command
6
+
3
7
  ## Version 0.6.0: Sep 4, 2018
4
8
 
5
9
  - Bug fixes for generated JSON is now formatted to aid in comparing versions of generated fixtures
data/README.md CHANGED
@@ -69,11 +69,16 @@ Edge specifications, like the above, should be put in subfolders of `/edge` and
69
69
 
70
70
  ## Generating files
71
71
 
72
- When you want to generate your edge json files, run this:
72
+ When you want to generate all your edge json files, run this:
73
73
 
74
74
  `bundle exec generate_edges`
75
75
 
76
- You can also pass in a file path relative to the edge root path (usually spec/edge):
76
+ When you can also specify a specific file:
77
+
78
+ `bundle exec generate_edges spec/edge/rails_controller_edge.rb`
79
+
80
+ You can also pass in a file path relative to the edge root path (usually `spec/edge`):
81
+
77
82
  `bundle exec generate_edges rails_controller_edge.rb`
78
83
 
79
84
  ## Some helpful setup
data/exe/generate_edges CHANGED
@@ -3,7 +3,23 @@
3
3
  require 'open3'
4
4
  require 'rails_edge_test'
5
5
 
6
- rails_root = File.expand_path("../", ENV["BUNDLE_GEMFILE"])
6
+ # Walk up recursively the filesystem until we can find a folder
7
+ # containing the Gemfile. Then we can use that folder as the starting
8
+ # point to look for the rails files that we need.
9
+ def find_gemfile_dir(path)
10
+ if File.file?(File.join(path, 'Gemfile'))
11
+ path
12
+ else
13
+ new_path = File.expand_path('..', path)
7
14
 
8
- RailsEdgeTest::Runner.load_rails_environment!(rails_root)
15
+ if path == new_path
16
+ raise 'Could not find directory with Gemfile'
17
+ else
18
+ find_gemfile_dir(new_path)
19
+ end
20
+ end
21
+ end
22
+
23
+ gemfile_dir = find_gemfile_dir(Dir.pwd)
24
+ RailsEdgeTest::Runner.load_rails_environment!(gemfile_dir)
9
25
  RailsEdgeTest::Runner.go!(ARGV)
@@ -15,12 +15,17 @@ module RailsEdgeTest
15
15
  glob_path = args.shift
16
16
  end
17
17
 
18
- glob = File.join(
18
+ glob_with_root_path = File.join(
19
19
  RailsEdgeTest.configuration.edge_root_path,
20
20
  glob_path
21
21
  )
22
22
 
23
- Dir.glob(glob).each do |file|
23
+ # load files both at the root path and edge_root_path
24
+ Dir.glob(glob_path).each do |file|
25
+ load file
26
+ end
27
+
28
+ Dir.glob(glob_with_root_path).each do |file|
24
29
  load file
25
30
  end
26
31
 
@@ -1,3 +1,3 @@
1
1
  module RailsEdgeTest
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_edge_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Leven
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-04 00:00:00.000000000 Z
11
+ date: 2018-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  requirements: []
152
152
  rubyforge_project:
153
- rubygems_version: 2.6.11
153
+ rubygems_version: 2.5.2.3
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Generate json for front-end testing using your rails backend.