import_js 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: f759acda060eff3f55d211716772f6aa040f8ae1
4
- data.tar.gz: 0677ca9b877988c2f48e741e553877291b52eec3
3
+ metadata.gz: c2c89c88f08b5caa370d8b929e5448f918b2f2d4
4
+ data.tar.gz: 5783b944690642d76215f53e7e85cfe36715d018
5
5
  SHA512:
6
- metadata.gz: e85b323677c84e01d2a6f50f89f65fded4cd3fdf8da3d7ca70ca746a6150477a5c8edd1d48ada71b5899473f23d91ea174b2a5ed7bfbfbc96922f0824035c698
7
- data.tar.gz: c738f98d9172d78419907580449cf49d2024ddb2b215a794effed8f791ac6dc3a1e4ee2bea0f85246c954345a1361a0bbc01cc20043855ca816f971c320fd21e
6
+ metadata.gz: ba11ff91ca83a95ac4bbc0808e435fefc6eebc4dafebfc848d94415c1c7d6401a85f7ff2af32ce3037d94044e8d3274fa03519534761e377ee26a7c161d0a546
7
+ data.tar.gz: bfd88afddeb5e09b671796067a2d52c2c92fac6f70aee60272e61e20d9e15e5e13891ce3708b0006cda0d8867e6a249702cd5fe5bab46966b59544698d0713e5
@@ -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
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module ImportJS
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: import_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henric Trotzig