import_js 0.1.4 → 0.1.5
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/bin/import-js +3 -0
- data/lib/import_js/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2c89c88f08b5caa370d8b929e5448f918b2f2d4
|
4
|
+
data.tar.gz: 5783b944690642d76215f53e7e85cfe36715d018
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba11ff91ca83a95ac4bbc0808e435fefc6eebc4dafebfc848d94415c1c7d6401a85f7ff2af32ce3037d94044e8d3274fa03519534761e377ee26a7c161d0a546
|
7
|
+
data.tar.gz: bfd88afddeb5e09b671796067a2d52c2c92fac6f70aee60272e61e20d9e15e5e13891ce3708b0006cda0d8867e6a249702cd5fe5bab46966b59544698d0713e5
|
data/bin/import-js
CHANGED
@@ -7,6 +7,7 @@ require 'json'
|
|
7
7
|
opts = Slop.parse do |o|
|
8
8
|
o.string '-w', '--word', 'a word/variable to import'
|
9
9
|
o.bool '--goto', 'instead of importing, just print the path to a module'
|
10
|
+
o.bool '--fix', 'imports all undefined variables, and removes unused imports'
|
10
11
|
o.array '--selections', 'a list of resolved selections, e.g. Foo:0,Bar:1'
|
11
12
|
o.string '--filename',
|
12
13
|
'a path to the file which contents are being passed in as stdin'
|
@@ -36,6 +37,8 @@ if opts.goto?
|
|
36
37
|
importer.goto
|
37
38
|
elsif opts[:word]
|
38
39
|
importer.import
|
40
|
+
elsif opts.fix?
|
41
|
+
importer.fix_imports
|
39
42
|
else
|
40
43
|
importer.import_all
|
41
44
|
end
|
data/lib/import_js/version.rb
CHANGED