bibliothecary 5.2.0 → 5.3.0

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: 63862e85e3869ed89e0fd67e3c880fdf6e11710a
4
- data.tar.gz: e63a382ed34ef91da60d964567baa14b62ea4305
3
+ metadata.gz: 2fa6295e2d804a14e0272bc9e6df52cbdf44f013
4
+ data.tar.gz: 09a249dd16c786b3e66f1f0b02c6eddbe82cd794
5
5
  SHA512:
6
- metadata.gz: 12dc273cb5db780d643a33655bc9f712599b6bba7e8ff2c5532d8d2e38b23b4092e85d7a5c26a588afd513fd6aec7b8351ccd7fd5c9ca911ac8ed3d6673cb368
7
- data.tar.gz: 621afd3937fdce67f3b78972e7e5ac16ddc9b10891b4fac2eadb99299787e9730e8f7d3323929bf6742a6b718aafabeb3d35901a83cebada9f3672c265b9f864
6
+ metadata.gz: e9a2921352f301b01d2c251508300c026ac03fdb90acd68bf16f3a405d1b86666994cdb1058e1000bdca4489087491dca4503256dd5736732088ef1182578f10
7
+ data.tar.gz: 3895ca5d0d453f70dab81f7b284b86679a738beac7d8942be22ae72fad84ce5a84b1ad24d6a8438da019bb9d5cb864c0ca33c926e5daedf52bb78052d23a5bd1
@@ -7,15 +7,15 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^package\.json$/ => {
10
+ /^(?!node_modules).+*package\.json$/ => {
11
11
  kind: 'manifest',
12
12
  parser: :parse_manifest
13
13
  },
14
- /^npm-shrinkwrap\.json$/ => {
14
+ /^(?!node_modules).+*npm-shrinkwrap\.json$/ => {
15
15
  kind: 'lockfile',
16
16
  parser: :parse_shrinkwrap
17
17
  },
18
- /^yarn\.lock$/ => {
18
+ /^(?!node_modules).+*yarn\.lock$/ => {
19
19
  kind: 'lockfile',
20
20
  parser: :parse_yarn_lock
21
21
  }
@@ -7,31 +7,25 @@ module Bibliothecary
7
7
  REQUIRE_REGEXP = /([a-zA-Z0-9]+[a-zA-Z0-9\-_\.]+)([><=\d\.,]+)?/
8
8
  REQUIREMENTS_REGEXP = /^#{REQUIRE_REGEXP}/
9
9
 
10
- def self.parse_file(filename, contents)
11
- if is_requirements_file(filename)
12
- parse_requirements_txt(contents)
13
- elsif filename.match(/setup\.py$/)
14
- parse_setup_py(contents)
15
- elsif filename.match(/^Pipfile$/)
16
- parse_pipfile(contents)
17
- elsif filename.match(/^Pipfile\.lock$/)
18
- parse_pipfile_lock(contents)
19
- end
20
- end
21
-
22
- def self.determine_kind(filename)
23
- if is_requirements_file(filename) || filename.match(/setup\.py$/) || filename.match(/^Pipfile$/)
24
- 'manifest'
25
- elsif filename.match(/^Pipfile\.lock$/)
26
- 'lockfile'
27
- end
28
- end
29
-
30
- def self.match?(filename)
31
- is_requirements_file(filename) ||
32
- filename.match(/setup\.py$/) ||
33
- filename.match(/Pipfile$/) ||
34
- filename.match(/Pipfile\.lock$/)
10
+ def self.mapping
11
+ {
12
+ /^(?!node_modules).*require.*\.(txt|pip)$/ => {
13
+ kind: 'manifest',
14
+ parser: :parse_requirements_txt
15
+ },
16
+ /setup\.py$/ => {
17
+ kind: 'manifest',
18
+ parser: :parse_setup_py
19
+ },
20
+ /^Pipfile$/ => {
21
+ kind: 'manifest',
22
+ parser: :parse_pipfile
23
+ },
24
+ /^Pipfile\.lock$/ => {
25
+ kind: 'lockfile',
26
+ parser: :parse_pipfile_lock
27
+ }
28
+ }
35
29
  end
36
30
 
37
31
  def self.parse_pipfile(file_contents)
@@ -111,14 +105,6 @@ module Bibliothecary
111
105
  end
112
106
  deps
113
107
  end
114
-
115
- def self.is_requirements_file(filename)
116
- if filename.match(/require.*\.(txt|pip)$/) and !filename.match(/^node_modules/)
117
- return true
118
- else
119
- return false
120
- end
121
- end
122
108
  end
123
109
  end
124
110
  end
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "5.2.0"
2
+ VERSION = "5.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliothecary
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-24 00:00:00.000000000 Z
11
+ date: 2017-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb