Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b8414e1
setup.py: Move 'nose' to tests_require
satwikkansal Jul 1, 2017
b6f61bb
Merge branch 'quickfix' into 'master'
balasankarc Jul 7, 2019
fc21e53
Update metadata to reflect project maintainership changes
balasankarc Jul 25, 2020
363d8a5
Further cleanup to match new maintainership reality
balasankarc Jul 25, 2020
58f72a5
Clarify license metadata
pombredanne Jul 25, 2020
b2333dd
add regex to detect all types of dependency
rpotter12 Jul 25, 2020
6c2e97f
add contributor
rpotter12 Jul 25, 2020
5da33a9
Merge pull request #10 from gemfileparser/pombredanne-license-clarifi…
balasankarc Jul 26, 2020
537c9c5
remove unnecessary path variable name
rpotter12 Jul 26, 2020
75772fc
Merge pull request #9 from rpotter12/master
pombredanne Jul 26, 2020
cec4ff0
remove nose install require
rpotter12 Jul 26, 2020
1740086
Merge pull request #11 from rpotter12/master
pombredanne Jul 26, 2020
f96996e
Clarify license in README (#12)
pombredanne Aug 18, 2020
032664b
Add license header
pombredanne Aug 20, 2020
e0bd8a6
Update README
pombredanne Aug 20, 2020
5646bf5
Rename README.md to README.rst
pombredanne Aug 20, 2020
4c42b84
Move bin command line script to function
pombredanne Aug 20, 2020
00fd2c6
Use proper ReST for README
pombredanne Aug 20, 2020
acc8851
Ignore tmp
pombredanne Aug 20, 2020
95c5b12
Remove script that has been migrated to function
pombredanne Aug 20, 2020
2c15ffe
Remove numbers from authors list
pombredanne Aug 20, 2020
6912f96
Add MANIFEST.in for sdist
pombredanne Aug 20, 2020
91c2c53
Remove unused requirements.txt
pombredanne Aug 20, 2020
f127bd6
Use setup.cfg for setup metadata
pombredanne Aug 20, 2020
793d183
Remove __init__.py file that is not needed
pombredanne Aug 20, 2020
90beddd
Make tests pass. Remove nose dependency
pombredanne Aug 20, 2020
f82b43e
Rename test file
pombredanne Aug 20, 2020
8d6832e
Add tests section to README
pombredanne Aug 20, 2020
a4e2909
Ignore .pytest_cache
pombredanne Aug 20, 2020
7b5f3a5
Add Dependency.to_dict method, extract class
pombredanne Aug 20, 2020
f0d91c7
Do not use globals for group
pombredanne Aug 20, 2020
ce1b4ed
Make tests data driven
pombredanne Aug 20, 2020
458703d
Add self name to authors
pombredanne Aug 20, 2020
88134c1
Use SPDX license identifiers for brevity and clarity
pombredanne Aug 26, 2020
6ee209a
Streamline docstrings, remove redundant code
pombredanne Aug 26, 2020
8a93afb
Format for long lines
pombredanne Aug 26, 2020
b7534a7
Merge pull request #14 from gemfileparser/release-preparation
pombredanne Aug 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ docs/_build/

# PyBuilder
target/
/tmp/
/.pytest_cache/
9 changes: 9 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file lists contributors who made significant contribution to
# gemfileparser. This file is not intended to list every contributor to the
# project, though. For that, check the Git revision history.
#
# Names are in alphabetical order, for the sanity of mind.

- Balasankar C <balasankarc@autistici.org>
- Rohit Potter <rohitpotter12@gmail.com>
- Philippe Ombredanne <pombredanne@nexb.com>
44 changes: 44 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
gemfileparser is dual-licensed under your choice of [GNU GPL version 3 (or above) License]
(http://www.gnu.org/licenses/gpl)
or the [MIT License](https://opensource.org/licenses/MIT).

Personally, I prefer anyone using this to respect the GPL license and use that
itself for derivative works - thus making them also Free Software. But, your
call.

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

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.


MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions LICENSE.GPLv3
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Copyright (c) 2020 Gemfileparser authors (listed in AUTHORS file)
2015-2018 Balasankar C <balasankarc@autistici.org>

GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Expand Down
3 changes: 2 additions & 1 deletion LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 12 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
graft gemfileparser
graft tests

include AUTHORS
include LICENSE.GPLv3
include LICENSE.MIT
include MANIFEST.in
include README.rst
include setup.cfg
include setup.py

global-exclude *.py[co] __pycache__ *.*~
58 changes: 0 additions & 58 deletions README.md

This file was deleted.

94 changes: 94 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
=============
gemfileparser
=============

gemfileparser parses Ruby Gemfile using Python with supports Ruby Gemfiles
and .gemspec files as well as Cocoapod .podspec files.


Installation
~~~~~~~~~~~~

In a virtualenv, use the command::

pip install gemfileparser

Otherwise from a git clone, use the following commands in a virtualenv::

git clone https://github.com/gemfileparser/gemfileparser.git
cd gemfileparser
python setup.py install


Usage
~~~~~

::

from gemfileparser import GemfileParser
parser = GemfileParser(<path to Gemfile>, <name of the application (optional)>)
dependency_dictionary = parser.parse()

The parse() method returns a dict object of the following format::

{
'development': [list of dependency objects inside group 'development'],
'runtime': [list of runtime dependency objects],
.
.
}

Each dependency object contains the following attributes:

- name - Name of the gem
- requirement - Version requirement
- autorequire - Autorequire value
- source - Source URL of the gem
- parent - Dependency of which gem
- group - Group that a gem is a member of (default : runtime)


Example
~~~~~~~

::

from gemfileparser import GemfileParser
n = GemfileParser('Gemfile', 'diaspora')
deps = n.parse()
for key in deps:
if deps[key]:
print key
for dependency in deps[key]:
print("\t", dependency)


Tests
~~~~~

Do this to run tests::

pip install -e .
pip install pytest
pytest -vvs tests


Copyright
~~~~~~~~~
* Copyright (c) 2020 Gemfileparser authors (listed in AUTHORS file)
* Copyright (c) 2015-2018 Balasankar C <balasankarc@autistici.org>


License
~~~~~~~

gemfileparser is dual-licensed under your choice of the
`GNU GPL version 3 (or later) License <http://www.gnu.org/licenses/gpl>`_
or the `MIT License <https://opensource.org/licenses/MIT>`_.

It is preferred anyone using this project to respect the GPL-3+ license and use
that itself for derivative works - thus making them also Free Software. But,
your call.

When making contributions to gemfileparser you agree to license these contributions
under the same choice of licenses.
17 changes: 0 additions & 17 deletions bin/parsegemfile

This file was deleted.

Loading