percy-cli 1.2.6 → 1.2.7
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 +4 -4
- data/.travis.yml +2 -3
- data/lib/percy/cli.rb +4 -0
- data/lib/percy/cli/snapshot.rb +8 -4
- data/lib/percy/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7df8ccf2d597885ee3005eef4f11eacdb2ceb365
|
4
|
+
data.tar.gz: 24e3aadbe605bcb00c59722269e315b05861cc23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5603b957334f02c8f066ae1f1d762ff2e48d6f2eaf50909d2897378bba674cd8691f6b1681812f113b55ec22a45c1f4f970be360ee19e8293a54bede8d74b7f3
|
7
|
+
data.tar.gz: d343aee9eefac3f5fcca8f2480e1c1f42e795e7316a2e6aa10e03f5a8ad884c0bf9d5aff42eb6f6a73b196d9656ac67f66ced148317979571423d4ead88c7d3f
|
data/.travis.yml
CHANGED
data/lib/percy/cli.rb
CHANGED
@@ -58,6 +58,9 @@ module Percy
|
|
58
58
|
c.option \
|
59
59
|
'--[no-]enable_javascript',
|
60
60
|
"Whether or not to enable JavaScript when rendering all snapshots. Default false."
|
61
|
+
c.option \
|
62
|
+
'--include_all',
|
63
|
+
"Whether to include all files in the directory as resources. By default only common website related file types are included."
|
61
64
|
c.option \
|
62
65
|
'--threads NUM',
|
63
66
|
Integer,
|
@@ -68,6 +71,7 @@ module Percy
|
|
68
71
|
options.default threads: DEFAULT_NUM_THREADS
|
69
72
|
options.threads = MAX_NUM_THREADS if options.threads > MAX_NUM_THREADS
|
70
73
|
options.enable_javascript = options.enable_javascript
|
74
|
+
options.include_all = options.include_all
|
71
75
|
options.widths = (options.widths || '').split(',')
|
72
76
|
|
73
77
|
raise OptionParser::MissingArgument, 'root folder path is required' if args.empty?
|
data/lib/percy/cli/snapshot.rb
CHANGED
@@ -25,6 +25,7 @@ module Percy
|
|
25
25
|
snapshot_limit = options[:snapshot_limit]
|
26
26
|
baseurl = options[:baseurl] || '/'
|
27
27
|
enable_javascript = !!options[:enable_javascript]
|
28
|
+
include_all = !!options[:include_all]
|
28
29
|
widths = options[:widths].map { |w| Integer(w) }
|
29
30
|
raise ArgumentError.new('baseurl must start with /') if baseurl[0] != '/'
|
30
31
|
|
@@ -32,7 +33,7 @@ module Percy
|
|
32
33
|
|
33
34
|
# Find all the static files in the given root directory.
|
34
35
|
root_paths = find_root_paths(root_dir, snapshots_regex: options[:snapshots_regex])
|
35
|
-
resource_paths = find_resource_paths(root_dir)
|
36
|
+
resource_paths = find_resource_paths(root_dir, include_all: include_all)
|
36
37
|
root_resources = list_resources(root_paths, base_resource_options.merge(is_root: true))
|
37
38
|
build_resources = list_resources(resource_paths, base_resource_options)
|
38
39
|
all_resources = root_resources + build_resources
|
@@ -126,13 +127,16 @@ module Percy
|
|
126
127
|
file_paths
|
127
128
|
end
|
128
129
|
|
129
|
-
def find_resource_paths(dir_path)
|
130
|
+
def find_resource_paths(dir_path, options = {})
|
130
131
|
file_paths = []
|
131
132
|
_find_files(dir_path).each do |path|
|
132
133
|
# Skip git files.
|
133
134
|
next if path.match(/\/\.git\//)
|
134
|
-
|
135
|
-
|
135
|
+
|
136
|
+
if !options[:include_all]
|
137
|
+
# Only include files with the above static extensions.
|
138
|
+
next if !Percy::Cli::STATIC_RESOURCE_EXTENSIONS.include?(File.extname(path))
|
139
|
+
end
|
136
140
|
|
137
141
|
file_paths << path
|
138
142
|
end
|
data/lib/percy/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|