bibliothecary 5.0.2 → 5.1.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: 7a73ecad5bf0a411b2eab208e5da2fe8b9cb8c36
4
- data.tar.gz: 0869502853eaea04bdaed75aaad6409ae5c03db2
3
+ metadata.gz: e3d8c00df772bfce34e75fbaf2f7a51ad1050820
4
+ data.tar.gz: 86bd9b0167acbc493691712de9dcef25b479ee53
5
5
  SHA512:
6
- metadata.gz: 2ae3763a2b36c3496ec8208f12d2315047649a7970d4f55df8842d2f7f1d9016c8d2d86984bc1172642e22eb941b014833416cba107c55dd1e17d89af6ade1e0
7
- data.tar.gz: 0b6006e9ce5aad4d2a4d5c1d707cd98b5e1d885f2d01c6143d5a03bad60d60c5a50c860e369322c75b14a0a72402d84f143891b60e3ffbf0b5e33efc8a3bf4c8
6
+ metadata.gz: f70bbee146587d06fa83638ffb23c14c45f7c3b449de96658a5643382f9ee53af4b1531cea8ee64d8006baf26fba120d737b75b7677b329e0a3b99d04d2f5091
7
+ data.tar.gz: 2df0457e89255a357a78bc761f4eedf4a1a4b1ada021ae70f46f19769f1e53b5a194b36fbf56d3d7a4674815ccc319bfda4916ef28c4ec7b580fcfdfb1db9340
@@ -26,7 +26,7 @@ Thanks for considering contributing. These guidelines outline how to contribute
26
26
  ## What's Libraries.io About?
27
27
  _Our goal is to raise the quality of all software._
28
28
 
29
- By outlining our [mission and strategy](/strategy.md) we hope to give you more power to make decisions and determine how best to spend your time. Specifically we tackle three distinct problems:
29
+ By outlining our [mission and strategy](https://docs.libraries.io/strategy) we hope to give you more power to make decisions and determine how best to spend your time. Specifically we tackle three distinct problems:
30
30
 
31
31
  * Discovery: _Helping developers make faster, more informed decisions about the software that they use._
32
32
  * Maintainability: _Helping maintainers understand more about the software they depend upon and the consumers of their software._
@@ -35,7 +35,7 @@ By outlining our [mission and strategy](/strategy.md) we hope to give you more p
35
35
  ## What Should I Know Before I Get Started?
36
36
 
37
37
  ### Code of Conduct
38
- Libraries.io is an open and inclusive [community of people](https://github.com/orgs/librariesio/people) working together. We expect contributors to abide by our [contributor code of conduct](CODE_OF_CONDUCT.md) which basically say 'be excellent to each other'. Please report unacceptable behavior to conduct@libraries.io
38
+ Libraries.io is an open and inclusive [community of people](https://github.com/orgs/librariesio/people) working together. We expect contributors to abide by our [contributor code of conduct](https://docs.libraries.io/CODE_OF_CONDUCT.md) which basically say 'be excellent to each other'. Please report unacceptable behavior to conduct@libraries.io
39
39
 
40
40
  ### Langauge
41
41
  We communicate predominately in English. Contributions to the project should be made with English as the first language. We are happy for members of the community to communicate in a language other than English in chat, email and video but be aware that this might be considered exclusive by other members of the community.
@@ -54,7 +54,7 @@ The simplest thing that you can do to help us is by filing good bug reports, so
54
54
  * Double-check that the bug is persistent. The site is still in it's infancy and sometimes artifacts may appear and disappear.
55
55
  * Double-check the bug hasn't already been reported [on our issue tracker](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they *should* be labelled `bug` or `bugsnag`.
56
56
 
57
- If something hasn't been raised, you can go ahead and create a new issue using [the template](/issue_template.md). If you'd like to help investigate further or fix the bug just mention it in your issue and check out our [workflow](#workflow).
57
+ If something hasn't been raised, you can go ahead and create a new issue using [the template](https://docs.libraries.io/issue_template.md). If you'd like to help investigate further or fix the bug just mention it in your issue and check out our [workflow](#workflow).
58
58
 
59
59
  ### Suggesting Enhancements
60
60
 
@@ -64,7 +64,7 @@ The next simplest thing you can do to help us is by telling us how we can improv
64
64
 
65
65
  * Check that the enhancement is not already [in our issue tracker](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they should be labelled 'enhancement'.
66
66
 
67
- If there isn't already an issue for feature then go ahead and create a new issue for it using the [template](/issue_template.md). If you'd like to work on the enhancement then just mention it in a comment and check out our [workflow](#workflow).
67
+ If there isn't already an issue for feature then go ahead and create a new issue for it using the [template](https://docs.libraries.io/issue_template.md). If you'd like to work on the enhancement then just mention it in a comment and check out our [workflow](#workflow).
68
68
 
69
69
  ### Suggesting New Features
70
70
 
@@ -72,23 +72,23 @@ If you're into this zone then you need to understand a little more about what we
72
72
 
73
73
  #### Before Suggesting a Feature
74
74
 
75
- * Check that it aligns with [our strategy](strategy.md) and is specifically not in line with something we have said we will not do (for the moment this is anything to do with ranking *people*).
75
+ * Check that it aligns with [our strategy](https://docs.libraries.io/strategy) and is specifically not in line with something we have said we will not do (for the moment this is anything to do with ranking *people*).
76
76
  * Check that the feature is not already [in our issue tracker](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they should be tagged 'feature'.
77
77
  * Specifically check that it is not already a [funded commitment](https://github.com/librariesio/supporters/issues).
78
78
 
79
- If you're still thinking about that killer feature that no one else is thinking about then *please* create an issue for it using the [template](/issue_template.md).
79
+ If you're still thinking about that killer feature that no one else is thinking about then *please* create an issue for it using the [template](https://docs.libraries.io/issue_template.md).
80
80
 
81
81
  ### Your First Contribution
82
82
  You're in luck! We label issues that are ideal for first time contributors with [`first-pr`](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+user%3Alibrariesio+label%3A%22first-pr%22). For someone who wants something a little more meaty you might find an issue that needs some assistance with [`help wanted`](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+user%3Alibrariesio+label%3A%22help+wanted%22). Next you'll want to read our [workflow](#workflow).
83
83
 
84
84
  ### Tackling Something Meatier
85
85
 
86
- Tickets are labeled by size, skills required and to indicate workflow. Details can be found in our [labelling policy](/labelling.md).
86
+ Tickets are labeled by size, skills required and to indicate workflow. Details can be found in our [labelling policy](https://docs.libraries.io/labelling).
87
87
 
88
88
  To get you started you might want to check out issues concerning [documentation](https://github.com/librariesio/documentation/issues/), [user experience](https://github.com/librariesio/libraries.io/labels/ux), [visual design](https://github.com/librariesio/libraries.io/issues/labels/visual%20design) or perhaps something already [awaiting help](https://github.com/librariesio/libraries.io/labels/help%20wanted). You may find the following useful:
89
89
 
90
- * Our [strategy](/strategy.md) which outlines what our goals are, how we are going to achieve those goals and what we are specifically going to avoid.
91
- * A [techncial overview](/techoverview.md) of the components that make up the Libraries.io project and run the [https://libraries.io](https://libraries.io) site.
90
+ * Our [strategy](https://docs.libraries.io/strategy) which outlines what our goals are, how we are going to achieve those goals and what we are specifically going to avoid.
91
+ * An [overview](https://docs.libraries.io/overview) of the components that make up the Libraries.io project and run the [https://libraries.io](https://libraries.io) site.
92
92
 
93
93
  ## How Can I Talk To Other Contributors?
94
94
 
@@ -136,10 +136,10 @@ We *try* to use principles of [GitHub-flow](https://lucamezzalira.com/2014/03/10
136
136
  We *try* to create an issue for everything. That is any bug, feature or enhancement that is worth an open, focussed and documented discussion.
137
137
 
138
138
  #### Labelling
139
- We constrain labels as they are a key part of our workflow. Tickets will be labeled according to our [labelling policy](/labelling.md).
139
+ We constrain labels as they are a key part of our workflow. Tickets will be labeled according to our [labelling policy](https://docs.libraries.io/labelling).
140
140
 
141
141
  #### Templates
142
- We use templates to guide contributors toward good practice in [filing bugs, requesting enhancements and features](/issue_template.md) and in [issuing pull-requests](/pull_request_template.md).
142
+ We use templates to guide contributors toward good practice in [filing bugs, requesting enhancements and features](https://docs.libraries.io/issue_template.md) and in [issuing pull-requests](https://docs.libraries.io/pull_request_template.md).
143
143
 
144
144
  #### Commenting
145
145
  If it possible to comment your contribution — for instance if you are contributing code — then do so in a way that is simple, clear, concise and lowers the level of understanding necessary for others to comprehend what comes afterward does or achieves. If you are contributing code it is very likely it will be rejected if it does not contain sufficient comments.
@@ -151,15 +151,16 @@ When committing to a branch be sure to use plain, simple language that describes
151
151
  When adding or fixing functionality, tests should be added to help reduce future regressions and breakage. All tests are ran automatically when new commits are pushed to a branch. Pull requests with broken/missing tests are not likely to be merged.
152
152
 
153
153
  #### Submitting for Review
154
- Once a piece of work (in a branch) is complete it should be readied for review. This is your last chance to ensure that your contribution is [properly tested](#testing). If you are contributing code it is likely your contribution will be rejected if it would lower the test-coverage. Once this is done you can submit a pull-request following the [template](/pull_request_template.md).
154
+ Once a piece of work (in a branch) is complete it should be readied for review. This is your last chance to ensure that your contribution is [properly tested](#testing). If you are contributing code it is likely your contribution will be rejected if it would lower the test-coverage. Once this is done you can submit a pull-request following the [template](https://docs.libraries.io/pull_request_template.md).
155
155
 
156
156
  It is likely that your contributions will need to be checked by at least one member of the [core team](https://github.com/orgs/librariesio/teams/core) prior to merging. It is also incredibly likely that your contribution may need some re-work in order to be accepted. Particularly if it lacks an appropriate level of comments, tests or it is difficult to understand your commits. Please do not take offense if this is the case. We understand that contributors give their time because they want to improve the project but please understand it is another's responsibility to ensure that the project is maintainable, and good practices like these are key to ensuring that is possible.
157
157
 
158
158
  #### Reviewing a PR
159
- We appreciate that it may be difficult to offer constructive criticism, but it is a necessary part of ensuring the project is maintainable and successful. If it is difficult to understand something, request it is better commented. If you do not feel assured of the robustness of a contribution, request it is better tested. If it is unclear what the goal of the piece of work is and how it relates to the [strategy](/strategy.md), request a clarification in the corresponding issue. If a pull-request has no corresponding issue, decreases code coverage or otherwise decreases the quality of the project. Reject it. Otherwise, merge it.
159
+ We appreciate that it may be difficult to offer constructive criticism, but it is a necessary part of ensuring the project is maintainable and successful. If it is difficult to understand something, request it is better commented. If you do not feel assured of the robustness of a contribution, request it is better tested. If it is unclear what the goal of the piece of work is and how it relates to the [strategy](https://docs.libraries.io/strategy), request a clarification in the corresponding issue. If a pull-request has no corresponding issue, decreases code coverage or otherwise decreases the quality of the project. Reject it. Otherwise, merge it.
160
160
 
161
161
  #### Merging
162
- As we keep the `master` branch in a permanent state of 'deployment ready' once-merged your contribution will be live on the next deployment.
162
+ As we keep the `master` branch in a permanent state of 'deployment ready' once-merged your contribution will be live on the next deployment.
163
+
163
164
  #### Deploying
164
165
  Any member of the [deployers](https://github.com/orgs/librariesio/teams/deployers) team are able to redeploy the site. If you require a deployment then you might find one of them in our `#general` [chat channel on Slack](slack.libraries.io).
165
166
 
@@ -5,9 +5,9 @@ module Bibliothecary
5
5
  end
6
6
  module ClassMethods
7
7
  def parse_file(filename, contents)
8
- mapping.each do |regex, method_name|
8
+ mapping.each do |regex, details|
9
9
  if filename.match(regex)
10
- return send(method_name, contents)
10
+ return send(details[:parser], contents)
11
11
  end
12
12
  end
13
13
  return []
@@ -36,7 +36,8 @@ module Bibliothecary
36
36
  {
37
37
  platform: platform_name,
38
38
  path: filename,
39
- dependencies: dependencies
39
+ dependencies: dependencies,
40
+ kind: determine_kind(filename)
40
41
  }
41
42
  else
42
43
  nil
@@ -46,6 +47,15 @@ module Bibliothecary
46
47
  end
47
48
  end
48
49
 
50
+ def determine_kind(filename)
51
+ mapping.each do |regex, details|
52
+ if filename.match(regex)
53
+ return details[:kind]
54
+ end
55
+ end
56
+ return []
57
+ end
58
+
49
59
  def parse_ruby_manifest(manifest)
50
60
  manifest.dependencies.inject([]) do |deps, dep|
51
61
  deps.push({
@@ -7,7 +7,10 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^bower\.json$/ => :parse_manifest
10
+ /^bower\.json$/ => {
11
+ kind: 'manifest',
12
+ parser: :parse_manifest
13
+ }
11
14
  }
12
15
  end
13
16
 
@@ -7,8 +7,14 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /Cargo\.toml$/ => :parse_manifest,
11
- /Cargo\.lock$/ => :parse_lockfile
10
+ /Cargo\.toml$/ => {
11
+ kind: 'manifest',
12
+ parser: :parse_manifest
13
+ },
14
+ /Cargo\.lock$/ => {
15
+ kind: 'lockfile',
16
+ parser: :parse_lockfile
17
+ }
12
18
  }
13
19
  end
14
20
 
@@ -5,9 +5,18 @@ module Bibliothecary
5
5
 
6
6
  def self.mapping
7
7
  {
8
- /^Cartfile$/ => :parse_cartfile,
9
- /^Cartfile\.private$/ => :parse_cartfile_private,
10
- /^Cartfile\.resolved$/ => :parse_cartfile_resolved
8
+ /^Cartfile$/ => {
9
+ kind: 'manifest',
10
+ parser: :parse_cartfile
11
+ },
12
+ /^Cartfile\.private$/ => {
13
+ kind: 'manifest',
14
+ parser: :parse_cartfile_private
15
+ },
16
+ /^Cartfile\.resolved$/ => {
17
+ kind: 'lockfile',
18
+ parser: :parse_cartfile_resolved
19
+ }
11
20
  }
12
21
  end
13
22
 
@@ -8,7 +8,10 @@ module Bibliothecary
8
8
 
9
9
  def self.mapping
10
10
  {
11
- /^project\.clj$/ => :parse_manifest
11
+ /^project\.clj$/ => {
12
+ kind: 'manifest',
13
+ parser: :parse_manifest
14
+ }
12
15
  }
13
16
  end
14
17
 
@@ -11,10 +11,22 @@ module Bibliothecary
11
11
 
12
12
  def self.mapping
13
13
  {
14
- /^Podfile$/ => :parse_podfile,
15
- /^[A-Za-z0-9_-]+\.podspec$/ => :parse_podspec,
16
- /^Podfile\.lock$/ => :parse_podfile_lock,
17
- /^[A-Za-z0-9_-]+\.podspec.json$/ => :parse_json_manifest
14
+ /^Podfile$/ => {
15
+ kind: 'manifest',
16
+ parser: :parse_podfile
17
+ },
18
+ /^[A-Za-z0-9_-]+\.podspec$/ => {
19
+ kind: 'manifest',
20
+ parser: :parse_podspec
21
+ },
22
+ /^Podfile\.lock$/ => {
23
+ kind: 'lockfile',
24
+ parser: :parse_podfile_lock
25
+ },
26
+ /^[A-Za-z0-9_-]+\.podspec.json$/ => {
27
+ kind: 'manifest',
28
+ parser: :parse_json_manifest
29
+ }
18
30
  }
19
31
  end
20
32
 
@@ -8,8 +8,14 @@ module Bibliothecary
8
8
 
9
9
  def self.mapping
10
10
  {
11
- /^META\.json$/i => :parse_json_manifest,
12
- /^META\.yml$/i => :parse_yaml_manifest
11
+ /^META\.json$/i => {
12
+ kind: 'manifest',
13
+ parser: :parse_json_manifest
14
+ },
15
+ /^META\.yml$/i => {
16
+ kind: 'manifest',
17
+ parser: :parse_yaml_manifest
18
+ }
13
19
  }
14
20
  end
15
21
 
@@ -9,7 +9,10 @@ module Bibliothecary
9
9
 
10
10
  def self.mapping
11
11
  {
12
- /^DESCRIPTION$/i => :parse_description
12
+ /^DESCRIPTION$/i => {
13
+ kind: 'manifest',
14
+ parser: :parse_description
15
+ }
13
16
  }
14
17
  end
15
18
 
@@ -8,8 +8,14 @@ module Bibliothecary
8
8
 
9
9
  def self.mapping
10
10
  {
11
- /^dub\.json$/ => :parse_manifest,
12
- /^dub\.sdl$/ => :parse_sdl_manifest
11
+ /^dub\.json$/ => {
12
+ kind: 'manifest',
13
+ parser: :parse_manifest
14
+ },
15
+ /^dub\.sdl$/ => {
16
+ kind: 'manifest',
17
+ parser: :parse_sdl_manifest
18
+ }
13
19
  }
14
20
  end
15
21
 
@@ -7,8 +7,14 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^elm-package\.json$|^elm_dependencies\.json$/ => :parse_json_manifest,
11
- /^elm-stuff\/exact-dependencies\.json$/ => :parse_json_lock
10
+ /^elm-package\.json$|^elm_dependencies\.json$/ => {
11
+ kind: 'manifest',
12
+ parser: :parse_json_manifest
13
+ },
14
+ /^elm-stuff\/exact-dependencies\.json$/ => {
15
+ kind: 'lockfile',
16
+ parser: :parse_json_lock
17
+ }
12
18
  }
13
19
  end
14
20
 
@@ -10,12 +10,30 @@ module Bibliothecary
10
10
 
11
11
  def self.mapping
12
12
  {
13
- /^glide\.yaml$/ => :parse_glide_yaml,
14
- /^glide\.lock$/ => :parse_glide_lockfile,
15
- /^Godeps\/Godeps\.json$/ => :parse_godep_json,
16
- /^Godeps$/i => :parse_gpm,
17
- /^vendor\/manifest$/ => :parse_gb_manifest,
18
- /^vendor\/vendor.json$/ => :parse_govendor
13
+ /^glide\.yaml$/ => {
14
+ kind: 'manifest',
15
+ parser: :parse_glide_yaml
16
+ },
17
+ /^glide\.lock$/ => {
18
+ kind: 'lockfile',
19
+ parser: :parse_glide_lockfile
20
+ },
21
+ /^Godeps\/Godeps\.json$/ => {
22
+ kind: 'manifest',
23
+ parser: :parse_godep_json
24
+ },
25
+ /^Godeps$/i => {
26
+ kind: 'manifest',
27
+ parser: :parse_gpm
28
+ },
29
+ /^vendor\/manifest$/ => {
30
+ kind: 'manifest',
31
+ parser: :parse_gb_manifest
32
+ },
33
+ /^vendor\/vendor.json$/ => {
34
+ kind: 'manifest',
35
+ parser: :parse_govendor
36
+ }
19
37
  }
20
38
  end
21
39
 
@@ -7,8 +7,14 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^mix\.exs$/ => :parse_mix,
11
- /^mix\.lock$/ => :parse_mix_lock
10
+ /^mix\.exs$/ => {
11
+ kind: 'manifest',
12
+ parser: :parse_mix
13
+ },
14
+ /^mix\.lock$/ => {
15
+ kind: 'lockfile',
16
+ parser: :parse_mix_lock
17
+ }
12
18
  }
13
19
  end
14
20
 
@@ -5,7 +5,10 @@ module Bibliothecary
5
5
 
6
6
  def self.mapping
7
7
  {
8
- /^REQUIRE$/i => :parse_require
8
+ /^REQUIRE$/i => {
9
+ kind: 'manifest',
10
+ parser: :parse_require
11
+ }
9
12
  }
10
13
  end
11
14
 
@@ -7,9 +7,18 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /ivy\.xml$/i => :parse_ivy_manifest,
11
- /pom\.xml$/i => :parse_pom_manifest,
12
- /build.gradle$/i => :parse_gradle
10
+ /ivy\.xml$/i => {
11
+ kind: 'manifest',
12
+ parser: :parse_ivy_manifest
13
+ },
14
+ /pom\.xml$/i => {
15
+ kind: 'manifest',
16
+ parser: :parse_pom_manifest
17
+ },
18
+ /build.gradle$/i => {
19
+ kind: 'manifest',
20
+ parser: :parse_gradle
21
+ }
13
22
  }
14
23
  end
15
24
 
@@ -7,7 +7,10 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^versions\.json$/ => :parse_manifest
10
+ /^versions\.json$/ => {
11
+ kind: 'manifest',
12
+ parser: :parse_manifest
13
+ }
11
14
  }
12
15
  end
13
16
 
@@ -7,9 +7,18 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^package\.json$/ => :parse_manifest,
11
- /^npm-shrinkwrap\.json$/ => :parse_shrinkwrap,
12
- /^yarn\.lock$/ => :parse_yarn_lock
10
+ /^package\.json$/ => {
11
+ kind: 'manifest',
12
+ parser: :parse_manifest
13
+ },
14
+ /^npm-shrinkwrap\.json$/ => {
15
+ kind: 'lockfile',
16
+ parser: :parse_shrinkwrap
17
+ },
18
+ /^yarn\.lock$/ => {
19
+ kind: 'lockfile',
20
+ parser: :parse_yarn_lock
21
+ }
13
22
  }
14
23
  end
15
24
 
@@ -8,11 +8,26 @@ module Bibliothecary
8
8
 
9
9
  def self.mapping
10
10
  {
11
- /Project\.json$/ => :parse_project_json,
12
- /Project\.lock\.json$/ => :parse_project_lock_json,
13
- /packages\.config$/ => :parse_packages_config,
14
- /^[A-Za-z0-9_-]+\.nuspec$/ => :parse_nuspec,
15
- /paket\.lock$/ => :parse_paket_lock
11
+ /Project\.json$/ => {
12
+ kind: 'manifest',
13
+ parser: :parse_project_json
14
+ },
15
+ /Project\.lock\.json$/ => {
16
+ kind: 'lockfile',
17
+ parser: :parse_project_lock_json
18
+ },
19
+ /packages\.config$/ => {
20
+ kind: 'manifest',
21
+ parser: :parse_packages_config
22
+ },
23
+ /^[A-Za-z0-9_-]+\.nuspec$/ => {
24
+ kind: 'manifest',
25
+ parser: :parse_nuspec
26
+ },
27
+ /paket\.lock$/ => {
28
+ kind: 'lockfile',
29
+ parser: :parse_paket_lock
30
+ }
16
31
  }
17
32
  end
18
33
 
@@ -7,8 +7,14 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^composer\.json$/ => :parse_manifest,
11
- /^composer\.lock$/ => :parse_lockfile
10
+ /^composer\.json$/ => {
11
+ kind: 'manifest',
12
+ parser: :parse_manifest
13
+ },
14
+ /^composer\.lock$/ => {
15
+ kind: 'lockfile',
16
+ parser: :parse_lockfile
17
+ }
12
18
  }
13
19
  end
14
20
 
@@ -7,8 +7,14 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^pubspec\.yaml$/i => :parse_yaml_manifest,
11
- /^pubspec\.lock$/i => :parse_yaml_lockfile
10
+ /^pubspec\.yaml$/i => {
11
+ kind: 'manifest',
12
+ parser: :parse_yaml_manifest
13
+ },
14
+ /^pubspec\.lock$/i => {
15
+ kind: 'lockfile',
16
+ parser: :parse_yaml_lockfile
17
+ }
12
18
  }
13
19
  end
14
20
 
@@ -19,6 +19,14 @@ module Bibliothecary
19
19
  end
20
20
  end
21
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
+
22
30
  def self.match?(filename)
23
31
  is_requirements_file(filename) ||
24
32
  filename.match(/setup\.py$/) ||
@@ -10,9 +10,18 @@ module Bibliothecary
10
10
 
11
11
  def self.mapping
12
12
  {
13
- /^Gemfile$|^gems\.rb$/ => :parse_gemfile,
14
- /[A-Za-z0-9_-]+\.gemspec$/ => :parse_gemspec,
15
- /^Gemfile\.lock$|^gems\.locked$/ => :parse_gemfile_lock
13
+ /^Gemfile$|^gems\.rb$/ => {
14
+ kind: 'manifest',
15
+ parser: :parse_gemfile
16
+ },
17
+ /[A-Za-z0-9_-]+\.gemspec$/ => {
18
+ kind: 'manifest',
19
+ parser: :parse_gemspec
20
+ },
21
+ /^Gemfile\.lock$|^gems\.locked$/ => {
22
+ kind: 'lockfile',
23
+ parser: :parse_gemfile_lock
24
+ }
16
25
  }
17
26
  end
18
27
 
@@ -7,8 +7,14 @@ module Bibliothecary
7
7
 
8
8
  def self.mapping
9
9
  {
10
- /^shard\.yml$/i => :parse_yaml_manifest,
11
- /^shard\.lock$/i => :parse_yaml_lockfile
10
+ /^shard\.yml$/i => {
11
+ kind: 'manifest',
12
+ parser: :parse_yaml_manifest
13
+ },
14
+ /^shard\.lock$/i => {
15
+ kind: 'lockfile',
16
+ parser: :parse_yaml_lockfile
17
+ }
12
18
  }
13
19
  end
14
20
 
@@ -5,7 +5,10 @@ module Bibliothecary
5
5
 
6
6
  def self.mapping
7
7
  {
8
- /^Package\.swift$/i => :parse_package_swift
8
+ /^Package\.swift$/i => {
9
+ kind: 'manifest',
10
+ parser: :parse_package_swift
11
+ }
9
12
  }
10
13
  end
11
14
 
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "5.0.2"
2
+ VERSION = "5.1.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.0.2
4
+ version: 5.1.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-22 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb