Skip to content

Commit 784da0e

Browse files
authored
Merge pull request #4 from gemfileparser/master
Merge latest master
2 parents 71b1948 + b7534a7 commit 784da0e

28 files changed

Lines changed: 2010 additions & 332 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ docs/_build/
5656

5757
# PyBuilder
5858
target/
59+
/tmp/
60+
/.pytest_cache/

AUTHORS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file lists contributors who made significant contribution to
2+
# gemfileparser. This file is not intended to list every contributor to the
3+
# project, though. For that, check the Git revision history.
4+
#
5+
# Names are in alphabetical order, for the sanity of mind.
6+
7+
- Balasankar C <balasankarc@autistici.org>
8+
- Rohit Potter <rohitpotter12@gmail.com>
9+
- Philippe Ombredanne <pombredanne@nexb.com>

LICENSE

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
gemfileparser is dual-licensed under your choice of [GNU GPL version 3 (or above) License]
2+
(http://www.gnu.org/licenses/gpl)
3+
or the [MIT License](https://opensource.org/licenses/MIT).
4+
5+
Personally, I prefer anyone using this to respect the GPL license and use that
6+
itself for derivative works - thus making them also Free Software. But, your
7+
call.
8+
9+
Copyright (c) 2020 Gemfileparser authors (listed in AUTHORS file)
10+
2015-2018 Balasankar C <balasankarc@autistici.org>
11+
12+
This program is free software: you can redistribute it and/or modify
13+
it under the terms of the GNU General Public License as published by
14+
the Free Software Foundation, either version 3 of the License, or
15+
(at your option) any later version.
16+
.
17+
This program is distributed in the hope that it will be useful,
18+
but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
GNU General Public License for more details.
21+
.
22+
You should have received a copy of the GNU General Public License
23+
along with this program. If not, see <http://www.gnu.org/licenses/>.
24+
25+
26+
MIT License
27+
28+
Permission is hereby granted, free of charge, to any person obtaining a copy
29+
of this software and associated documentation files (the "Software"), to deal
30+
in the Software without restriction, including without limitation the rights
31+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32+
copies of the Software, and to permit persons to whom the Software is
33+
furnished to do so, subject to the following conditions:
34+
35+
The above copyright notice and this permission notice shall be included in all
36+
copies or substantial portions of the Software.
37+
38+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44+
SOFTWARE.

LICENSE.GPLv3

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Copyright (c) 2020 Gemfileparser authors (listed in AUTHORS file)
2+
2015-2018 Balasankar C <balasankarc@autistici.org>
3+
14
GNU GENERAL PUBLIC LICENSE
25
Version 3, 29 June 2007
36

LICENSE.MIT

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MIT License
22

3-
Copyright (c) 2018 Balasankar C
3+
Copyright (c) 2020 Gemfileparser authors (listed in AUTHORS file)
4+
2015-2018 Balasankar C <balasankarc@autistici.org>
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
graft gemfileparser
2+
graft tests
3+
4+
include AUTHORS
5+
include LICENSE.GPLv3
6+
include LICENSE.MIT
7+
include MANIFEST.in
8+
include README.rst
9+
include setup.cfg
10+
include setup.py
11+
12+
global-exclude *.py[co] __pycache__ *.*~

README.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

README.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
=============
2+
gemfileparser
3+
=============
4+
5+
gemfileparser parses Ruby Gemfile using Python with supports Ruby Gemfiles
6+
and .gemspec files as well as Cocoapod .podspec files.
7+
8+
9+
Installation
10+
~~~~~~~~~~~~
11+
12+
In a virtualenv, use the command::
13+
14+
pip install gemfileparser
15+
16+
Otherwise from a git clone, use the following commands in a virtualenv::
17+
18+
git clone https://github.com/gemfileparser/gemfileparser.git
19+
cd gemfileparser
20+
python setup.py install
21+
22+
23+
Usage
24+
~~~~~
25+
26+
::
27+
28+
from gemfileparser import GemfileParser
29+
parser = GemfileParser(<path to Gemfile>, <name of the application (optional)>)
30+
dependency_dictionary = parser.parse()
31+
32+
The parse() method returns a dict object of the following format::
33+
34+
{
35+
'development': [list of dependency objects inside group 'development'],
36+
'runtime': [list of runtime dependency objects],
37+
.
38+
.
39+
}
40+
41+
Each dependency object contains the following attributes:
42+
43+
- name - Name of the gem
44+
- requirement - Version requirement
45+
- autorequire - Autorequire value
46+
- source - Source URL of the gem
47+
- parent - Dependency of which gem
48+
- group - Group that a gem is a member of (default : runtime)
49+
50+
51+
Example
52+
~~~~~~~
53+
54+
::
55+
56+
from gemfileparser import GemfileParser
57+
n = GemfileParser('Gemfile', 'diaspora')
58+
deps = n.parse()
59+
for key in deps:
60+
if deps[key]:
61+
print key
62+
for dependency in deps[key]:
63+
print("\t", dependency)
64+
65+
66+
Tests
67+
~~~~~
68+
69+
Do this to run tests::
70+
71+
pip install -e .
72+
pip install pytest
73+
pytest -vvs tests
74+
75+
76+
Copyright
77+
~~~~~~~~~
78+
* Copyright (c) 2020 Gemfileparser authors (listed in AUTHORS file)
79+
* Copyright (c) 2015-2018 Balasankar C <balasankarc@autistici.org>
80+
81+
82+
License
83+
~~~~~~~
84+
85+
gemfileparser is dual-licensed under your choice of the
86+
`GNU GPL version 3 (or later) License <http://www.gnu.org/licenses/gpl>`_
87+
or the `MIT License <https://opensource.org/licenses/MIT>`_.
88+
89+
It is preferred anyone using this project to respect the GPL-3+ license and use
90+
that itself for derivative works - thus making them also Free Software. But,
91+
your call.
92+
93+
When making contributions to gemfileparser you agree to license these contributions
94+
under the same choice of licenses.

bin/parsegemfile

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)