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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5438e17a8ea38a2494a8b817a03724de8886d81
4
- data.tar.gz: c312cdce75c5d1a60a4f5b20d8db1d0cfa4996ef
3
+ metadata.gz: 7df8ccf2d597885ee3005eef4f11eacdb2ceb365
4
+ data.tar.gz: 24e3aadbe605bcb00c59722269e315b05861cc23
5
5
  SHA512:
6
- metadata.gz: 0e795c6f4ddae80f4a811f3bb01d96466321ba85bf337f2c36e1d982db808978a8aff4fcf64031e55bb1eab3e01be9d84d13358724e788d3150951ae1b963822
7
- data.tar.gz: 495e9d47440269cf603fd7ce8ae52b7766cf4513b1bc26335adb35cd242654f605f26571599b57b8594c879e0b454243a3358b3037a94645321ccf084c1f3b7a
6
+ metadata.gz: 5603b957334f02c8f066ae1f1d762ff2e48d6f2eaf50909d2897378bba674cd8691f6b1681812f113b55ec22a45c1f4f970be360ee19e8293a54bede8d74b7f3
7
+ data.tar.gz: d343aee9eefac3f5fcca8f2480e1c1f42e795e7316a2e6aa10e03f5a8ad884c0bf9d5aff42eb6f6a73b196d9656ac67f66ced148317979571423d4ead88c7d3f
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.1.1
5
- - 2.2.2
3
+ - 2.1
4
+ - 2.2
6
5
  - ruby-head
7
6
  script: bundle exec rspec
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?
@@ -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
- # Only include files with the above static extensions.
135
- next if !Percy::Cli::STATIC_RESOURCE_EXTENSIONS.include?(File.extname(path))
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
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  class Cli
3
- VERSION = '1.2.6'
3
+ VERSION = '1.2.7'
4
4
  end
5
5
  end
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.6
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-28 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander